diff --git a/proj7/jquery-source/jquery b/proj7/jquery-source/jquery deleted file mode 160000 index 954966e..0000000 --- a/proj7/jquery-source/jquery +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 954966e08d26bf29700711dc4d7b56198350e862 diff --git a/proj7/jquery-source/jquery/.bowerrc b/proj7/jquery-source/jquery/.bowerrc new file mode 100644 index 0000000..baa91a3 --- /dev/null +++ b/proj7/jquery-source/jquery/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/.editorconfig b/proj7/jquery-source/jquery/.editorconfig new file mode 100644 index 0000000..d06e318 --- /dev/null +++ b/proj7/jquery-source/jquery/.editorconfig @@ -0,0 +1,43 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +# Tabs in JS unless otherwise specified +[**.js] +indent_style = tab + +[Makefile] +indent_style = tab + + +[speed/**.html] +indent_style = tab + +[speed/**.css] +indent_style = tab + +[speed/benchmarker.js] +indent_style = space +indent_size = 2 + + +[test/**.xml] +indent_style = tab + +[test/**.php] +indent_style = tab + +[test/**.html] +indent_style = tab + +[test/**.css] +indent_style = space +indent_size = 8 diff --git a/proj7/jquery-source/jquery/.gitattributes b/proj7/jquery-source/jquery/.gitattributes new file mode 100644 index 0000000..d6dc470 --- /dev/null +++ b/proj7/jquery-source/jquery/.gitattributes @@ -0,0 +1,2 @@ +* eol=lf +*.jar binary diff --git a/proj7/jquery-source/jquery/.jscs.json b/proj7/jquery-source/jquery/.jscs.json new file mode 100644 index 0000000..f2d8a1f --- /dev/null +++ b/proj7/jquery-source/jquery/.jscs.json @@ -0,0 +1,23 @@ +{ + "requireCurlyBraces": [ "if", "else", "for", "while", "do" ], + "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ], + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "requireMultipleVarDecl": true, + "requireSpacesInsideObjectBrackets": "all", + "requireSpacesInsideArrayBrackets": "all", + "disallowLeftStickedOperators": [ "?", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ], + "disallowRightStickedOperators": [ "?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "requireRightStickedOperators": [ "!" ], + "requireLeftStickedOperators": [ "," ], + "disallowKeywords": [ "with" ], + "disallowMultipleLineBreaks": true, + "disallowKeywordsOnNewLine": [ "else" ], + "requireLineFeedAtFileEnd": true, + + "excludeFiles": [ "src/intro.js", "src/outro.js", "src/sizzle/**/*" ] +} diff --git a/proj7/jquery-source/jquery/.jshintignore b/proj7/jquery-source/jquery/.jshintignore new file mode 100644 index 0000000..71bddb8 --- /dev/null +++ b/proj7/jquery-source/jquery/.jshintignore @@ -0,0 +1,12 @@ +src/intro.js +src/outro.js +src/sizzle/**/* +test/libs/**/* +test/data/jquery-1.9.1.js +test/data/badcall.js +test/data/badjson.js +test/data/json_obj.js +test/data/readywaitasset.js +test/data/readywaitloader.js +test/data/support/csp.js +test/data/support/getComputedSupport.js diff --git a/proj7/jquery-source/jquery/.jshintrc b/proj7/jquery-source/jquery/.jshintrc new file mode 100644 index 0000000..13a9e01 --- /dev/null +++ b/proj7/jquery-source/jquery/.jshintrc @@ -0,0 +1,17 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": true, + "quotmark": "double", + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "node": true +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/.mailmap b/proj7/jquery-source/jquery/.mailmap new file mode 100644 index 0000000..c28005f --- /dev/null +++ b/proj7/jquery-source/jquery/.mailmap @@ -0,0 +1,100 @@ +Adam Coulombe +Adam J. Sontag +Alexander Farkas +Alexander Farkas +Alexis Abril +Andrew E Monat +Anton Matzneller +Anton Matzneller +Batiste Bieler +Benjamin Truyman +Brandon Aaron +Carl Danley +Carl Fürstenberg +Carl Fürstenberg +Charles McNulty +Christopher Jones cjqed +Colin Snover +Corey Frang +Dan Heberden +Daniel Chatfield +Daniel Gálvez +Danil Somsikov +Dave Methvin +Dave Reed +David Fox +David Murdoch +Devin Cooper +Douglas Neiner +Dmitry Gusev +Earle Castledine +Erick Ruiz de Chávez +Gianni Alessandro Chiappetta +Heungsub Lee +Iraê Carvalho +Isaac Z. Schlueter +Ismail Khair +James Burke +James Padolsey +Jason Bedard +Jay Merrifield +Jay Merrifield +Jean Boussier +Jephte Clain +Jess Thrysoee +Joao Henrique de Andrade Bruni +Joe Presbrey +John Resig +John Resig +Jordan Boesch +Josh Varner +Julian Aubourg +Julian Aubourg +Julian Aubourg +Jörn Zaefferer +Jörn Zaefferer +Jörn Zaefferer +Karl Swedberg +Klaus Hartl +Kris Borchers +Lee Carpenter +Li Xudong +Louis-Rémi Babé +Louis-Rémi Babé +Louis-Rémi Babé +Louis-Rémi Babé +Marcel Greter +Matthias Jäggli +Michael Murray +Michał Gołębiowski +Michał Gołębiowski +Mike Alsup +Nguyen Phuc Lam +Oleg Gaidarenko +Paul Bakaus +Rafaël Blais Masson +Richard D. Worth +Rick Waldron +Rick Waldron +Robert Katić +Ron Otten +Sai Lung Wong +Scott González +Scott Jehl +Sebastian Burkhard +Timmy Willison +Timmy Willison +Timo Tijhof +TJ Holowaychuk +Tom H Fuertes +Tom H Fuertes Tom H Fuertes +Tom Viner +Wesley Walser +Xavi Ramirez +Xavier Montillet +Yehuda Katz +Yehuda Katz +Yehuda Katz +Yehuda Katz +Yiming He +Terry Jones diff --git a/proj7/jquery-source/jquery/.npmignore b/proj7/jquery-source/jquery/.npmignore new file mode 100644 index 0000000..595cb6a --- /dev/null +++ b/proj7/jquery-source/jquery/.npmignore @@ -0,0 +1,13 @@ +.jshintignore +.jshintrc + +/.editorconfig +/.gitattributes +/.jscs.json +/.mailmap +/.travis.yml + +/build +/speed +/test +/Gruntfile.js diff --git a/proj7/jquery-source/jquery/.travis.yml b/proj7/jquery-source/jquery/.travis.yml new file mode 100644 index 0000000..35048b6 --- /dev/null +++ b/proj7/jquery-source/jquery/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: +- '0.10' diff --git a/proj7/jquery-source/jquery/AUTHORS.txt b/proj7/jquery-source/jquery/AUTHORS.txt new file mode 100644 index 0000000..f5c06a6 --- /dev/null +++ b/proj7/jquery-source/jquery/AUTHORS.txt @@ -0,0 +1,217 @@ +Authors ordered by first contribution. + +John Resig +Gilles van den Hoven +Michael Geary +Stefan Petre +Yehuda Katz +Corey Jewett +Klaus Hartl +Franck Marcia +Jörn Zaefferer +Paul Bakaus +Brandon Aaron +Mike Alsup +Dave Methvin +Ed Engelhardt +Sean Catchpole +Paul Mclanahan +David Serduke +Richard D. Worth +Scott González +Ariel Flesler +Jon Evans +TJ Holowaychuk +Michael Bensoussan +Robert Katić +Louis-Rémi Babé +Earle Castledine +Damian Janowski +Rich Dougherty +Kim Dalsgaard +Andrea Giammarchi +Mark Gibson +Karl Swedberg +Justin Meyer +Ben Alman +James Padolsey +David Petersen +Batiste Bieler +Alexander Farkas +Rick Waldron +Filipe Fortes +Neeraj Singh +Paul Irish +Iraê Carvalho +Matt Curry +Michael Monteleone +Noah Sloan +Tom Viner +Douglas Neiner +Adam J. Sontag +Dave Reed +Ralph Whitbeck +Carl Fürstenberg +Jacob Wright +J. Ryan Stinnett +unknown +temp01 +Heungsub Lee +Colin Snover +Ryan W Tenney +Pinhook +Ron Otten +Jephte Clain +Anton Matzneller +Alex Sexton +Dan Heberden +Henri Wiechers +Russell Holbrook +Julian Aubourg +Gianni Alessandro Chiappetta +Scott Jehl +James Burke +Jonas Pfenniger +Xavi Ramirez +Jared Grippe +Sylvester Keil +Brandon Sterne +Mathias Bynens +Timmy Willison +Corey Frang +Digitalxero +Anton Kovalyov +David Murdoch +Josh Varner +Charles McNulty +Jordan Boesch +Jess Thrysoee +Michael Murray +Lee Carpenter +Alexis Abril +Rob Morgan +John Firebaugh +Sam Bisbee +Gilmore Davidson +Brian Brennan +Xavier Montillet +Daniel Pihlstrom +Sahab Yazdani +avaly +Scott Hughes +Mike Sherov +Greg Hazel +Schalk Neethling +Denis Knauf +Timo Tijhof +Steen Nielsen +Anton Ryzhov +Shi Chuan +Berker Peksag +Toby Brain +Matt Mueller +Justin +Daniel Herman +Oleg Gaidarenko +Richard Gibson +Rafaël Blais Masson +cmc3cn <59194618@qq.com> +Joe Presbrey +Sindre Sorhus +Arne de Bree +Vladislav Zarakovsky +Andrew E Monat +Oskari +Joao Henrique de Andrade Bruni +tsinha +Matt Farmer +Trey Hunner +Jason Moon +Jeffery To +Kris Borchers +Vladimir Zhuravlev +Jacob Thornton +Chad Killingsworth +Nowres Rafid +David Benjamin +Uri Gilad +Chris Faulkner +Elijah Manor +Daniel Chatfield +Nikita Govorov +Wesley Walser +Mike Pennisi +Markus Staab +Dave Riddle +Callum Macrae +Benjamin Truyman +James Huston +Erick Ruiz de Chávez +David Bonner +Akintayo Akinwunmi +MORGAN +Ismail Khair +Carl Danley +Mike Petrovich +Greg Lavallee +Daniel Gálvez +Sai Lung Wong +Tom H Fuertes +Roland Eckl +Jay Merrifield +Allen J Schmidt Jr +Jonathan Sampson +Marcel Greter +Matthias Jäggli +David Fox +Yiming He +Devin Cooper +Paul Ramos +Rod Vagg +Bennett Sorbo +Sebastian Burkhard +Zachary Adam Kaplan +nanto_vi +nanto +Danil Somsikov +Ryunosuke SATO +Jean Boussier +Adam Coulombe +Andrew Plummer +Mark Raddatz +Isaac Z. Schlueter +Karl Sieburg +Pascal Borreli +Nguyen Phuc Lam +Dmitry Gusev +Michał Gołębiowski +Li Xudong +Steven Benner +Tom H Fuertes +Renato Oliveira dos Santos +ros3cin +Jason Bedard +Kyle Robinson Young +Chris Talkington +Eddie Monge +Terry Jones +Jason Merino +Jeremy Dunck +Chris Price +Guy Bedford +Amey Sakhadeo +Mike Sidorov +Anthony Ryan +Dominik D. Geyer +George Kats +Lihan Li +Ronny Springer +Chris Antaki +Marian Sollmann +njhamann +Ilya Kantor +hongymagic +John Paul +Jakob Stoeck +Christopher Jones +Forbes Lindesay diff --git a/proj7/jquery-source/jquery/CONTRIBUTING.md b/proj7/jquery-source/jquery/CONTRIBUTING.md new file mode 100644 index 0000000..dd6b183 --- /dev/null +++ b/proj7/jquery-source/jquery/CONTRIBUTING.md @@ -0,0 +1,214 @@ +# Contributing to jQuery + +1. [Getting Involved](#getting-involved) +2. [Discussion](#discussion) +3. [How To Report Bugs](#how-to-report-bugs) +4. [Core Style Guide](#jquery-core-style-guide) +5. [Tips For Bug Patching](#tips-for-bug-patching) + + + +## Getting Involved + +There are a number of ways to get involved with the development of jQuery core. Even if you've never contributed code to an Open Source project before, we're always looking for help identifying bugs, writing and reducing test cases and documentation. + +This is the best way to contribute to jQuery core. Please read through the full guide detailing [How to Report Bugs](#how-to-report-bugs). + +## Discussion + +### Forum and IRC + +The jQuery core development team frequently tracks posts on the [jQuery Development Forum](http://forum.jquery.com/developing-jquery-core). If you have longer posts or questions please feel free to post them there. If you think you've found a bug please [file it in the bug tracker](#how-to-report-bugs). + +Additionally most of the jQuery core development team can be found in the [#jquery-dev](http://webchat.freenode.net/?channels=jquery-dev) IRC channel on irc.freenode.net. + +### Weekly Status Meetings + +Every week (unless otherwise noted) the jQuery core dev team has a meeting to discuss the progress of current work and to bring forward possible new blocker bugs for discussion. + +The meeting is held in the [#jquery-meeting](http://webchat.freenode.net/?channels=jquery-meeting) IRC channel on irc.freenode.net at [Noon EST](http://www.timeanddate.com/worldclock/fixedtime.html?month=1&day=17&year=2011&hour=12&min=0&sec=0&p1=43) on Mondays. + +[Past Meeting Notes](https://docs.google.com/document/d/1MrLFvoxW7GMlH9KK-bwypn77cC98jUnz7sMW1rg_TP4/edit?hl=en) + + +## How to Report Bugs + +### Make sure it is a jQuery bug + +Many bugs reported to our bug tracker are actually bugs in user code, not in jQuery code. Keep in mind that just because your code throws an error and the console points to a line number inside of jQuery, this does *not* mean the bug is a jQuery bug; more often than not, these errors result from providing incorrect arguments when calling a jQuery function. + +If you are new to jQuery, it is usually a much better idea to ask for help first in the [Using jQuery Forum](http://forum.jquery.com/using-jquery) or the [jQuery IRC channel](http://webchat.freenode.net/?channels=%23jquery). You will get much quicker support, and you will help avoid tying up the jQuery team with invalid bug reports. These same resources can also be useful if you want to confirm that your bug is indeed a bug in jQuery before filing any tickets. + + +### Disable any browser extensions + +Make sure you have reproduced the bug with all browser extensions and add-ons disabled, as these can sometimes cause things to break in interesting and unpredictable ways. Try using incognito, stealth or anonymous browsing modes. + + +### Try the latest version of jQuery + +Bugs in old versions of jQuery may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](http://code.jquery.com/jquery.js). + +### Try an older version of jQuery + +Sometimes, bugs are introduced in newer versions of jQuery that do not exist in previous versions. When possible, it can be useful to try testing with an older release. + +### Reduce, reduce, reduce! + +When you are experiencing a problem, the most useful thing you can possibly do is to [reduce your code](http://webkit.org/quality/reduction.html) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs that are reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible. + +## jQuery Core Style Guide + +See: [jQuery's Style Guides](http://contribute.jquery.org/style-guide/) + +## Tips For Bug Patching + + +### Environment: localhost w/ PHP, Node & Grunt + +Starting in jQuery 1.8, a newly overhauled development workflow has been introduced. In this new system, we rely on node & gruntjs to automate the building and validation of source code—while you write code. + +The Ajax tests still depend on PHP running locally*, so make sure you have the following installed: + +* Some kind of localhost server program that supports PHP (any will do) +* Node.js +* NPM (comes with the latest version of Node.js) +* Grunt (install with: `npm install grunt -g` + + +Maintaining a list of platform specific instructions is outside of the scope of this document and there is plenty of existing documentation for the above technologies. + +* The PHP dependency will soon be shed in favor of an all-node solution. + + +### Build a Local Copy of jQuery + +Create a fork of the jQuery repo on github at http://github.com/jquery/jquery + +Change directory to your web root directory, whatever that might be: + +```bash +$ cd /path/to/your/www/root/ +``` + +Clone your jQuery fork to work locally + +```bash +$ git clone git@github.com:username/jquery.git +``` + +Change directory to the newly created dir jquery/ + +```bash +$ cd jquery +``` + +Add the jQuery master as a remote. I label mine "upstream" + +```bash +$ git remote add upstream git://github.com/jquery/jquery.git +``` + +Get in the habit of pulling in the "upstream" master to stay up to date as jQuery receives new commits + +```bash +$ git pull upstream master +``` + +Run the Grunt tools: + +```bash +$ grunt && grunt watch +``` + +Now open the jQuery test suite in a browser at http://localhost/test. If there is a port, be sure to include it. + +Success! You just built and tested jQuery! + + +### Fix a bug from a ticket filed at bugs.jquery.com: + +**NEVER write your patches to the master branch** - it gets messy (I say this from experience!) + +**ALWAYS USE A "TOPIC" BRANCH!** Like so (#### = the ticket #)... + +Make sure you start with your up-to-date master: + +```bash +$ git checkout master +``` + +Create and checkout a new branch that includes the ticket # + +```bash +$ git checkout -b bug_#### + +# ( Explanation: this useful command will: +# "checkout" a "-b" (branch) by the name of "bug_####" +# or create it if it doesn't exist ) +``` + +Now you're on branch: bug_#### + +Determine the module/file you'll be working in... + +Open up the corresponding /test/unit/?????.js and add the initial failing unit tests. This may seem awkward at first, but in the long run it will make sense. To truly and efficiently patch a bug, you need to be working against that bug. + +Next, open the module files and make your changes + +Run http://localhost/test --> **ALL TESTS MUST PASS** + +Once you're satisfied with your patch... + +Stage the files to be tracked: + +```bash +$ git add filename +# (you can use "git status" to list the files you've changed) +``` + + +( I recommend NEVER, EVER using "git add . " ) + +Once you've staged all of your changed files, go ahead and commit them + +```bash +$ git commit -m "Brief description of fix. Fixes #0000" +``` + +For a multiple line commit message, leave off the `-m "description"`. + +You will then be led into vi (or the text editor that you have set up) to complete your commit message. + +Then, push your branch with the bug fix commits to your github fork + +```bash +$ git push origin -u bug_#### +``` + +Before you tackle your next bug patch, return to the master: + +```bash +$ git checkout master +``` + + + +### Test Suite Tips... + +During the process of writing your patch, you will run the test suite MANY times. You can speed up the process by narrowing the running test suite down to the module you are testing by either double clicking the title of the test or appending it to the url. The following examples assume you're working on a local repo, hosted on your localhost server. + +Example: + +http://localhost/test/?filter=css + +This will only run the "css" module tests. This will significantly speed up your development and debugging. + +**ALWAYS RUN THE FULL SUITE BEFORE COMMITTING AND PUSHING A PATCH!** + + +### Browser support + +Remember that jQuery supports multiple browsers and their versions; any contributed code must work in all of them. You can refer to the [browser support page](http://jquery.com/browser-support/) for the current list of supported browsers. + +Note that browser support differs depending on whether you are targeting the `master` or `1.x-master` branch. diff --git a/proj7/jquery-source/jquery/Gruntfile.js b/proj7/jquery-source/jquery/Gruntfile.js new file mode 100644 index 0000000..ea570f1 --- /dev/null +++ b/proj7/jquery-source/jquery/Gruntfile.js @@ -0,0 +1,153 @@ +module.exports = function( grunt ) { + "use strict"; + + function readOptionalJSON( filepath ) { + var data = {}; + try { + data = grunt.file.readJSON( filepath ); + } catch ( e ) {} + return data; + } + + var gzip = require( "gzip-js" ), + srcHintOptions = readOptionalJSON( "src/.jshintrc" ); + + // The concatenated file won't pass onevar + // But our modules can + delete srcHintOptions.onevar; + + grunt.initConfig({ + pkg: grunt.file.readJSON( "package.json" ), + dst: readOptionalJSON( "dist/.destination.json" ), + compare_size: { + files: [ "dist/jquery.js", "dist/jquery.min.js" ], + options: { + compress: { + gz: function( contents ) { + return gzip.zip( contents, {} ).length; + } + }, + cache: "build/.sizecache.json" + } + }, + build: { + all: { + dest: "dist/jquery.js", + minimum: [ + "core", + "selector" + ], + // Exclude specified modules if the module matching the key is removed + removeWith: { + ajax: [ "manipulation/_evalUrl" ], + callbacks: [ "deferred" ], + css: [ "effects", "dimensions", "offset" ], + sizzle: [ "css/hiddenVisibleSelectors", "effects/animatedSelector" ] + } + } + }, + bowercopy: { + options: { + clean: true + }, + src: { + files: { + "src/sizzle/dist": "sizzle/dist", + "src/sizzle/test/data": "sizzle/test/data", + "src/sizzle/test/unit": "sizzle/test/unit", + "src/sizzle/test/index.html": "sizzle/test/index.html", + "src/sizzle/test/jquery.js": "sizzle/test/jquery.js" + } + }, + tests: { + options: { + destPrefix: "test/libs" + }, + files: { + "qunit": "qunit/qunit", + "require.js": "requirejs/require.js", + "sinon/fake_timers.js": "sinon/lib/sinon/util/fake_timers.js" + } + } + }, + jsonlint: { + pkg: { + src: [ "package.json" ] + }, + + jscs: { + src: [ ".jscs.json" ] + }, + + bower: { + src: [ "bower.json" ] + } + }, + jshint: { + all: { + src: [ + "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/tasks/*", + "build/{bower-install,release-notes,release}.js" + ], + options: { + jshintrc: true + } + }, + dist: { + src: "dist/jquery.js", + options: srcHintOptions + } + }, + jscs: { + src: "src/**/*.js", + gruntfile: "Gruntfile.js", + tasks: "build/tasks/*.js" + }, + testswarm: { + tests: "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue selector serialize support traversing Sizzle".split( " " ) + }, + watch: { + files: [ "<%= jshint.all.src %>" ], + tasks: "dev" + }, + uglify: { + all: { + files: { + "dist/jquery.min.js": [ "dist/jquery.js" ] + }, + options: { + preserveComments: false, + sourceMap: "dist/jquery.min.map", + sourceMappingURL: "jquery.min.map", + report: "min", + beautify: { + ascii_only: true + }, + banner: "/*! jQuery v<%= pkg.version %> | " + + "(c) 2005, <%= grunt.template.today('yyyy') %> jQuery Foundation, Inc. | " + + "jquery.org/license */", + compress: { + hoist_funs: false, + loops: false, + unused: false + } + } + } + } + }); + + // Load grunt tasks from NPM packages + require( "load-grunt-tasks" )( grunt ); + + // Integrate jQuery specific tasks + grunt.loadTasks( "build/tasks" ); + + // Alias bower to bowercopy + grunt.registerTask( "bower", "bowercopy" ); + + // Short list as a high frequency watch task + grunt.registerTask( "dev", [ "build:*:*", "jshint", "jscs" ] ); + + // Default grunt + grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] ); +}; diff --git a/proj7/jquery-source/jquery/MIT-LICENSE.txt b/proj7/jquery-source/jquery/MIT-LICENSE.txt new file mode 100644 index 0000000..cdd31b5 --- /dev/null +++ b/proj7/jquery-source/jquery/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +Copyright 2014 jQuery Foundation and other contributors +http://jquery.com/ + +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. diff --git a/proj7/jquery-source/jquery/README.md b/proj7/jquery-source/jquery/README.md new file mode 100644 index 0000000..48880de --- /dev/null +++ b/proj7/jquery-source/jquery/README.md @@ -0,0 +1,372 @@ +[jQuery](http://jquery.com/) - New Wave JavaScript +================================================== + +Contribution Guides +-------------------------------------- + +In the spirit of open source software development, jQuery always encourages community code contribution. To help you get started and before you jump into writing code, be sure to read these important contribution guidelines thoroughly: + +1. [Getting Involved](http://contribute.jquery.org/) +2. [Core Style Guide](http://contribute.jquery.org/style-guide/js/) +3. [Writing Code for jQuery Foundation Projects](http://contribute.jquery.org/code/) + + +Environments in which to use jQuery +-------------------------------------- + +- [Browser support](http://jquery.com/browser-support/) differs between the master (2.x) branch and the 1.x-master branch. Specifically, 2.x does not support legacy browsers such as IE6-8. The jQuery team continues to provide support for legacy browsers on the 1.x-master branch. Use the latest 1.x release if support for those browsers is required. See [browser support](http://jquery.com/browser-support/) for more info. +- To use jQuery in Node, browser extensions, and other non-browser environments, use only **2.x** releases. 1.x does not support these environments. + + +What you need to build your own jQuery +-------------------------------------- + +In order to build jQuery, you need to have Node.js/npm latest and git 1.7 or later. +(Earlier versions might work OK, but are not tested.) + +For Windows you have to download and install [git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/download/). + +Mac OS users should install [Homebrew](http://mxcl.github.com/homebrew/). Once Homebrew is installed, run `brew install git` to install git, +and `brew install node` to install Node.js. + +Linux/BSD users should use their appropriate package managers to install git and Node.js, or build from source +if you swing that way. Easy-peasy. + + +How to build your own jQuery +---------------------------- + +Clone a copy of the main jQuery git repo by running: + +```bash +git clone git://github.com/jquery/jquery.git +``` + +Enter the jquery directory and run the build script: +```bash +cd jquery && npm run build +``` +The built version of jQuery will be put in the `dist/` subdirectory, along with the minified copy and associated map file. + +If you want create custom build or help with jQuery development, it would be better to install [grunt command line interface](https://github.com/gruntjs/grunt-cli) as a global package: + +``` +npm install -g grunt-cli +``` +Make sure you have `grunt` installed by testing: +``` +grunt -v +``` + +Now by running `grunt` command, in the jquery directory, you could build full version of jQuery, just like with `npm run build` command: +``` +grunt +``` + +There are many other tasks available for jQuery Core: +``` +grunt -help +``` + +### Modules + +Special builds can be created that exclude subsets of jQuery functionality. +This allows for smaller custom builds when the builder is certain that those parts of jQuery are not being used. +For example, an app that only used JSONP for `$.ajax()` and did not need to calculate offsets or positions of elements could exclude the offset and ajax/xhr modules. + +Any module may be excluded except for `core`, and `selector`. To exclude a module, pass its path relative to the `src` folder (without the `.js` extension). + +Some example modules that can be excluded are: + +- **ajax**: All AJAX functionality: `$.ajax()`, `$.get()`, `$.post()`, `$.ajaxSetup()`, `.load()`, transports, and ajax event shorthands such as `.ajaxStart()`. +- **ajax/xhr**: The XMLHTTPRequest AJAX transport only. +- **ajax/script**: The ` +``` + +Using [`npm`](http://npmjs.org/): + +```bash +npm install lodash + +npm install -g lodash +npm link 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/): + +```js +var _ = require('lodash'); + +// or as a drop-in replacement for Underscore +var _ = require('lodash/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 project’s root directory before requiring it. + +In [RingoJS v0.7.0-](http://ringojs.org/): + +```js +var _ = require('lodash')._; +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({ + 'paths': { + 'underscore': 'path/to/lodash' + } +}, +['underscore'], function(_) { + console.log(_.VERSION); +}); +``` + +## Release Notes + +### v1.0.1 + + * Add support for specifying source map URLs in `-p`/`--source-map` build options + * Ensured the second argument passed to `_.assign` is not treated as a `callback` + * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL` + * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed + * Made `_.defer` use `setImmediate`, in Node.js, when available + * Made `_.where` search arrays for values regardless of their index position + * Removed dead code from `_.template` + +The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). + +## BestieJS + +Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js new file mode 100644 index 0000000..37ebc92 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js @@ -0,0 +1,5152 @@ +/** + * @license + * Lo-Dash 1.0.1 (Custom Build) + * Build: `lodash -o ./dist/lodash.compat.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.4.4 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * Available under MIT license + */ +;(function(window, undefined) { + + /** Detect free variable `exports` */ + var freeExports = typeof exports == 'object' && exports; + + /** Detect free variable `module` */ + var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; + + /** Detect free variable `global` and use it as `window` */ + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal) { + window = freeGlobal; + } + + /** Used for array and object method references */ + var arrayRef = [], + objectRef = {}; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = objectRef; + + /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ + var largeArraySize = 30; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = window._; + + /** Used to match HTML entities */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g; + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + (objectRef.valueOf + '') + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/valueOf|for [^\]]+/g, '.+?') + '$' + ); + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to match HTML characters */ + var reUnescapedHtml = /[&<>"']/g; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowed = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** Native method shortcuts */ + var ceil = Math.ceil, + concat = arrayRef.concat, + floor = Math.floor, + getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectRef.hasOwnProperty, + push = arrayRef.push, + toString = objectRef.toString; + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, + nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = window.isFinite, + nativeIsNaN = window.isNaN, + nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeRandom = Math.random; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Detect various environments */ + var isIeOpera = !!window.attachEvent, + isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera); + + /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ + var isBindFast = nativeBind && !isV8; + + /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ + var isKeysFast = nativeKeys && (isIeOpera || isV8); + + /** + * Detect the JScript [[DontEnum]] bug: + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well. + */ + var hasDontEnumBug; + + /** + * Detect if a `prototype` properties are enumerable by default: + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly sets a function's `prototype` property [[Enumerable]] + * value to `true`. + */ + var hasEnumPrototype; + + /** Detect if own properties are iterated after inherited properties (IE < 9) */ + var iteratesOwnLast; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects + * incorrectly: + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + */ + var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, + arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); + + /** Detect if `arguments` object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1) */ + var nonEnumArgs = true; + + (function() { + var props = []; + function ctor() { this.x = 1; } + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + for (prop in arguments) { nonEnumArgs = !prop; } + + hasDontEnumBug = !/valueOf/.test(props); + hasEnumPrototype = ctor.propertyIsEnumerable('prototype'); + iteratesOwnLast = props[0] != 'x'; + }(1)); + + /** Detect if `arguments` objects are `Object` objects (all but Opera < 10.5) */ + var argsAreObjects = arguments.constructor == Object; + + /** Detect if `arguments` objects [[Class]] is unresolvable (Firefox < 4, IE < 9) */ + var noArgsClass = !isArguments(arguments); + + /** + * Detect lack of support for accessing string characters by index: + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + */ + var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a DOM node's [[Class]] is unresolvable (IE < 9) + * and that the JS engine won't error when attempting to coerce an object to + * a string without a `toString` function. + */ + try { + var noNodeClass = toString.call(document) == objectClass && !({ 'toString': 0 } + ''); + } catch(e) { } + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object, that wraps the given `value`, to enable method + * chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, + * `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, + * `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, + * `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, + * `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, + * `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, + * `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, + * `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, + * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, + * `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, + * `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * passed, otherwise they return unwrapped values. + * + * @name _ + * @constructor + * @category Chaining + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodash(value) { + // exit early if already wrapped, even if wrapped by a different `lodash` constructor + if (value && typeof value == 'object' && value.__wrapped__) { + return value; + } + // allow invoking `lodash` without the `new` operator + if (!(this instanceof lodash)) { + return new lodash(value); + } + this.__wrapped__ = value; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type String + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Obect} data The data object used to populate the text. + * @returns {String} Returns the interpolated text. + */ + var iteratorTemplate = function(obj) { + + var __p = 'var index, iterable = ' + + (obj.firstArg ) + + ', result = iterable;\nif (!iterable) return result;\n' + + (obj.top ) + + ';\n'; + if (obj.arrays) { + __p += 'var length = iterable.length; index = -1;\nif (' + + (obj.arrays ) + + ') { '; + if (obj.noCharByIndex) { + __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; + } ; + __p += '\n while (++index < length) {\n ' + + (obj.loop ) + + '\n }\n}\nelse { '; + } else if (obj.nonEnumArgs) { + __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + + (obj.loop ) + + '\n }\n } else { '; + } ; + + if (obj.hasEnumPrototype) { + __p += '\n var skipProto = typeof iterable == \'function\';\n '; + } ; + + if (obj.isKeysFast && obj.useHas) { + __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n '; + if (obj.hasEnumPrototype) { + __p += 'if (!(skipProto && index == \'prototype\')) {\n '; + } ; + __p += + (obj.loop ) + + ''; + if (obj.hasEnumPrototype) { + __p += '}\n'; + } ; + __p += ' } '; + } else { + __p += '\n for (index in iterable) {'; + if (obj.hasEnumPrototype || obj.useHas) { + __p += '\n if ('; + if (obj.hasEnumPrototype) { + __p += '!(skipProto && index == \'prototype\')'; + } if (obj.hasEnumPrototype && obj.useHas) { + __p += ' && '; + } if (obj.useHas) { + __p += 'hasOwnProperty.call(iterable, index)'; + } ; + __p += ') { '; + } ; + __p += + (obj.loop ) + + '; '; + if (obj.hasEnumPrototype || obj.useHas) { + __p += '\n }'; + } ; + __p += '\n } '; + } ; + + if (obj.hasDontEnumBug) { + __p += '\n\n var ctor = iterable.constructor;\n '; + for (var k = 0; k < 7; k++) { + __p += '\n index = \'' + + (obj.shadowed[k] ) + + '\';\n if ('; + if (obj.shadowed[k] == 'constructor') { + __p += '!(ctor && ctor.prototype === iterable) && '; + } ; + __p += 'hasOwnProperty.call(iterable, index)) {\n ' + + (obj.loop ) + + '\n } '; + } ; + + } ; + + if (obj.arrays || obj.nonEnumArgs) { + __p += '\n}'; + } ; + __p += + (obj.bottom ) + + ';\nreturn result'; + + + return __p + }; + + /** Reusable iterator options for `assign` and `defaults` */ + var defaultsIteratorOptions = { + 'args': 'object, source, guard', + 'top': + 'var args = arguments,\n' + + ' argsIndex = 0,\n' + + " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + + 'while (++argsIndex < argsLength) {\n' + + ' iterable = args[argsIndex];\n' + + ' if (iterable && objectTypes[typeof iterable]) {', + 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", + 'bottom': ' }\n}' + }; + + /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ + var eachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)", + 'arrays': "typeof length == 'number'", + 'loop': 'if (callback(iterable[index], index, collection) === false) return result' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'arrays': false + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function optimized to search large arrays for a given `value`, + * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @param {Number} [largeSize=30] The length at which an array is considered large. + * @returns {Boolean} Returns `true`, if `value` is found, else `false`. + */ + function cachedContains(array, fromIndex, largeSize) { + fromIndex || (fromIndex = 0); + + var length = array.length, + isLarge = (length - fromIndex) >= (largeSize || largeArraySize); + + if (isLarge) { + var cache = {}, + index = fromIndex - 1; + + while (++index < length) { + // manually coerce `value` to a string because `hasOwnProperty`, in some + // older versions of Firefox, coerces objects incorrectly + var key = array[index] + ''; + (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); + } + } + return function(value) { + if (isLarge) { + var key = value + ''; + return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; + } + return indexOf(array, value, fromIndex) > -1; + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || typeof a == 'undefined') { + return 1; + } + if (a < b || typeof b == 'undefined') { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` binding + * of `thisArg` and prepends any `partialArgs` to the arguments passed to the + * bound function. + * + * @private + * @param {Function|String} func The function to bind or the method name. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Array} partialArgs An array of arguments to be partially applied. + * @param {Object} [rightIndicator] Used to indicate partially applying arguments from the right. + * @returns {Function} Returns the new bound function. + */ + function createBound(func, thisArg, partialArgs, rightIndicator) { + var isFunc = isFunction(func), + isPartial = !partialArgs, + key = thisArg; + + // juggle arguments + if (isPartial) { + partialArgs = thisArg; + } + if (!isFunc) { + thisArg = func; + } + + function bound() { + // `Function#bind` spec + // http://es5.github.com/#x15.3.4.5 + var args = arguments, + thisBinding = isPartial ? this : thisArg; + + if (!isFunc) { + func = thisArg[key]; + } + if (partialArgs.length) { + args = args.length + ? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) + : partialArgs; + } + if (this instanceof bound) { + // ensure `new bound` is an instance of `bound` and `func` + noop.prototype = func.prototype; + thisBinding = new noop; + noop.prototype = null; + + // mimic the constructor's `return` behavior + // http://es5.github.com/#x13.2.2 + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + return bound; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name, the created callback will return the property value for a given element. + * If `func` is an object, the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @private + * @param {Mixed} [func=identity] The value to convert to a callback. + * @param {Mixed} [thisArg] The `this` binding of the created callback. + * @param {Number} [argCount=3] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function createCallback(func, thisArg, argCount) { + if (func == null) { + return identity; + } + var type = typeof func; + if (type != 'function') { + if (type != 'object') { + return function(object) { + return object[func]; + }; + } + var props = keys(func); + return function(object) { + var length = props.length, + result = false; + while (length--) { + if (!(result = isEqual(object[props[length]], func[props[length]], indicatorObject))) { + break; + } + } + return result; + }; + } + if (typeof thisArg != 'undefined') { + if (argCount === 1) { + return function(value) { + return func.call(thisArg, value); + }; + } + if (argCount === 2) { + return function(a, b) { + return func.call(thisArg, a, b); + }; + } + if (argCount === 4) { + return function(accumulator, value, index, object) { + return func.call(thisArg, accumulator, value, index, object); + }; + } + return function(value, index, object) { + return func.call(thisArg, value, index, object); + }; + } + return func; + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {Object} [options1, options2, ...] The compile options object(s). + * arrays - A string of code to determine if the iterable is an array or array-like. + * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. + * args - A string of comma separated arguments the iteration function will accept. + * top - A string of code to execute before the iteration branches. + * loop - A string of code to execute in the object loop. + * bottom - A string of code to execute after the iteration branches. + * + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + var data = { + // support properties + 'hasDontEnumBug': hasDontEnumBug, + 'hasEnumPrototype': hasEnumPrototype, + 'isKeysFast': isKeysFast, + 'nonEnumArgs': nonEnumArgs, + 'noCharByIndex': noCharByIndex, + 'shadowed': shadowed, + + // iterator options + 'arrays': 'isArray(iterable)', + 'bottom': '', + 'loop': '', + 'top': '', + 'useHas': true + }; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + data[key] = object[key]; + } + } + var args = data.args; + data.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'createCallback, hasOwnProperty, isArguments, isArray, isString, ' + + 'objectTypes, nativeKeys', + 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' + ); + // return the compiled function + return factory( + createCallback, hasOwnProperty, isArguments, isArray, isString, + objectTypes, nativeKeys + ); + } + + /** + * A function compiled to iterate `arguments` objects, arrays, objects, and + * strings consistenly across environments, executing the `callback` for each + * element in the `collection`. The `callback` is bound to `thisArg` and invoked + * with three arguments; (value, index|key, collection). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @private + * @type Function + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + */ + var each = createIterator(eachIteratorOptions); + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used, instead of `Array#slice`, to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|String} collection The collection to slice. + * @param {Number} start The start index. + * @param {Number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {String} match The matched character to unescape. + * @returns {String} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return toString.call(value) == argsClass; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (noArgsClass) { + isArguments = function(value) { + return value ? hasOwnProperty.call(value, 'callee') : false; + }; + } + + /** + * Iterates over `object`'s own and inherited enumerable properties, executing + * the `callback` for each property. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, key, object). Callbacks may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * alert('Woof, woof!'); + * }; + * + * _.forIn(new Dog('Dagny'), function(value, key) { + * alert(key); + * }); + * // => alerts 'name' and 'bark' (order is not guaranteed) + */ + var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * Iterates over an object's own enumerable properties, executing the `callback` + * for each property. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by explicitly + * returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * alert(key); + * }); + * // => alerts '0', '1', and 'length' (order is not guaranteed) + */ + var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + // `instanceof` may cause a memory leak in IE 7 if `value` is a host object + // http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak + return (argsAreObjects && value instanceof Array) || toString.call(value) == arrayClass; + }; + + /** + * Creates an array composed of the own enumerable property names of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (order is not guaranteed) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + if ((hasEnumPrototype && typeof object == 'function') || + (nonEnumArgs && object.length && isArguments(object))) { + return shimKeys(object); + } + return nativeKeys(object); + }; + + /** + * A fallback implementation of `isPlainObject` that checks if a given `value` + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects + var result = false; + if (!(value && typeof value == 'object') || isArguments(value)) { + return result; + } + // check that the constructor is `Object` (i.e. `Object instanceof Object`) + var ctor = value.constructor; + if ((!isFunction(ctor) && (!noNodeClass || !isNode(value))) || ctor instanceof ctor) { + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (iteratesOwnLast) { + forIn(value, function(value, key, object) { + result = !hasOwnProperty.call(object, key); + return false; + }); + return result === false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return result === false || hasOwnProperty.call(value, result); + } + return result; + } + + /** + * A fallback implementation of `Object.keys` that produces an array of the + * given object's own enumerable property names. + * + * @private + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + */ + function shimKeys(object) { + var result = []; + forOwn(object, function(value, key) { + result.push(key); + }); + return result; + } + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite propery assignments of previous + * sources. If a `callback` function is passed, it will be executed to produce + * the assigned values. The `callback` is bound to `thisArg` and invoked with + * two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'moe' }, { 'age': 40 }); + * // => { 'name': 'moe', 'age': 40 } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var food = { 'name': 'apple' }; + * defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var assign = createIterator(defaultsIteratorOptions, { + 'top': + defaultsIteratorOptions.top.replace(';', + ';\n' + + "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + + ' var callback = createCallback(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]' + }); + + /** + * Creates a clone of `value`. If `deep` is `true`, nested objects will also + * be cloned, otherwise they will be assigned by reference. If a `callback` + * function is passed, it will be executed to produce the cloned values. If + * `callback` returns `undefined`, cloning will be handled by the method instead. + * The `callback` is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to clone. + * @param {Boolean} [deep=false] A flag to indicate a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate clones with source counterparts. + * @returns {Mixed} Returns the cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var shallow = _.clone(stooges); + * shallow[0] === stooges[0]; + * // => true + * + * var deep = _.clone(stooges, true); + * deep[0] === stooges[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, deep, callback, thisArg, stackA, stackB) { + var result = value; + + // allows working with "Collections" methods without using their `callback` + // argument, `index|key`, for this method's `callback` + if (typeof deep == 'function') { + thisArg = callback; + callback = deep; + deep = false; + } + if (typeof callback == 'function') { + callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 1); + result = callback(result); + + var done = typeof result != 'undefined'; + if (!done) { + result = value; + } + } + // inspect [[Class]] + var isObj = isObject(result); + if (isObj) { + var className = toString.call(result); + if (!cloneableClasses[className] || (noNodeClass && isNode(result))) { + return result; + } + var isArr = isArray(result); + } + // shallow clone + if (!isObj || !deep) { + return isObj && !done + ? (isArr ? slice(result) : assign({}, result)) + : result; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return done ? result : new ctor(+result); + + case numberClass: + case stringClass: + return done ? result : new ctor(result); + + case regexpClass: + return done ? result : ctor(result.source, reFlags.exec(result)); + } + // check for circular references and return corresponding clone + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // init cloned object + if (!done) { + result = isArr ? ctor(result.length) : {}; + + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? forEach : forOwn)(done ? result : value, function(objValue, key) { + result[key] = clone(objValue, deep, callback, undefined, stackA, stackB); + }); + + return result; + } + + /** + * Creates a deep clone of `value`. If a `callback` function is passed, it will + * be executed to produce the cloned values. If `callback` returns the value it + * was passed, cloning will be handled by the method instead. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). + * + * Note: This function is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the deep cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var deep = _.cloneDeep(stooges); + * deep[0] === stooges[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : value; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return clone(value, true, callback, thisArg); + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param- {Object} [guard] Internally used to allow working with `_.reduce` + * without using its callback's `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var food = { 'name': 'apple' }; + * _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var defaults = createIterator(defaultsIteratorOptions); + + /** + * Creates a sorted array of all enumerable properties, own and inherited, + * of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified object `property` exists and is a direct property, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to check. + * @param {String} property The property to check for. + * @returns {Boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, property) { + return object ? hasOwnProperty.call(object, property) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'moe', 'second': 'larry' }); + * // => { 'moe': 'first', 'larry': 'second' } (order is not guaranteed) + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || toString.call(value) == boolClass; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value instanceof Date || toString.call(value) == dateClass; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value ? value.nodeType === 1 : false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|String} value The value to inspect. + * @returns {Boolean} Returns `true`, if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + className == argsClass || (noArgsClass && isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If `callback` is passed, it will be executed to + * compare values. If `callback` returns `undefined`, comparisons will be handled + * by the method instead. The `callback` is bound to `thisArg` and invoked with + * two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} a The value to compare. + * @param {Mixed} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. + * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. + * @returns {Boolean} Returns `true`, if the values are equvalent, else `false`. + * @example + * + * var moe = { 'name': 'moe', 'age': 40 }; + * var copy = { 'name': 'moe', 'age': 40 }; + * + * moe == copy; + * // => false + * + * _.isEqual(moe, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + var whereIndicator = callback === indicatorObject; + if (callback && !whereIndicator) { + callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 2); + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + (!a || (type != 'function' && type != 'object')) && + (!b || (otherType != 'function' && otherType != 'object'))) { + return false; + } + // exit early for `null` and `undefined`, avoiding ES3's Function#call behavior + // http://es5.github.com/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return a != +a + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == b + ''; + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + if (a.__wrapped__ || b.__wrapped__) { + return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, thisArg, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass || (noNodeClass && (isNode(a) || isNode(b)))) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = !argsAreObjects && isArguments(a) ? Object : a.constructor, + ctorB = !argsAreObjects && isArguments(b) ? Object : b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && !( + isFunction(ctorA) && ctorA instanceof ctorA && + isFunction(ctorB) && ctorB instanceof ctorB + )) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + length = a.length; + size = b.length; + + // compare lengths to determine if a deep comparison is necessary + result = size == a.length; + if (!result && !whereIndicator) { + return result; + } + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (whereIndicator) { + while (index--) { + if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) { + break; + } + } + } else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) { + break; + } + } + return result; + } + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && isEqual(a[key], value, callback, thisArg, stackA, stackB)); + } + }); + + if (result && !whereIndicator) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + return result; + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite`, which will return true for + * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return value instanceof Function || toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.com/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return value ? objectTypes[typeof value] : false; + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN`, which will return `true` for + * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || toString.call(value) == numberClass; + } + + /** + * Checks if a given `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. + * @example + * + * function Stooge(name, age) { + * this.name = name; + * this.age = age; + * } + * + * _.isPlainObject(new Stooge('moe', 40)); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'name': 'moe', 'age': 40 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && typeof value == 'object')) { + return false; + } + var valueOf = value.valueOf, + objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/moe/); + * // => true + */ + function isRegExp(value) { + return value instanceof RegExp || toString.call(value) == regexpClass; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a string, else `false`. + * @example + * + * _.isString('moe'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || toString.call(value) == stringClass; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined`, into the destination object. Subsequent sources + * will overwrite propery assignments of previous sources. If a `callback` function + * is passed, it will be executed to produce the merged values of the destination + * and source properties. If `callback` returns `undefined`, merging will be + * handled by the method instead. The `callback` is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Object} [deepIndicator] Internally used to indicate that `stackA` + * and `stackB` are arrays of traversed objects instead of source objects. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate values with their + * source counterparts. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'stooges': [ + * { 'name': 'moe' }, + * { 'name': 'larry' } + * ] + * }; + * + * var ages = { + * 'stooges': [ + * { 'age': 40 }, + * { 'age': 50 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object, source, deepIndicator) { + var args = arguments, + index = 0, + length = 2; + + if (!isObject(object)) { + return object; + } + if (deepIndicator === indicatorObject) { + var callback = args[3], + stackA = args[4], + stackB = args[5]; + } else { + stackA = []; + stackB = []; + + // allows working with `_.reduce` and `_.reduceRight` without + // using their `callback` arguments, `index|key` and `collection` + if (typeof deepIndicator != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + callback = createCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + } + while (++index < length) { + (isArray(args[index]) ? forEach : forOwn)(args[index], function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + + if (callback) { + result = callback(value, source); + if (typeof result != 'undefined') { + value = result; + } + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!callback) { + value = merge(value, source, indicatorObject, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a `callback` function is passed, it will be executed + * for each property in the `object`, omitting the properties `callback` + * returns truthy for. The `callback` is bound to `thisArg` and invoked + * with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'moe', 'age': 40 }, 'age'); + * // => { 'name': 'moe' } + * + * _.omit({ 'name': 'moe', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'moe' } + */ + function omit(object, callback, thisArg) { + var isFunc = typeof callback == 'function', + result = {}; + + if (isFunc) { + callback = createCallback(callback, thisArg); + } else { + var props = concat.apply(arrayRef, arguments); + } + forIn(object, function(value, key, object) { + if (isFunc + ? !callback(value, key, object) + : indexOf(props, key, 1) < 0 + ) { + result[key] = value; + } + }); + return result; + } + + /** + * Creates a two dimensional array of the given object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'moe': 30, 'larry': 40 }); + * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of property + * names. If `callback` is passed, it will be executed for each property in the + * `object`, picking the properties `callback` returns truthy for. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Array|Function|String} callback|[prop1, prop2, ...] The function called + * per iteration or properties to pick, either as individual arguments or arrays. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); + * // => { 'name': 'moe' } + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'moe' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = 0, + props = concat.apply(arrayRef, arguments), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = createCallback(callback, thisArg); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Array|Number|String} [index1, index2, ...] The indexes of + * `collection` to retrieve, either as individual arguments or arrays. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['moe', 'larry', 'curly'], 0, 2); + * // => ['moe', 'curly'] + */ + function at(collection) { + var index = -1, + props = concat.apply(arrayRef, slice(arguments, 1)), + length = props.length, + result = Array(length); + + if (noCharByIndex && isString(collection)) { + collection = collection.split(''); + } + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given `target` element is present in a `collection` using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Mixed} target The value to check for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); + * // => true + * + * _.contains('curly', 'ur'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (typeof length == 'number') { + result = (isString(collection) + ? collection.indexOf(target, fromIndex) + : indexOf(collection, target, fromIndex) + ) > -1; + } else { + each(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys returned from running each element of the + * `collection` through the given `callback`. The corresponding value of each key + * is the number of times the key was returned by the `callback`. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + function countBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection) + ''; + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + return result; + } + + /** + * Checks if the `callback` returns a truthy value for **all** elements of a + * `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if all elements pass the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(stooges, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(stooges, { 'age': 50 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + each(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * the `callback` returns truthy for. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + * + * // using "_.where" callback shorthand + * _.filter(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + each(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning the first that the `callback` + * returns truthy for. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the element that passed the callback check, + * else `undefined`. + * @example + * + * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => 2 + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'banana', 'organic': true, 'type': 'fruit' }, + * { 'name': 'beet', 'organic': false, 'type': 'vegetable' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * var veggie = _.find(food, { 'type': 'vegetable' }); + * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + * + * // using "_.pluck" callback shorthand + * var healthy = _.find(food, 'organic'); + * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' } + */ + function find(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over a `collection`, executing the `callback` for each element in + * the `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). Callbacks may exit iteration early + * by explicitly returning `false`. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(alert).join(','); + * // => alerts each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); + * // => alerts each number value (order is not guaranteed) + */ + function forEach(collection, callback, thisArg) { + if (callback && typeof thisArg == 'undefined' && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + each(collection, callback, thisArg); + } + return collection; + } + + /** + * Creates an object composed of keys returned from running each element of the + * `collection` through the `callback`. The corresponding value of each key is + * an array of elements passed to `callback` that returned the key. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + function groupBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection) + ''; + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + return result; + } + + /** + * Invokes the method named by `methodName` on each element in the `collection`, + * returning an array of the results of each invoked method. Additional arguments + * will be passed to each invoked method. If `methodName` is a function, it will + * be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the `collection` + * through the `callback`. The `callback` is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (order is not guaranteed) + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(stooges, 'name'); + * // => ['moe', 'larry'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + each(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.max(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'larry', 'age': 50 }; + * + * // using "_.pluck" callback shorthand + * _.max(stooges, 'age'); + * // => { 'name': 'larry', 'age': 50 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + each(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.min(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'moe', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.min(stooges, 'age'); + * // => { 'name': 'moe', 'age': 40 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + each(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the `collection`. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {String} property The property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.pluck(stooges, 'name'); + * // => ['moe', 'larry'] + */ + var pluck = map; + + /** + * Reduces a `collection` to a value that is the accumulated result of running + * each element in the `collection` through the `callback`, where each successive + * `callback` execution consumes the return value of the previous execution. + * If `accumulator` is not passed, the first element of the `collection` will be + * used as the initial `accumulator` value. The `callback` is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg, 4); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + each(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is similar to `_.reduce`, except that it iterates over a + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var iterable = collection, + length = collection ? collection.length : 0, + noaccum = arguments.length < 3; + + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (noCharByIndex && isString(collection)) { + iterable = collection.split(''); + } + callback = createCallback(callback, thisArg, 4); + forEach(collection, function(value, index, collection) { + index = props ? props[--length] : --length; + accumulator = noaccum + ? (noaccum = false, iterable[index]) + : callback(accumulator, iterable[index], index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter`, this method returns the elements of a + * `collection` that `callback` does **not** return truthy for. + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that did **not** pass the + * callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(food, 'organic'); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + * + * // using "_.where" callback shorthand + * _.reject(food, { 'type': 'fruit' }); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + */ + function reject(collection, callback, thisArg) { + callback = createCallback(callback, thisArg); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Creates an array of shuffled `array` values, using a version of the + * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = floor(nativeRandom() * (++index + 1)); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to inspect. + * @returns {Number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('curly'); + * // => 5 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the `callback` returns a truthy value for **any** element of a + * `collection`. The function returns as soon as it finds passing value, and + * does not iterate over the entire `collection`. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if any element passes the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(food, 'organic'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(food, { 'type': 'meat' }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + each(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in the `collection` through the `callback`. This method + * performs a stable sort, that is, it will preserve the original sort order of + * equal elements. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * // using "_.pluck" callback shorthand + * _.sortBy(['banana', 'strawberry', 'apple'], 'length'); + * // => ['apple', 'banana', 'strawberry'] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + result[++index] = { + 'criteria': callback(value, key, collection), + 'index': index, + 'value': value + }; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + result[length] = result[length].value; + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return noCharByIndex && isString(collection) + ? collection.split('') + : slice(collection); + } + return values(collection); + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * that have the given `properties`. When checking `properties`, this method + * performs a deep comparison between values to determine if they are equivalent + * to each other. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given `properties`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.where(stooges, { 'age': 40 }); + * // => [{ 'name': 'moe', 'age': 40 }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values of `array` removed. The values + * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array of `array` elements not present in the other arrays + * using strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {Array} [array1, array2, ...] Arrays to check. + * @returns {Array} Returns a new array of `array` elements not present in the + * other arrays. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + var index = -1, + length = array ? array.length : 0, + flattened = concat.apply(arrayRef, arguments), + contains = cachedContains(flattened, length), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Gets the first element of the `array`. If a number `n` is passed, the first + * `n` elements of the `array` are returned. If a `callback` function is passed, + * the first elements the `callback` returns truthy for are returned. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n] The function called + * per element or the number of elements to return. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(food, 'organic'); + * // => [{ 'name': 'banana', 'organic': true }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.first(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] + */ + function first(array, callback, thisArg) { + if (array) { + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = createCallback(callback, thisArg); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array[0]; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `shallow` is + * truthy, `array` will only be flattened a single level. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @param {Boolean} shallow A flag to indicate only flattening a single level. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + */ + function flatten(array, shallow) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + // recursively flatten arrays (susceptible to call stack limits) + if (isArray(value)) { + push.apply(result, shallow ? value : flatten(value)); + } else { + result.push(value); + } + } + return result; + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the `array` is already + * sorted, passing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to + * perform a binary search on a sorted `array`. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + var index = -1, + length = array ? array.length : 0; + + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; + } else if (fromIndex) { + index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Gets all but the last element of `array`. If a number `n` is passed, the + * last `n` elements are excluded from the result. If a `callback` function + * is passed, the last elements the `callback` returns truthy for are excluded + * from the result. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.initial(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'banana', 'type': 'fruit' }] + */ + function initial(array, callback, thisArg) { + if (!array) { + return []; + } + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Computes the intersection of all the passed-in arrays using strict equality + * for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique elements that are present + * in **all** of the arrays. + * @example + * + * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2] + */ + function intersection(array) { + var args = arguments, + argsLength = args.length, + cache = { '0': {} }, + index = -1, + length = array ? array.length : 0, + isLarge = length >= 100, + result = [], + seen = result; + + outer: + while (++index < length) { + var value = array[index]; + if (isLarge) { + var key = value + ''; + var inited = hasOwnProperty.call(cache[0], key) + ? !(seen = cache[0][key]) + : (seen = cache[0][key] = []); + } + if (inited || indexOf(seen, value) < 0) { + if (isLarge) { + seen.push(value); + } + var argsIndex = argsLength; + while (--argsIndex) { + if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) { + continue outer; + } + } + result.push(value); + } + } + return result; + } + + /** + * Gets the last element of the `array`. If a number `n` is passed, the last + * `n` elements of the `array` are returned. If a `callback` function is passed, + * the last elements the `callback` returns truthy for are returned. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n] The function called + * per element or the number of elements to return. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.last(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.last(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] + */ + function last(array, callback, thisArg) { + if (array) { + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array[length - 1]; + } + } + return slice(array, nativeMax(0, length - n)); + } + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=array.length-1] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Pass either + * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or + * two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.object(['moe', 'larry'], [30, 40]); + * // => { 'moe': 30, 'larry': 40 } + */ + function object(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else { + result[key[0]] = key[1]; + } + } + return result; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Number} [start=0] The start of the range. + * @param {Number} end The end of the range. + * @param {Number} [step=1] The value to increment or descrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(10); + * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + * + * _.range(1, 11); + * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * _.range(0, 30, 5); + * // => [0, 5, 10, 15, 20, 25] + * + * _.range(0, -10, -1); + * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = +step || 1; + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / step)), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * The opposite of `_.initial`, this method gets all but the first value of `array`. + * If a number `n` is passed, the first `n` values are excluded from the result. + * If a `callback` function is passed, the first elements the `callback` returns + * truthy for are excluded from the result. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.rest(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.rest(food, { 'type': 'fruit' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = createCallback(callback, thisArg); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which the `value` + * should be inserted into `array` in order to maintain the sort order of the + * sorted `array`. If `callback` is passed, it will be executed for `value` and + * each element in `array` to compute their sort ranking. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to iterate over. + * @param {Mixed} value The value to evaluate. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Number} Returns the index at which the value should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + callback(array[mid]) < value + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Computes the union of the passed-in arrays using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique values, in order, that are + * present in one or more of the arrays. + * @example + * + * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2, 3, 101, 10] + */ + function union() { + return uniq(concat.apply(arrayRef, arguments)); + } + + /** + * Creates a duplicate-value-free version of the `array` using strict equality + * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` + * for `isSorted` will run a faster algorithm. If `callback` is passed, each + * element of `array` is passed through a callback` before uniqueness is computed. + * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = [], + seen = result; + + // juggle arguments + if (typeof isSorted == 'function') { + thisArg = callback; + callback = isSorted; + isSorted = false; + } + // init value cache for large arrays + var isLarge = !isSorted && length >= 75; + if (isLarge) { + var cache = {}; + } + if (callback) { + seen = []; + callback = createCallback(callback, thisArg); + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isLarge) { + var key = computed + ''; + var inited = hasOwnProperty.call(cache, key) + ? !(seen = cache[key]) + : (seen = cache[key] = []); + } + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : inited || indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * Creates an array with all occurrences of the passed values removed using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {Mixed} [value1, value2, ...] Values to remove. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + var index = -1, + length = array ? array.length : 0, + contains = cachedContains(arguments, 1), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Groups the elements of each array at their corresponding indexes. Useful for + * separate data sources that are coordinated through matching array indexes. + * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix + * in a similar fashion. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['moe', 'larry'], [30, 40], [true, false]); + * // => [['moe', 30, true], ['larry', 40, false]] + */ + function zip(array) { + var index = -1, + length = array ? max(pluck(arguments, 'length')) : 0, + result = Array(length); + + while (++index < length) { + result[index] = pluck(arguments, index); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that is restricted to executing `func` only after it is + * called `n` times. The `func` is executed with the `this` binding of the + * created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Number} n The number of times the function must be called before + * it is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var renderNotes = _.after(notes.length, render); + * _.forEach(notes, function(note) { + * note.asyncSave({ 'success': renderNotes }); + * }); + * // `renderNotes` is run once, after all notes have saved + */ + function after(n, func) { + if (n < 1) { + return func(); + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * passed to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'moe' }, 'hi'); + * func(); + * // => 'hi moe' + */ + function bind(func, thisArg) { + // use `Function#bind` if it exists and is fast + // (in V8 `Function#bind` is slower except when partially applied) + return isBindFast || (nativeBind && arguments.length > 2) + ? nativeBind.call.apply(nativeBind, arguments) + : createBound(func, thisArg, slice(arguments, 2)); + } + + /** + * Binds methods on `object` to `object`, overwriting the existing method. + * Method names may be specified as individual arguments or as arrays of method + * names. If no method names are provided, all the function properties of `object` + * will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { alert('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => alerts 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = concat.apply(arrayRef, arguments), + index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = bind(object[key], object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those passed to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {String} key The key of the method. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'moe', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi moe' + * + * object.greet = function(greeting) { + * return greeting + ', ' + this.name + '!'; + * }; + * + * func(); + * // => 'hi, moe!' + */ + function bindKey(object, key) { + return createBound(object, key, slice(arguments, 2)); + } + + /** + * Creates a function that is the composition of the passed functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} [func1, func2, ...] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var greet = function(name) { return 'hi ' + name; }; + * var exclaim = function(statement) { return statement + '!'; }; + * var welcome = _.compose(exclaim, greet); + * welcome('moe'); + * // => 'hi moe!' + */ + function compose() { + var funcs = arguments; + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. Pass + * `true` for `immediate` to cause debounce to invoke `func` on the leading, + * instead of the trailing, edge of the `wait` timeout. Subsequent calls to + * the debounced function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {Number} wait The number of milliseconds to delay. + * @param {Boolean} immediate A flag to indicate execution is on the leading + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * var lazyLayout = _.debounce(calculateLayout, 300); + * jQuery(window).on('resize', lazyLayout); + */ + function debounce(func, wait, immediate) { + var args, + result, + thisArg, + timeoutId; + + function delayed() { + timeoutId = null; + if (!immediate) { + result = func.apply(thisArg, args); + } + } + return function() { + var isImmediate = immediate && !timeoutId; + args = arguments; + thisArg = this; + + clearTimeout(timeoutId); + timeoutId = setTimeout(delayed, wait); + + if (isImmediate) { + result = func.apply(thisArg, args); + } + return result; + }; + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {Number} wait The number of milliseconds to delay execution. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * var log = _.bind(console.log, console); + * _.delay(log, 1000, 'logged later'); + * // => 'logged later' (Appears after one second.) + */ + function delay(func, wait) { + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * _.defer(function() { alert('deferred'); }); + * // returns from the function before `alert` is called + */ + function defer(func) { + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + // use `setImmediate` if it's available in Node.js + if (isV8 && freeModule && typeof setImmediate == 'function') { + defer = bind(setImmediate, window); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * passed, it will be used to determine the cache key for storing the result + * based on the arguments passed to the memoized function. By default, the first + * argument passed to the memoized function is used as the cache key. The `func` + * is executed with the `this` binding of the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + */ + function memoize(func, resolver) { + var cache = {}; + return function() { + var key = (resolver ? resolver.apply(this, arguments) : arguments[0]) + ''; + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + }; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those passed to the new function. This + * method is similar to `_.bind`, except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('moe'); + * // => 'hi moe' + */ + function partial(func) { + return createBound(func, slice(arguments, 1)); + } + + /** + * This method is similar to `_.partial`, except that `partial` arguments are + * appended to those passed to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createBound(func, slice(arguments, 1), null, indicatorObject); + } + + /** + * Creates a function that, when executed, will only call the `func` + * function at most once per every `wait` milliseconds. If the throttled + * function is invoked more than once during the `wait` timeout, `func` will + * also be called on the trailing edge of the timeout. Subsequent calls to the + * throttled function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {Number} wait The number of milliseconds to throttle executions to. + * @returns {Function} Returns the new throttled function. + * @example + * + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + */ + function throttle(func, wait) { + var args, + result, + thisArg, + timeoutId, + lastCalled = 0; + + function trailingCall() { + lastCalled = new Date; + timeoutId = null; + result = func.apply(thisArg, args); + } + return function() { + var now = new Date, + remaining = wait - (now - lastCalled); + + args = arguments; + thisArg = this; + + if (remaining <= 0) { + clearTimeout(timeoutId); + timeoutId = null; + lastCalled = now; + result = func.apply(thisArg, args); + } + else if (!timeoutId) { + timeoutId = setTimeout(trailingCall, remaining); + } + return result; + }; + } + + /** + * Creates a function that passes `value` to the `wrapper` function as its + * first argument. Additional arguments passed to the function are appended + * to those passed to the `wrapper` function. The `wrapper` is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Mixed} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var hello = function(name) { return 'hello ' + name; }; + * hello = _.wrap(hello, function(func) { + * return 'before, ' + func('moe') + ', after'; + * }); + * hello(); + * // => 'before, hello moe, after' + */ + function wrap(value, wrapper) { + return function() { + var args = [value]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} string The string to escape. + * @returns {String} Returns the escaped string. + * @example + * + * _.escape('Moe, Larry & Curly'); + * // => 'Moe, Larry & Curly' + */ + function escape(string) { + return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This function returns the first argument passed to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Mixed} value Any value. + * @returns {Mixed} Returns `value`. + * @example + * + * var moe = { 'name': 'moe' }; + * moe === _.identity(moe); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds functions properties of `object` to the `lodash` function and chainable + * wrapper. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object of function properties to add to `lodash`. + * @example + * + * _.mixin({ + * 'capitalize': function(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * }); + * + * _.capitalize('moe'); + * // => 'Moe' + * + * _('moe').capitalize(); + * // => 'Moe' + */ + function mixin(object) { + forEach(functions(object), function(methodName) { + var func = lodash[methodName] = object[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + return new lodash(func.apply(lodash, args)); + }; + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + window._ = oldDash; + return this; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is passed, a number between `0` and the given number will be returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Number} [min=0] The minimum possible value. + * @param {Number} [max=1] The maximum possible value. + * @returns {Number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => a number between 0 and 5 + * + * _.random(5); + * // => also a number between 0 and 5 + */ + function random(min, max) { + if (min == null && max == null) { + max = 1; + } + min = +min || 0; + if (max == null) { + max = min; + min = 0; + } + return min + floor(nativeRandom() * ((+max || 0) - min + 1)); + } + + /** + * Resolves the value of `property` on `object`. If `property` is a function, + * it will be invoked and its result returned, else the property value is + * returned. If `object` is falsey, then `null` is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {String} property The property to get the value of. + * @returns {Mixed} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, property) { + var value = object ? object[property] : undefined; + return isFunction(value) ? object[property]() : value; + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` + * build and using precompiled templates, or loading Lo-Dash in a sandbox. + * + * For more information on precompiling templates see: + * http://lodash.com/#custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} text The template text. + * @param {Obect} data The data object used to populate the text. + * @param {Object} options The options object. + * escape - The "escape" delimiter regexp. + * evaluate - The "evaluate" delimiter regexp. + * interpolate - The "interpolate" delimiter regexp. + * sourceURL - The sourceURL of the template's compiled source. + * variable - The data object variable name. + * + * @returns {Function|String} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'moe' }); + * // => 'hello moe' + * + * var list = '<% _.forEach(people, function(name) { %>
  • <%= name %>
  • <% }); %>'; + * _.template(list, { 'people': ['moe', 'larry'] }); + * // => '
  • moe
  • larry
  • ' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nTo avoid potential issues, update `npm` before installing Lo-Dash:\n\n```bash\nnpm install npm -g\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n\n// or as a drop-in replacement for Underscore\nvar _ = require('lodash/lodash.underscore');\n```\n\n**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 project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Release Notes\n\n### v1.0.1\n\n * Add support for specifying source map URLs in `-p`/`--source-map` build options\n * Ensured the second argument passed to `_.assign` is not treated as a `callback`\n * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL`\n * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed\n * Made `_.defer` use `setImmediate`, in Node.js, when available\n * Made `_.where` search arrays for values regardless of their index position\n * Removed dead code from `_.template`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash@1.0.1", + "_from": "lodash@~1.0.1", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json new file mode 100644 index 0000000..7940868 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json @@ -0,0 +1,48 @@ +{ + "name": "findup-sync", + "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", + "version": "0.1.2", + "homepage": "https://github.com/cowboy/node-findup-sync", + "author": { + "name": "\"Cowboy\" Ben Alman", + "url": "http://benalman.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/cowboy/node-findup-sync.git" + }, + "bugs": { + "url": "https://github.com/cowboy/node-findup-sync/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/cowboy/node-findup-sync/blob/master/LICENSE-MIT" + } + ], + "main": "lib/findup-sync", + "engines": { + "node": ">= 0.6.0" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "dependencies": { + "glob": "~3.1.21", + "lodash": "~1.0.1" + }, + "devDependencies": { + "grunt": "~0.4.0", + "grunt-contrib-jshint": "~0.2.0", + "grunt-contrib-nodeunit": "~0.1.2" + }, + "keywords": [ + "find", + "glob", + "file" + ], + "readme": "# findup-sync\n\nFind the first file matching a given pattern in the current directory or the nearest ancestor directory.\n\n## Getting Started\nInstall the module with: `npm install findup-sync`\n\n```js\nvar findup = require('findup-sync');\n\n// Start looking in the CWD.\nvar filepath1 = findup('{a,b}*.txt');\n\n// Start looking somewhere else, and ignore case (probably a good idea).\nvar filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});\n```\n\n## Usage\n\n```js\nfindup(patternOrPatterns [, minimatchOptions])\n```\n\n### patternOrPatterns\nType: `String` or `Array` \nDefault: none\n\nOne or more wildcard glob patterns. Or just filenames.\n\n### minimatchOptions\nType: `Object` \nDefault: `{}`\n\nOptions to be passed to [minimatch](https://github.com/isaacs/minimatch).\n\nNote that if you want to start in a different directory than the current working directory, specify a `cwd` property here.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. \n2012-11-15 - v0.1.1 - Now works without an options object. \n2012-11-01 - v0.1.0 - Initial release.\n", + "readmeFilename": "README.md", + "_id": "findup-sync@0.1.2", + "_from": "findup-sync@~0.1.2" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/findup-sync_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/findup-sync_test.js new file mode 100644 index 0000000..f8baf9e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/findup-sync_test.js @@ -0,0 +1,48 @@ +'use strict'; + +// Nodejs lib. +var path = require('path'); + +var findup = require('../lib/findup-sync.js'); + +// Get a relative path. +var rel = function(abspath) { + return typeof abspath === 'string' ? path.relative('.', abspath) : abspath; +}; + +exports['findup'] = { + setUp: function(done) { + this.cwd = process.cwd(); + done(); + }, + tearDown: function(done) { + process.chdir(this.cwd); + done(); + }, + 'simple': function(test) { + test.expect(8); + var opts = {cwd: 'test/fixtures/a/b'}; + test.equal(rel(findup('foo.txt', opts)), path.normalize('test/fixtures/a/foo.txt'), 'should find files'); + test.equal(rel(findup('bar.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find files'); + test.equal(rel(findup('a.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should find files'); + test.equal(rel(findup('?.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should support glob patterns'); + test.equal(rel(findup('*.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches the glob pattern'); + test.equal(rel(findup(['b*.txt', 'f*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); + test.equal(rel(findup(['f*.txt', 'b*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); + test.equal(findup('not-gonna-exist-i-hope.txt', opts), null, 'should returning null if no files found'); + test.done(); + }, + 'cwd': function(test) { + test.expect(8); + process.chdir('test/fixtures/a/b'); + test.equal(rel(findup('foo.txt')), path.normalize('../foo.txt'), 'should find files'); + test.equal(rel(findup('bar.txt')), 'bar.txt', 'should find files'); + test.equal(rel(findup('a.txt')), path.normalize('../../a.txt'), 'should find files'); + test.equal(rel(findup('?.txt')), path.normalize('../../a.txt'), 'should support glob patterns'); + test.equal(rel(findup('*.txt')), 'bar.txt', 'should find the first thing that matches the glob pattern'); + test.equal(rel(findup(['b*.txt', 'f*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); + test.equal(rel(findup(['f*.txt', 'b*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); + test.equal(findup('not-gonna-exist-i-hope.txt'), null, 'should returning null if no files found'); + test.done(); + }, +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a/b/bar.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a/b/bar.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a/foo.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/a/foo.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/aaa.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/test/fixtures/aaa.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.npmignore new file mode 100644 index 0000000..2af4b71 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.npmignore @@ -0,0 +1,2 @@ +.*.swp +test/a/ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.travis.yml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.travis.yml new file mode 100644 index 0000000..baa0031 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/README.md new file mode 100644 index 0000000..cc69164 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/README.md @@ -0,0 +1,250 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +## Attention: node-glob users! + +The API has changed dramatically between 2.x and 3.x. This library is +now 100% JavaScript, and the integer flags have been replaced with an +options object. + +Also, there's an event emitter class, proper tests, and all the other +things you've come to expect from node modules. + +And best of all, no compilation! + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Features + +Please see the [minimatch +documentation](https://github.com/isaacs/minimatch) for more details. + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instanting the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `error` The error encountered. When an error is encountered, the + glob object is in an undefined state, and should be discarded. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `statCache` Collection of all the stat results the glob search + performed. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `1` - Path exists, and is not a directory + * `2` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `abort` Stop the search. + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the glob object, as well. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. It will cause + ELOOP to be triggered one level sooner in the case of cyclical + symbolic links. +* `silent` When an unusual error is encountered + when attempting to read a directory, a warning will be printed to + stderr. Set the `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered + when attempting to read a directory, the process will just continue on + in search of other matches. Set the `strict` option to raise an error + in these cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary to + set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. + Set this flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `nocase` Perform a case-insensitive match. Note that case-insensitive + filesystems will sometimes result in glob returning results that are + case-insensitively matched anyway, since readdir and stat will not + raise an error. +* `debug` Set to enable debug logging in minimatch and glob. +* `globDebug` Set to enable debug logging in glob, but not minimatch. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/g.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/g.js new file mode 100644 index 0000000..be122df --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/g.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "test/a/**/[cg]/../[cg]" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/usr-local.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/usr-local.js new file mode 100644 index 0000000..327a425 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/examples/usr-local.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "{./*/*,/*,/usr/local/*}" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js new file mode 100644 index 0000000..f4c69e9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js @@ -0,0 +1,690 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// readdir(PREFIX) as ENTRIES +// If fails, END +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + + + +module.exports = glob + +var fs = require("fs") +, minimatch = require("minimatch") +, Minimatch = minimatch.Minimatch +, inherits = require("inherits") +, EE = require("events").EventEmitter +, path = require("path") +, isDir = {} +, assert = require("assert").ok + +function glob (pattern, options, cb) { + if (typeof options === "function") cb = options, options = {} + if (!options) options = {} + + if (typeof options === "number") { + deprecated() + return + } + + var g = new Glob(pattern, options, cb) + return g.sync ? g.found : g +} + +glob.fnmatch = deprecated + +function deprecated () { + throw new Error("glob's interface has changed. Please see the docs.") +} + +glob.sync = globSync +function globSync (pattern, options) { + if (typeof options === "number") { + deprecated() + return + } + + options = options || {} + options.sync = true + return glob(pattern, options) +} + + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options, cb) + } + + if (typeof options === "function") { + cb = options + options = null + } + + if (typeof cb === "function") { + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) + }) + } + + options = options || {} + + this.EOF = {} + this._emitQueue = [] + + this.maxDepth = options.maxDepth || 1000 + this.maxLength = options.maxLength || Infinity + this.cache = options.cache || {} + this.statCache = options.statCache || {} + + this.changedCwd = false + var cwd = process.cwd() + if (!options.hasOwnProperty("cwd")) this.cwd = cwd + else { + this.cwd = options.cwd + this.changedCwd = path.resolve(options.cwd) !== cwd + } + + this.root = options.root || path.resolve(this.cwd, "/") + this.root = path.resolve(this.root) + if (process.platform === "win32") + this.root = this.root.replace(/\\/g, "/") + + this.nomount = !!options.nomount + + if (!pattern) { + throw new Error("must provide pattern") + } + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + this.strict = options.strict !== false + this.dot = !!options.dot + this.mark = !!options.mark + this.sync = !!options.sync + this.nounique = !!options.nounique + this.nonull = !!options.nonull + this.nosort = !!options.nosort + this.nocase = !!options.nocase + this.stat = !!options.stat + + this.debug = !!options.debug || !!options.globDebug + if (this.debug) + this.log = console.error + + this.silent = !!options.silent + + var mm = this.minimatch = new Minimatch(pattern, options) + this.options = mm.options + pattern = this.pattern = mm.pattern + + this.error = null + this.aborted = false + + // list of all the patterns that ** has resolved do, so + // we can avoid visiting multiple times. + this._globstars = {} + + EE.call(this) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + this.minimatch.set.forEach(iterator.bind(this)) + function iterator (pattern, i, set) { + this._process(pattern, 0, i, function (er) { + if (er) this.emit("error", er) + if (-- n <= 0) this._finish() + }) + } +} + +Glob.prototype.log = function () {} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + + var nou = this.nounique + , all = nou ? [] : {} + + for (var i = 0, l = this.matches.length; i < l; i ++) { + var matches = this.matches[i] + this.log("matches[%d] =", i, matches) + // do like the shell, and spit out the literal glob + if (!matches) { + if (this.nonull) { + var literal = this.minimatch.globSet[i] + if (nou) all.push(literal) + else all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) all.push.apply(all, m) + else m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) all = Object.keys(all) + + if (!this.nosort) { + all = all.sort(this.nocase ? alphasorti : alphasort) + } + + this.log("emitting end", all) + + this.EOF = this.found = all + this.emitMatch(this.EOF, -1) +} + +function alphasorti (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return alphasort(a, b) +} + +function alphasort (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit("abort") +} + +Glob.prototype.pause = function () { + if (this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = true + this.emit("pause") +} + +Glob.prototype.resume = function () { + if (!this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = false + this.emit("resume") + this._processEmitQueue() + //process.nextTick(this.emit.bind(this, "resume")) +} + +Glob.prototype._mark = function (p) { + var c = this.cache[p] + var m = p + if (c) { + var isDir = c === 2 || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + this.statCache[m] = this.statCache[p] + this.cache[m] = this.cache[p] + } + } + + return m +} + +Glob.prototype._pushMatch = function(m, index) { + if (this.mark && m !== this.EOF) + m = this._mark(m) + + if (m !== this.EOF) { + this.matches[index] = this.matches[index] || {} + this.matches[index][m] = true + } + + this._emitQueue.push(m) + this._processEmitQueue() +} + +Glob.prototype.emitMatch = function (m, index) { + if ((!this.stat && !this.mark) || this.statCache[m] || m === this.EOF) { + this._pushMatch(m, index) + } else { + this._stat(m, function(exists, isDir) { + if (exists) + this._pushMatch(m, index) + }) + } +} + +Glob.prototype._processEmitQueue = function (m) { + while (!this._processingEmitQueue && + !this.paused) { + this._processingEmitQueue = true + var m = this._emitQueue.shift() + if (!m) { + this._processingEmitQueue = false + break + } + + this.log('emit!', m === this.EOF ? "end" : "match") + + this.emit(m === this.EOF ? "end" : "match", m) + this._processingEmitQueue = false + } +} + +Glob.prototype._process = function (pattern, depth, index, cb_) { + assert(this instanceof Glob) + + var cb = function cb (er, res) { + assert(this instanceof Glob) + if (this.paused) { + if (!this._processQueue) { + this._processQueue = [] + this.once("resume", function () { + var q = this._processQueue + this._processQueue = null + q.forEach(function (cb) { cb() }) + }) + } + this._processQueue.push(cb_.bind(this, er, res)) + } else { + cb_.call(this, er, res) + } + }.bind(this) + + if (this.aborted) return cb() + + if (depth > this.maxDepth) return cb() + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === "string") { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + prefix = pattern.join("/") + this._stat(prefix, function (exists, isDir) { + // either it's there, or it isn't. + // nothing more to do, either way. + if (exists) { + if (prefix && isAbsolute(prefix) && !this.nomount) { + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + this.emitMatch(prefix, index) + } + return cb() + }) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's "absolute" like /foo/bar, + // or "relative" like "../baz" + prefix = pattern.slice(0, n) + prefix = prefix.join("/") + break + } + + // get the list of entries. + var read + if (prefix === null) read = "." + else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + if (!prefix || !isAbsolute(prefix)) { + prefix = path.join("/", prefix) + } + read = prefix = path.resolve(prefix) + + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } + + this.log('readdir(%j)', read, this.cwd, this.root) + + return this._readdir(read, function (er, entries) { + if (er) { + // not a directory! + // this means that, whatever else comes after this, it can never match + return cb() + } + + // globstar is special + if (pattern[n] === minimatch.GLOBSTAR) { + // test without the globstar, and with every child both below + // and replacing the globstar. + var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] + entries.forEach(function (e) { + if (e.charAt(0) === "." && !this.dot) return + // instead of the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) + // below the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) + }, this) + + s = s.filter(function (pattern) { + var key = gsKey(pattern) + var seen = !this._globstars[key] + this._globstars[key] = true + return seen + }, this) + + if (!s.length) + return cb() + + // now asyncForEach over this + var l = s.length + , errState = null + s.forEach(function (gsPattern) { + this._process(gsPattern, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l <= 0) return cb() + }) + }, this) + + return + } + + // not a globstar + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = pattern[n] + var rawGlob = pattern[n]._glob + , dotOk = this.dot || rawGlob.charAt(0) === "." + + entries = entries.filter(function (e) { + return (e.charAt(0) !== "." || dotOk) && + e.match(pattern[n]) + }) + + // If n === pattern.length - 1, then there's no need for the extra stat + // *unless* the user has specified "mark" or "stat" explicitly. + // We know that they exist, since the readdir returned them. + if (n === pattern.length - 1 && + !this.mark && + !this.stat) { + entries.forEach(function (e) { + if (prefix) { + if (prefix !== "/") e = prefix + "/" + e + else e = prefix + e + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + + if (process.platform === "win32") + e = e.replace(/\\/g, "/") + + this.emitMatch(e, index) + }, this) + return cb.call(this) + } + + + // now test all the remaining entries as stand-ins for that part + // of the pattern. + var l = entries.length + , errState = null + if (l === 0) return cb() // no matches possible + entries.forEach(function (e) { + var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) + this._process(p, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l === 0) return cb.call(this) + }) + }, this) + }) + +} + +function gsKey (pattern) { + return '**' + pattern.map(function (p) { + return (p === minimatch.GLOBSTAR) ? '**' : (''+p) + }).join('/') +} + +Glob.prototype._stat = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterStat(f, abs, cb, er) + } + + this.log('stat', [this.cwd, f, '=', abs]) + + if (!this.stat && this.cache.hasOwnProperty(f)) { + var exists = this.cache[f] + , isDir = exists && (Array.isArray(exists) || exists === 2) + if (this.sync) return cb.call(this, !!exists, isDir) + return process.nextTick(cb.bind(this, !!exists, isDir)) + } + + var stat = this.statCache[abs] + if (this.sync || stat) { + var er + try { + stat = fs.statSync(abs) + } catch (e) { + er = e + } + this._afterStat(f, abs, cb, er, stat) + } else { + fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + } +} + +Glob.prototype._afterStat = function (f, abs, cb, er, stat) { + var exists + assert(this instanceof Glob) + + if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { + this.log("should be ENOTDIR, fake it") + + er = new Error("ENOTDIR, not a directory '" + abs + "'") + er.path = abs + er.code = "ENOTDIR" + stat = null + } + + var emit = !this.statCache[abs] + this.statCache[abs] = stat + + if (er || !stat) { + exists = false + } else { + exists = stat.isDirectory() ? 2 : 1 + if (emit) + this.emit('stat', f, stat) + } + this.cache[f] = this.cache[f] || exists + cb.call(this, !!exists, exists === 2) +} + +Glob.prototype._readdir = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (isAbsolute(f)) { + abs = f + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterReaddir(f, abs, cb, er) + } + + this.log('readdir', [this.cwd, f, abs]) + if (this.cache.hasOwnProperty(f)) { + var c = this.cache[f] + if (Array.isArray(c)) { + if (this.sync) return cb.call(this, null, c) + return process.nextTick(cb.bind(this, null, c)) + } + + if (!c || c === 1) { + // either ENOENT or ENOTDIR + var code = c ? "ENOTDIR" : "ENOENT" + , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) + er.path = f + er.code = code + this.log(f, er) + if (this.sync) return cb.call(this, er) + return process.nextTick(cb.bind(this, er)) + } + + // at this point, c === 2, meaning it's a dir, but we haven't + // had to read it yet, or c === true, meaning it's *something* + // but we don't have any idea what. Need to read it, either way. + } + + if (this.sync) { + var er, entries + try { + entries = fs.readdirSync(abs) + } catch (e) { + er = e + } + return this._afterReaddir(f, abs, cb, er, entries) + } + + fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) +} + +Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { + assert(this instanceof Glob) + if (entries && !er) { + this.cache[f] = entries + // if we haven't asked to stat everything for suresies, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. This also gets us one step + // further into ELOOP territory. + if (!this.mark && !this.stat) { + entries.forEach(function (e) { + if (f === "/") e = f + e + else e = f + "/" + e + this.cache[e] = true + }, this) + } + + return cb.call(this, er, entries) + } + + // now handle errors, and cache the information + if (er) switch (er.code) { + case "ENOTDIR": // totally normal. means it *does* exist. + this.cache[f] = 1 + return cb.call(this, er) + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[f] = false + return cb.call(this, er) + default: // some unusual error. Treat as failure. + this.cache[f] = false + if (this.strict) this.emit("error", er) + if (!this.silent) console.error("glob error", er) + return cb.call(this, er) + } +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits_browser.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/package.json new file mode 100644 index 0000000..5bf0db5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/package.json @@ -0,0 +1,33 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits", + "_id": "inherits@2.0.1", + "_from": "inherits@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json new file mode 100644 index 0000000..2c7a1be --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json @@ -0,0 +1,43 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "3.2.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "engines": { + "node": "*" + }, + "dependencies": { + "minimatch": "~0.2.11", + "inherits": "2" + }, + "devDependencies": { + "tap": "~0.4.0", + "mkdirp": "0", + "rimraf": "1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "BSD", + "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `1` - Path exists, and is not a directory\n * `2` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob", + "_id": "glob@3.2.8", + "dist": { + "shasum": "faed42352b23fd9688f67e91dfd4a6b3f58f0784" + }, + "_from": "glob@~3.2.6", + "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/00-setup.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/00-setup.js new file mode 100644 index 0000000..245afaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/00-setup.js @@ -0,0 +1,176 @@ +// just a little pre-run script to set up the fixtures. +// zz-finish cleans it up + +var mkdirp = require("mkdirp") +var path = require("path") +var i = 0 +var tap = require("tap") +var fs = require("fs") +var rimraf = require("rimraf") + +var files = +[ "a/.abcdef/x/y/z/a" +, "a/abcdef/g/h" +, "a/abcfed/g/h" +, "a/b/c/d" +, "a/bc/e/f" +, "a/c/d/c/b" +, "a/cb/e/f" +] + +var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") +var symlinkFrom = "../.." + +files = files.map(function (f) { + return path.resolve(__dirname, f) +}) + +tap.test("remove fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "remove fixtures") + t.end() + }) +}) + +files.forEach(function (f) { + tap.test(f, function (t) { + var d = path.dirname(f) + mkdirp(d, 0755, function (er) { + if (er) { + t.fail(er) + return t.bailout() + } + fs.writeFile(f, "i like tests", function (er) { + t.ifError(er, "make file") + t.end() + }) + }) + }) +}) + +if (process.platform !== "win32") { + tap.test("symlinky", function (t) { + var d = path.dirname(symlinkTo) + console.error("mkdirp", d) + mkdirp(d, 0755, function (er) { + t.ifError(er) + fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { + t.ifError(er, "make symlink") + t.end() + }) + }) + }) +} + +;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { + w = "/tmp/glob-test/" + w + tap.test("create " + w, function (t) { + mkdirp(w, function (er) { + if (er) + throw er + t.pass(w) + t.end() + }) + }) +}) + + +// generate the bash pattern test-fixtures if possible +if (process.platform === "win32" || !process.env.TEST_REGEN) { + console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") + return +} + +var spawn = require("child_process").spawn; +var globs = + // put more patterns here. + // anything that would be directly in / should be in /tmp/glob-test + ["test/a/*/+(c|g)/./d" + ,"test/a/**/[cg]/../[cg]" + ,"test/a/{b,c,d,e,f}/**/g" + ,"test/a/b/**" + ,"test/**/g" + ,"test/a/abc{fed,def}/g/h" + ,"test/a/abc{fed/g,def}/**/" + ,"test/a/abc{fed/g,def}/**///**/" + ,"test/**/a/**/" + ,"test/+(a|b|c)/a{/,bc*}/**" + ,"test/*/*/*/f" + ,"test/**/f" + ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" + ,"{./*/*,/tmp/glob-test/*}" + ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! + ,"test/a/!(symlink)/**" + ] +var bashOutput = {} +var fs = require("fs") + +globs.forEach(function (pattern) { + tap.test("generate fixture " + pattern, function (t) { + var cmd = "shopt -s globstar && " + + "shopt -s extglob && " + + "shopt -s nullglob && " + + // "shopt >&2; " + + "eval \'for i in " + pattern + "; do echo $i; done\'" + var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) + var out = [] + cp.stdout.on("data", function (c) { + out.push(c) + }) + cp.stderr.pipe(process.stderr) + cp.on("close", function (code) { + out = flatten(out) + if (!out) + out = [] + else + out = cleanResults(out.split(/\r*\n/)) + + bashOutput[pattern] = out + t.notOk(code, "bash test should finish nicely") + t.end() + }) + }) +}) + +tap.test("save fixtures", function (t) { + var fname = path.resolve(__dirname, "bash-results.json") + var data = JSON.stringify(bashOutput, null, 2) + "\n" + fs.writeFile(fname, data, function (er) { + t.ifError(er) + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +function flatten (chunks) { + var s = 0 + chunks.forEach(function (c) { s += c.length }) + var out = new Buffer(s) + s = 0 + chunks.forEach(function (c) { + c.copy(out, s) + s += c.length + }) + + return out.toString().trim() +} + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-comparison.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-comparison.js new file mode 100644 index 0000000..239ed1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-comparison.js @@ -0,0 +1,63 @@ +// basic test +// show that it does the same thing by default as the shell. +var tap = require("tap") +, child_process = require("child_process") +, bashResults = require("./bash-results.json") +, globs = Object.keys(bashResults) +, glob = require("../") +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +globs.forEach(function (pattern) { + var expect = bashResults[pattern] + // anything regarding the symlink thing will fail on windows, so just skip it + if (process.platform === "win32" && + expect.some(function (m) { + return /\/symlink\//.test(m) + })) + return + + tap.test(pattern, function (t) { + glob(pattern, function (er, matches) { + if (er) + throw er + + // sort and unmark, just to match the shell results + matches = cleanResults(matches) + + t.deepEqual(matches, expect, pattern) + t.end() + }) + }) + + tap.test(pattern + " sync", function (t) { + var matches = cleanResults(glob.sync(pattern)) + + t.deepEqual(matches, expect, "should match shell") + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-results.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-results.json new file mode 100644 index 0000000..593215c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/bash-results.json @@ -0,0 +1,350 @@ +{ + "test/a/*/+(c|g)/./d": [ + "test/a/b/c/./d" + ], + "test/a/**/[cg]/../[cg]": [ + "test/a/abcdef/g/../g", + "test/a/abcfed/g/../g", + "test/a/b/c/../c", + "test/a/c/../c", + "test/a/c/d/c/../c", + "test/a/symlink/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" + ], + "test/a/{b,c,d,e,f}/**/g": [], + "test/a/b/**": [ + "test/a/b", + "test/a/b/c", + "test/a/b/c/d" + ], + "test/**/g": [ + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed,def}/g/h": [ + "test/a/abcdef/g/h", + "test/a/abcfed/g/h" + ], + "test/a/abc{fed/g,def}/**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed/g,def}/**///**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/**/a/**/": [ + "test/a", + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/b", + "test/a/b/c", + "test/a/bc", + "test/a/bc/e", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/cb", + "test/a/cb/e", + "test/a/symlink", + "test/a/symlink/a", + "test/a/symlink/a/b", + "test/a/symlink/a/b/c", + "test/a/symlink/a/b/c/a", + "test/a/symlink/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" + ], + "test/+(a|b|c)/a{/,bc*}/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h" + ], + "test/*/*/*/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/**/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" + ], + "{./*/*,/tmp/glob-test/*}": [ + "./examples/g.js", + "./examples/usr-local.js", + "./node_modules/inherits", + "./node_modules/minimatch", + "./node_modules/mkdirp", + "./node_modules/rimraf", + "./node_modules/tap", + "./test/00-setup.js", + "./test/a", + "./test/bash-comparison.js", + "./test/bash-results.json", + "./test/cwd-test.js", + "./test/globstar-match.js", + "./test/mark.js", + "./test/new-glob-optional-options.js", + "./test/nocase-nomagic.js", + "./test/pause-resume.js", + "./test/root-nomount.js", + "./test/root.js", + "./test/stat.js", + "./test/zz-cleanup.js", + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq" + ], + "{/tmp/glob-test/*,*}": [ + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq", + "examples", + "glob.js", + "LICENSE", + "node_modules", + "package.json", + "README.md", + "test" + ], + "test/a/!(symlink)/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h", + "test/a/b", + "test/a/b/c", + "test/a/b/c/d", + "test/a/bc", + "test/a/bc/e", + "test/a/bc/e/f", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/c/d/c/b", + "test/a/cb", + "test/a/cb/e", + "test/a/cb/e/f" + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/cwd-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/cwd-test.js new file mode 100644 index 0000000..352c27e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/cwd-test.js @@ -0,0 +1,55 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing cwd and searching for **/d", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('**/d', function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('a', function (t) { + glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'b/c/d', 'c/d' ]) + t.end() + }) + }) + + t.test('a/b', function (t) { + glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('a/b/', function (t) { + glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('.', function (t) { + glob('**/d', {cwd: process.cwd()}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/globstar-match.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/globstar-match.js new file mode 100644 index 0000000..9b234fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/globstar-match.js @@ -0,0 +1,19 @@ +var Glob = require("../glob.js").Glob +var test = require('tap').test + +test('globstar should not have dupe matches', function(t) { + var pattern = 'a/**/[gh]' + var g = new Glob(pattern, { cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + console.error('match %j', m) + matches.push(m) + }) + g.on('end', function(set) { + console.error('set', set) + matches = matches.sort() + set = set.sort() + t.same(matches, set, 'should have same set of matches') + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/mark.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/mark.js new file mode 100644 index 0000000..e742820 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/mark.js @@ -0,0 +1,82 @@ +var test = require("tap").test +var glob = require('../') +process.chdir(__dirname) + +test("mark, no / on pattern", function (t) { + glob("a/*", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + + if (process.platform !== "win32") + expect.push('a/symlink/') + + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, no / on pattern", function (t) { + glob("a/*", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef', + 'a/abcfed', + 'a/b', + 'a/bc', + 'a/c', + 'a/cb' ] + + if (process.platform !== "win32") + expect.push('a/symlink') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /[^\/]$/) + }) +}) + +test("mark=true, / on pattern", function (t) { + glob("a/*/", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, / on pattern", function (t) { + glob("a/*/", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/new-glob-optional-options.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/new-glob-optional-options.js new file mode 100644 index 0000000..3e7dc5a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/new-glob-optional-options.js @@ -0,0 +1,10 @@ +var Glob = require('../glob.js').Glob; +var test = require('tap').test; + +test('new glob, with cb, and no options', function (t) { + new Glob(__filename, function(er, results) { + if (er) throw er; + t.same(results, [__filename]); + t.end(); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/nocase-nomagic.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/nocase-nomagic.js new file mode 100644 index 0000000..2503f23 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/nocase-nomagic.js @@ -0,0 +1,113 @@ +var fs = require('fs'); +var test = require('tap').test; +var glob = require('../'); + +test('mock fs', function(t) { + var stat = fs.stat + var statSync = fs.statSync + var readdir = fs.readdir + var readdirSync = fs.readdirSync + + function fakeStat(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = { isDirectory: function() { return true } } + break + case '/tmp/a': + ret = { isDirectory: function() { return false } } + break + } + return ret + } + + fs.stat = function(path, cb) { + var f = fakeStat(path); + if (f) { + process.nextTick(function() { + cb(null, f) + }) + } else { + stat.call(fs, path, cb) + } + } + + fs.statSync = function(path) { + return fakeStat(path) || statSync.call(fs, path) + } + + function fakeReaddir(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = [ 'a', 'A' ] + break + case '/': + ret = ['tmp', 'tMp', 'tMP', 'TMP'] + } + return ret + } + + fs.readdir = function(path, cb) { + var f = fakeReaddir(path) + if (f) + process.nextTick(function() { + cb(null, f) + }) + else + readdir.call(fs, path, cb) + } + + fs.readdirSync = function(path) { + return fakeReaddir(path) || readdirSync.call(fs, path) + } + + t.pass('mocked') + t.end() +}) + +test('nocase, nomagic', function(t) { + var n = 2 + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/a', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) + glob('/tmp/A', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) +}) + +test('nocase, with some magic', function(t) { + t.plan(2) + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/pause-resume.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/pause-resume.js new file mode 100644 index 0000000..e1ffbab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/pause-resume.js @@ -0,0 +1,73 @@ +// show that no match events happen while paused. +var tap = require("tap") +, child_process = require("child_process") +// just some gnarly pattern with lots of matches +, pattern = "test/a/!(symlink)/**" +, bashResults = require("./bash-results.json") +, patterns = Object.keys(bashResults) +, glob = require("../") +, Glob = glob.Glob +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +var globResults = [] +tap.test("use a Glob object, and pause/resume it", function (t) { + var g = new Glob(pattern) + , paused = false + , res = [] + , expect = bashResults[pattern] + + g.on("pause", function () { + console.error("pause") + }) + + g.on("resume", function () { + console.error("resume") + }) + + g.on("match", function (m) { + t.notOk(g.paused, "must not be paused") + globResults.push(m) + g.pause() + t.ok(g.paused, "must be paused") + setTimeout(g.resume.bind(g), 10) + }) + + g.on("end", function (matches) { + t.pass("reached glob end") + globResults = cleanResults(globResults) + matches = cleanResults(matches) + t.deepEqual(matches, globResults, + "end event matches should be the same as match events") + + t.deepEqual(matches, expect, + "glob matches should be the same as bash results") + + t.end() + }) +}) + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root-nomount.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root-nomount.js new file mode 100644 index 0000000..3ac5979 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root-nomount.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing root and searching for /b*/**", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) + }) + + t.test('a', function (t) { + glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root.js new file mode 100644 index 0000000..95c23f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/root.js @@ -0,0 +1,46 @@ +var t = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +var glob = require('../') +var path = require('path') + +t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) +}) + + +t.test('a', function (t) { + console.error("root=" + path.resolve('a')) + glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { + t.ifError(er) + var wanted = [ + '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' + ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + }) + + t.like(matches, wanted) + t.end() + }) +}) + +t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + })) + t.end() + }) +}) + +t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/stat.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/stat.js new file mode 100644 index 0000000..6291711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/stat.js @@ -0,0 +1,32 @@ +var glob = require('../') +var test = require('tap').test +var path = require('path') + +test('stat all the things', function(t) { + var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + matches.push(m) + }) + var stats = [] + g.on('stat', function(m) { + stats.push(m) + }) + g.on('end', function(eof) { + stats = stats.sort() + matches = matches.sort() + eof = eof.sort() + t.same(stats, matches) + t.same(eof, matches) + var cache = Object.keys(this.statCache) + t.same(cache.map(function (f) { + return path.relative(__dirname, f) + }).sort(), matches) + + cache.forEach(function(c) { + t.equal(typeof this.statCache[c], 'object') + }, this) + + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/zz-cleanup.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/zz-cleanup.js new file mode 100644 index 0000000..e085f0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/glob/test/zz-cleanup.js @@ -0,0 +1,11 @@ +// remove the fixtures +var tap = require("tap") +, rimraf = require("rimraf") +, path = require("path") + +tap.test("cleanup fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "removed") + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.npmignore new file mode 100644 index 0000000..fe46877 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.npmignore @@ -0,0 +1,3 @@ +node_modules +*~ +*sublime-* diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.travis.yml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.travis.yml new file mode 100644 index 0000000..0bab9cd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/.travis.yml @@ -0,0 +1,5 @@ + language: node_js + node_js: + - 0.4 + - 0.6 + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000..d518d83 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +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. + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md new file mode 100644 index 0000000..ba30a32 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md @@ -0,0 +1,72 @@ +iconv-lite - pure javascript character encoding conversion +====================================================================== + +[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite) + +## Features + +* Pure javascript. Doesn't need native code compilation. +* Easy API. +* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). +* Encoding is much faster than node-iconv (see below for performance comparison). + +## Usage + + var iconv = require('iconv-lite'); + + // Convert from an encoded buffer to string. + str = iconv.decode(buf, 'win1251'); + + // Convert from string to an encoded buffer. + buf = iconv.encode("Sample input string", 'win1251'); + + // Check if encoding is supported + iconv.encodingExists("us-ascii") + + +## Supported encodings + +* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64' +* All widespread single byte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family. + Aliases like 'latin1', 'us-ascii' also supported. +* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'. + +Others are easy to add, see the source. Please, participate. +Most encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors! + +Not supported yet: EUC family, Shift_JIS. + + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). +Note: your results may vary, so please always check on your hardware. + + operation iconv@1.2.4 iconv-lite@0.2.4 + ---------------------------------------------------------- + encode('win1251') ~115 Mb/s ~230 Mb/s + decode('win1251') ~95 Mb/s ~130 Mb/s + + +## Notes + +When decoding, a 'binary'-encoded string can be used as a source buffer. +Untranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome. + +## Testing + + git clone git@github.com:ashtuchkin/iconv-lite.git + cd iconv-lite + npm install + npm test + + # To view performance: + node test/performance.js + +## TODO + +* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). +* Add more encodings. +* Add transliteration (best fit char). +* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js new file mode 100644 index 0000000..0423d63 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js @@ -0,0 +1,9 @@ +var big5Table = require('./table/big5.js'); +module.exports = { + 'windows950': 'big5', + 'cp950': 'big5', + 'big5': { + type: 'table', + table: big5Table + } +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js new file mode 100644 index 0000000..78a63ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js @@ -0,0 +1,9 @@ +var gbkTable = require('./table/gbk.js'); +module.exports = { + 'windows936': 'gbk', + 'gb2312': 'gbk', + 'gbk': { + type: 'table', + table: gbkTable + } +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js new file mode 100644 index 0000000..f41a7ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js @@ -0,0 +1,340 @@ +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "iso885911", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10029": "maccenteuro", + "10079": "maciceland", + "10081": "macturkish", + "20866": "koi8r", + "21866": "koi8u", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "ascii8bit": "ascii", + "usascii": "ascii", + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + "cp819": "iso88951", + "arabic": "iso88596", + "arabic8": "iso88596", + "greek": "iso88597", + "greek8": "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", + "thai": "iso885911", + "thai8": "iso885911", + "tis620": "iso885911", + "windows874": "iso885911", + "win874": "iso885911", + "cp874": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + "cp20866": "koi8r", + "ibm878": "koi8r", + "cp21866": "koi8u", + "ibm1168": "koi8u", + "windows1250": { + "type": "singlebyte", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "singlebyte", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "singlebyte", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "singlebyte", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "cp737": { + "type": "singlebyte", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "cp775": { + "type": "singlebyte", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "cp850": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "cp852": { + "type": "singlebyte", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "cp855": { + "type": "singlebyte", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "cp857": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "cp858": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "cp860": { + "type": "singlebyte", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "cp861": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "cp862": { + "type": "singlebyte", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "cp863": { + "type": "singlebyte", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "cp864": { + "type": "singlebyte", + "chars": "°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "cp865": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "cp866": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "cp869": { + "type": "singlebyte", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "maccenteuro": { + "type": "singlebyte", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + "maccroatian": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "singlebyte", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "singlebyte", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "singlebyte", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "singlebyte", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js new file mode 100644 index 0000000..605c72d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js @@ -0,0 +1 @@ +module.exports={"33088":19991,"33089":20002,"33090":20012,"33091":20053,"33092":20066,"33093":20106,"33094":20144,"33095":20203,"33096":20205,"33097":20220,"33098":20252,"33099":20362,"33100":20479,"33101":20546,"33102":20560,"33103":20600,"33104":20696,"33105":20702,"33106":20724,"33107":20758,"33108":20810,"33109":20817,"33110":20836,"33111":20842,"33112":20869,"33113":20880,"33114":20893,"33115":20902,"33116":20904,"33117":20905,"33118":20935,"33119":20950,"33120":20955,"33121":20972,"33122":20988,"33123":21003,"33124":21012,"33125":21013,"33126":21024,"33127":21035,"33128":21049,"33129":21071,"33130":21105,"33131":21136,"33132":21138,"33133":21140,"33134":21148,"33135":21167,"33136":21173,"33137":21200,"33138":21248,"33139":21255,"33140":21284,"33141":21318,"33142":21343,"33143":21395,"33144":21424,"33145":21469,"33146":21539,"33147":21584,"33148":21585,"33149":21642,"33150":21661,"33185":21667,"33186":21684,"33187":21712,"33188":21795,"33189":21823,"33190":21836,"33191":21843,"33192":21853,"33193":21868,"33194":21918,"33195":21929,"33196":21996,"33197":22005,"33198":22051,"33199":22096,"33200":22140,"33201":22154,"33202":22164,"33203":22176,"33204":22191,"33205":22232,"33206":22272,"33207":22361,"33208":22373,"33209":22399,"33210":22405,"33211":22409,"33212":22433,"33213":22444,"33214":22452,"33215":22464,"33216":22472,"33217":22483,"33218":22511,"33219":22596,"33220":22636,"33221":22674,"33222":22682,"33223":22706,"33224":22712,"33225":22757,"33226":22779,"33227":22786,"33228":22795,"33229":22800,"33230":22808,"33231":22811,"33232":29836,"33233":29837,"33234":29849,"33235":29851,"33236":29860,"33237":29876,"33238":29881,"33239":29896,"33240":29900,"33241":29904,"33242":29907,"33243":30018,"33244":30037,"33245":30062,"33246":30093,"33247":30110,"33248":30172,"33249":30252,"33250":30287,"33251":30289,"33252":30323,"33253":30324,"33254":30373,"33255":30425,"33256":30478,"33257":30479,"33258":30552,"33259":30578,"33260":30583,"33261":30584,"33262":30586,"33263":30587,"33264":30616,"33265":30639,"33266":30654,"33267":30659,"33268":30661,"33269":30667,"33270":30685,"33271":30694,"33272":30708,"33273":30750,"33274":30781,"33275":30786,"33276":30788,"33277":30795,"33278":30801,"33344":21782,"33345":22775,"33346":38964,"33347":33883,"33348":28948,"33349":33398,"33350":35158,"33351":40236,"33352":40206,"33353":36527,"33354":24674,"33355":26214,"33356":34510,"33357":25785,"33358":37772,"33359":22107,"33360":28485,"33361":35532,"33362":29001,"33363":24012,"33364":34633,"33365":39464,"33366":31658,"33367":36107,"33368":39255,"33369":23597,"33370":32331,"33371":38938,"33372":20518,"33373":25458,"33374":40568,"33375":30783,"33376":40633,"33377":40634,"33378":36046,"33379":35715,"33380":61305,"33381":33931,"33382":37284,"33383":31331,"33384":25776,"33385":24061,"33386":24214,"33387":32865,"33388":26965,"33389":31466,"33390":28710,"33391":26812,"33392":31095,"33393":28060,"33394":36841,"33395":31074,"33396":22178,"33397":34687,"33398":21093,"33399":31108,"33400":28300,"33401":37271,"33402":31622,"33403":38956,"33404":26717,"33405":20397,"33406":34222,"33441":31725,"33442":34635,"33443":20534,"33444":26893,"33445":27542,"33446":24910,"33447":20855,"33448":30495,"33449":20516,"33450":32622,"33451":30452,"33452":27097,"33453":24803,"33454":25334,"33455":21599,"33456":38788,"33457":22092,"33458":20677,"33459":22040,"33460":34398,"33461":22834,"33462":22875,"33463":22877,"33464":22883,"33465":22892,"33466":22939,"33467":22999,"33468":23019,"33469":23066,"33470":23210,"33471":23248,"33472":23281,"33473":23350,"33474":23497,"33475":23539,"33476":23571,"33477":23580,"33478":23582,"33479":23635,"33480":23705,"33481":23708,"33482":23738,"33483":23739,"33484":23745,"33485":23797,"33486":23802,"33487":23829,"33488":23832,"33489":23870,"33490":23891,"33491":23900,"33492":23917,"33493":23923,"33494":23924,"33495":23948,"33496":23952,"33497":23993,"33498":24016,"33499":24019,"33500":24135,"33501":24164,"33502":24271,"33503":24272,"33504":24298,"33505":24304,"33506":24329,"33507":24332,"33508":24337,"33509":24353,"33510":24372,"33511":24385,"33512":24389,"33513":24401,"33514":24412,"33515":24422,"33516":24451,"33517":24560,"33518":24650,"33519":24672,"33520":24715,"33521":24742,"33522":24798,"33523":24849,"33524":24864,"33525":24865,"33526":24892,"33527":24893,"33528":24984,"33529":25015,"33530":25076,"33531":25107,"33532":25117,"33533":25118,"33534":25143,"33600":24186,"33601":27664,"33602":21454,"33603":20267,"33604":20302,"33605":21556,"33606":22257,"33607":22766,"33608":22841,"33609":22918,"33610":23596,"33611":20915,"33612":20914,"33613":28798,"33614":35265,"33615":35282,"33616":36125,"33617":36710,"33618":20122,"33619":26469,"33620":20177,"33621":20004,"33622":21327,"33623":23626,"33624":20872,"33625":24213,"33626":25269,"33627":19996,"33628":20105,"33629":29366,"33630":31868,"33631":32416,"33632":21351,"33633":36711,"33634":37048,"33635":38271,"33636":38376,"33637":20384,"33638":20387,"33639":20822,"33640":21017,"33641":21170,"33642":21364,"33643":22850,"33644":24069,"33645":26594,"33646":27769,"33647":20026,"33648":32419,"33649":32418,"33650":32426,"33651":32427,"33652":32421,"33653":32422,"33654":32417,"33655":32989,"33656":33486,"33657":35745,"33658":35746,"33659":35747,"33660":36126,"33661":36127,"33662":20891,"33697":36712,"33698":38377,"33699":38886,"33700":39029,"33701":39118,"33702":39134,"33703":20457,"33704":20204,"33705":20261,"33706":20010,"33707":20262,"33708":20179,"33709":20923,"33710":21018,"33711":21093,"33712":21592,"33713":23089,"33714":23385,"33715":23777,"33716":23707,"33717":23704,"33718":24072,"33719":24211,"33720":24452,"33721":25375,"33722":26102,"33723":26187,"33724":20070,"33725":27902,"33726":27971,"33727":20044,"33728":29421,"33729":29384,"33730":20137,"33731":30757,"33732":31210,"33733":32442,"33734":32433,"33735":32441,"33736":32431,"33737":32445,"33738":32432,"33739":32423,"33740":32429,"33741":32435,"33742":32440,"33743":32439,"33744":32961,"33745":33033,"33746":21005,"33747":35760,"33748":35750,"33749":35752,"33750":35751,"33751":35754,"33752":35759,"33753":35757,"33754":35755,"33755":23682,"33756":36130,"33757":36129,"33758":36713,"33759":36715,"33760":38025,"33761":38024,"33762":38026,"33763":38027,"33764":38378,"33765":38453,"33766":38485,"33767":38473,"33768":39269,"33769":39532,"33770":39592,"33771":20266,"33772":20255,"33773":20390,"33774":20391,"33775":21153,"33776":21160,"33777":21306,"33778":21442,"33779":21713,"33780":38382,"33781":34900,"33782":22269,"33783":22362,"33784":22441,"33785":25191,"33786":22815,"33787":23044,"33788":22919,"33789":19987,"33790":23558,"33856":23625,"33857":23781,"33858":23703,"33859":24102,"33860":24080,"33861":24352,"33862":24378,"33863":20174,"33864":24469,"33865":20932,"33866":24581,"33867":25195,"33868":25346,"33869":25194,"33870":25249,"33871":25379,"33872":36133,"33873":21551,"33874":26011,"33875":26025,"33876":26172,"33877":21206,"33878":24323,"33879":26465,"33880":26541,"33881":26432,"33882":27682,"33883":20937,"33884":27973,"33885":28170,"33886":27882,"33887":27814,"33888":20928,"33889":29301,"33890":29424,"33891":29616,"33892":20135,"33893":27605,"33894":24322,"33895":20247,"33896":32458,"33897":32479,"33898":32461,"33899":32459,"33900":32460,"33901":32454,"33902":32453,"33903":32452,"33904":32456,"33905":32449,"33906":32450,"33907":38069,"33908":20064,"33909":33626,"33910":33550,"33911":33682,"33912":24196,"33913":33483,"33914":22788,"33915":26415,"33916":34926,"33917":35269,"33918":35268,"33953":35775,"33954":35766,"33955":35776,"33956":35767,"33957":35768,"33958":35774,"33959":35772,"33960":35769,"33961":36137,"33962":36131,"33963":36143,"33964":36135,"33965":36138,"33966":36139,"33967":36717,"33968":36719,"33969":36825,"33970":36830,"33971":36851,"33972":38039,"33973":38035,"33974":38031,"33975":38034,"33976":38381,"33977":38472,"33978":38470,"33979":38452,"33980":39030,"33981":39031,"33982":40060,"33983":40479,"33984":21348,"33985":40614,"33986":22791,"33987":20263,"33988":20254,"33989":20975,"33990":21056,"33991":21019,"33992":21171,"33993":21195,"33994":20007,"33995":21333,"33996":21727,"33997":21796,"33998":20052,"33999":22260,"34000":23591,"34001":22330,"34002":25253,"34003":22490,"34004":22774,"34005":23090,"34006":23547,"34007":23706,"34008":24103,"34009":24079,"34010":21397,"34011":21417,"34012":24694,"34013":38391,"34014":24812,"34015":24699,"34016":24700,"34017":25315,"34018":25381,"34019":25442,"34020":25196,"34021":26531,"34022":26635,"34023":26632,"34024":38054,"34025":27531,"34026":22771,"34027":27695,"34028":27689,"34029":28044,"34030":20945,"34031":28270,"34032":28065,"34033":27748,"34034":27979,"34035":27985,"34036":28067,"34037":26080,"34038":29369,"34039":33487,"34040":30011,"34041":30153,"34042":21457,"34043":30423,"34044":30746,"34045":31174,"34046":31383,"34112":31508,"34113":31499,"34114":32478,"34115":32467,"34116":32466,"34117":32477,"34118":19997,"34119":32476,"34120":32473,"34121":32474,"34122":32470,"34123":32475,"34124":32899,"34125":32958,"34126":32960,"34127":21326,"34128":33713,"34129":33484,"34130":34394,"34131":35270,"34132":35780,"34133":35789,"34134":35777,"34135":35778,"34136":35791,"34137":35781,"34138":35784,"34139":35787,"34140":35785,"34141":35786,"34142":35779,"34143":36142,"34144":36148,"34145":36144,"34146":36155,"34147":36146,"34148":36153,"34149":36154,"34150":36149,"34151":20080,"34152":36140,"34153":36152,"34154":36151,"34155":36722,"34156":36724,"34157":36726,"34158":36827,"34159":37038,"34160":20065,"34161":38046,"34162":38062,"34163":38041,"34164":38048,"34165":38055,"34166":38045,"34167":38052,"34168":38051,"34169":38389,"34170":38384,"34171":24320,"34172":38386,"34173":38388,"34174":38387,"34209":38431,"34210":38454,"34211":38451,"34212":38887,"34213":39033,"34214":39034,"34215":39035,"34216":39274,"34217":39277,"34218":39272,"34219":39278,"34220":39276,"34221":20911,"34222":39533,"34223":20081,"34224":20538,"34225":20256,"34226":20165,"34227":20542,"34228":20260,"34229":20588,"34230":38130,"34231":21183,"34232":31215,"34233":27719,"34234":21527,"34235":21596,"34236":21595,"34237":22253,"34238":22278,"34239":28034,"34240":22359,"34241":22366,"34242":22488,"34243":33556,"34244":22885,"34245":22920,"34246":29233,"34247":24574,"34248":24582,"34249":24698,"34250":25439,"34251":25250,"34252":25443,"34253":26500,"34254":26198,"34255":26197,"34256":26104,"34257":20250,"34258":19994,"34259":26497,"34260":26472,"34261":26722,"34262":26539,"34263":23681,"34264":27807,"34265":28781,"34266":28287,"34267":28369,"34268":27815,"34269":28902,"34270":28860,"34271":28800,"34272":28949,"34273":29239,"34274":29422,"34275":29502,"34276":29682,"34277":24403,"34278":30415,"34279":30544,"34280":30529,"34281":38606,"34282":30860,"34283":33410,"34284":31509,"34285":31908,"34286":32463,"34287":32482,"34288":32465,"34289":32485,"34290":32486,"34291":20041,"34292":32673,"34293":22307,"34294":32928,"34295":33050,"34296":32959,"34297":33041,"34298":33636,"34299":33479,"34300":21494,"34301":33716,"34302":34398,"34368":34383,"34369":21495,"34370":34568,"34371":34476,"34372":34917,"34373":35013,"34374":35815,"34375":35813,"34376":35814,"34377":35797,"34378":35799,"34379":35800,"34380":35801,"34381":35811,"34382":35802,"34383":35805,"34384":35803,"34385":35809,"34386":35810,"34387":35808,"34388":35807,"34389":36156,"34390":36164,"34391":36158,"34392":36159,"34393":36160,"34394":36161,"34395":36162,"34396":36165,"34397":36739,"34398":36733,"34399":36732,"34400":36734,"34401":20892,"34402":36816,"34403":36798,"34404":36829,"34405":36807,"34406":37049,"34407":38068,"34408":38067,"34409":38073,"34410":38072,"34411":38078,"34412":38080,"34413":38085,"34414":38057,"34415":38082,"34416":38083,"34417":38089,"34418":38091,"34419":38044,"34420":38093,"34421":38079,"34422":38086,"34423":38392,"34424":38504,"34425":38589,"34426":30005,"34427":39044,"34428":39037,"34429":39039,"34430":39036,"34465":39041,"34466":39042,"34467":39282,"34468":39284,"34469":39281,"34470":39280,"34471":39536,"34472":39534,"34473":39535,"34474":40480,"34475":20389,"34476":20392,"34477":21294,"34478":21388,"34479":23581,"34480":21589,"34481":21497,"34482":21949,"34483":21863,"34484":21716,"34485":22242,"34486":22270,"34487":23576,"34488":22443,"34489":22545,"34490":23551,"34491":26790,"34492":22842,"34493":22849,"34494":22954,"34495":23454,"34496":23517,"34497":23545,"34498":23649,"34499":23853,"34500":23702,"34501":24065,"34502":24124,"34503":24443,"34504":24577,"34505":24815,"34506":24696,"34507":24813,"34508":24808,"34509":25602,"34510":25524,"34511":25530,"34512":30021,"34513":33635,"34514":26538,"34515":28378,"34516":28173,"34517":27721,"34518":28385,"34519":28382,"34520":28176,"34521":28072,"34522":28063,"34523":27818,"34524":28180,"34525":28183,"34526":28068,"34527":33639,"34528":23572,"34529":33638,"34530":29425,"34531":29712,"34532":29595,"34533":30111,"34534":30113,"34535":30127,"34536":30186,"34537":23613,"34538":30417,"34539":30805,"34540":31087,"34541":31096,"34542":31181,"34543":31216,"34544":27964,"34545":31389,"34546":31546,"34547":31581,"34548":32509,"34549":32510,"34550":32508,"34551":32496,"34552":32491,"34553":32511,"34554":32039,"34555":32512,"34556":32434,"34557":32494,"34558":32504,"34624":32501,"34625":32438,"34626":32500,"34627":32490,"34628":32513,"34629":32502,"34630":32602,"34631":38395,"34632":33669,"34633":30422,"34634":33642,"34635":33485,"34636":34432,"34637":35829,"34638":35821,"34639":35820,"34640":35748,"34641":35819,"34642":35823,"34643":35828,"34644":35824,"34645":35826,"34646":35825,"34647":35827,"34648":35822,"34649":23486,"34650":36168,"34651":36170,"34652":36213,"34653":36214,"34654":36741,"34655":36740,"34656":36731,"34657":36828,"34658":36874,"34659":36882,"34660":38128,"34661":38134,"34662":38108,"34663":38125,"34664":38114,"34665":38124,"34666":38120,"34667":38133,"34668":38115,"34669":38402,"34670":38394,"34671":38397,"34672":38401,"34673":38400,"34674":38469,"34675":39047,"34676":39046,"34677":39122,"34678":39290,"34679":39292,"34680":39285,"34681":39287,"34682":39539,"34683":32942,"34684":39600,"34685":40483,"34686":40482,"34721":20964,"34722":40784,"34723":20159,"34724":20202,"34725":20215,"34726":20396,"34727":20393,"34728":20461,"34729":21095,"34730":21016,"34731":21073,"34732":21053,"34733":21385,"34734":21792,"34735":22068,"34736":21719,"34737":22040,"34738":21943,"34739":21880,"34740":21501,"34741":22687,"34742":22367,"34743":22368,"34744":22549,"34745":23092,"34746":23157,"34747":22953,"34748":23047,"34749":23046,"34750":23485,"34751":23457,"34752":20889,"34753":23618,"34754":23956,"34755":24092,"34756":24223,"34757":21416,"34758":24217,"34759":21422,"34760":24191,"34761":24377,"34762":24198,"34763":34385,"34764":24551,"34765":24578,"34766":24751,"34767":24814,"34768":24868,"34769":24579,"34770":25370,"34771":25169,"34772":25438,"34773":25320,"34774":25376,"34775":25242,"34776":25528,"34777":25599,"34778":25932,"34779":25968,"34780":26242,"34781":26165,"34782":26679,"34783":26729,"34784":26530,"34785":26631,"34786":27004,"34787":26728,"34788":20048,"34789":26526,"34790":27431,"34791":27527,"34792":27572,"34793":27974,"34794":27900,"34795":27905,"34796":27975,"34797":28291,"34798":28070,"34799":28071,"34800":27988,"34801":28909,"34802":22870,"34803":33721,"34804":30126,"34805":30353,"34806":30385,"34807":30424,"34808":30830,"34809":30721,"34810":31377,"34811":31351,"34812":32532,"34813":32451,"34814":32428,"34880":32516,"34881":32517,"34882":32521,"34883":32534,"34884":32536,"34885":32447,"34886":32526,"34887":32531,"34888":32525,"34889":32514,"34890":32520,"34891":32519,"34892":39554,"34893":32610,"34894":33014,"34895":32932,"34896":33714,"34897":33643,"34898":33931,"34899":34430,"34900":34583,"34901":21355,"34902":35850,"34903":35845,"34904":35848,"34905":35846,"34906":35806,"34907":35831,"34908":35832,"34909":35838,"34910":35839,"34911":35844,"34912":35843,"34913":35841,"34914":35770,"34915":35812,"34916":35847,"34917":35837,"34918":35840,"34919":31446,"34920":36180,"34921":36175,"34922":36171,"34923":36145,"34924":36134,"34925":36172,"34926":36132,"34927":21334,"34928":36176,"34929":36136,"34930":36179,"34931":36341,"34932":36745,"34933":36742,"34934":36749,"34935":36744,"34936":36743,"34937":36718,"34938":36750,"34939":36747,"34940":36746,"34941":36866,"34942":36801,"34977":37051,"34978":37073,"34979":37011,"34980":38156,"34981":38161,"34982":38144,"34983":38138,"34984":38096,"34985":38148,"34986":38109,"34987":38160,"34988":38153,"34989":38155,"34990":38049,"34991":38146,"34992":38398,"34993":38405,"34994":24041,"34995":39049,"34996":39052,"34997":20859,"34998":39295,"34999":39297,"35000":39548,"35001":39547,"35002":39543,"35003":39542,"35004":39549,"35005":39550,"35006":39545,"35007":39544,"35008":39607,"35009":38393,"35010":40063,"35011":40065,"35012":40489,"35013":40486,"35014":40632,"35015":40831,"35016":20454,"35017":20647,"35018":20394,"35019":24130,"35020":21058,"35021":21544,"35022":21725,"35023":22003,"35024":22438,"35025":22363,"35026":22859,"35027":34949,"35028":23398,"35029":23548,"35030":23466,"35031":20973,"35032":24811,"35033":25044,"35034":24518,"35035":25112,"35036":25317,"35037":25377,"35038":25374,"35039":25454,"35040":25523,"35041":25321,"35042":25441,"35043":25285,"35044":25373,"35045":21382,"35046":26195,"35047":26196,"35048":26137,"35049":26726,"35050":27178,"35051":26641,"35052":26925,"35053":26725,"35054":26426,"35055":26721,"35056":28096,"35057":27987,"35058":27901,"35059":27978,"35060":27811,"35061":28582,"35062":28177,"35063":28861,"35064":28903,"35065":28783,"35066":28907,"35067":28950,"35068":29420,"35069":29585,"35070":29935,"35136":30232,"35137":21346,"35138":30610,"35139":30742,"35140":30875,"35141":31215,"35142":39062,"35143":31267,"35144":31397,"35145":31491,"35146":31579,"35147":32546,"35148":32547,"35149":33830,"35150":32538,"35151":21439,"35152":32543,"35153":32540,"35154":32537,"35155":32457,"35156":33147,"35157":20852,"35158":33329,"35159":33633,"35160":33831,"35161":33436,"35162":34434,"35163":33828,"35164":35044,"35165":20146,"35166":35278,"35167":35867,"35168":35866,"35169":35855,"35170":35763,"35171":35851,"35172":35853,"35173":35856,"35174":35864,"35175":35834,"35176":35858,"35177":35859,"35178":35773,"35179":35861,"35180":35865,"35181":35852,"35182":35862,"35183":36182,"35184":36752,"35185":36753,"35186":36755,"35187":36751,"35188":21150,"35189":36873,"35190":36831,"35191":36797,"35192":36951,"35193":37050,"35194":38189,"35195":38191,"35196":38192,"35197":38169,"35198":38065,"35233":38050,"35234":38177,"35235":24405,"35236":38126,"35237":38181,"35238":38182,"35239":38175,"35240":38178,"35241":38193,"35242":38414,"35243":38543,"35244":38505,"35245":38745,"35246":33148,"35247":39050,"35248":39048,"35249":39057,"35250":39060,"35251":22836,"35252":39059,"35253":39056,"35254":39302,"35255":39279,"35256":39300,"35257":39301,"35258":39559,"35259":39560,"35260":39558,"35261":39608,"35262":39612,"35263":40077,"35264":40501,"35265":40490,"35266":40495,"35267":40493,"35268":40499,"35269":40857,"35270":40863,"35271":20248,"35272":20607,"35273":20648,"35274":21169,"35275":21659,"35276":21523,"35277":21387,"35278":22489,"35279":23156,"35280":23252,"35281":23351,"35282":23604,"35283":23654,"35284":23679,"35285":23896,"35286":24110,"35287":24357,"35288":24212,"35289":24691,"35290":25103,"35291":20987,"35292":25380,"35293":25319,"35294":25311,"35295":25601,"35296":25947,"35297":27609,"35298":26279,"35299":26723,"35300":26816,"35301":26727,"35302":26633,"35303":27183,"35304":27539,"35305":27617,"35306":27870,"35307":28392,"35308":27982,"35309":28059,"35310":28389,"35311":28073,"35312":28493,"35313":33829,"35314":28799,"35315":28891,"35316":28905,"35317":22681,"35318":29406,"35319":33719,"35320":29615,"35321":29815,"35322":30184,"35323":30103,"35324":30699,"35325":30970,"35326":30710,"35392":31699,"35393":31914,"35394":38214,"35395":31937,"35396":32553,"35397":32489,"35398":32554,"35399":32533,"35400":32551,"35401":32503,"35402":32541,"35403":24635,"35404":32437,"35405":32555,"35406":32420,"35407":32549,"35408":32358,"35409":32550,"35410":22768,"35411":32874,"35412":32852,"35413":32824,"35414":33043,"35415":32966,"35416":33080,"35417":33037,"35418":20020,"35419":20030,"35420":33392,"35421":34103,"35422":34015,"35423":20111,"35424":34684,"35425":34632,"35426":20149,"35427":35099,"35428":35274,"35429":35868,"35430":35876,"35431":35878,"35432":35762,"35433":35854,"35434":35875,"35435":35874,"35436":35466,"35437":35879,"35438":36186,"35439":36187,"35440":36141,"35441":36185,"35442":36235,"35443":36758,"35444":36759,"35445":27586,"35446":36757,"35447":33286,"35448":36824,"35449":36808,"35450":37213,"35451":38208,"35452":38209,"35453":38170,"35454":38190,"35489":38194,"35490":38149,"35491":38180,"35492":38202,"35493":38201,"35494":38203,"35495":38206,"35496":38199,"35497":38420,"35498":38421,"35499":38417,"35500":38385,"35501":38544,"35502":38582,"35503":34429,"35504":38889,"35505":39063,"35506":39123,"35507":39563,"35508":39567,"35509":40092,"35510":40091,"35511":40084,"35512":40081,"35513":40511,"35514":40509,"35515":28857,"35516":25995,"35517":19995,"35518":22108,"35519":22329,"35520":22418,"35521":23158,"35522":25041,"35523":25193,"35524":25527,"35525":25200,"35526":25781,"35527":25670,"35528":25822,"35529":25783,"35530":26029,"35531":27103,"35532":26588,"35533":27099,"35534":26592,"35535":27428,"35536":24402,"35537":27553,"35538":27899,"35539":28182,"35540":28388,"35541":28174,"35542":28293,"35543":27983,"35544":28908,"35545":28952,"35546":29367,"35547":29454,"35548":29934,"35549":30112,"35550":30545,"35551":30784,"35552":31036,"35553":31313,"35554":31229,"35555":31388,"35556":31373,"35557":31659,"35558":31783,"35559":31658,"35560":31697,"35561":31616,"35562":31918,"35563":32455,"35564":32558,"35565":32469,"35566":32557,"35567":32483,"35568":32559,"35569":32728,"35570":32844,"35571":32834,"35572":33040,"35573":33169,"35574":26087,"35575":33832,"35576":34013,"35577":33632,"35578":34546,"35579":34633,"35580":35280,"35581":35294,"35582":35871,"35648":35880,"35649":35884,"35650":35882,"35651":36184,"35652":36434,"35653":36857,"35654":36344,"35655":36527,"35656":36716,"35657":36761,"35658":36841,"35659":21307,"35660":37233,"35661":38225,"35662":38145,"35663":38056,"35664":38221,"35665":38215,"35666":38224,"35667":38226,"35668":38217,"35669":38422,"35670":38383,"35671":38423,"35672":38425,"35673":26434,"35674":21452,"35675":38607,"35676":40481,"35677":39069,"35678":39068,"35679":39064,"35680":39066,"35681":39067,"35682":39311,"35683":39306,"35684":39304,"35685":39569,"35686":39617,"35687":40104,"35688":40100,"35689":40107,"35690":40103,"35691":40515,"35692":40517,"35693":40516,"35694":22404,"35695":22364,"35696":23456,"35697":24222,"35698":24208,"35699":24809,"35700":24576,"35701":25042,"35702":25314,"35703":26103,"35704":27249,"35705":26911,"35706":27016,"35707":27257,"35708":28487,"35709":28625,"35710":27813,"35745":28626,"35746":27896,"35747":28865,"35748":29261,"35749":29322,"35750":20861,"35751":29549,"35752":29626,"35753":29756,"35754":30068,"35755":30250,"35756":30861,"35757":31095,"35758":31283,"35759":31614,"35760":33575,"35761":32462,"35762":32499,"35763":32472,"35764":32599,"35765":32564,"35766":33211,"35767":33402,"35768":34222,"35769":33647,"35770":34433,"35771":34631,"35772":35014,"35773":34948,"35774":35889,"35775":35782,"35776":35885,"35777":35890,"35778":35749,"35779":35887,"35780":36192,"35781":36190,"35782":36343,"35783":36762,"35784":36735,"35785":36766,"35786":36793,"35787":38236,"35788":38237,"35789":38238,"35790":38142,"35791":38231,"35792":38232,"35793":38230,"35794":38233,"35795":38197,"35796":38210,"35797":38143,"35798":37694,"35799":20851,"35800":38471,"35801":38590,"35802":38654,"35803":38892,"35804":38901,"35805":31867,"35806":39072,"35807":39125,"35808":39314,"35809":39313,"35810":39579,"35811":39575,"35812":40120,"35813":40115,"35814":40109,"35815":40119,"35816":40529,"35817":40521,"35818":40522,"35819":40524,"35820":40527,"35821":20029,"35822":40628,"35823":21149,"35824":21657,"35825":22052,"35826":20005,"35827":23453,"35828":24748,"35829":24527,"35830":25318,"35831":25600,"35832":32999,"35833":27015,"35834":28572,"35835":28491,"35836":28809,"35837":29649,"35838":30719,"35904":30778,"35905":30718,"35906":30782,"35907":31398,"35908":31454,"35909":31609,"35910":31726,"35911":36779,"35912":32548,"35913":32487,"35914":32578,"35915":33002,"35916":33328,"35917":34108,"35918":34106,"35919":33446,"35920":33529,"35921":34164,"35922":34461,"35923":35124,"35924":35273,"35925":35302,"35926":35758,"35927":35793,"35928":35893,"35929":36194,"35930":36193,"35931":36280,"35932":37322,"35933":38047,"35934":38105,"35935":38152,"35936":38416,"35937":39128,"35938":39286,"35939":39269,"35940":39582,"35941":33150,"35942":39578,"35943":40131,"35944":40133,"35945":20826,"35946":40835,"35947":40836,"35948":20458,"35949":21995,"35950":21869,"35951":22179,"35952":23646,"35953":24807,"35954":24913,"35955":25668,"35956":25658,"35957":26003,"35958":27185,"35959":26639,"35960":26818,"35961":27516,"35962":28866,"35963":29306,"35964":38262,"35965":29838,"35966":30302,"36001":32544,"36002":32493,"36003":20848,"36004":34259,"36005":34510,"36006":35272,"36007":35892,"36008":25252,"36009":35465,"36010":36163,"36011":36364,"36012":36291,"36013":36347,"36014":36720,"36015":36777,"36016":38256,"36017":38253,"36018":38081,"36019":38107,"36020":38094,"36021":38255,"36022":38220,"36023":21709,"36024":39038,"36025":39074,"36026":39144,"36027":39537,"36028":39584,"36029":34022,"36030":39585,"36031":39621,"36032":40141,"36033":40143,"36034":33722,"36035":40548,"36036":40542,"36037":40839,"36038":40840,"36039":21870,"36040":20456,"36041":20645,"36042":21587,"36043":23402,"36044":24005,"36045":23782,"36046":24367,"36047":25674,"36048":26435,"36049":27426,"36050":28393,"36051":29473,"36052":21472,"36053":30270,"36054":30307,"36055":31548,"36056":31809,"36057":32843,"36058":33039,"36059":34989,"36060":34924,"36061":35835,"36062":36174,"36063":36189,"36064":36399,"36065":36396,"36066":36756,"36067":37094,"36068":38136,"36069":37492,"36070":38657,"36071":38801,"36072":32366,"36073":39076,"36074":39556,"36075":39553,"36076":40150,"36077":40098,"36078":40148,"36079":40151,"36080":40551,"36081":40485,"36082":40761,"36083":40841,"36084":40842,"36085":40858,"36086":24651,"36087":25371,"36088":25605,"36089":29906,"36090":31363,"36091":32552,"36092":33250,"36093":33821,"36094":34506,"36160":21464,"36161":36902,"36162":36923,"36163":38259,"36164":38084,"36165":38757,"36166":26174,"36167":39181,"36168":24778,"36169":39551,"36170":39564,"36171":39635,"36172":39633,"36173":40157,"36174":40158,"36175":40156,"36176":40502,"36177":22065,"36178":22365,"36179":25597,"36180":30251,"36181":30315,"36182":32641,"36183":34453,"36184":35753,"36185":35863,"36186":35894,"36187":33395,"36188":36195,"36189":37247,"36190":38643,"36191":28789,"36192":38701,"36193":39078,"36194":39588,"36195":39699,"36196":39751,"36197":40078,"36198":40560,"36199":40557,"36200":30839,"36201":30416,"36202":40140,"36203":40844,"36204":40843,"36205":21381,"36206":27012,"36207":28286,"36208":31729,"36209":31657,"36210":34542,"36211":35266,"36212":36433,"36213":34885,"36214":38053,"36215":39045,"36216":39307,"36217":39627,"36218":40649,"36219":28390,"36220":30633,"36221":38218,"36222":38831,"36257":39540,"36258":39589,"36259":32518,"36260":35872,"36261":36495,"36262":37245,"36263":38075,"36264":37550,"36265":38179,"36266":40132,"36267":40072,"36268":40681,"36269":20991,"36270":40550,"36271":39562,"36272":40563,"36273":40510,"36274":38074,"36275":20162,"36276":34381,"36277":27538,"36278":22439,"36279":22395,"36280":25099,"36281":20451,"36282":21037,"36283":21389,"36284":21593,"36285":21370,"36286":32424,"36287":33543,"36288":38023,"36289":38022,"36290":21591,"36291":24362,"36292":31059,"36293":32446,"36294":37071,"36295":38028,"36296":21072,"36297":21286,"36298":22261,"36299":22445,"36300":23045,"36301":23741,"36302":23811,"36303":28062,"36304":28172,"36305":28867,"36306":30502,"36307":32448,"36308":32464,"36309":33003,"36310":38030,"36311":38032,"36312":38037,"36313":38029,"36314":38379,"36315":22955,"36316":23899,"36317":24701,"36318":26720,"36319":26536,"36320":27817,"36321":27976,"36322":30066,"36323":30743,"36324":32471,"36325":33757,"36326":35271,"36327":35765,"36328":35790,"36329":35794,"36330":36150,"36331":36147,"36332":36730,"36333":36725,"36334":36728,"36335":36911,"36336":37075,"36337":37124,"36338":38059,"36339":38060,"36340":38043,"36341":38063,"36342":38061,"36343":38058,"36344":38390,"36345":38503,"36346":39032,"36347":39275,"36348":40697,"36349":20251,"36350":20603,"36416":20325,"36417":21794,"36418":22450,"36419":24047,"36420":24493,"36421":28828,"36422":33557,"36423":29426,"36424":29614,"36425":32488,"36426":32480,"36427":32481,"36428":32671,"36429":33645,"36430":34545,"36431":35795,"36432":35798,"36433":35817,"36434":35796,"36435":35804,"36436":36241,"36437":36738,"36438":36737,"36439":37036,"36440":38090,"36441":38088,"36442":38064,"36443":38066,"36444":38070,"36445":38157,"36446":38092,"36447":38077,"36448":38076,"36449":39043,"36450":39040,"36451":20971,"36452":40702,"36453":20606,"36454":21787,"36455":23901,"36456":24123,"36457":24747,"36458":24749,"36459":24580,"36460":25132,"36461":25111,"36462":25247,"36463":25248,"36464":25532,"36465":26724,"36466":26473,"36467":33637,"36468":27986,"36469":27812,"36470":28829,"36471":30386,"36472":30720,"36473":32507,"36474":32498,"36475":32495,"36476":32506,"36477":33715,"36478":35275,"36513":35830,"36514":36167,"36515":38129,"36516":38098,"36517":38097,"36518":38101,"36519":38111,"36520":38123,"36521":38127,"36522":38122,"36523":38135,"36524":38102,"36525":38117,"36526":39121,"36527":21055,"36528":21154,"36529":21715,"36530":21586,"36531":23810,"36532":23780,"36533":24209,"36534":24870,"36535":25378,"36536":26912,"36537":27637,"36538":39053,"36539":28061,"36540":28514,"36541":28064,"36542":28375,"36543":29711,"36544":29825,"36545":30231,"36546":32515,"36547":32535,"36548":32524,"36549":32527,"36550":32529,"36551":33628,"36552":33932,"36553":33553,"36554":33473,"36555":35833,"36556":35836,"36557":35842,"36558":36181,"36559":37112,"36560":38162,"36561":38103,"36562":38141,"36563":38163,"36564":38154,"36565":38116,"36566":38150,"36567":38151,"36568":38164,"36569":38406,"36570":38403,"36571":38739,"36572":39055,"36573":39293,"36574":39541,"36575":39552,"36576":40066,"36577":40488,"36578":21714,"36579":21717,"36580":21721,"36581":23250,"36582":23748,"36583":24639,"36584":27546,"36585":27981,"36586":28904,"36587":29443,"36588":29423,"36589":30876,"36590":31405,"36591":32279,"36592":32539,"36593":33927,"36594":33640,"36595":33929,"36596":33630,"36597":33720,"36598":33431,"36599":34547,"36600":35816,"36601":35857,"36602":35860,"36603":35869,"36604":37072,"36605":38185,"36606":38188,"36672":38166,"36673":38167,"36674":38140,"36675":38171,"36676":38165,"36677":38174,"36678":38036,"36679":38415,"36680":38408,"36681":38409,"36682":38410,"36683":38412,"36684":38413,"36685":40498,"36686":40497,"36687":21724,"36688":24113,"36689":24697,"36690":25672,"36691":58305,"36692":27894,"36693":29461,"36694":29971,"36695":30213,"36696":30187,"36697":30807,"36698":31654,"36699":31578,"36700":31976,"36701":32545,"36702":32807,"36703":33631,"36704":33718,"36705":34544,"36706":35042,"36707":35279,"36708":35873,"36709":35788,"36710":35877,"36711":36292,"36712":38200,"36713":38196,"36714":38113,"36715":38198,"36716":38418,"36717":39271,"36718":40082,"36719":40085,"36720":40504,"36721":40505,"36722":40506,"36723":40832,"36724":24636,"36725":25669,"36726":25784,"36727":27898,"36728":30102,"36729":32523,"36730":32873,"36731":33641,"36732":34789,"36733":34414,"36734":35764,"36769":35881,"36770":36188,"36771":36157,"36772":36760,"36773":37021,"36774":38227,"36775":38112,"36776":38204,"36777":38223,"36778":34021,"36779":38890,"36780":39273,"36781":39568,"36782":39570,"36783":39571,"36784":38411,"36785":40105,"36786":40096,"36787":40520,"36788":40513,"36789":40518,"36790":21411,"36791":21590,"36792":22406,"36793":27104,"36794":26638,"36795":27655,"36796":27895,"36797":28486,"36798":31074,"36799":32562,"36800":32563,"36801":32628,"36802":33315,"36803":34511,"36804":34431,"36805":35043,"36806":35281,"36807":35311,"36808":35886,"36809":38235,"36810":38239,"36811":38250,"36812":38214,"36813":38121,"36814":38891,"36815":39073,"36816":39312,"36817":39618,"36818":40117,"36819":40118,"36820":40123,"36821":40113,"36822":40526,"36823":40491,"36824":40700,"36825":21950,"36826":25732,"36827":26634,"36828":26533,"36829":26636,"36830":32561,"36831":32845,"36832":33551,"36833":33480,"36834":34162,"36835":34548,"36836":34686,"36837":38132,"36838":38246,"36839":38248,"36840":38241,"36841":38243,"36842":38212,"36843":38251,"36844":38119,"36845":38244,"36846":38137,"36847":38426,"36848":39071,"36849":39316,"36850":39546,"36851":39581,"36852":39583,"36853":39576,"36854":40535,"36855":40538,"36856":40540,"36857":40838,"36858":40837,"36859":20649,"36860":23743,"36861":30152,"36862":25786,"36928":27017,"36929":28384,"36930":30779,"36931":31901,"36932":32425,"36933":32556,"36934":34105,"36935":36166,"36936":38257,"36937":38396,"36938":39129,"36939":39586,"36940":39574,"36941":39580,"36942":40101,"36943":40142,"36944":40144,"36945":40547,"36946":40536,"36947":40574,"36948":20865,"36949":23048,"36950":28757,"36951":25874,"36952":30271,"36953":31656,"36954":31860,"36955":33339,"36956":35276,"36957":36345,"36958":36318,"36959":36729,"36960":38228,"36961":38252,"36962":39587,"36963":39557,"36964":40149,"36965":40099,"36966":40102,"36967":40552,"36968":40503,"36969":40859,"36970":26686,"36971":26916,"36972":34016,"36973":38624,"36974":36723,"36975":40159,"36976":40095,"36977":40553,"36978":40556,"36979":40554,"36980":40555,"36981":40519,"36982":28751,"36983":31766,"36984":35888,"36985":39628,"36986":31550,"36987":31900,"36988":32565,"36989":33044,"36990":36479,"37025":38247,"37026":40090,"37027":36273,"37028":36508,"37029":37246,"37030":35891,"37031":39070,"37032":39079,"37033":39591,"37034":40492,"37035":25094,"37036":38404,"37037":40097,"37038":40514,"37039":31160,"37040":25300,"37041":36299,"37042":29648,"37043":23467,"37044":25296,"37045":27585,"37046":20943,"37047":31108,"37048":21525,"37049":28508,"37050":34972,"37051":37095,"37052":20857,"37053":25144,"37054":25243,"37055":25383,"37056":25531,"37057":25566,"37058":25594,"37059":25745,"37060":25792,"37061":25825,"37062":25846,"37063":25861,"37064":25909,"37065":25934,"37066":25963,"37067":25992,"37068":26073,"37069":26142,"37070":26171,"37071":26175,"37072":26180,"37073":26199,"37074":26217,"37075":26227,"37076":26243,"37077":26300,"37078":26303,"37079":26305,"37080":26357,"37081":26362,"37082":26363,"37083":26382,"37084":26390,"37085":26423,"37086":26468,"37087":26470,"37088":26534,"37089":26535,"37090":26537,"37091":26619,"37092":26621,"37093":26624,"37094":26625,"37095":26629,"37096":26654,"37097":26698,"37098":26706,"37099":26709,"37100":26713,"37101":26765,"37102":26809,"37103":26831,"37104":20616,"37105":38184,"37106":40087,"37107":26914,"37108":26918,"37109":220,"37110":58591,"37111":58592,"37112":252,"37113":58594,"37114":58595,"37115":220,"37116":252,"37117":26934,"37118":26977,"37184":33477,"37185":33482,"37186":33496,"37187":33560,"37188":33562,"37189":33571,"37190":33606,"37191":33627,"37192":33634,"37193":33644,"37194":33646,"37195":33692,"37196":33695,"37197":33717,"37198":33724,"37199":33783,"37200":33834,"37201":33864,"37202":33884,"37203":33890,"37204":33924,"37205":33928,"37206":34012,"37207":34019,"37208":34104,"37209":34138,"37210":34199,"37211":34219,"37212":34241,"37213":34323,"37214":34326,"37215":8715,"37216":34581,"37217":34672,"37218":34685,"37219":34699,"37220":34728,"37221":34759,"37222":34768,"37223":34823,"37224":34830,"37225":34855,"37226":34990,"37227":8712,"37228":34997,"37229":35007,"37230":35045,"37231":35061,"37232":35100,"37233":35101,"37234":35191,"37235":35303,"37236":35383,"37237":35500,"37238":35546,"37239":35675,"37240":35697,"37241":35883,"37242":35898,"37243":35964,"37244":35982,"37245":36014,"37246":36114,"37281":36169,"37282":36173,"37283":36209,"37284":36360,"37285":36410,"37286":36464,"37287":36505,"37288":36528,"37289":36529,"37290":36549,"37291":36550,"37292":36558,"37293":36579,"37294":36620,"37295":36721,"37296":36727,"37297":36775,"37298":36847,"37299":36878,"37300":36921,"37301":36965,"37302":37001,"37303":37086,"37304":37141,"37305":37334,"37306":37339,"37307":37342,"37308":37345,"37309":37349,"37310":37366,"37311":37372,"37312":37417,"37313":37420,"37314":65287,"37315":37465,"37316":37495,"37317":37613,"37318":37690,"37319":58701,"37320":58702,"37321":29227,"37322":20866,"37323":20886,"37324":20023,"37325":20843,"37326":20799,"37327":58709,"37328":58710,"37329":26409,"37330":27706,"37331":21378,"37332":30098,"37333":32896,"37334":34916,"37335":19974,"37336":58718,"37337":58719,"37338":58720,"37339":11927,"37340":21241,"37341":21269,"37342":8225,"37343":58725,"37344":13316,"37345":58727,"37346":58728,"37347":58729,"37348":58730,"37349":58731,"37350":20981,"37351":58733,"37352":23662,"37353":58735,"37354":22231,"37355":20128,"37356":20907,"37357":11904,"37358":27079,"37359":58741,"37360":9550,"37361":9688,"37362":9689,"37363":9794,"37364":9654,"37365":9668,"37366":8597,"37367":8252,"37368":182,"37369":8704,"37370":8616,"37371":8596,"37372":8962,"37373":58755,"37374":58756,"37440":20124,"37441":24746,"37442":22311,"37443":22258,"37444":21307,"37445":22769,"37446":36920,"37447":38560,"37448":26628,"37449":21942,"37450":39365,"37451":35585,"37452":20870,"37453":32257,"37454":24540,"37455":27431,"37456":27572,"37457":26716,"37458":22885,"37459":31311,"37460":20206,"37461":20385,"37462":30011,"37463":28784,"37464":20250,"37465":24724,"37466":28023,"37467":32117,"37468":22730,"37469":25040,"37470":25313,"37471":27579,"37472":35226,"37473":23398,"37474":27005,"37475":21917,"37476":28167,"37477":58794,"37478":24059,"37479":38501,"37480":21223,"37481":23515,"37482":28450,"37483":38306,"37484":27475,"37485":35251,"37486":27671,"37487":24112,"37488":25135,"37489":29344,"37490":34384,"37491":26087,"37492":24613,"37493":25312,"37494":25369,"37495":34394,"37496":23777,"37497":25375,"37498":29421,"37499":37111,"37500":38911,"37501":26241,"37502":21220,"37537":35641,"37538":21306,"37539":39366,"37540":21234,"37541":58824,"37542":24452,"37543":33550,"37544":24693,"37545":25522,"37546":28179,"37547":32076,"37548":34509,"37549":36605,"37550":32153,"37551":40335,"37552":25731,"37553":30476,"37554":20537,"37555":21091,"37556":38522,"37557":22287,"37558":26908,"37559":27177,"37560":38997,"37561":39443,"37562":21427,"37563":21577,"37564":23087,"37565":35492,"37566":24195,"37567":28207,"37568":37489,"37569":21495,"37570":22269,"37571":40658,"37572":31296,"37573":30741,"37574":28168,"37575":25998,"37576":27507,"37577":21092,"37578":38609,"37579":21442,"37580":26719,"37581":24808,"37582":36059,"37583":27531,"37584":27503,"37585":20816,"37586":36766,"37587":28287,"37588":23455,"37589":20889,"37590":33294,"37591":25448,"37592":37320,"37593":23551,"37594":21454,"37595":34886,"37596":24467,"37597":28171,"37598":29539,"37599":32294,"37600":31899,"37601":20966,"37602":23558,"37603":31216,"37604":28169,"37605":28988,"37606":22888,"37607":26465,"37608":29366,"37609":20055,"37610":27972,"37611":21104,"37612":30067,"37613":32260,"37614":22732,"37615":23330,"37616":35698,"37617":37304,"37618":35302,"37619":22065,"37620":23517,"37621":23613,"37622":22259,"37623":31883,"37624":37204,"37625":31298,"37626":38543,"37627":39620,"37628":26530,"37629":25968,"37630":25454,"37696":28716,"37697":22768,"37698":25993,"37699":38745,"37700":31363,"37701":25666,"37702":32118,"37703":23554,"37704":27973,"37705":25126,"37706":36341,"37707":37549,"37708":28508,"37709":36983,"37710":36984,"37711":32330,"37712":31109,"37713":30094,"37714":22766,"37715":20105,"37716":33624,"37717":25436,"37718":25407,"37719":24035,"37720":31379,"37721":35013,"37722":20711,"37723":23652,"37724":32207,"37725":39442,"37726":22679,"37727":24974,"37728":34101,"37729":36104,"37730":33235,"37731":23646,"37732":32154,"37733":22549,"37734":23550,"37735":24111,"37736":28382,"37737":28381,"37738":25246,"37739":27810,"37740":28655,"37741":21336,"37742":22022,"37743":22243,"37744":26029,"37745":24382,"37746":36933,"37747":26172,"37748":37619,"37749":24193,"37750":24500,"37751":32884,"37752":25074,"37753":22618,"37754":36883,"37755":37444,"37756":28857,"37757":36578,"37758":20253,"37793":38651,"37794":28783,"37795":24403,"37796":20826,"37797":30423,"37798":31282,"37799":38360,"37800":24499,"37801":27602,"37802":29420,"37803":35501,"37804":23626,"37805":38627,"37806":24336,"37807":24745,"37808":33075,"37809":25309,"37810":24259,"37811":22770,"37812":26757,"37813":21338,"37814":34180,"37815":40614,"37816":32283,"37817":30330,"37818":39658,"37819":25244,"37820":27996,"37821":27996,"37822":25935,"37823":25975,"37824":20398,"37825":25173,"37826":20175,"37827":36794,"37828":22793,"37829":27497,"37830":33303,"37831":31807,"37832":21253,"37833":23453,"37834":25265,"37835":27873,"37836":32990,"37837":30770,"37838":35914,"37839":39165,"37840":22696,"37841":27598,"37842":28288,"37843":33032,"37844":40665,"37845":35379,"37846":34220,"37847":36493,"37848":19982,"37849":35465,"37850":25671,"37851":27096,"37852":35617,"37853":26332,"37854":26469,"37855":38972,"37856":20081,"37857":35239,"37858":31452,"37859":38534,"37860":26053,"37861":20001,"37862":29471,"37863":32209,"37864":28057,"37865":22593,"37866":31036,"37867":21169,"37868":25147,"37869":38666,"37870":40802,"37871":26278,"37872":27508,"37873":24651,"37874":32244,"37875":37676,"37876":28809,"37877":21172,"37878":27004,"37879":37682,"37880":28286,"37881":24357,"37882":20096,"37883":26365,"37884":22985,"37885":23437,"37886":23947,"37952":27179,"37953":26907,"37954":21936,"37955":31874,"37956":36796,"37957":27018,"37958":21682,"37959":40235,"37960":38635,"37961":26905,"37962":25539,"37963":39364,"37964":20967,"37965":26626,"37966":36795,"37967":20685,"37968":23776,"37969":26627,"37970":20970,"37971":21250,"37972":30834,"37973":30033,"37974":30048,"37975":22138,"37976":37618,"37977":22592,"37978":26622,"37979":20451,"37980":26466,"37981":31870,"37982":21249,"37983":20452,"37984":20453,"37985":20969,"37986":21498,"37987":21720,"37988":22222,"37989":22310,"37990":22327,"37991":22328,"37992":22408,"37993":22451,"37994":22442,"37995":22448,"37996":22486,"37997":22640,"37998":22713,"37999":22743,"38000":23670,"38001":23740,"38002":23749,"38003":23742,"38004":23926,"38005":24342,"38006":24634,"38007":25525,"38008":26433,"38009":26467,"38010":26529,"38011":26810,"38012":26917,"38013":26920,"38014":27258,"38049":26915,"38050":26913,"38051":27006,"38052":27009,"38053":27101,"38054":27182,"38055":27250,"38056":27423,"38057":27615,"38058":28181,"38059":29077,"38060":29927,"38061":29938,"38062":29936,"38063":29937,"38064":29944,"38065":29957,"38066":30057,"38067":30314,"38068":30836,"38069":31437,"38070":31439,"38071":31445,"38072":31443,"38073":31457,"38074":31472,"38075":31490,"38076":31763,"38077":31767,"38078":31888,"38079":31917,"38080":31936,"38081":31960,"38082":32155,"38083":32261,"38084":32359,"38085":32387,"38086":32400,"38087":33188,"38088":33373,"38089":33826,"38090":34009,"38091":34352,"38092":34475,"38093":34543,"38094":34992,"38095":35011,"38096":35012,"38097":35076,"38098":59183,"38099":36542,"38100":36552,"38101":36684,"38102":36791,"38103":36826,"38104":36903,"38105":36950,"38106":37685,"38107":37691,"38108":37817,"38109":38282,"38110":38294,"38111":38777,"38112":38790,"38113":38800,"38114":39082,"38115":39830,"38116":39831,"38117":39860,"38118":39887,"38119":39889,"38120":39890,"38121":39922,"38122":39921,"38123":39984,"38124":40007,"38125":40026,"38126":40176,"38127":40262,"38128":40292,"38129":40363,"38130":20036,"38131":21583,"38132":25368,"38133":39857,"38134":40041,"38135":40263,"38136":40293,"38137":39983,"38138":40639,"38139":20916,"38140":21610,"38141":26528,"38142":39822,"38208":37032,"38209":20914,"38210":13869,"38211":25285,"38212":21189,"38213":26545,"38214":21709,"38215":24658,"38216":21441,"38217":28913,"38218":22531,"38219":21855,"38220":37390,"38221":30528,"38222":29756,"38223":29002,"38224":28377,"38225":21472,"38226":29486,"38227":35023,"38228":30861,"38229":32675,"38230":32171,"38231":36394,"38232":37979,"38233":25452,"38234":24487,"38235":23557,"38236":32827,"38237":23791,"38238":14776,"38239":29009,"38240":36045,"38241":38894,"38242":22642,"38243":23139,"38244":32632,"38245":23895,"38246":24943,"38247":27032,"38248":32137,"38249":31918,"38250":32179,"38251":28545,"38252":23290,"38253":22715,"38254":29269,"38255":30286,"38256":36653,"38257":37561,"38258":40286,"38259":40623,"38260":32583,"38261":40388,"38262":36120,"38263":20915,"38264":34412,"38265":21668,"38266":21414,"38267":21030,"38268":26422,"38269":20001,"38270":21364,"38305":24313,"38306":21177,"38307":21647,"38308":24312,"38309":22956,"38310":24625,"38311":29248,"38312":33047,"38313":30267,"38314":24333,"38315":26187,"38316":26280,"38317":24932,"38318":25423,"38319":28895,"38320":27940,"38321":31911,"38322":31945,"38323":21465,"38324":25933,"38325":22338,"38326":29647,"38327":32966,"38328":13649,"38329":27445,"38330":30849,"38331":21452,"38332":29483,"38333":29482,"38334":29641,"38335":30026,"38336":23033,"38337":29124,"38338":29966,"38339":32220,"38340":39393,"38341":35241,"38342":28662,"38343":14935,"38344":25834,"38345":15341,"38346":27809,"38347":28284,"38348":30055,"38349":22633,"38350":22633,"38351":20996,"38352":59338,"38353":24967,"38354":25658,"38355":33263,"38356":59342,"38357":20917,"38358":20945,"38359":27769,"38360":22815,"38361":36857,"38362":39153,"38363":25911,"38364":33033,"38365":34996,"38366":14890,"38367":36525,"38368":32663,"38369":39440,"38370":32037,"38371":27336,"38372":20876,"38373":21031,"38374":59360,"38375":33050,"38376":21408,"38377":21410,"38378":27738,"38379":27703,"38380":33304,"38381":21894,"38382":24315,"38383":20937,"38384":30897,"38385":37474,"38386":21357,"38387":20931,"38388":59374,"38389":33905,"38390":35207,"38391":38765,"38392":35728,"38393":38563,"38394":24316,"38395":38583,"38396":20814,"38397":39952,"38398":26160,"38464":37461,"38465":30728,"38466":37701,"38467":37491,"38468":37737,"38469":59390,"38470":59391,"38471":59392,"38472":59393,"38473":37343,"38474":37338,"38475":30804,"38476":30822,"38477":30856,"38478":30902,"38479":30919,"38480":30930,"38481":30935,"38482":8491,"38483":8651,"38484":30948,"38485":30958,"38486":30960,"38487":30961,"38488":30965,"38489":31026,"38490":31027,"38491":31030,"38492":31064,"38493":12307,"38494":31065,"38495":31089,"38496":31102,"38497":31107,"38498":31110,"38499":31111,"38500":31121,"38501":31129,"38502":31135,"38503":31141,"38504":31202,"38505":31217,"38506":31220,"38507":31274,"38508":31290,"38509":31301,"38510":31333,"38511":31420,"38512":31426,"38513":31433,"38514":31451,"38515":31465,"38516":31486,"38517":31500,"38518":31527,"38519":31529,"38520":31554,"38521":31555,"38522":31573,"38523":31599,"38524":31666,"38525":27102,"38526":27129,"38561":37238,"38562":33114,"38563":33527,"38564":21579,"38565":33074,"38566":32957,"38567":33816,"38568":37214,"38569":37232,"38570":37260,"38571":33096,"38572":59459,"38573":17462,"38574":33113,"38575":32927,"38576":59463,"38577":21833,"38578":21537,"38579":21722,"38580":21554,"38581":21945,"38582":21652,"38583":59470,"38584":30802,"38585":30789,"38586":30796,"38587":59474,"38588":33981,"38589":33820,"38590":33476,"38591":59478,"38592":33915,"38593":35629,"38594":59481,"38595":22347,"38596":59483,"38597":59484,"38598":22341,"38599":34766,"38600":22112,"38601":21994,"38602":22139,"38603":32956,"38604":59491,"38605":30904,"38606":27148,"38607":21708,"38608":31696,"38609":31724,"38610":31738,"38611":31765,"38612":31771,"38613":31797,"38614":31812,"38615":31853,"38616":31886,"38617":31928,"38618":31939,"38619":31974,"38620":31981,"38621":31987,"38622":31989,"38623":31993,"38624":59511,"38625":31996,"38626":32139,"38627":32151,"38628":32164,"38629":32168,"38630":32205,"38631":32208,"38632":32211,"38633":32229,"38634":32253,"38635":27154,"38636":27170,"38637":27184,"38638":27190,"38639":27237,"38640":59527,"38641":59528,"38642":59529,"38643":59530,"38644":59531,"38645":59532,"38646":59533,"38647":59534,"38648":27251,"38649":27256,"38650":59537,"38651":59538,"38652":27260,"38653":27305,"38654":27306,"38720":9450,"38721":9312,"38722":9313,"38723":9314,"38724":9315,"38725":9316,"38726":9317,"38727":9318,"38728":9319,"38729":9320,"38730":9321,"38731":9322,"38732":9323,"38733":9324,"38734":9325,"38735":9326,"38736":9327,"38737":9328,"38738":9329,"38739":9330,"38740":9331,"38741":37700,"38742":37805,"38743":37830,"38744":37861,"38745":37914,"38746":37921,"38747":37950,"38748":37953,"38749":37971,"38750":37978,"38751":38042,"38752":38071,"38753":38104,"38754":38110,"38755":38131,"38756":38147,"38757":38158,"38758":38159,"38759":38168,"38760":38173,"38761":38186,"38762":38187,"38763":38207,"38764":38213,"38765":38222,"38766":38242,"38767":38245,"38768":38249,"38769":38258,"38770":38279,"38771":38297,"38772":38304,"38773":38322,"38774":38502,"38775":38557,"38776":38575,"38777":38578,"38778":38707,"38779":38715,"38780":38733,"38781":38735,"38782":38737,"38817":38741,"38818":38756,"38819":38763,"38820":38769,"38821":38802,"38822":38834,"38823":38898,"38824":38973,"38825":38996,"38826":39077,"38827":39107,"38828":39130,"38829":39150,"38830":39197,"38831":39200,"38832":39267,"38833":39296,"38834":39303,"38835":39309,"38836":39315,"38837":39317,"38838":39356,"38839":39368,"38840":39410,"38841":39606,"38842":39641,"38843":39646,"38844":39695,"38845":39753,"38846":39794,"38847":39811,"38848":39839,"38849":39867,"38850":39907,"38851":39925,"38852":39936,"38853":39940,"38854":39963,"38855":9398,"38856":9399,"38857":9400,"38858":9401,"38859":9402,"38860":9403,"38861":9404,"38862":9405,"38863":9406,"38864":9407,"38865":9408,"38866":9409,"38867":9410,"38868":9411,"38869":9412,"38870":9413,"38871":9414,"38872":9415,"38873":9416,"38874":9417,"38875":9418,"38876":9419,"38877":9420,"38878":9421,"38879":9422,"38880":9423,"38881":9424,"38882":9425,"38883":9426,"38884":9427,"38885":9428,"38886":9429,"38887":9430,"38888":9431,"38889":9432,"38890":9433,"38891":9434,"38892":9435,"38893":9436,"38894":9437,"38895":9438,"38896":9439,"38897":9440,"38898":9441,"38899":9442,"38900":9443,"38901":9444,"38902":9445,"38903":9446,"38904":9447,"38905":9448,"38906":9449,"38907":174,"38908":8482,"38909":59697,"38910":59698,"38976":40054,"38977":10122,"38978":10123,"38979":10124,"38980":10125,"38981":10126,"38982":10127,"38983":10128,"38984":10129,"38985":10130,"38986":10131,"38987":40069,"38988":40070,"38989":40071,"38990":40075,"38991":40080,"38992":40094,"38993":40110,"38994":40112,"38995":40114,"38996":40116,"38997":40122,"38998":40124,"38999":40125,"39000":40134,"39001":40135,"39002":40138,"39003":40139,"39004":40147,"39005":40152,"39006":40153,"39007":40162,"39008":40171,"39009":40172,"39010":40234,"39011":40264,"39012":40272,"39013":40314,"39014":40390,"39015":40523,"39016":40533,"39017":40539,"39018":40561,"39019":40618,"39020":40637,"39021":40644,"39022":40674,"39023":40682,"39024":40712,"39025":40715,"39026":40717,"39027":40737,"39028":40772,"39029":40785,"39030":40861,"39031":64014,"39032":64015,"39033":64017,"39034":64019,"39035":64020,"39036":64024,"39037":64031,"39038":64032,"39073":64033,"39074":64035,"39075":64036,"39076":64039,"39077":64040,"39078":64041,"39079":19972,"39080":20015,"39081":20097,"39082":20103,"39083":20131,"39084":20151,"39085":20156,"39086":20216,"39087":20264,"39088":20265,"39089":20279,"39090":20290,"39091":20293,"39092":20299,"39093":20338,"39094":20386,"39095":20400,"39096":20413,"39097":20424,"39098":20428,"39099":20464,"39100":20466,"39101":20473,"39102":20483,"39103":20488,"39104":20532,"39105":20539,"39106":20568,"39107":20582,"39108":20609,"39109":20624,"39110":20668,"39111":20688,"39112":20703,"39113":20705,"39114":20732,"39115":20749,"39116":20779,"39117":20832,"39118":20910,"39119":20920,"39120":20946,"39121":20962,"39122":20997,"39123":21044,"39124":21052,"39125":21081,"39126":21096,"39127":21113,"39128":21156,"39129":21196,"39130":21287,"39131":21314,"39132":21341,"39133":21373,"39134":21374,"39135":21445,"39136":21456,"39137":21458,"39138":21502,"39139":21613,"39140":21637,"39141":21651,"39142":21662,"39143":21689,"39144":21731,"39145":21743,"39146":21773,"39147":21784,"39148":21797,"39149":21800,"39150":21803,"39151":21831,"39152":21881,"39153":21904,"39154":21940,"39155":21953,"39156":21975,"39157":21976,"39158":22011,"39159":20404,"39160":22049,"39161":8707,"39162":22098,"39163":59852,"39164":9787,"39165":59854,"39166":59855,"39232":22109,"39233":9332,"39234":9333,"39235":9334,"39236":9335,"39237":9336,"39238":9337,"39239":9338,"39240":9339,"39241":9340,"39242":9341,"39243":9342,"39244":9343,"39245":9344,"39246":9345,"39247":9346,"39248":9347,"39249":9348,"39250":9349,"39251":9350,"39252":9351,"39253":22113,"39254":22153,"39255":22155,"39256":22174,"39257":22177,"39258":22193,"39259":22201,"39260":22207,"39261":22230,"39262":22255,"39263":22293,"39264":22301,"39265":22322,"39266":22333,"39267":22335,"39268":22339,"39269":8660,"39270":22398,"39271":22410,"39272":22413,"39273":22416,"39274":22428,"39275":22459,"39276":22462,"39277":22468,"39278":22494,"39279":22526,"39280":22546,"39281":22562,"39282":22599,"39283":22620,"39284":22623,"39285":22643,"39286":22695,"39287":22698,"39288":22704,"39289":22709,"39290":22710,"39291":22731,"39292":22736,"39293":22752,"39294":22789,"39329":22801,"39330":22921,"39331":22932,"39332":22938,"39333":22943,"39334":22960,"39335":22968,"39336":22980,"39337":23023,"39338":23024,"39339":23032,"39340":23042,"39341":23051,"39342":23053,"39343":23058,"39344":23073,"39345":23076,"39346":23079,"39347":23082,"39348":23083,"39349":23084,"39350":23101,"39351":23109,"39352":23124,"39353":23129,"39354":23137,"39355":23144,"39356":23147,"39357":23150,"39358":23153,"39359":23161,"39360":23166,"39361":23169,"39362":23170,"39363":23174,"39364":23176,"39365":23185,"39366":23193,"39367":23200,"39368":23201,"39369":23211,"39370":23235,"39371":23246,"39372":23247,"39373":23251,"39374":23268,"39375":23280,"39376":23294,"39377":23309,"39378":23313,"39379":23317,"39380":23327,"39381":23339,"39382":23361,"39383":23364,"39384":23366,"39385":23370,"39386":23375,"39387":23400,"39388":23412,"39389":23414,"39390":23420,"39391":23426,"39392":23440,"39393":9372,"39394":9373,"39395":9374,"39396":9375,"39397":9376,"39398":9377,"39399":9378,"39400":9379,"39401":9380,"39402":9381,"39403":9382,"39404":9383,"39405":9384,"39406":9385,"39407":9386,"39408":9387,"39409":9388,"39410":9389,"39411":9390,"39412":9391,"39413":9392,"39414":9393,"39415":9394,"39416":9395,"39417":9396,"39418":9397,"39419":60009,"39420":12850,"39421":12849,"39422":27307,"39488":23446,"39489":9352,"39490":9353,"39491":9354,"39492":9355,"39493":9356,"39494":9357,"39495":9358,"39496":9359,"39497":9360,"39498":9361,"39499":9362,"39500":9363,"39501":9364,"39502":9365,"39503":9366,"39504":9367,"39505":9368,"39506":9369,"39507":9370,"39508":9371,"39509":23509,"39510":23511,"39511":23587,"39512":23685,"39513":23710,"39514":23746,"39515":23824,"39516":23852,"39517":23855,"39518":23880,"39519":23894,"39520":23920,"39521":23931,"39522":23941,"39523":23972,"39524":23979,"39525":23990,"39526":24001,"39527":24023,"39528":24073,"39529":24136,"39530":24210,"39531":24253,"39532":24334,"39533":24434,"39534":24497,"39535":24514,"39536":24539,"39537":24543,"39538":24611,"39539":24702,"39540":24791,"39541":24839,"39542":24844,"39543":24857,"39544":24866,"39545":24912,"39546":24928,"39547":24961,"39548":24981,"39549":25017,"39550":25024,"39585":25039,"39586":25043,"39587":25050,"39588":25232,"39589":25393,"39590":8835,"39591":25399,"39592":25465,"39593":25483,"39594":25537,"39595":25570,"39596":25574,"39597":25595,"39598":25598,"39599":25607,"39600":25650,"39601":25656,"39602":25659,"39603":25690,"39604":25713,"39605":25724,"39606":25741,"39607":25775,"39608":25780,"39609":25782,"39610":25821,"39611":25829,"39612":25866,"39613":25873,"39614":25887,"39615":25951,"39616":25965,"39617":25990,"39618":26037,"39619":26046,"39620":26065,"39621":26068,"39622":26083,"39623":26111,"39624":26136,"39625":26147,"39626":26211,"39627":26219,"39628":26237,"39629":26245,"39630":26258,"39631":26266,"39632":26276,"39633":26285,"39634":26291,"39635":26294,"39636":26317,"39637":26318,"39638":26370,"39639":26380,"39640":26393,"39641":26436,"39642":26475,"39643":26511,"39644":26532,"39645":26559,"39646":26582,"39647":26583,"39648":8834,"39649":26637,"39650":26640,"39651":26651,"39652":26678,"39653":26695,"39654":26710,"39655":26756,"39656":26760,"39657":26813,"39658":26819,"39659":26821,"39660":26882,"39661":26883,"39662":26889,"39663":26904,"39664":26947,"39665":26950,"39666":26980,"39667":26983,"39668":26994,"39669":27013,"39670":27039,"39671":27042,"39672":27089,"39673":27093,"39674":27094,"39675":39457,"39676":39462,"39677":39471,"39678":27329,"39744":22975,"39745":27105,"39746":27139,"39747":27162,"39748":27164,"39749":27180,"39750":27181,"39751":27187,"39752":27203,"39753":27205,"39754":27212,"39755":27219,"39756":27223,"39757":27235,"39758":27252,"39759":27266,"39760":27274,"39761":27279,"39762":27289,"39763":27303,"39764":27313,"39765":27317,"39766":27326,"39767":27337,"39768":27348,"39769":27352,"39770":27382,"39771":27479,"39772":27514,"39773":27612,"39774":27676,"39775":27697,"39776":27736,"39777":27758,"39778":27765,"39779":27775,"39780":27823,"39781":27851,"39782":27871,"39783":27903,"39784":27906,"39785":27909,"39786":27910,"39787":27942,"39788":27991,"39789":27995,"39790":28017,"39791":28033,"39792":28047,"39793":28069,"39794":28081,"39795":28158,"39796":28162,"39797":28164,"39798":28175,"39799":28184,"39800":28202,"39801":28240,"39802":28249,"39803":28314,"39804":28341,"39805":28344,"39806":28379,"39841":28410,"39842":28420,"39843":28427,"39844":28428,"39845":28438,"39846":28439,"39847":28468,"39848":28477,"39849":28502,"39850":28537,"39851":28554,"39852":28573,"39853":28575,"39854":28603,"39855":28606,"39856":28627,"39857":28633,"39858":28664,"39859":28675,"39860":28747,"39861":28749,"39862":28752,"39863":28756,"39864":28764,"39865":28775,"39866":28791,"39867":28793,"39868":28811,"39869":28815,"39870":28832,"39871":28835,"39872":28837,"39873":28838,"39874":28839,"39875":28868,"39876":28876,"39877":28880,"39878":28886,"39879":618,"39880":603,"39881":230,"39882":652,"39883":593,"39884":596,"39885":650,"39886":605,"39887":601,"39888":602,"39889":604,"39890":609,"39891":7747,"39892":7753,"39893":330,"39894":7739,"39895":629,"39896":240,"39897":643,"39898":658,"39899":679,"39900":676,"39901":227,"39902":60294,"39903":60295,"39904":623,"39905":632,"39906":647,"39907":60299,"39908":199,"39909":339,"39910":594,"39911":65351,"39912":715,"39913":719,"39914":65345,"39915":65346,"39916":65348,"39917":65349,"39918":65350,"39919":65352,"39920":65353,"39921":65354,"39922":65355,"39923":65356,"39924":65357,"39925":65358,"39926":65359,"39927":65360,"39928":65362,"39929":65363,"39930":65364,"39931":65365,"39932":65366,"39933":65367,"39934":65370,"40000":28917,"40001":12832,"40002":12833,"40003":12834,"40004":12835,"40005":12836,"40006":12837,"40007":12838,"40008":12839,"40009":12840,"40010":12841,"40011":28926,"40012":28933,"40013":28957,"40014":28969,"40015":28971,"40016":28972,"40017":28979,"40018":28981,"40019":28987,"40020":28990,"40021":28992,"40022":29007,"40023":29035,"40024":29045,"40025":29047,"40026":29052,"40027":29054,"40028":29068,"40029":29070,"40030":29073,"40031":29078,"40032":29090,"40033":29091,"40034":29101,"40035":29108,"40036":29111,"40037":29114,"40038":29137,"40039":29149,"40040":29163,"40041":29184,"40042":29193,"40043":29198,"40044":29199,"40045":29206,"40046":29207,"40047":29220,"40048":23204,"40049":29230,"40050":8838,"40051":29271,"40052":29276,"40053":29332,"40054":29444,"40055":29456,"40056":29505,"40057":29556,"40058":29580,"40059":29583,"40060":29592,"40061":29596,"40062":29598,"40097":29607,"40098":29610,"40099":29653,"40100":29665,"40101":29666,"40102":29668,"40103":29670,"40104":29679,"40105":29683,"40106":8839,"40107":29689,"40108":29691,"40109":29698,"40110":29713,"40111":29714,"40112":29716,"40113":29717,"40114":29719,"40115":29721,"40116":29724,"40117":29726,"40118":29727,"40119":29751,"40120":29752,"40121":29753,"40122":29763,"40123":29765,"40124":29767,"40125":29768,"40126":29769,"40127":29779,"40128":29782,"40129":29797,"40130":29803,"40131":29804,"40132":29812,"40133":29818,"40134":29826,"40135":21378,"40136":24191,"40137":20008,"40138":24186,"40139":20886,"40140":23424,"40141":21353,"40142":11911,"40143":60436,"40144":21251,"40145":9746,"40146":33401,"40147":17553,"40148":11916,"40149":11914,"40150":20022,"40151":60444,"40152":21274,"40153":60446,"40154":60447,"40155":11925,"40156":60449,"40157":60450,"40158":9492,"40159":20058,"40160":36790,"40161":24308,"40162":20872,"40163":20101,"40164":60457,"40165":20031,"40166":60459,"40167":60460,"40168":20059,"40169":21430,"40170":36710,"40171":32415,"40172":35744,"40173":36125,"40174":40479,"40175":38376,"40176":38021,"40177":38429,"40178":25164,"40179":27701,"40180":20155,"40181":24516,"40182":28780,"40183":11950,"40184":21475,"40185":27362,"40186":39483,"40187":39484,"40188":39512,"40189":39516,"40190":39523,"40256":9742,"40257":8594,"40258":8592,"40259":8593,"40260":8595,"40261":8680,"40262":8678,"40263":8679,"40264":8681,"40265":8680,"40266":8678,"40267":8679,"40268":8681,"40269":9758,"40270":9756,"40271":9755,"40272":9759,"40273":12310,"40274":12311,"40275":9675,"40276":10005,"40277":10003,"40278":22267,"40279":9789,"40280":22813,"40281":26189,"40282":29221,"40283":10025,"40284":10017,"40285":9786,"40286":9785,"40287":60515,"40288":60516,"40289":60517,"40290":60518,"40291":60519,"40292":23672,"40293":9836,"40294":9834,"40295":23249,"40296":23479,"40297":23804,"40298":60526,"40299":9993,"40300":9986,"40301":60529,"40302":60530,"40303":60531,"40304":60532,"40305":23765,"40306":26478,"40307":29793,"40308":29853,"40309":32595,"40310":34195,"40311":10063,"40312":60540,"40313":60541,"40314":23928,"40315":24379,"40316":60544,"40317":9473,"40318":9475,"40353":60547,"40354":60548,"40355":60549,"40356":60550,"40357":60551,"40358":60552,"40359":60553,"40360":60554,"40361":60555,"40362":60556,"40363":60557,"40364":60558,"40365":60559,"40366":60560,"40367":60561,"40368":39602,"40369":39648,"40370":39700,"40371":39732,"40372":39737,"40373":39744,"40374":39760,"40375":39807,"40376":9788,"40377":32149,"40378":9729,"40379":38708,"40380":9730,"40381":60575,"40382":60576,"40383":60577,"40384":9992,"40385":60579,"40386":60580,"40387":60581,"40388":60582,"40389":60583,"40390":60584,"40391":60585,"40392":8507,"40393":8481,"40394":26343,"40395":28247,"40396":60590,"40397":29015,"40398":31178,"40399":8470,"40400":33132,"40401":35577,"40402":38998,"40403":60597,"40404":60598,"40405":9760,"40406":60600,"40407":9828,"40408":9824,"40409":9831,"40410":9827,"40411":9826,"40412":9830,"40413":9825,"40414":9829,"40415":60609,"40416":60610,"40417":27364,"40418":8478,"40419":13250,"40420":13272,"40421":13217,"40422":60616,"40423":13221,"40424":60618,"40425":60619,"40426":60620,"40427":60621,"40428":60622,"40429":9745,"40430":39809,"40431":39819,"40432":39821,"40433":39901,"40434":39913,"40435":39917,"40436":39924,"40437":39967,"40438":39968,"40439":39974,"40440":40019,"40441":40029,"40442":40059,"40443":40204,"40444":40214,"40445":8626,"40446":27397,"40512":36073,"40513":36082,"40514":36099,"40515":36113,"40516":36124,"40517":36218,"40518":36265,"40519":36288,"40520":36353,"40521":36366,"40522":36422,"40523":36456,"40524":36465,"40525":36478,"40526":36480,"40527":36534,"40528":36537,"40529":36540,"40530":36547,"40531":36580,"40532":36589,"40533":36594,"40534":36656,"40535":36673,"40536":36682,"40537":36773,"40538":36787,"40539":36792,"40540":36810,"40541":36815,"40542":36872,"40543":36915,"40544":36919,"40545":36964,"40546":36972,"40547":37289,"40548":37302,"40549":37316,"40550":37370,"40551":37384,"40552":37395,"40553":37409,"40554":37416,"40555":37419,"40556":37429,"40557":37436,"40558":37441,"40559":37464,"40560":37469,"40561":37471,"40562":37483,"40563":37486,"40564":37505,"40565":37508,"40566":37513,"40567":37519,"40568":37553,"40569":37562,"40570":37567,"40571":37588,"40572":37595,"40573":37603,"40574":37605,"40609":37611,"40610":37612,"40611":37620,"40612":37622,"40613":37629,"40614":37635,"40615":37639,"40616":37680,"40617":37681,"40618":37696,"40619":37698,"40620":37699,"40621":37727,"40622":37730,"40623":37734,"40624":37736,"40625":37747,"40626":37748,"40627":37752,"40628":37757,"40629":37761,"40630":37764,"40631":37766,"40632":37767,"40633":37776,"40634":37788,"40635":37792,"40636":37816,"40637":37819,"40638":37821,"40639":37823,"40640":37835,"40641":37843,"40642":37851,"40643":37856,"40644":37872,"40645":37873,"40646":37875,"40647":37876,"40648":37889,"40649":37892,"40650":37896,"40651":37911,"40652":37915,"40653":37917,"40654":37924,"40655":37925,"40656":37926,"40657":37933,"40658":37954,"40659":37955,"40660":37965,"40661":37972,"40662":37976,"40663":37989,"40664":37991,"40665":37996,"40666":38009,"40667":38011,"40668":38264,"40669":38277,"40670":38310,"40671":38314,"40672":38486,"40673":38523,"40674":38565,"40675":38644,"40676":38683,"40677":38710,"40678":38720,"40679":38721,"40680":38743,"40681":38791,"40682":38793,"40683":38811,"40684":38833,"40685":38845,"40686":38848,"40687":38850,"40688":38866,"40689":38880,"40690":38932,"40691":38933,"40692":38947,"40693":38963,"40694":39016,"40695":39095,"40696":39097,"40697":39111,"40698":39114,"40699":39136,"40700":39137,"40701":39148,"40702":39157,"40768":40225,"40769":40244,"40770":40249,"40771":40265,"40772":40270,"40773":40301,"40774":8759,"40775":40302,"40776":40316,"40777":40323,"40778":40339,"40779":40357,"40780":8748,"40781":40381,"40782":27521,"40783":27569,"40784":40015,"40785":40592,"40786":40384,"40787":60817,"40788":60818,"40789":9775,"40790":9776,"40791":9783,"40792":9779,"40793":9780,"40794":9781,"40795":9778,"40796":9782,"40797":9777,"40798":40393,"40799":40404,"40800":40444,"40801":40458,"40802":40460,"40803":40462,"40804":40472,"40805":40571,"40806":40581,"40807":40610,"40808":40620,"40809":40625,"40810":40641,"40811":40646,"40812":40647,"40813":40689,"40814":40696,"40815":40743,"40816":39182,"40817":39193,"40818":39196,"40819":39223,"40820":39261,"40821":39266,"40822":39323,"40823":39332,"40824":39338,"40825":39352,"40826":39392,"40827":39398,"40828":39413,"40829":39455,"40830":32254,"40865":32263,"40866":32347,"40867":32357,"40868":32364,"40869":32567,"40870":32576,"40871":32577,"40872":32585,"40873":32594,"40874":32655,"40875":32659,"40876":32692,"40877":32733,"40878":32743,"40879":32762,"40880":32770,"40881":32776,"40882":32814,"40883":32815,"40884":32828,"40885":32935,"40886":33036,"40887":33066,"40888":33076,"40889":33090,"40890":33110,"40891":33156,"40892":33189,"40893":33252,"40894":33364,"40895":33381,"40896":33403,"40897":33415,"40898":33471,"40899":33506,"40900":33518,"40901":33528,"40902":33532,"40903":33535,"40904":33547,"40905":33565,"40906":33597,"40907":33623,"40908":33681,"40909":33708,"40910":33741,"40911":33773,"40912":33797,"40913":33812,"40914":33814,"40915":33825,"40916":33838,"40917":33854,"40918":33866,"40919":33875,"40920":33877,"40921":33880,"40922":33892,"40923":33906,"40924":33919,"40925":33920,"40926":33938,"40927":33939,"40928":33942,"40929":33955,"40930":33982,"40931":34014,"40932":34017,"40933":34018,"40934":34020,"40935":34040,"40936":34051,"40937":34053,"40938":34064,"40939":34099,"40940":8208,"40941":34114,"40942":34124,"40943":34130,"40944":34143,"40945":34159,"40946":34160,"40947":34163,"40948":34262,"40949":34272,"40950":34286,"40951":34300,"40952":34317,"40953":34319,"40954":34324,"40955":34344,"40956":34370,"40957":34373,"40958":34418,"41024":34972,"41025":23405,"41026":33079,"41027":60958,"41028":39224,"41029":21874,"41030":21867,"41031":60962,"41032":13774,"41033":21873,"41034":21946,"41035":22001,"41036":13778,"41037":22000,"41038":22021,"41039":22050,"41040":22061,"41041":22083,"41042":22046,"41043":22162,"41044":31949,"41045":21530,"41046":21523,"41047":21655,"41048":26353,"41049":30004,"41050":21581,"41051":22180,"41052":22175,"41053":25811,"41054":25390,"41055":25592,"41056":25886,"41057":20088,"41058":27626,"41059":27698,"41060":27709,"41061":27746,"41062":27826,"41063":28152,"41064":28201,"41065":28278,"41066":28290,"41067":28294,"41068":28347,"41069":28383,"41070":28386,"41071":28433,"41072":28452,"41073":28532,"41074":28561,"41075":28597,"41076":28659,"41077":28661,"41078":28859,"41079":28864,"41080":28943,"41081":8706,"41082":29013,"41083":29043,"41084":29050,"41085":61016,"41086":21027,"41121":61018,"41122":13393,"41123":61020,"41124":36812,"41125":61022,"41126":61023,"41127":192,"41128":200,"41129":204,"41130":210,"41131":217,"41132":193,"41133":205,"41134":211,"41135":218,"41136":257,"41137":275,"41138":299,"41139":333,"41140":363,"41141":470,"41142":196,"41143":203,"41144":207,"41145":214,"41146":220,"41147":198,"41148":199,"41149":209,"41150":195,"41151":213,"41152":225,"41153":233,"41154":237,"41155":243,"41156":250,"41157":472,"41158":228,"41159":235,"41160":239,"41161":246,"41162":252,"41163":230,"41164":231,"41165":241,"41166":227,"41167":245,"41168":462,"41169":283,"41170":464,"41171":466,"41172":468,"41173":474,"41174":197,"41175":201,"41176":29064,"41177":216,"41178":208,"41179":7922,"41180":222,"41181":223,"41182":170,"41183":161,"41184":224,"41185":232,"41186":236,"41187":242,"41188":249,"41189":476,"41190":229,"41191":29080,"41192":29143,"41193":248,"41194":240,"41195":7923,"41196":254,"41197":255,"41198":186,"41199":191,"41200":226,"41201":234,"41202":238,"41203":244,"41204":251,"41205":29173,"41206":194,"41207":202,"41208":206,"41209":212,"41210":219,"41211":184,"41212":164,"41213":61110,"41214":402,"41280":12288,"41281":65292,"41282":12289,"41283":12290,"41284":65294,"41285":8231,"41286":65307,"41287":65306,"41288":65311,"41289":65281,"41290":65072,"41291":8230,"41292":8229,"41293":65104,"41294":65105,"41295":65106,"41296":183,"41297":65108,"41298":65109,"41299":65110,"41300":65111,"41301":65372,"41302":8211,"41303":65073,"41304":8212,"41305":65075,"41306":9588,"41307":65076,"41308":65103,"41309":65288,"41310":65289,"41311":65077,"41312":65078,"41313":65371,"41314":65373,"41315":65079,"41316":65080,"41317":12308,"41318":12309,"41319":65081,"41320":65082,"41321":12304,"41322":12305,"41323":65083,"41324":65084,"41325":12298,"41326":12299,"41327":65085,"41328":65086,"41329":12296,"41330":12297,"41331":65087,"41332":65088,"41333":12300,"41334":12301,"41335":65089,"41336":65090,"41337":12302,"41338":12303,"41339":65091,"41340":65092,"41341":65113,"41342":65114,"41377":65115,"41378":65116,"41379":65117,"41380":65118,"41381":8216,"41382":8217,"41383":8220,"41384":8221,"41385":12317,"41386":12318,"41387":8245,"41388":8242,"41389":65283,"41390":65286,"41391":65290,"41392":8251,"41393":167,"41394":12291,"41395":9675,"41396":9679,"41397":9651,"41398":9650,"41399":9678,"41400":9734,"41401":9733,"41402":9671,"41403":9670,"41404":9633,"41405":9632,"41406":9661,"41407":9660,"41408":12963,"41409":8453,"41410":175,"41411":65507,"41412":65343,"41413":717,"41414":65097,"41415":65098,"41416":65101,"41417":65102,"41418":65099,"41419":65100,"41420":65119,"41421":65120,"41422":65121,"41423":65291,"41424":65293,"41425":215,"41426":247,"41427":177,"41428":8730,"41429":65308,"41430":65310,"41431":65309,"41432":8806,"41433":8807,"41434":8800,"41435":8734,"41436":8786,"41437":8801,"41438":65122,"41439":65123,"41440":65124,"41441":65125,"41442":65126,"41443":65374,"41444":8745,"41445":8746,"41446":8869,"41447":8736,"41448":8735,"41449":8895,"41450":13266,"41451":13265,"41452":8747,"41453":8750,"41454":8757,"41455":8756,"41456":9792,"41457":9794,"41458":8853,"41459":8857,"41460":8593,"41461":8595,"41462":8592,"41463":8594,"41464":8598,"41465":8599,"41466":8601,"41467":8600,"41468":8741,"41469":8739,"41470":65295,"41536":65340,"41537":8725,"41538":65128,"41539":65284,"41540":65509,"41541":12306,"41542":65504,"41543":65505,"41544":65285,"41545":65312,"41546":8451,"41547":8457,"41548":65129,"41549":65130,"41550":65131,"41551":13269,"41552":13212,"41553":13213,"41554":13214,"41555":13262,"41556":13217,"41557":13198,"41558":13199,"41559":13252,"41560":176,"41561":20825,"41562":20827,"41563":20830,"41564":20829,"41565":20833,"41566":20835,"41567":21991,"41568":29929,"41569":31950,"41570":9601,"41571":9602,"41572":9603,"41573":9604,"41574":9605,"41575":9606,"41576":9607,"41577":9608,"41578":9615,"41579":9614,"41580":9613,"41581":9612,"41582":9611,"41583":9610,"41584":9609,"41585":9532,"41586":9524,"41587":9516,"41588":9508,"41589":9500,"41590":9620,"41591":9472,"41592":9474,"41593":9621,"41594":9484,"41595":9488,"41596":9492,"41597":9496,"41598":9581,"41633":9582,"41634":9584,"41635":9583,"41636":9552,"41637":9566,"41638":9578,"41639":9569,"41640":9698,"41641":9699,"41642":9701,"41643":9700,"41644":9585,"41645":9586,"41646":9587,"41647":65296,"41648":65297,"41649":65298,"41650":65299,"41651":65300,"41652":65301,"41653":65302,"41654":65303,"41655":65304,"41656":65305,"41657":8544,"41658":8545,"41659":8546,"41660":8547,"41661":8548,"41662":8549,"41663":8550,"41664":8551,"41665":8552,"41666":8553,"41667":12321,"41668":12322,"41669":12323,"41670":12324,"41671":12325,"41672":12326,"41673":12327,"41674":12328,"41675":12329,"41676":21313,"41677":21316,"41678":21317,"41679":65313,"41680":65314,"41681":65315,"41682":65316,"41683":65317,"41684":65318,"41685":65319,"41686":65320,"41687":65321,"41688":65322,"41689":65323,"41690":65324,"41691":65325,"41692":65326,"41693":65327,"41694":65328,"41695":65329,"41696":65330,"41697":65331,"41698":65332,"41699":65333,"41700":65334,"41701":65335,"41702":65336,"41703":65337,"41704":65338,"41705":65345,"41706":65346,"41707":65347,"41708":65348,"41709":65349,"41710":65350,"41711":65351,"41712":65352,"41713":65353,"41714":65354,"41715":65355,"41716":65356,"41717":65357,"41718":65358,"41719":65359,"41720":65360,"41721":65361,"41722":65362,"41723":65363,"41724":65364,"41725":65365,"41726":65366,"41792":65367,"41793":65368,"41794":65369,"41795":65370,"41796":913,"41797":914,"41798":915,"41799":916,"41800":917,"41801":918,"41802":919,"41803":920,"41804":921,"41805":922,"41806":923,"41807":924,"41808":925,"41809":926,"41810":927,"41811":928,"41812":929,"41813":931,"41814":932,"41815":933,"41816":934,"41817":935,"41818":936,"41819":937,"41820":945,"41821":946,"41822":947,"41823":948,"41824":949,"41825":950,"41826":951,"41827":952,"41828":953,"41829":954,"41830":955,"41831":956,"41832":957,"41833":958,"41834":959,"41835":960,"41836":961,"41837":963,"41838":964,"41839":965,"41840":966,"41841":967,"41842":968,"41843":969,"41844":12549,"41845":12550,"41846":12551,"41847":12552,"41848":12553,"41849":12554,"41850":12555,"41851":12556,"41852":12557,"41853":12558,"41854":12559,"41889":12560,"41890":12561,"41891":12562,"41892":12563,"41893":12564,"41894":12565,"41895":12566,"41896":12567,"41897":12568,"41898":12569,"41899":12570,"41900":12571,"41901":12572,"41902":12573,"41903":12574,"41904":12575,"41905":12576,"41906":12577,"41907":12578,"41908":12579,"41909":12580,"41910":12581,"41911":12582,"41912":12583,"41913":12584,"41914":12585,"41915":729,"41916":713,"41917":714,"41918":711,"41919":715,"41920":9216,"41921":9217,"41922":9218,"41923":9219,"41924":9220,"41925":9221,"41926":9222,"41927":9223,"41928":9224,"41929":9225,"41930":9226,"41931":9227,"41932":9228,"41933":9229,"41934":9230,"41935":9231,"41936":9232,"41937":9233,"41938":9234,"41939":9235,"41940":9236,"41941":9237,"41942":9238,"41943":9239,"41944":9240,"41945":9241,"41946":9242,"41947":9243,"41948":9244,"41949":9245,"41950":9246,"41951":9247,"41952":9249,"41953":8364,"41954":63561,"41955":63562,"41956":63563,"41957":63564,"41958":63565,"41959":63566,"41960":63567,"41961":63568,"41962":63569,"41963":63570,"41964":63571,"41965":63572,"41966":63573,"41967":63574,"41968":63575,"41969":63576,"41970":63577,"41971":63578,"41972":63579,"41973":63580,"41974":63581,"41975":63582,"41976":63583,"41977":63584,"41978":63585,"41979":63586,"41980":63587,"41981":63588,"41982":63589,"42048":19968,"42049":20057,"42050":19969,"42051":19971,"42052":20035,"42053":20061,"42054":20102,"42055":20108,"42056":20154,"42057":20799,"42058":20837,"42059":20843,"42060":20960,"42061":20992,"42062":20993,"42063":21147,"42064":21269,"42065":21313,"42066":21340,"42067":21448,"42068":19977,"42069":19979,"42070":19976,"42071":19978,"42072":20011,"42073":20024,"42074":20961,"42075":20037,"42076":20040,"42077":20063,"42078":20062,"42079":20110,"42080":20129,"42081":20800,"42082":20995,"42083":21242,"42084":21315,"42085":21449,"42086":21475,"42087":22303,"42088":22763,"42089":22805,"42090":22823,"42091":22899,"42092":23376,"42093":23377,"42094":23379,"42095":23544,"42096":23567,"42097":23586,"42098":23608,"42099":23665,"42100":24029,"42101":24037,"42102":24049,"42103":24050,"42104":24051,"42105":24062,"42106":24178,"42107":24318,"42108":24331,"42109":24339,"42110":25165,"42145":19985,"42146":19984,"42147":19981,"42148":20013,"42149":20016,"42150":20025,"42151":20043,"42152":23609,"42153":20104,"42154":20113,"42155":20117,"42156":20114,"42157":20116,"42158":20130,"42159":20161,"42160":20160,"42161":20163,"42162":20166,"42163":20167,"42164":20173,"42165":20170,"42166":20171,"42167":20164,"42168":20803,"42169":20801,"42170":20839,"42171":20845,"42172":20846,"42173":20844,"42174":20887,"42175":20982,"42176":20998,"42177":20999,"42178":21000,"42179":21243,"42180":21246,"42181":21247,"42182":21270,"42183":21305,"42184":21320,"42185":21319,"42186":21317,"42187":21342,"42188":21380,"42189":21451,"42190":21450,"42191":21453,"42192":22764,"42193":22825,"42194":22827,"42195":22826,"42196":22829,"42197":23380,"42198":23569,"42199":23588,"42200":23610,"42201":23663,"42202":24052,"42203":24187,"42204":24319,"42205":24340,"42206":24341,"42207":24515,"42208":25096,"42209":25142,"42210":25163,"42211":25166,"42212":25903,"42213":25991,"42214":26007,"42215":26020,"42216":26041,"42217":26085,"42218":26352,"42219":26376,"42220":26408,"42221":27424,"42222":27490,"42223":27513,"42224":27595,"42225":27604,"42226":27611,"42227":27663,"42228":27700,"42229":28779,"42230":29226,"42231":29238,"42232":29243,"42233":29255,"42234":29273,"42235":29275,"42236":29356,"42237":29579,"42238":19993,"42304":19990,"42305":19989,"42306":19988,"42307":19992,"42308":20027,"42309":20045,"42310":20047,"42311":20046,"42312":20197,"42313":20184,"42314":20180,"42315":20181,"42316":20182,"42317":20183,"42318":20195,"42319":20196,"42320":20185,"42321":20190,"42322":20805,"42323":20804,"42324":20873,"42325":20874,"42326":20908,"42327":20985,"42328":20986,"42329":20984,"42330":21002,"42331":21152,"42332":21151,"42333":21253,"42334":21254,"42335":21271,"42336":21277,"42337":20191,"42338":21322,"42339":21321,"42340":21345,"42341":21344,"42342":21359,"42343":21358,"42344":21435,"42345":21487,"42346":21476,"42347":21491,"42348":21484,"42349":21486,"42350":21481,"42351":21480,"42352":21500,"42353":21496,"42354":21493,"42355":21483,"42356":21478,"42357":21482,"42358":21490,"42359":21489,"42360":21488,"42361":21477,"42362":21485,"42363":21499,"42364":22235,"42365":22234,"42366":22806,"42401":22830,"42402":22833,"42403":22900,"42404":22902,"42405":23381,"42406":23427,"42407":23612,"42408":24040,"42409":24039,"42410":24038,"42411":24066,"42412":24067,"42413":24179,"42414":24188,"42415":24321,"42416":24344,"42417":24343,"42418":24517,"42419":25098,"42420":25171,"42421":25172,"42422":25170,"42423":25169,"42424":26021,"42425":26086,"42426":26414,"42427":26412,"42428":26410,"42429":26411,"42430":26413,"42431":27491,"42432":27597,"42433":27665,"42434":27664,"42435":27704,"42436":27713,"42437":27712,"42438":27710,"42439":29359,"42440":29572,"42441":29577,"42442":29916,"42443":29926,"42444":29976,"42445":29983,"42446":29992,"42447":29993,"42448":30000,"42449":30001,"42450":30002,"42451":30003,"42452":30091,"42453":30333,"42454":30382,"42455":30399,"42456":30446,"42457":30683,"42458":30690,"42459":30707,"42460":31034,"42461":31166,"42462":31348,"42463":31435,"42464":19998,"42465":19999,"42466":20050,"42467":20051,"42468":20073,"42469":20121,"42470":20132,"42471":20134,"42472":20133,"42473":20223,"42474":20233,"42475":20249,"42476":20234,"42477":20245,"42478":20237,"42479":20240,"42480":20241,"42481":20239,"42482":20210,"42483":20214,"42484":20219,"42485":20208,"42486":20211,"42487":20221,"42488":20225,"42489":20235,"42490":20809,"42491":20807,"42492":20806,"42493":20808,"42494":20840,"42560":20849,"42561":20877,"42562":20912,"42563":21015,"42564":21009,"42565":21010,"42566":21006,"42567":21014,"42568":21155,"42569":21256,"42570":21281,"42571":21280,"42572":21360,"42573":21361,"42574":21513,"42575":21519,"42576":21516,"42577":21514,"42578":21520,"42579":21505,"42580":21515,"42581":21508,"42582":21521,"42583":21517,"42584":21512,"42585":21507,"42586":21518,"42587":21510,"42588":21522,"42589":22240,"42590":22238,"42591":22237,"42592":22323,"42593":22320,"42594":22312,"42595":22317,"42596":22316,"42597":22319,"42598":22313,"42599":22809,"42600":22810,"42601":22839,"42602":22840,"42603":22916,"42604":22904,"42605":22915,"42606":22909,"42607":22905,"42608":22914,"42609":22913,"42610":23383,"42611":23384,"42612":23431,"42613":23432,"42614":23429,"42615":23433,"42616":23546,"42617":23574,"42618":23673,"42619":24030,"42620":24070,"42621":24182,"42622":24180,"42657":24335,"42658":24347,"42659":24537,"42660":24534,"42661":25102,"42662":25100,"42663":25101,"42664":25104,"42665":25187,"42666":25179,"42667":25176,"42668":25910,"42669":26089,"42670":26088,"42671":26092,"42672":26093,"42673":26354,"42674":26355,"42675":26377,"42676":26429,"42677":26420,"42678":26417,"42679":26421,"42680":27425,"42681":27492,"42682":27515,"42683":27670,"42684":27741,"42685":27735,"42686":27737,"42687":27743,"42688":27744,"42689":27728,"42690":27733,"42691":27745,"42692":27739,"42693":27725,"42694":27726,"42695":28784,"42696":29279,"42697":29277,"42698":30334,"42699":31481,"42700":31859,"42701":31992,"42702":32566,"42703":32650,"42704":32701,"42705":32769,"42706":32771,"42707":32780,"42708":32786,"42709":32819,"42710":32895,"42711":32905,"42712":32907,"42713":32908,"42714":33251,"42715":33258,"42716":33267,"42717":33276,"42718":33292,"42719":33307,"42720":33311,"42721":33390,"42722":33394,"42723":33406,"42724":34411,"42725":34880,"42726":34892,"42727":34915,"42728":35199,"42729":38433,"42730":20018,"42731":20136,"42732":20301,"42733":20303,"42734":20295,"42735":20311,"42736":20318,"42737":20276,"42738":20315,"42739":20309,"42740":20272,"42741":20304,"42742":20305,"42743":20285,"42744":20282,"42745":20280,"42746":20291,"42747":20308,"42748":20284,"42749":20294,"42750":20323,"42816":20316,"42817":20320,"42818":20271,"42819":20302,"42820":20278,"42821":20313,"42822":20317,"42823":20296,"42824":20314,"42825":20812,"42826":20811,"42827":20813,"42828":20853,"42829":20918,"42830":20919,"42831":21029,"42832":21028,"42833":21033,"42834":21034,"42835":21032,"42836":21163,"42837":21161,"42838":21162,"42839":21164,"42840":21283,"42841":21363,"42842":21365,"42843":21533,"42844":21549,"42845":21534,"42846":21566,"42847":21542,"42848":21582,"42849":21543,"42850":21574,"42851":21571,"42852":21555,"42853":21576,"42854":21570,"42855":21531,"42856":21545,"42857":21578,"42858":21561,"42859":21563,"42860":21560,"42861":21550,"42862":21557,"42863":21558,"42864":21536,"42865":21564,"42866":21568,"42867":21553,"42868":21547,"42869":21535,"42870":21548,"42871":22250,"42872":22256,"42873":22244,"42874":22251,"42875":22346,"42876":22353,"42877":22336,"42878":22349,"42913":22343,"42914":22350,"42915":22334,"42916":22352,"42917":22351,"42918":22331,"42919":22767,"42920":22846,"42921":22941,"42922":22930,"42923":22952,"42924":22942,"42925":22947,"42926":22937,"42927":22934,"42928":22925,"42929":22948,"42930":22931,"42931":22922,"42932":22949,"42933":23389,"42934":23388,"42935":23386,"42936":23387,"42937":23436,"42938":23435,"42939":23439,"42940":23596,"42941":23616,"42942":23617,"42943":23615,"42944":23614,"42945":23696,"42946":23697,"42947":23700,"42948":23692,"42949":24043,"42950":24076,"42951":24207,"42952":24199,"42953":24202,"42954":24311,"42955":24324,"42956":24351,"42957":24420,"42958":24418,"42959":24439,"42960":24441,"42961":24536,"42962":24524,"42963":24535,"42964":24525,"42965":24561,"42966":24555,"42967":24568,"42968":24554,"42969":25106,"42970":25105,"42971":25220,"42972":25239,"42973":25238,"42974":25216,"42975":25206,"42976":25225,"42977":25197,"42978":25226,"42979":25212,"42980":25214,"42981":25209,"42982":25203,"42983":25234,"42984":25199,"42985":25240,"42986":25198,"42987":25237,"42988":25235,"42989":25233,"42990":25222,"42991":25913,"42992":25915,"42993":25912,"42994":26097,"42995":26356,"42996":26463,"42997":26446,"42998":26447,"42999":26448,"43000":26449,"43001":26460,"43002":26454,"43003":26462,"43004":26441,"43005":26438,"43006":26464,"43072":26451,"43073":26455,"43074":27493,"43075":27599,"43076":27714,"43077":27742,"43078":27801,"43079":27777,"43080":27784,"43081":27785,"43082":27781,"43083":27803,"43084":27754,"43085":27770,"43086":27792,"43087":27760,"43088":27788,"43089":27752,"43090":27798,"43091":27794,"43092":27773,"43093":27779,"43094":27762,"43095":27774,"43096":27764,"43097":27782,"43098":27766,"43099":27789,"43100":27796,"43101":27800,"43102":27778,"43103":28790,"43104":28796,"43105":28797,"43106":28792,"43107":29282,"43108":29281,"43109":29280,"43110":29380,"43111":29378,"43112":29590,"43113":29996,"43114":29995,"43115":30007,"43116":30008,"43117":30338,"43118":30447,"43119":30691,"43120":31169,"43121":31168,"43122":31167,"43123":31350,"43124":31995,"43125":32597,"43126":32918,"43127":32915,"43128":32925,"43129":32920,"43130":32923,"43131":32922,"43132":32946,"43133":33391,"43134":33426,"43169":33419,"43170":33421,"43171":35211,"43172":35282,"43173":35328,"43174":35895,"43175":35910,"43176":35925,"43177":35997,"43178":36196,"43179":36208,"43180":36275,"43181":36523,"43182":36554,"43183":36763,"43184":36784,"43185":36802,"43186":36806,"43187":36805,"43188":36804,"43189":24033,"43190":37009,"43191":37026,"43192":37034,"43193":37030,"43194":37027,"43195":37193,"43196":37318,"43197":37324,"43198":38450,"43199":38446,"43200":38449,"43201":38442,"43202":38444,"43203":20006,"43204":20054,"43205":20083,"43206":20107,"43207":20123,"43208":20126,"43209":20139,"43210":20140,"43211":20335,"43212":20381,"43213":20365,"43214":20339,"43215":20351,"43216":20332,"43217":20379,"43218":20363,"43219":20358,"43220":20355,"43221":20336,"43222":20341,"43223":20360,"43224":20329,"43225":20347,"43226":20374,"43227":20350,"43228":20367,"43229":20369,"43230":20346,"43231":20820,"43232":20818,"43233":20821,"43234":20841,"43235":20855,"43236":20854,"43237":20856,"43238":20925,"43239":20989,"43240":21051,"43241":21048,"43242":21047,"43243":21050,"43244":21040,"43245":21038,"43246":21046,"43247":21057,"43248":21182,"43249":21179,"43250":21330,"43251":21332,"43252":21331,"43253":21329,"43254":21350,"43255":21367,"43256":21368,"43257":21369,"43258":21462,"43259":21460,"43260":21463,"43261":21619,"43262":21621,"43328":21654,"43329":21624,"43330":21653,"43331":21632,"43332":21627,"43333":21623,"43334":21636,"43335":21650,"43336":21638,"43337":21628,"43338":21648,"43339":21617,"43340":21622,"43341":21644,"43342":21658,"43343":21602,"43344":21608,"43345":21643,"43346":21629,"43347":21646,"43348":22266,"43349":22403,"43350":22391,"43351":22378,"43352":22377,"43353":22369,"43354":22374,"43355":22372,"43356":22396,"43357":22812,"43358":22857,"43359":22855,"43360":22856,"43361":22852,"43362":22868,"43363":22974,"43364":22971,"43365":22996,"43366":22969,"43367":22958,"43368":22993,"43369":22982,"43370":22992,"43371":22989,"43372":22987,"43373":22995,"43374":22986,"43375":22959,"43376":22963,"43377":22994,"43378":22981,"43379":23391,"43380":23396,"43381":23395,"43382":23447,"43383":23450,"43384":23448,"43385":23452,"43386":23449,"43387":23451,"43388":23578,"43389":23624,"43390":23621,"43425":23622,"43426":23735,"43427":23713,"43428":23736,"43429":23721,"43430":23723,"43431":23729,"43432":23731,"43433":24088,"43434":24090,"43435":24086,"43436":24085,"43437":24091,"43438":24081,"43439":24184,"43440":24218,"43441":24215,"43442":24220,"43443":24213,"43444":24214,"43445":24310,"43446":24358,"43447":24359,"43448":24361,"43449":24448,"43450":24449,"43451":24447,"43452":24444,"43453":24541,"43454":24544,"43455":24573,"43456":24565,"43457":24575,"43458":24591,"43459":24596,"43460":24623,"43461":24629,"43462":24598,"43463":24618,"43464":24597,"43465":24609,"43466":24615,"43467":24617,"43468":24619,"43469":24603,"43470":25110,"43471":25109,"43472":25151,"43473":25150,"43474":25152,"43475":25215,"43476":25289,"43477":25292,"43478":25284,"43479":25279,"43480":25282,"43481":25273,"43482":25298,"43483":25307,"43484":25259,"43485":25299,"43486":25300,"43487":25291,"43488":25288,"43489":25256,"43490":25277,"43491":25276,"43492":25296,"43493":25305,"43494":25287,"43495":25293,"43496":25269,"43497":25306,"43498":25265,"43499":25304,"43500":25302,"43501":25303,"43502":25286,"43503":25260,"43504":25294,"43505":25918,"43506":26023,"43507":26044,"43508":26106,"43509":26132,"43510":26131,"43511":26124,"43512":26118,"43513":26114,"43514":26126,"43515":26112,"43516":26127,"43517":26133,"43518":26122,"43584":26119,"43585":26381,"43586":26379,"43587":26477,"43588":26507,"43589":26517,"43590":26481,"43591":26524,"43592":26483,"43593":26487,"43594":26503,"43595":26525,"43596":26519,"43597":26479,"43598":26480,"43599":26495,"43600":26505,"43601":26494,"43602":26512,"43603":26485,"43604":26522,"43605":26515,"43606":26492,"43607":26474,"43608":26482,"43609":27427,"43610":27494,"43611":27495,"43612":27519,"43613":27667,"43614":27675,"43615":27875,"43616":27880,"43617":27891,"43618":27825,"43619":27852,"43620":27877,"43621":27827,"43622":27837,"43623":27838,"43624":27836,"43625":27874,"43626":27819,"43627":27861,"43628":27859,"43629":27832,"43630":27844,"43631":27833,"43632":27841,"43633":27822,"43634":27863,"43635":27845,"43636":27889,"43637":27839,"43638":27835,"43639":27873,"43640":27867,"43641":27850,"43642":27820,"43643":27887,"43644":27868,"43645":27862,"43646":27872,"43681":28821,"43682":28814,"43683":28818,"43684":28810,"43685":28825,"43686":29228,"43687":29229,"43688":29240,"43689":29256,"43690":29287,"43691":29289,"43692":29376,"43693":29390,"43694":29401,"43695":29399,"43696":29392,"43697":29609,"43698":29608,"43699":29599,"43700":29611,"43701":29605,"43702":30013,"43703":30109,"43704":30105,"43705":30106,"43706":30340,"43707":30402,"43708":30450,"43709":30452,"43710":30693,"43711":30717,"43712":31038,"43713":31040,"43714":31041,"43715":31177,"43716":31176,"43717":31354,"43718":31353,"43719":31482,"43720":31998,"43721":32596,"43722":32652,"43723":32651,"43724":32773,"43725":32954,"43726":32933,"43727":32930,"43728":32945,"43729":32929,"43730":32939,"43731":32937,"43732":32948,"43733":32938,"43734":32943,"43735":33253,"43736":33278,"43737":33293,"43738":33459,"43739":33437,"43740":33433,"43741":33453,"43742":33469,"43743":33439,"43744":33465,"43745":33457,"43746":33452,"43747":33445,"43748":33455,"43749":33464,"43750":33443,"43751":33456,"43752":33470,"43753":33463,"43754":34382,"43755":34417,"43756":21021,"43757":34920,"43758":36555,"43759":36814,"43760":36820,"43761":36817,"43762":37045,"43763":37048,"43764":37041,"43765":37046,"43766":37319,"43767":37329,"43768":38263,"43769":38272,"43770":38428,"43771":38464,"43772":38463,"43773":38459,"43774":38468,"43840":38466,"43841":38585,"43842":38632,"43843":38738,"43844":38750,"43845":20127,"43846":20141,"43847":20142,"43848":20449,"43849":20405,"43850":20399,"43851":20415,"43852":20448,"43853":20433,"43854":20431,"43855":20445,"43856":20419,"43857":20406,"43858":20440,"43859":20447,"43860":20426,"43861":20439,"43862":20398,"43863":20432,"43864":20420,"43865":20418,"43866":20442,"43867":20430,"43868":20446,"43869":20407,"43870":20823,"43871":20882,"43872":20881,"43873":20896,"43874":21070,"43875":21059,"43876":21066,"43877":21069,"43878":21068,"43879":21067,"43880":21063,"43881":21191,"43882":21193,"43883":21187,"43884":21185,"43885":21261,"43886":21335,"43887":21371,"43888":21402,"43889":21467,"43890":21676,"43891":21696,"43892":21672,"43893":21710,"43894":21705,"43895":21688,"43896":21670,"43897":21683,"43898":21703,"43899":21698,"43900":21693,"43901":21674,"43902":21697,"43937":21700,"43938":21704,"43939":21679,"43940":21675,"43941":21681,"43942":21691,"43943":21673,"43944":21671,"43945":21695,"43946":22271,"43947":22402,"43948":22411,"43949":22432,"43950":22435,"43951":22434,"43952":22478,"43953":22446,"43954":22419,"43955":22869,"43956":22865,"43957":22863,"43958":22862,"43959":22864,"43960":23004,"43961":23000,"43962":23039,"43963":23011,"43964":23016,"43965":23043,"43966":23013,"43967":23018,"43968":23002,"43969":23014,"43970":23041,"43971":23035,"43972":23401,"43973":23459,"43974":23462,"43975":23460,"43976":23458,"43977":23461,"43978":23553,"43979":23630,"43980":23631,"43981":23629,"43982":23627,"43983":23769,"43984":23762,"43985":24055,"43986":24093,"43987":24101,"43988":24095,"43989":24189,"43990":24224,"43991":24230,"43992":24314,"43993":24328,"43994":24365,"43995":24421,"43996":24456,"43997":24453,"43998":24458,"43999":24459,"44000":24455,"44001":24460,"44002":24457,"44003":24594,"44004":24605,"44005":24608,"44006":24613,"44007":24590,"44008":24616,"44009":24653,"44010":24688,"44011":24680,"44012":24674,"44013":24646,"44014":24643,"44015":24684,"44016":24683,"44017":24682,"44018":24676,"44019":25153,"44020":25308,"44021":25366,"44022":25353,"44023":25340,"44024":25325,"44025":25345,"44026":25326,"44027":25341,"44028":25351,"44029":25329,"44030":25335,"44096":25327,"44097":25324,"44098":25342,"44099":25332,"44100":25361,"44101":25346,"44102":25919,"44103":25925,"44104":26027,"44105":26045,"44106":26082,"44107":26149,"44108":26157,"44109":26144,"44110":26151,"44111":26159,"44112":26143,"44113":26152,"44114":26161,"44115":26148,"44116":26359,"44117":26623,"44118":26579,"44119":26609,"44120":26580,"44121":26576,"44122":26604,"44123":26550,"44124":26543,"44125":26613,"44126":26601,"44127":26607,"44128":26564,"44129":26577,"44130":26548,"44131":26586,"44132":26597,"44133":26552,"44134":26575,"44135":26590,"44136":26611,"44137":26544,"44138":26585,"44139":26594,"44140":26589,"44141":26578,"44142":27498,"44143":27523,"44144":27526,"44145":27573,"44146":27602,"44147":27607,"44148":27679,"44149":27849,"44150":27915,"44151":27954,"44152":27946,"44153":27969,"44154":27941,"44155":27916,"44156":27953,"44157":27934,"44158":27927,"44193":27963,"44194":27965,"44195":27966,"44196":27958,"44197":27931,"44198":27893,"44199":27961,"44200":27943,"44201":27960,"44202":27945,"44203":27950,"44204":27957,"44205":27918,"44206":27947,"44207":28843,"44208":28858,"44209":28851,"44210":28844,"44211":28847,"44212":28845,"44213":28856,"44214":28846,"44215":28836,"44216":29232,"44217":29298,"44218":29295,"44219":29300,"44220":29417,"44221":29408,"44222":29409,"44223":29623,"44224":29642,"44225":29627,"44226":29618,"44227":29645,"44228":29632,"44229":29619,"44230":29978,"44231":29997,"44232":30031,"44233":30028,"44234":30030,"44235":30027,"44236":30123,"44237":30116,"44238":30117,"44239":30114,"44240":30115,"44241":30328,"44242":30342,"44243":30343,"44244":30344,"44245":30408,"44246":30406,"44247":30403,"44248":30405,"44249":30465,"44250":30457,"44251":30456,"44252":30473,"44253":30475,"44254":30462,"44255":30460,"44256":30471,"44257":30684,"44258":30722,"44259":30740,"44260":30732,"44261":30733,"44262":31046,"44263":31049,"44264":31048,"44265":31047,"44266":31161,"44267":31162,"44268":31185,"44269":31186,"44270":31179,"44271":31359,"44272":31361,"44273":31487,"44274":31485,"44275":31869,"44276":32002,"44277":32005,"44278":32000,"44279":32009,"44280":32007,"44281":32004,"44282":32006,"44283":32568,"44284":32654,"44285":32703,"44286":32772,"44352":32784,"44353":32781,"44354":32785,"44355":32822,"44356":32982,"44357":32997,"44358":32986,"44359":32963,"44360":32964,"44361":32972,"44362":32993,"44363":32987,"44364":32974,"44365":32990,"44366":32996,"44367":32989,"44368":33268,"44369":33314,"44370":33511,"44371":33539,"44372":33541,"44373":33507,"44374":33499,"44375":33510,"44376":33540,"44377":33509,"44378":33538,"44379":33545,"44380":33490,"44381":33495,"44382":33521,"44383":33537,"44384":33500,"44385":33492,"44386":33489,"44387":33502,"44388":33491,"44389":33503,"44390":33519,"44391":33542,"44392":34384,"44393":34425,"44394":34427,"44395":34426,"44396":34893,"44397":34923,"44398":35201,"44399":35284,"44400":35336,"44401":35330,"44402":35331,"44403":35998,"44404":36000,"44405":36212,"44406":36211,"44407":36276,"44408":36557,"44409":36556,"44410":36848,"44411":36838,"44412":36834,"44413":36842,"44414":36837,"44449":36845,"44450":36843,"44451":36836,"44452":36840,"44453":37066,"44454":37070,"44455":37057,"44456":37059,"44457":37195,"44458":37194,"44459":37325,"44460":38274,"44461":38480,"44462":38475,"44463":38476,"44464":38477,"44465":38754,"44466":38761,"44467":38859,"44468":38893,"44469":38899,"44470":38913,"44471":39080,"44472":39131,"44473":39135,"44474":39318,"44475":39321,"44476":20056,"44477":20147,"44478":20492,"44479":20493,"44480":20515,"44481":20463,"44482":20518,"44483":20517,"44484":20472,"44485":20521,"44486":20502,"44487":20486,"44488":20540,"44489":20511,"44490":20506,"44491":20498,"44492":20497,"44493":20474,"44494":20480,"44495":20500,"44496":20520,"44497":20465,"44498":20513,"44499":20491,"44500":20505,"44501":20504,"44502":20467,"44503":20462,"44504":20525,"44505":20522,"44506":20478,"44507":20523,"44508":20489,"44509":20860,"44510":20900,"44511":20901,"44512":20898,"44513":20941,"44514":20940,"44515":20934,"44516":20939,"44517":21078,"44518":21084,"44519":21076,"44520":21083,"44521":21085,"44522":21290,"44523":21375,"44524":21407,"44525":21405,"44526":21471,"44527":21736,"44528":21776,"44529":21761,"44530":21815,"44531":21756,"44532":21733,"44533":21746,"44534":21766,"44535":21754,"44536":21780,"44537":21737,"44538":21741,"44539":21729,"44540":21769,"44541":21742,"44542":21738,"44608":21734,"44609":21799,"44610":21767,"44611":21757,"44612":21775,"44613":22275,"44614":22276,"44615":22466,"44616":22484,"44617":22475,"44618":22467,"44619":22537,"44620":22799,"44621":22871,"44622":22872,"44623":22874,"44624":23057,"44625":23064,"44626":23068,"44627":23071,"44628":23067,"44629":23059,"44630":23020,"44631":23072,"44632":23075,"44633":23081,"44634":23077,"44635":23052,"44636":23049,"44637":23403,"44638":23640,"44639":23472,"44640":23475,"44641":23478,"44642":23476,"44643":23470,"44644":23477,"44645":23481,"44646":23480,"44647":23556,"44648":23633,"44649":23637,"44650":23632,"44651":23789,"44652":23805,"44653":23803,"44654":23786,"44655":23784,"44656":23792,"44657":23798,"44658":23809,"44659":23796,"44660":24046,"44661":24109,"44662":24107,"44663":24235,"44664":24237,"44665":24231,"44666":24369,"44667":24466,"44668":24465,"44669":24464,"44670":24665,"44705":24675,"44706":24677,"44707":24656,"44708":24661,"44709":24685,"44710":24681,"44711":24687,"44712":24708,"44713":24735,"44714":24730,"44715":24717,"44716":24724,"44717":24716,"44718":24709,"44719":24726,"44720":25159,"44721":25331,"44722":25352,"44723":25343,"44724":25422,"44725":25406,"44726":25391,"44727":25429,"44728":25410,"44729":25414,"44730":25423,"44731":25417,"44732":25402,"44733":25424,"44734":25405,"44735":25386,"44736":25387,"44737":25384,"44738":25421,"44739":25420,"44740":25928,"44741":25929,"44742":26009,"44743":26049,"44744":26053,"44745":26178,"44746":26185,"44747":26191,"44748":26179,"44749":26194,"44750":26188,"44751":26181,"44752":26177,"44753":26360,"44754":26388,"44755":26389,"44756":26391,"44757":26657,"44758":26680,"44759":26696,"44760":26694,"44761":26707,"44762":26681,"44763":26690,"44764":26708,"44765":26665,"44766":26803,"44767":26647,"44768":26700,"44769":26705,"44770":26685,"44771":26612,"44772":26704,"44773":26688,"44774":26684,"44775":26691,"44776":26666,"44777":26693,"44778":26643,"44779":26648,"44780":26689,"44781":27530,"44782":27529,"44783":27575,"44784":27683,"44785":27687,"44786":27688,"44787":27686,"44788":27684,"44789":27888,"44790":28010,"44791":28053,"44792":28040,"44793":28039,"44794":28006,"44795":28024,"44796":28023,"44797":27993,"44798":28051,"44864":28012,"44865":28041,"44866":28014,"44867":27994,"44868":28020,"44869":28009,"44870":28044,"44871":28042,"44872":28025,"44873":28037,"44874":28005,"44875":28052,"44876":28874,"44877":28888,"44878":28900,"44879":28889,"44880":28872,"44881":28879,"44882":29241,"44883":29305,"44884":29436,"44885":29433,"44886":29437,"44887":29432,"44888":29431,"44889":29574,"44890":29677,"44891":29705,"44892":29678,"44893":29664,"44894":29674,"44895":29662,"44896":30036,"44897":30045,"44898":30044,"44899":30042,"44900":30041,"44901":30142,"44902":30149,"44903":30151,"44904":30130,"44905":30131,"44906":30141,"44907":30140,"44908":30137,"44909":30146,"44910":30136,"44911":30347,"44912":30384,"44913":30410,"44914":30413,"44915":30414,"44916":30505,"44917":30495,"44918":30496,"44919":30504,"44920":30697,"44921":30768,"44922":30759,"44923":30776,"44924":30749,"44925":30772,"44926":30775,"44961":30757,"44962":30765,"44963":30752,"44964":30751,"44965":30770,"44966":31061,"44967":31056,"44968":31072,"44969":31071,"44970":31062,"44971":31070,"44972":31069,"44973":31063,"44974":31066,"44975":31204,"44976":31203,"44977":31207,"44978":31199,"44979":31206,"44980":31209,"44981":31192,"44982":31364,"44983":31368,"44984":31449,"44985":31494,"44986":31505,"44987":31881,"44988":32033,"44989":32023,"44990":32011,"44991":32010,"44992":32032,"44993":32034,"44994":32020,"44995":32016,"44996":32021,"44997":32026,"44998":32028,"44999":32013,"45000":32025,"45001":32027,"45002":32570,"45003":32607,"45004":32660,"45005":32709,"45006":32705,"45007":32774,"45008":32792,"45009":32789,"45010":32793,"45011":32791,"45012":32829,"45013":32831,"45014":33009,"45015":33026,"45016":33008,"45017":33029,"45018":33005,"45019":33012,"45020":33030,"45021":33016,"45022":33011,"45023":33032,"45024":33021,"45025":33034,"45026":33020,"45027":33007,"45028":33261,"45029":33260,"45030":33280,"45031":33296,"45032":33322,"45033":33323,"45034":33320,"45035":33324,"45036":33467,"45037":33579,"45038":33618,"45039":33620,"45040":33610,"45041":33592,"45042":33616,"45043":33609,"45044":33589,"45045":33588,"45046":33615,"45047":33586,"45048":33593,"45049":33590,"45050":33559,"45051":33600,"45052":33585,"45053":33576,"45054":33603,"45120":34388,"45121":34442,"45122":34474,"45123":34451,"45124":34468,"45125":34473,"45126":34444,"45127":34467,"45128":34460,"45129":34928,"45130":34935,"45131":34945,"45132":34946,"45133":34941,"45134":34937,"45135":35352,"45136":35344,"45137":35342,"45138":35340,"45139":35349,"45140":35338,"45141":35351,"45142":35347,"45143":35350,"45144":35343,"45145":35345,"45146":35912,"45147":35962,"45148":35961,"45149":36001,"45150":36002,"45151":36215,"45152":36524,"45153":36562,"45154":36564,"45155":36559,"45156":36785,"45157":36865,"45158":36870,"45159":36855,"45160":36864,"45161":36858,"45162":36852,"45163":36867,"45164":36861,"45165":36869,"45166":36856,"45167":37013,"45168":37089,"45169":37085,"45170":37090,"45171":37202,"45172":37197,"45173":37196,"45174":37336,"45175":37341,"45176":37335,"45177":37340,"45178":37337,"45179":38275,"45180":38498,"45181":38499,"45182":38497,"45217":38491,"45218":38493,"45219":38500,"45220":38488,"45221":38494,"45222":38587,"45223":39138,"45224":39340,"45225":39592,"45226":39640,"45227":39717,"45228":39730,"45229":39740,"45230":20094,"45231":20602,"45232":20605,"45233":20572,"45234":20551,"45235":20547,"45236":20556,"45237":20570,"45238":20553,"45239":20581,"45240":20598,"45241":20558,"45242":20565,"45243":20597,"45244":20596,"45245":20599,"45246":20559,"45247":20495,"45248":20591,"45249":20589,"45250":20828,"45251":20885,"45252":20976,"45253":21098,"45254":21103,"45255":21202,"45256":21209,"45257":21208,"45258":21205,"45259":21264,"45260":21263,"45261":21273,"45262":21311,"45263":21312,"45264":21310,"45265":21443,"45266":26364,"45267":21830,"45268":21866,"45269":21862,"45270":21828,"45271":21854,"45272":21857,"45273":21827,"45274":21834,"45275":21809,"45276":21846,"45277":21839,"45278":21845,"45279":21807,"45280":21860,"45281":21816,"45282":21806,"45283":21852,"45284":21804,"45285":21859,"45286":21811,"45287":21825,"45288":21847,"45289":22280,"45290":22283,"45291":22281,"45292":22495,"45293":22533,"45294":22538,"45295":22534,"45296":22496,"45297":22500,"45298":22522,"45299":22530,"45300":22581,"45301":22519,"45302":22521,"45303":22816,"45304":22882,"45305":23094,"45306":23105,"45307":23113,"45308":23142,"45309":23146,"45310":23104,"45376":23100,"45377":23138,"45378":23130,"45379":23110,"45380":23114,"45381":23408,"45382":23495,"45383":23493,"45384":23492,"45385":23490,"45386":23487,"45387":23494,"45388":23561,"45389":23560,"45390":23559,"45391":23648,"45392":23644,"45393":23645,"45394":23815,"45395":23814,"45396":23822,"45397":23835,"45398":23830,"45399":23842,"45400":23825,"45401":23849,"45402":23828,"45403":23833,"45404":23844,"45405":23847,"45406":23831,"45407":24034,"45408":24120,"45409":24118,"45410":24115,"45411":24119,"45412":24247,"45413":24248,"45414":24246,"45415":24245,"45416":24254,"45417":24373,"45418":24375,"45419":24407,"45420":24428,"45421":24425,"45422":24427,"45423":24471,"45424":24473,"45425":24478,"45426":24472,"45427":24481,"45428":24480,"45429":24476,"45430":24703,"45431":24739,"45432":24713,"45433":24736,"45434":24744,"45435":24779,"45436":24756,"45437":24806,"45438":24765,"45473":24773,"45474":24763,"45475":24757,"45476":24796,"45477":24764,"45478":24792,"45479":24789,"45480":24774,"45481":24799,"45482":24760,"45483":24794,"45484":24775,"45485":25114,"45486":25115,"45487":25160,"45488":25504,"45489":25511,"45490":25458,"45491":25494,"45492":25506,"45493":25509,"45494":25463,"45495":25447,"45496":25496,"45497":25514,"45498":25457,"45499":25513,"45500":25481,"45501":25475,"45502":25499,"45503":25451,"45504":25512,"45505":25476,"45506":25480,"45507":25497,"45508":25505,"45509":25516,"45510":25490,"45511":25487,"45512":25472,"45513":25467,"45514":25449,"45515":25448,"45516":25466,"45517":25949,"45518":25942,"45519":25937,"45520":25945,"45521":25943,"45522":21855,"45523":25935,"45524":25944,"45525":25941,"45526":25940,"45527":26012,"45528":26011,"45529":26028,"45530":26063,"45531":26059,"45532":26060,"45533":26062,"45534":26205,"45535":26202,"45536":26212,"45537":26216,"45538":26214,"45539":26206,"45540":26361,"45541":21207,"45542":26395,"45543":26753,"45544":26799,"45545":26786,"45546":26771,"45547":26805,"45548":26751,"45549":26742,"45550":26801,"45551":26791,"45552":26775,"45553":26800,"45554":26755,"45555":26820,"45556":26797,"45557":26758,"45558":26757,"45559":26772,"45560":26781,"45561":26792,"45562":26783,"45563":26785,"45564":26754,"45565":27442,"45566":27578,"45632":27627,"45633":27628,"45634":27691,"45635":28046,"45636":28092,"45637":28147,"45638":28121,"45639":28082,"45640":28129,"45641":28108,"45642":28132,"45643":28155,"45644":28154,"45645":28165,"45646":28103,"45647":28107,"45648":28079,"45649":28113,"45650":28078,"45651":28126,"45652":28153,"45653":28088,"45654":28151,"45655":28149,"45656":28101,"45657":28114,"45658":28186,"45659":28085,"45660":28122,"45661":28139,"45662":28120,"45663":28138,"45664":28145,"45665":28142,"45666":28136,"45667":28102,"45668":28100,"45669":28074,"45670":28140,"45671":28095,"45672":28134,"45673":28921,"45674":28937,"45675":28938,"45676":28925,"45677":28911,"45678":29245,"45679":29309,"45680":29313,"45681":29468,"45682":29467,"45683":29462,"45684":29459,"45685":29465,"45686":29575,"45687":29701,"45688":29706,"45689":29699,"45690":29702,"45691":29694,"45692":29709,"45693":29920,"45694":29942,"45729":29943,"45730":29980,"45731":29986,"45732":30053,"45733":30054,"45734":30050,"45735":30064,"45736":30095,"45737":30164,"45738":30165,"45739":30133,"45740":30154,"45741":30157,"45742":30350,"45743":30420,"45744":30418,"45745":30427,"45746":30519,"45747":30526,"45748":30524,"45749":30518,"45750":30520,"45751":30522,"45752":30827,"45753":30787,"45754":30798,"45755":31077,"45756":31080,"45757":31085,"45758":31227,"45759":31378,"45760":31381,"45761":31520,"45762":31528,"45763":31515,"45764":31532,"45765":31526,"45766":31513,"45767":31518,"45768":31534,"45769":31890,"45770":31895,"45771":31893,"45772":32070,"45773":32067,"45774":32113,"45775":32046,"45776":32057,"45777":32060,"45778":32064,"45779":32048,"45780":32051,"45781":32068,"45782":32047,"45783":32066,"45784":32050,"45785":32049,"45786":32573,"45787":32670,"45788":32666,"45789":32716,"45790":32718,"45791":32722,"45792":32796,"45793":32842,"45794":32838,"45795":33071,"45796":33046,"45797":33059,"45798":33067,"45799":33065,"45800":33072,"45801":33060,"45802":33282,"45803":33333,"45804":33335,"45805":33334,"45806":33337,"45807":33678,"45808":33694,"45809":33688,"45810":33656,"45811":33698,"45812":33686,"45813":33725,"45814":33707,"45815":33682,"45816":33674,"45817":33683,"45818":33673,"45819":33696,"45820":33655,"45821":33659,"45822":33660,"45888":33670,"45889":33703,"45890":34389,"45891":24426,"45892":34503,"45893":34496,"45894":34486,"45895":34500,"45896":34485,"45897":34502,"45898":34507,"45899":34481,"45900":34479,"45901":34505,"45902":34899,"45903":34974,"45904":34952,"45905":34987,"45906":34962,"45907":34966,"45908":34957,"45909":34955,"45910":35219,"45911":35215,"45912":35370,"45913":35357,"45914":35363,"45915":35365,"45916":35377,"45917":35373,"45918":35359,"45919":35355,"45920":35362,"45921":35913,"45922":35930,"45923":36009,"45924":36012,"45925":36011,"45926":36008,"45927":36010,"45928":36007,"45929":36199,"45930":36198,"45931":36286,"45932":36282,"45933":36571,"45934":36575,"45935":36889,"45936":36877,"45937":36890,"45938":36887,"45939":36899,"45940":36895,"45941":36893,"45942":36880,"45943":36885,"45944":36894,"45945":36896,"45946":36879,"45947":36898,"45948":36886,"45949":36891,"45950":36884,"45985":37096,"45986":37101,"45987":37117,"45988":37207,"45989":37326,"45990":37365,"45991":37350,"45992":37347,"45993":37351,"45994":37357,"45995":37353,"45996":38281,"45997":38506,"45998":38517,"45999":38515,"46000":38520,"46001":38512,"46002":38516,"46003":38518,"46004":38519,"46005":38508,"46006":38592,"46007":38634,"46008":38633,"46009":31456,"46010":31455,"46011":38914,"46012":38915,"46013":39770,"46014":40165,"46015":40565,"46016":40575,"46017":40613,"46018":40635,"46019":20642,"46020":20621,"46021":20613,"46022":20633,"46023":20625,"46024":20608,"46025":20630,"46026":20632,"46027":20634,"46028":26368,"46029":20977,"46030":21106,"46031":21108,"46032":21109,"46033":21097,"46034":21214,"46035":21213,"46036":21211,"46037":21338,"46038":21413,"46039":21883,"46040":21888,"46041":21927,"46042":21884,"46043":21898,"46044":21917,"46045":21912,"46046":21890,"46047":21916,"46048":21930,"46049":21908,"46050":21895,"46051":21899,"46052":21891,"46053":21939,"46054":21934,"46055":21919,"46056":21822,"46057":21938,"46058":21914,"46059":21947,"46060":21932,"46061":21937,"46062":21886,"46063":21897,"46064":21931,"46065":21913,"46066":22285,"46067":22575,"46068":22570,"46069":22580,"46070":22564,"46071":22576,"46072":22577,"46073":22561,"46074":22557,"46075":22560,"46076":22777,"46077":22778,"46078":22880,"46144":23159,"46145":23194,"46146":23167,"46147":23186,"46148":23195,"46149":23207,"46150":23411,"46151":23409,"46152":23506,"46153":23500,"46154":23507,"46155":23504,"46156":23562,"46157":23563,"46158":23601,"46159":23884,"46160":23888,"46161":23860,"46162":23879,"46163":24061,"46164":24133,"46165":24125,"46166":24128,"46167":24131,"46168":24190,"46169":24266,"46170":24257,"46171":24258,"46172":24260,"46173":24380,"46174":24429,"46175":24489,"46176":24490,"46177":24488,"46178":24785,"46179":24801,"46180":24754,"46181":24758,"46182":24800,"46183":24860,"46184":24867,"46185":24826,"46186":24853,"46187":24816,"46188":24827,"46189":24820,"46190":24936,"46191":24817,"46192":24846,"46193":24822,"46194":24841,"46195":24832,"46196":24850,"46197":25119,"46198":25161,"46199":25507,"46200":25484,"46201":25551,"46202":25536,"46203":25577,"46204":25545,"46205":25542,"46206":25549,"46241":25554,"46242":25571,"46243":25552,"46244":25569,"46245":25558,"46246":25581,"46247":25582,"46248":25462,"46249":25588,"46250":25578,"46251":25563,"46252":25682,"46253":25562,"46254":25593,"46255":25950,"46256":25958,"46257":25954,"46258":25955,"46259":26001,"46260":26000,"46261":26031,"46262":26222,"46263":26224,"46264":26228,"46265":26230,"46266":26223,"46267":26257,"46268":26234,"46269":26238,"46270":26231,"46271":26366,"46272":26367,"46273":26399,"46274":26397,"46275":26874,"46276":26837,"46277":26848,"46278":26840,"46279":26839,"46280":26885,"46281":26847,"46282":26869,"46283":26862,"46284":26855,"46285":26873,"46286":26834,"46287":26866,"46288":26851,"46289":26827,"46290":26829,"46291":26893,"46292":26898,"46293":26894,"46294":26825,"46295":26842,"46296":26990,"46297":26875,"46298":27454,"46299":27450,"46300":27453,"46301":27544,"46302":27542,"46303":27580,"46304":27631,"46305":27694,"46306":27695,"46307":27692,"46308":28207,"46309":28216,"46310":28244,"46311":28193,"46312":28210,"46313":28263,"46314":28234,"46315":28192,"46316":28197,"46317":28195,"46318":28187,"46319":28251,"46320":28248,"46321":28196,"46322":28246,"46323":28270,"46324":28205,"46325":28198,"46326":28271,"46327":28212,"46328":28237,"46329":28218,"46330":28204,"46331":28227,"46332":28189,"46333":28222,"46334":28363,"46400":28297,"46401":28185,"46402":28238,"46403":28259,"46404":28228,"46405":28274,"46406":28265,"46407":28255,"46408":28953,"46409":28954,"46410":28966,"46411":28976,"46412":28961,"46413":28982,"46414":29038,"46415":28956,"46416":29260,"46417":29316,"46418":29312,"46419":29494,"46420":29477,"46421":29492,"46422":29481,"46423":29754,"46424":29738,"46425":29747,"46426":29730,"46427":29733,"46428":29749,"46429":29750,"46430":29748,"46431":29743,"46432":29723,"46433":29734,"46434":29736,"46435":29989,"46436":29990,"46437":30059,"46438":30058,"46439":30178,"46440":30171,"46441":30179,"46442":30169,"46443":30168,"46444":30174,"46445":30176,"46446":30331,"46447":30332,"46448":30358,"46449":30355,"46450":30388,"46451":30428,"46452":30543,"46453":30701,"46454":30813,"46455":30828,"46456":30831,"46457":31245,"46458":31240,"46459":31243,"46460":31237,"46461":31232,"46462":31384,"46497":31383,"46498":31382,"46499":31461,"46500":31459,"46501":31561,"46502":31574,"46503":31558,"46504":31568,"46505":31570,"46506":31572,"46507":31565,"46508":31563,"46509":31567,"46510":31569,"46511":31903,"46512":31909,"46513":32094,"46514":32080,"46515":32104,"46516":32085,"46517":32043,"46518":32110,"46519":32114,"46520":32097,"46521":32102,"46522":32098,"46523":32112,"46524":32115,"46525":21892,"46526":32724,"46527":32725,"46528":32779,"46529":32850,"46530":32901,"46531":33109,"46532":33108,"46533":33099,"46534":33105,"46535":33102,"46536":33081,"46537":33094,"46538":33086,"46539":33100,"46540":33107,"46541":33140,"46542":33298,"46543":33308,"46544":33769,"46545":33795,"46546":33784,"46547":33805,"46548":33760,"46549":33733,"46550":33803,"46551":33729,"46552":33775,"46553":33777,"46554":33780,"46555":33879,"46556":33802,"46557":33776,"46558":33804,"46559":33740,"46560":33789,"46561":33778,"46562":33738,"46563":33848,"46564":33806,"46565":33796,"46566":33756,"46567":33799,"46568":33748,"46569":33759,"46570":34395,"46571":34527,"46572":34521,"46573":34541,"46574":34516,"46575":34523,"46576":34532,"46577":34512,"46578":34526,"46579":34903,"46580":35009,"46581":35010,"46582":34993,"46583":35203,"46584":35222,"46585":35387,"46586":35424,"46587":35413,"46588":35422,"46589":35388,"46590":35393,"46656":35412,"46657":35419,"46658":35408,"46659":35398,"46660":35380,"46661":35386,"46662":35382,"46663":35414,"46664":35937,"46665":35970,"46666":36015,"46667":36028,"46668":36019,"46669":36029,"46670":36033,"46671":36027,"46672":36032,"46673":36020,"46674":36023,"46675":36022,"46676":36031,"46677":36024,"46678":36234,"46679":36229,"46680":36225,"46681":36302,"46682":36317,"46683":36299,"46684":36314,"46685":36305,"46686":36300,"46687":36315,"46688":36294,"46689":36603,"46690":36600,"46691":36604,"46692":36764,"46693":36910,"46694":36917,"46695":36913,"46696":36920,"46697":36914,"46698":36918,"46699":37122,"46700":37109,"46701":37129,"46702":37118,"46703":37219,"46704":37221,"46705":37327,"46706":37396,"46707":37397,"46708":37411,"46709":37385,"46710":37406,"46711":37389,"46712":37392,"46713":37383,"46714":37393,"46715":38292,"46716":38287,"46717":38283,"46718":38289,"46753":38291,"46754":38290,"46755":38286,"46756":38538,"46757":38542,"46758":38539,"46759":38525,"46760":38533,"46761":38534,"46762":38541,"46763":38514,"46764":38532,"46765":38593,"46766":38597,"46767":38596,"46768":38598,"46769":38599,"46770":38639,"46771":38642,"46772":38860,"46773":38917,"46774":38918,"46775":38920,"46776":39143,"46777":39146,"46778":39151,"46779":39145,"46780":39154,"46781":39149,"46782":39342,"46783":39341,"46784":40643,"46785":40653,"46786":40657,"46787":20098,"46788":20653,"46789":20661,"46790":20658,"46791":20659,"46792":20677,"46793":20670,"46794":20652,"46795":20663,"46796":20667,"46797":20655,"46798":20679,"46799":21119,"46800":21111,"46801":21117,"46802":21215,"46803":21222,"46804":21220,"46805":21218,"46806":21219,"46807":21295,"46808":21983,"46809":21992,"46810":21971,"46811":21990,"46812":21966,"46813":21980,"46814":21959,"46815":21969,"46816":21987,"46817":21988,"46818":21999,"46819":21978,"46820":21985,"46821":21957,"46822":21958,"46823":21989,"46824":21961,"46825":22290,"46826":22291,"46827":22622,"46828":22609,"46829":22616,"46830":22615,"46831":22618,"46832":22612,"46833":22635,"46834":22604,"46835":22637,"46836":22602,"46837":22626,"46838":22610,"46839":22603,"46840":22887,"46841":23233,"46842":23241,"46843":23244,"46844":23230,"46845":23229,"46846":23228,"46912":23219,"46913":23234,"46914":23218,"46915":23913,"46916":23919,"46917":24140,"46918":24185,"46919":24265,"46920":24264,"46921":24338,"46922":24409,"46923":24492,"46924":24494,"46925":24858,"46926":24847,"46927":24904,"46928":24863,"46929":24819,"46930":24859,"46931":24825,"46932":24833,"46933":24840,"46934":24910,"46935":24908,"46936":24900,"46937":24909,"46938":24894,"46939":24884,"46940":24871,"46941":24845,"46942":24838,"46943":24887,"46944":25121,"46945":25122,"46946":25619,"46947":25662,"46948":25630,"46949":25642,"46950":25645,"46951":25661,"46952":25644,"46953":25615,"46954":25628,"46955":25620,"46956":25613,"46957":25654,"46958":25622,"46959":25623,"46960":25606,"46961":25964,"46962":26015,"46963":26032,"46964":26263,"46965":26249,"46966":26247,"46967":26248,"46968":26262,"46969":26244,"46970":26264,"46971":26253,"46972":26371,"46973":27028,"46974":26989,"47009":26970,"47010":26999,"47011":26976,"47012":26964,"47013":26997,"47014":26928,"47015":27010,"47016":26954,"47017":26984,"47018":26987,"47019":26974,"47020":26963,"47021":27001,"47022":27014,"47023":26973,"47024":26979,"47025":26971,"47026":27463,"47027":27506,"47028":27584,"47029":27583,"47030":27603,"47031":27645,"47032":28322,"47033":28335,"47034":28371,"47035":28342,"47036":28354,"47037":28304,"47038":28317,"47039":28359,"47040":28357,"47041":28325,"47042":28312,"47043":28348,"47044":28346,"47045":28331,"47046":28369,"47047":28310,"47048":28316,"47049":28356,"47050":28372,"47051":28330,"47052":28327,"47053":28340,"47054":29006,"47055":29017,"47056":29033,"47057":29028,"47058":29001,"47059":29031,"47060":29020,"47061":29036,"47062":29030,"47063":29004,"47064":29029,"47065":29022,"47066":28998,"47067":29032,"47068":29014,"47069":29242,"47070":29266,"47071":29495,"47072":29509,"47073":29503,"47074":29502,"47075":29807,"47076":29786,"47077":29781,"47078":29791,"47079":29790,"47080":29761,"47081":29759,"47082":29785,"47083":29787,"47084":29788,"47085":30070,"47086":30072,"47087":30208,"47088":30192,"47089":30209,"47090":30194,"47091":30193,"47092":30202,"47093":30207,"47094":30196,"47095":30195,"47096":30430,"47097":30431,"47098":30555,"47099":30571,"47100":30566,"47101":30558,"47102":30563,"47168":30585,"47169":30570,"47170":30572,"47171":30556,"47172":30565,"47173":30568,"47174":30562,"47175":30702,"47176":30862,"47177":30896,"47178":30871,"47179":30872,"47180":30860,"47181":30857,"47182":30844,"47183":30865,"47184":30867,"47185":30847,"47186":31098,"47187":31103,"47188":31105,"47189":33836,"47190":31165,"47191":31260,"47192":31258,"47193":31264,"47194":31252,"47195":31263,"47196":31262,"47197":31391,"47198":31392,"47199":31607,"47200":31680,"47201":31584,"47202":31598,"47203":31591,"47204":31921,"47205":31923,"47206":31925,"47207":32147,"47208":32121,"47209":32145,"47210":32129,"47211":32143,"47212":32091,"47213":32622,"47214":32617,"47215":32618,"47216":32626,"47217":32681,"47218":32680,"47219":32676,"47220":32854,"47221":32856,"47222":32902,"47223":32900,"47224":33137,"47225":33136,"47226":33144,"47227":33125,"47228":33134,"47229":33139,"47230":33131,"47265":33145,"47266":33146,"47267":33126,"47268":33285,"47269":33351,"47270":33922,"47271":33911,"47272":33853,"47273":33841,"47274":33909,"47275":33894,"47276":33899,"47277":33865,"47278":33900,"47279":33883,"47280":33852,"47281":33845,"47282":33889,"47283":33891,"47284":33897,"47285":33901,"47286":33862,"47287":34398,"47288":34396,"47289":34399,"47290":34553,"47291":34579,"47292":34568,"47293":34567,"47294":34560,"47295":34558,"47296":34555,"47297":34562,"47298":34563,"47299":34566,"47300":34570,"47301":34905,"47302":35039,"47303":35028,"47304":35033,"47305":35036,"47306":35032,"47307":35037,"47308":35041,"47309":35018,"47310":35029,"47311":35026,"47312":35228,"47313":35299,"47314":35435,"47315":35442,"47316":35443,"47317":35430,"47318":35433,"47319":35440,"47320":35463,"47321":35452,"47322":35427,"47323":35488,"47324":35441,"47325":35461,"47326":35437,"47327":35426,"47328":35438,"47329":35436,"47330":35449,"47331":35451,"47332":35390,"47333":35432,"47334":35938,"47335":35978,"47336":35977,"47337":36042,"47338":36039,"47339":36040,"47340":36036,"47341":36018,"47342":36035,"47343":36034,"47344":36037,"47345":36321,"47346":36319,"47347":36328,"47348":36335,"47349":36339,"47350":36346,"47351":36330,"47352":36324,"47353":36326,"47354":36530,"47355":36611,"47356":36617,"47357":36606,"47358":36618,"47424":36767,"47425":36786,"47426":36939,"47427":36938,"47428":36947,"47429":36930,"47430":36948,"47431":36924,"47432":36949,"47433":36944,"47434":36935,"47435":36943,"47436":36942,"47437":36941,"47438":36945,"47439":36926,"47440":36929,"47441":37138,"47442":37143,"47443":37228,"47444":37226,"47445":37225,"47446":37321,"47447":37431,"47448":37463,"47449":37432,"47450":37437,"47451":37440,"47452":37438,"47453":37467,"47454":37451,"47455":37476,"47456":37457,"47457":37428,"47458":37449,"47459":37453,"47460":37445,"47461":37433,"47462":37439,"47463":37466,"47464":38296,"47465":38552,"47466":38548,"47467":38549,"47468":38605,"47469":38603,"47470":38601,"47471":38602,"47472":38647,"47473":38651,"47474":38649,"47475":38646,"47476":38742,"47477":38772,"47478":38774,"47479":38928,"47480":38929,"47481":38931,"47482":38922,"47483":38930,"47484":38924,"47485":39164,"47486":39156,"47521":39165,"47522":39166,"47523":39347,"47524":39345,"47525":39348,"47526":39649,"47527":40169,"47528":40578,"47529":40718,"47530":40723,"47531":40736,"47532":20711,"47533":20718,"47534":20709,"47535":20694,"47536":20717,"47537":20698,"47538":20693,"47539":20687,"47540":20689,"47541":20721,"47542":20686,"47543":20713,"47544":20834,"47545":20979,"47546":21123,"47547":21122,"47548":21297,"47549":21421,"47550":22014,"47551":22016,"47552":22043,"47553":22039,"47554":22013,"47555":22036,"47556":22022,"47557":22025,"47558":22029,"47559":22030,"47560":22007,"47561":22038,"47562":22047,"47563":22024,"47564":22032,"47565":22006,"47566":22296,"47567":22294,"47568":22645,"47569":22654,"47570":22659,"47571":22675,"47572":22666,"47573":22649,"47574":22661,"47575":22653,"47576":22781,"47577":22821,"47578":22818,"47579":22820,"47580":22890,"47581":22889,"47582":23265,"47583":23270,"47584":23273,"47585":23255,"47586":23254,"47587":23256,"47588":23267,"47589":23413,"47590":23518,"47591":23527,"47592":23521,"47593":23525,"47594":23526,"47595":23528,"47596":23522,"47597":23524,"47598":23519,"47599":23565,"47600":23650,"47601":23940,"47602":23943,"47603":24155,"47604":24163,"47605":24149,"47606":24151,"47607":24148,"47608":24275,"47609":24278,"47610":24330,"47611":24390,"47612":24432,"47613":24505,"47614":24903,"47680":24895,"47681":24907,"47682":24951,"47683":24930,"47684":24931,"47685":24927,"47686":24922,"47687":24920,"47688":24949,"47689":25130,"47690":25735,"47691":25688,"47692":25684,"47693":25764,"47694":25720,"47695":25695,"47696":25722,"47697":25681,"47698":25703,"47699":25652,"47700":25709,"47701":25723,"47702":25970,"47703":26017,"47704":26071,"47705":26070,"47706":26274,"47707":26280,"47708":26269,"47709":27036,"47710":27048,"47711":27029,"47712":27073,"47713":27054,"47714":27091,"47715":27083,"47716":27035,"47717":27063,"47718":27067,"47719":27051,"47720":27060,"47721":27088,"47722":27085,"47723":27053,"47724":27084,"47725":27046,"47726":27075,"47727":27043,"47728":27465,"47729":27468,"47730":27699,"47731":28467,"47732":28436,"47733":28414,"47734":28435,"47735":28404,"47736":28457,"47737":28478,"47738":28448,"47739":28460,"47740":28431,"47741":28418,"47742":28450,"47777":28415,"47778":28399,"47779":28422,"47780":28465,"47781":28472,"47782":28466,"47783":28451,"47784":28437,"47785":28459,"47786":28463,"47787":28552,"47788":28458,"47789":28396,"47790":28417,"47791":28402,"47792":28364,"47793":28407,"47794":29076,"47795":29081,"47796":29053,"47797":29066,"47798":29060,"47799":29074,"47800":29246,"47801":29330,"47802":29334,"47803":29508,"47804":29520,"47805":29796,"47806":29795,"47807":29802,"47808":29808,"47809":29805,"47810":29956,"47811":30097,"47812":30247,"47813":30221,"47814":30219,"47815":30217,"47816":30227,"47817":30433,"47818":30435,"47819":30596,"47820":30589,"47821":30591,"47822":30561,"47823":30913,"47824":30879,"47825":30887,"47826":30899,"47827":30889,"47828":30883,"47829":31118,"47830":31119,"47831":31117,"47832":31278,"47833":31281,"47834":31402,"47835":31401,"47836":31469,"47837":31471,"47838":31649,"47839":31637,"47840":31627,"47841":31605,"47842":31639,"47843":31645,"47844":31636,"47845":31631,"47846":31672,"47847":31623,"47848":31620,"47849":31929,"47850":31933,"47851":31934,"47852":32187,"47853":32176,"47854":32156,"47855":32189,"47856":32190,"47857":32160,"47858":32202,"47859":32180,"47860":32178,"47861":32177,"47862":32186,"47863":32162,"47864":32191,"47865":32181,"47866":32184,"47867":32173,"47868":32210,"47869":32199,"47870":32172,"47936":32624,"47937":32736,"47938":32737,"47939":32735,"47940":32862,"47941":32858,"47942":32903,"47943":33104,"47944":33152,"47945":33167,"47946":33160,"47947":33162,"47948":33151,"47949":33154,"47950":33255,"47951":33274,"47952":33287,"47953":33300,"47954":33310,"47955":33355,"47956":33993,"47957":33983,"47958":33990,"47959":33988,"47960":33945,"47961":33950,"47962":33970,"47963":33948,"47964":33995,"47965":33976,"47966":33984,"47967":34003,"47968":33936,"47969":33980,"47970":34001,"47971":33994,"47972":34623,"47973":34588,"47974":34619,"47975":34594,"47976":34597,"47977":34612,"47978":34584,"47979":34645,"47980":34615,"47981":34601,"47982":35059,"47983":35074,"47984":35060,"47985":35065,"47986":35064,"47987":35069,"47988":35048,"47989":35098,"47990":35055,"47991":35494,"47992":35468,"47993":35486,"47994":35491,"47995":35469,"47996":35489,"47997":35475,"47998":35492,"48033":35498,"48034":35493,"48035":35496,"48036":35480,"48037":35473,"48038":35482,"48039":35495,"48040":35946,"48041":35981,"48042":35980,"48043":36051,"48044":36049,"48045":36050,"48046":36203,"48047":36249,"48048":36245,"48049":36348,"48050":36628,"48051":36626,"48052":36629,"48053":36627,"48054":36771,"48055":36960,"48056":36952,"48057":36956,"48058":36963,"48059":36953,"48060":36958,"48061":36962,"48062":36957,"48063":36955,"48064":37145,"48065":37144,"48066":37150,"48067":37237,"48068":37240,"48069":37239,"48070":37236,"48071":37496,"48072":37504,"48073":37509,"48074":37528,"48075":37526,"48076":37499,"48077":37523,"48078":37532,"48079":37544,"48080":37500,"48081":37521,"48082":38305,"48083":38312,"48084":38313,"48085":38307,"48086":38309,"48087":38308,"48088":38553,"48089":38556,"48090":38555,"48091":38604,"48092":38610,"48093":38656,"48094":38780,"48095":38789,"48096":38902,"48097":38935,"48098":38936,"48099":39087,"48100":39089,"48101":39171,"48102":39173,"48103":39180,"48104":39177,"48105":39361,"48106":39599,"48107":39600,"48108":39654,"48109":39745,"48110":39746,"48111":40180,"48112":40182,"48113":40179,"48114":40636,"48115":40763,"48116":40778,"48117":20740,"48118":20736,"48119":20731,"48120":20725,"48121":20729,"48122":20738,"48123":20744,"48124":20745,"48125":20741,"48126":20956,"48192":21127,"48193":21128,"48194":21129,"48195":21133,"48196":21130,"48197":21232,"48198":21426,"48199":22062,"48200":22075,"48201":22073,"48202":22066,"48203":22079,"48204":22068,"48205":22057,"48206":22099,"48207":22094,"48208":22103,"48209":22132,"48210":22070,"48211":22063,"48212":22064,"48213":22656,"48214":22687,"48215":22686,"48216":22707,"48217":22684,"48218":22702,"48219":22697,"48220":22694,"48221":22893,"48222":23305,"48223":23291,"48224":23307,"48225":23285,"48226":23308,"48227":23304,"48228":23534,"48229":23532,"48230":23529,"48231":23531,"48232":23652,"48233":23653,"48234":23965,"48235":23956,"48236":24162,"48237":24159,"48238":24161,"48239":24290,"48240":24282,"48241":24287,"48242":24285,"48243":24291,"48244":24288,"48245":24392,"48246":24433,"48247":24503,"48248":24501,"48249":24950,"48250":24935,"48251":24942,"48252":24925,"48253":24917,"48254":24962,"48289":24956,"48290":24944,"48291":24939,"48292":24958,"48293":24999,"48294":24976,"48295":25003,"48296":24974,"48297":25004,"48298":24986,"48299":24996,"48300":24980,"48301":25006,"48302":25134,"48303":25705,"48304":25711,"48305":25721,"48306":25758,"48307":25778,"48308":25736,"48309":25744,"48310":25776,"48311":25765,"48312":25747,"48313":25749,"48314":25769,"48315":25746,"48316":25774,"48317":25773,"48318":25771,"48319":25754,"48320":25772,"48321":25753,"48322":25762,"48323":25779,"48324":25973,"48325":25975,"48326":25976,"48327":26286,"48328":26283,"48329":26292,"48330":26289,"48331":27171,"48332":27167,"48333":27112,"48334":27137,"48335":27166,"48336":27161,"48337":27133,"48338":27169,"48339":27155,"48340":27146,"48341":27123,"48342":27138,"48343":27141,"48344":27117,"48345":27153,"48346":27472,"48347":27470,"48348":27556,"48349":27589,"48350":27590,"48351":28479,"48352":28540,"48353":28548,"48354":28497,"48355":28518,"48356":28500,"48357":28550,"48358":28525,"48359":28507,"48360":28536,"48361":28526,"48362":28558,"48363":28538,"48364":28528,"48365":28516,"48366":28567,"48367":28504,"48368":28373,"48369":28527,"48370":28512,"48371":28511,"48372":29087,"48373":29100,"48374":29105,"48375":29096,"48376":29270,"48377":29339,"48378":29518,"48379":29527,"48380":29801,"48381":29835,"48382":29827,"48448":29822,"48449":29824,"48450":30079,"48451":30240,"48452":30249,"48453":30239,"48454":30244,"48455":30246,"48456":30241,"48457":30242,"48458":30362,"48459":30394,"48460":30436,"48461":30606,"48462":30599,"48463":30604,"48464":30609,"48465":30603,"48466":30923,"48467":30917,"48468":30906,"48469":30922,"48470":30910,"48471":30933,"48472":30908,"48473":30928,"48474":31295,"48475":31292,"48476":31296,"48477":31293,"48478":31287,"48479":31291,"48480":31407,"48481":31406,"48482":31661,"48483":31665,"48484":31684,"48485":31668,"48486":31686,"48487":31687,"48488":31681,"48489":31648,"48490":31692,"48491":31946,"48492":32224,"48493":32244,"48494":32239,"48495":32251,"48496":32216,"48497":32236,"48498":32221,"48499":32232,"48500":32227,"48501":32218,"48502":32222,"48503":32233,"48504":32158,"48505":32217,"48506":32242,"48507":32249,"48508":32629,"48509":32631,"48510":32687,"48545":32745,"48546":32806,"48547":33179,"48548":33180,"48549":33181,"48550":33184,"48551":33178,"48552":33176,"48553":34071,"48554":34109,"48555":34074,"48556":34030,"48557":34092,"48558":34093,"48559":34067,"48560":34065,"48561":34083,"48562":34081,"48563":34068,"48564":34028,"48565":34085,"48566":34047,"48567":34054,"48568":34690,"48569":34676,"48570":34678,"48571":34656,"48572":34662,"48573":34680,"48574":34664,"48575":34649,"48576":34647,"48577":34636,"48578":34643,"48579":34907,"48580":34909,"48581":35088,"48582":35079,"48583":35090,"48584":35091,"48585":35093,"48586":35082,"48587":35516,"48588":35538,"48589":35527,"48590":35524,"48591":35477,"48592":35531,"48593":35576,"48594":35506,"48595":35529,"48596":35522,"48597":35519,"48598":35504,"48599":35542,"48600":35533,"48601":35510,"48602":35513,"48603":35547,"48604":35916,"48605":35918,"48606":35948,"48607":36064,"48608":36062,"48609":36070,"48610":36068,"48611":36076,"48612":36077,"48613":36066,"48614":36067,"48615":36060,"48616":36074,"48617":36065,"48618":36205,"48619":36255,"48620":36259,"48621":36395,"48622":36368,"48623":36381,"48624":36386,"48625":36367,"48626":36393,"48627":36383,"48628":36385,"48629":36382,"48630":36538,"48631":36637,"48632":36635,"48633":36639,"48634":36649,"48635":36646,"48636":36650,"48637":36636,"48638":36638,"48704":36645,"48705":36969,"48706":36974,"48707":36968,"48708":36973,"48709":36983,"48710":37168,"48711":37165,"48712":37159,"48713":37169,"48714":37255,"48715":37257,"48716":37259,"48717":37251,"48718":37573,"48719":37563,"48720":37559,"48721":37610,"48722":37548,"48723":37604,"48724":37569,"48725":37555,"48726":37564,"48727":37586,"48728":37575,"48729":37616,"48730":37554,"48731":38317,"48732":38321,"48733":38660,"48734":38662,"48735":38663,"48736":38665,"48737":38752,"48738":38797,"48739":38795,"48740":38799,"48741":38945,"48742":38955,"48743":38940,"48744":39091,"48745":39178,"48746":39187,"48747":39186,"48748":39192,"48749":39389,"48750":39376,"48751":39391,"48752":39387,"48753":39377,"48754":39381,"48755":39378,"48756":39385,"48757":39607,"48758":39662,"48759":39663,"48760":39719,"48761":39749,"48762":39748,"48763":39799,"48764":39791,"48765":40198,"48766":40201,"48801":40195,"48802":40617,"48803":40638,"48804":40654,"48805":22696,"48806":40786,"48807":20754,"48808":20760,"48809":20756,"48810":20752,"48811":20757,"48812":20864,"48813":20906,"48814":20957,"48815":21137,"48816":21139,"48817":21235,"48818":22105,"48819":22123,"48820":22137,"48821":22121,"48822":22116,"48823":22136,"48824":22122,"48825":22120,"48826":22117,"48827":22129,"48828":22127,"48829":22124,"48830":22114,"48831":22134,"48832":22721,"48833":22718,"48834":22727,"48835":22725,"48836":22894,"48837":23325,"48838":23348,"48839":23416,"48840":23536,"48841":23566,"48842":24394,"48843":25010,"48844":24977,"48845":25001,"48846":24970,"48847":25037,"48848":25014,"48849":25022,"48850":25034,"48851":25032,"48852":25136,"48853":25797,"48854":25793,"48855":25803,"48856":25787,"48857":25788,"48858":25818,"48859":25796,"48860":25799,"48861":25794,"48862":25805,"48863":25791,"48864":25810,"48865":25812,"48866":25790,"48867":25972,"48868":26310,"48869":26313,"48870":26297,"48871":26308,"48872":26311,"48873":26296,"48874":27197,"48875":27192,"48876":27194,"48877":27225,"48878":27243,"48879":27224,"48880":27193,"48881":27204,"48882":27234,"48883":27233,"48884":27211,"48885":27207,"48886":27189,"48887":27231,"48888":27208,"48889":27481,"48890":27511,"48891":27653,"48892":28610,"48893":28593,"48894":28577,"48960":28611,"48961":28580,"48962":28609,"48963":28583,"48964":28595,"48965":28608,"48966":28601,"48967":28598,"48968":28582,"48969":28576,"48970":28596,"48971":29118,"48972":29129,"48973":29136,"48974":29138,"48975":29128,"48976":29141,"48977":29113,"48978":29134,"48979":29145,"48980":29148,"48981":29123,"48982":29124,"48983":29544,"48984":29852,"48985":29859,"48986":29848,"48987":29855,"48988":29854,"48989":29922,"48990":29964,"48991":29965,"48992":30260,"48993":30264,"48994":30266,"48995":30439,"48996":30437,"48997":30624,"48998":30622,"48999":30623,"49000":30629,"49001":30952,"49002":30938,"49003":30956,"49004":30951,"49005":31142,"49006":31309,"49007":31310,"49008":31302,"49009":31308,"49010":31307,"49011":31418,"49012":31705,"49013":31761,"49014":31689,"49015":31716,"49016":31707,"49017":31713,"49018":31721,"49019":31718,"49020":31957,"49021":31958,"49022":32266,"49057":32273,"49058":32264,"49059":32283,"49060":32291,"49061":32286,"49062":32285,"49063":32265,"49064":32272,"49065":32633,"49066":32690,"49067":32752,"49068":32753,"49069":32750,"49070":32808,"49071":33203,"49072":33193,"49073":33192,"49074":33275,"49075":33288,"49076":33368,"49077":33369,"49078":34122,"49079":34137,"49080":34120,"49081":34152,"49082":34153,"49083":34115,"49084":34121,"49085":34157,"49086":34154,"49087":34142,"49088":34691,"49089":34719,"49090":34718,"49091":34722,"49092":34701,"49093":34913,"49094":35114,"49095":35122,"49096":35109,"49097":35115,"49098":35105,"49099":35242,"49100":35238,"49101":35558,"49102":35578,"49103":35563,"49104":35569,"49105":35584,"49106":35548,"49107":35559,"49108":35566,"49109":35582,"49110":35585,"49111":35586,"49112":35575,"49113":35565,"49114":35571,"49115":35574,"49116":35580,"49117":35947,"49118":35949,"49119":35987,"49120":36084,"49121":36420,"49122":36401,"49123":36404,"49124":36418,"49125":36409,"49126":36405,"49127":36667,"49128":36655,"49129":36664,"49130":36659,"49131":36776,"49132":36774,"49133":36981,"49134":36980,"49135":36984,"49136":36978,"49137":36988,"49138":36986,"49139":37172,"49140":37266,"49141":37664,"49142":37686,"49143":37624,"49144":37683,"49145":37679,"49146":37666,"49147":37628,"49148":37675,"49149":37636,"49150":37658,"49216":37648,"49217":37670,"49218":37665,"49219":37653,"49220":37678,"49221":37657,"49222":38331,"49223":38567,"49224":38568,"49225":38570,"49226":38613,"49227":38670,"49228":38673,"49229":38678,"49230":38669,"49231":38675,"49232":38671,"49233":38747,"49234":38748,"49235":38758,"49236":38808,"49237":38960,"49238":38968,"49239":38971,"49240":38967,"49241":38957,"49242":38969,"49243":38948,"49244":39184,"49245":39208,"49246":39198,"49247":39195,"49248":39201,"49249":39194,"49250":39405,"49251":39394,"49252":39409,"49253":39608,"49254":39612,"49255":39675,"49256":39661,"49257":39720,"49258":39825,"49259":40213,"49260":40227,"49261":40230,"49262":40232,"49263":40210,"49264":40219,"49265":40664,"49266":40660,"49267":40845,"49268":40860,"49269":20778,"49270":20767,"49271":20769,"49272":20786,"49273":21237,"49274":22158,"49275":22144,"49276":22160,"49277":22149,"49278":22151,"49313":22159,"49314":22741,"49315":22739,"49316":22737,"49317":22734,"49318":23344,"49319":23338,"49320":23332,"49321":23418,"49322":23607,"49323":23656,"49324":23996,"49325":23994,"49326":23997,"49327":23992,"49328":24171,"49329":24396,"49330":24509,"49331":25033,"49332":25026,"49333":25031,"49334":25062,"49335":25035,"49336":25138,"49337":25140,"49338":25806,"49339":25802,"49340":25816,"49341":25824,"49342":25840,"49343":25830,"49344":25836,"49345":25841,"49346":25826,"49347":25837,"49348":25986,"49349":25987,"49350":26329,"49351":26326,"49352":27264,"49353":27284,"49354":27268,"49355":27298,"49356":27292,"49357":27355,"49358":27299,"49359":27262,"49360":27287,"49361":27280,"49362":27296,"49363":27484,"49364":27566,"49365":27610,"49366":27656,"49367":28632,"49368":28657,"49369":28639,"49370":28640,"49371":28635,"49372":28644,"49373":28651,"49374":28655,"49375":28544,"49376":28652,"49377":28641,"49378":28649,"49379":28629,"49380":28654,"49381":28656,"49382":29159,"49383":29151,"49384":29166,"49385":29158,"49386":29157,"49387":29165,"49388":29164,"49389":29172,"49390":29152,"49391":29237,"49392":29254,"49393":29552,"49394":29554,"49395":29865,"49396":29872,"49397":29862,"49398":29864,"49399":30278,"49400":30274,"49401":30284,"49402":30442,"49403":30643,"49404":30634,"49405":30640,"49406":30636,"49472":30631,"49473":30637,"49474":30703,"49475":30967,"49476":30970,"49477":30964,"49478":30959,"49479":30977,"49480":31143,"49481":31146,"49482":31319,"49483":31423,"49484":31751,"49485":31757,"49486":31742,"49487":31735,"49488":31756,"49489":31712,"49490":31968,"49491":31964,"49492":31966,"49493":31970,"49494":31967,"49495":31961,"49496":31965,"49497":32302,"49498":32318,"49499":32326,"49500":32311,"49501":32306,"49502":32323,"49503":32299,"49504":32317,"49505":32305,"49506":32325,"49507":32321,"49508":32308,"49509":32313,"49510":32328,"49511":32309,"49512":32319,"49513":32303,"49514":32580,"49515":32755,"49516":32764,"49517":32881,"49518":32882,"49519":32880,"49520":32879,"49521":32883,"49522":33222,"49523":33219,"49524":33210,"49525":33218,"49526":33216,"49527":33215,"49528":33213,"49529":33225,"49530":33214,"49531":33256,"49532":33289,"49533":33393,"49534":34218,"49569":34180,"49570":34174,"49571":34204,"49572":34193,"49573":34196,"49574":34223,"49575":34203,"49576":34183,"49577":34216,"49578":34186,"49579":34407,"49580":34752,"49581":34769,"49582":34739,"49583":34770,"49584":34758,"49585":34731,"49586":34747,"49587":34746,"49588":34760,"49589":34763,"49590":35131,"49591":35126,"49592":35140,"49593":35128,"49594":35133,"49595":35244,"49596":35598,"49597":35607,"49598":35609,"49599":35611,"49600":35594,"49601":35616,"49602":35613,"49603":35588,"49604":35600,"49605":35905,"49606":35903,"49607":35955,"49608":36090,"49609":36093,"49610":36092,"49611":36088,"49612":36091,"49613":36264,"49614":36425,"49615":36427,"49616":36424,"49617":36426,"49618":36676,"49619":36670,"49620":36674,"49621":36677,"49622":36671,"49623":36991,"49624":36989,"49625":36996,"49626":36993,"49627":36994,"49628":36992,"49629":37177,"49630":37283,"49631":37278,"49632":37276,"49633":37709,"49634":37762,"49635":37672,"49636":37749,"49637":37706,"49638":37733,"49639":37707,"49640":37656,"49641":37758,"49642":37740,"49643":37723,"49644":37744,"49645":37722,"49646":37716,"49647":38346,"49648":38347,"49649":38348,"49650":38344,"49651":38342,"49652":38577,"49653":38584,"49654":38614,"49655":38684,"49656":38686,"49657":38816,"49658":38867,"49659":38982,"49660":39094,"49661":39221,"49662":39425,"49728":39423,"49729":39854,"49730":39851,"49731":39850,"49732":39853,"49733":40251,"49734":40255,"49735":40587,"49736":40655,"49737":40670,"49738":40668,"49739":40669,"49740":40667,"49741":40766,"49742":40779,"49743":21474,"49744":22165,"49745":22190,"49746":22745,"49747":22744,"49748":23352,"49749":24413,"49750":25059,"49751":25139,"49752":25844,"49753":25842,"49754":25854,"49755":25862,"49756":25850,"49757":25851,"49758":25847,"49759":26039,"49760":26332,"49761":26406,"49762":27315,"49763":27308,"49764":27331,"49765":27323,"49766":27320,"49767":27330,"49768":27310,"49769":27311,"49770":27487,"49771":27512,"49772":27567,"49773":28681,"49774":28683,"49775":28670,"49776":28678,"49777":28666,"49778":28689,"49779":28687,"49780":29179,"49781":29180,"49782":29182,"49783":29176,"49784":29559,"49785":29557,"49786":29863,"49787":29887,"49788":29973,"49789":30294,"49790":30296,"49825":30290,"49826":30653,"49827":30655,"49828":30651,"49829":30652,"49830":30990,"49831":31150,"49832":31329,"49833":31330,"49834":31328,"49835":31428,"49836":31429,"49837":31787,"49838":31783,"49839":31786,"49840":31774,"49841":31779,"49842":31777,"49843":31975,"49844":32340,"49845":32341,"49846":32350,"49847":32346,"49848":32353,"49849":32338,"49850":32345,"49851":32584,"49852":32761,"49853":32763,"49854":32887,"49855":32886,"49856":33229,"49857":33231,"49858":33290,"49859":34255,"49860":34217,"49861":34253,"49862":34256,"49863":34249,"49864":34224,"49865":34234,"49866":34233,"49867":34214,"49868":34799,"49869":34796,"49870":34802,"49871":34784,"49872":35206,"49873":35250,"49874":35316,"49875":35624,"49876":35641,"49877":35628,"49878":35627,"49879":35920,"49880":36101,"49881":36441,"49882":36451,"49883":36454,"49884":36452,"49885":36447,"49886":36437,"49887":36544,"49888":36681,"49889":36685,"49890":36999,"49891":36995,"49892":37000,"49893":37291,"49894":37292,"49895":37328,"49896":37780,"49897":37770,"49898":37782,"49899":37794,"49900":37811,"49901":37806,"49902":37804,"49903":37808,"49904":37784,"49905":37786,"49906":37783,"49907":38356,"49908":38358,"49909":38352,"49910":38357,"49911":38626,"49912":38620,"49913":38617,"49914":38619,"49915":38622,"49916":38692,"49917":38819,"49918":38822,"49984":38829,"49985":38905,"49986":38989,"49987":38991,"49988":38988,"49989":38990,"49990":38995,"49991":39098,"49992":39230,"49993":39231,"49994":39229,"49995":39214,"49996":39333,"49997":39438,"49998":39617,"49999":39683,"50000":39686,"50001":39759,"50002":39758,"50003":39757,"50004":39882,"50005":39881,"50006":39933,"50007":39880,"50008":39872,"50009":40273,"50010":40285,"50011":40288,"50012":40672,"50013":40725,"50014":40748,"50015":20787,"50016":22181,"50017":22750,"50018":22751,"50019":22754,"50020":23541,"50021":40848,"50022":24300,"50023":25074,"50024":25079,"50025":25078,"50026":25077,"50027":25856,"50028":25871,"50029":26336,"50030":26333,"50031":27365,"50032":27357,"50033":27354,"50034":27347,"50035":28699,"50036":28703,"50037":28712,"50038":28698,"50039":28701,"50040":28693,"50041":28696,"50042":29190,"50043":29197,"50044":29272,"50045":29346,"50046":29560,"50081":29562,"50082":29885,"50083":29898,"50084":29923,"50085":30087,"50086":30086,"50087":30303,"50088":30305,"50089":30663,"50090":31001,"50091":31153,"50092":31339,"50093":31337,"50094":31806,"50095":31807,"50096":31800,"50097":31805,"50098":31799,"50099":31808,"50100":32363,"50101":32365,"50102":32377,"50103":32361,"50104":32362,"50105":32645,"50106":32371,"50107":32694,"50108":32697,"50109":32696,"50110":33240,"50111":34281,"50112":34269,"50113":34282,"50114":34261,"50115":34276,"50116":34277,"50117":34295,"50118":34811,"50119":34821,"50120":34829,"50121":34809,"50122":34814,"50123":35168,"50124":35167,"50125":35158,"50126":35166,"50127":35649,"50128":35676,"50129":35672,"50130":35657,"50131":35674,"50132":35662,"50133":35663,"50134":35654,"50135":35673,"50136":36104,"50137":36106,"50138":36476,"50139":36466,"50140":36487,"50141":36470,"50142":36460,"50143":36474,"50144":36468,"50145":36692,"50146":36686,"50147":36781,"50148":37002,"50149":37003,"50150":37297,"50151":37294,"50152":37857,"50153":37841,"50154":37855,"50155":37827,"50156":37832,"50157":37852,"50158":37853,"50159":37846,"50160":37858,"50161":37837,"50162":37848,"50163":37860,"50164":37847,"50165":37864,"50166":38364,"50167":38580,"50168":38627,"50169":38698,"50170":38695,"50171":38753,"50172":38876,"50173":38907,"50174":39006,"50240":39000,"50241":39003,"50242":39100,"50243":39237,"50244":39241,"50245":39446,"50246":39449,"50247":39693,"50248":39912,"50249":39911,"50250":39894,"50251":39899,"50252":40329,"50253":40289,"50254":40306,"50255":40298,"50256":40300,"50257":40594,"50258":40599,"50259":40595,"50260":40628,"50261":21240,"50262":22184,"50263":22199,"50264":22198,"50265":22196,"50266":22204,"50267":22756,"50268":23360,"50269":23363,"50270":23421,"50271":23542,"50272":24009,"50273":25080,"50274":25082,"50275":25880,"50276":25876,"50277":25881,"50278":26342,"50279":26407,"50280":27372,"50281":28734,"50282":28720,"50283":28722,"50284":29200,"50285":29563,"50286":29903,"50287":30306,"50288":30309,"50289":31014,"50290":31018,"50291":31020,"50292":31019,"50293":31431,"50294":31478,"50295":31820,"50296":31811,"50297":31821,"50298":31983,"50299":31984,"50300":36782,"50301":32381,"50302":32380,"50337":32386,"50338":32588,"50339":32768,"50340":33242,"50341":33382,"50342":34299,"50343":34297,"50344":34321,"50345":34298,"50346":34310,"50347":34315,"50348":34311,"50349":34314,"50350":34836,"50351":34837,"50352":35172,"50353":35258,"50354":35320,"50355":35696,"50356":35692,"50357":35686,"50358":35695,"50359":35679,"50360":35691,"50361":36111,"50362":36109,"50363":36489,"50364":36481,"50365":36485,"50366":36482,"50367":37300,"50368":37323,"50369":37912,"50370":37891,"50371":37885,"50372":38369,"50373":38704,"50374":39108,"50375":39250,"50376":39249,"50377":39336,"50378":39467,"50379":39472,"50380":39479,"50381":39477,"50382":39955,"50383":39949,"50384":40569,"50385":40629,"50386":40680,"50387":40751,"50388":40799,"50389":40803,"50390":40801,"50391":20791,"50392":20792,"50393":22209,"50394":22208,"50395":22210,"50396":22804,"50397":23660,"50398":24013,"50399":25084,"50400":25086,"50401":25885,"50402":25884,"50403":26005,"50404":26345,"50405":27387,"50406":27396,"50407":27386,"50408":27570,"50409":28748,"50410":29211,"50411":29351,"50412":29910,"50413":29908,"50414":30313,"50415":30675,"50416":31824,"50417":32399,"50418":32396,"50419":32700,"50420":34327,"50421":34349,"50422":34330,"50423":34851,"50424":34850,"50425":34849,"50426":34847,"50427":35178,"50428":35180,"50429":35261,"50430":35700,"50496":35703,"50497":35709,"50498":36115,"50499":36490,"50500":36493,"50501":36491,"50502":36703,"50503":36783,"50504":37306,"50505":37934,"50506":37939,"50507":37941,"50508":37946,"50509":37944,"50510":37938,"50511":37931,"50512":38370,"50513":38712,"50514":38713,"50515":38706,"50516":38911,"50517":39015,"50518":39013,"50519":39255,"50520":39493,"50521":39491,"50522":39488,"50523":39486,"50524":39631,"50525":39764,"50526":39761,"50527":39981,"50528":39973,"50529":40367,"50530":40372,"50531":40386,"50532":40376,"50533":40605,"50534":40687,"50535":40729,"50536":40796,"50537":40806,"50538":40807,"50539":20796,"50540":20795,"50541":22216,"50542":22218,"50543":22217,"50544":23423,"50545":24020,"50546":24018,"50547":24398,"50548":25087,"50549":25892,"50550":27402,"50551":27489,"50552":28753,"50553":28760,"50554":29568,"50555":29924,"50556":30090,"50557":30318,"50558":30316,"50593":31155,"50594":31840,"50595":31839,"50596":32894,"50597":32893,"50598":33247,"50599":35186,"50600":35183,"50601":35324,"50602":35712,"50603":36118,"50604":36119,"50605":36497,"50606":36499,"50607":36705,"50608":37192,"50609":37956,"50610":37969,"50611":37970,"50612":38717,"50613":38718,"50614":38851,"50615":38849,"50616":39019,"50617":39253,"50618":39509,"50619":39501,"50620":39634,"50621":39706,"50622":40009,"50623":39985,"50624":39998,"50625":39995,"50626":40403,"50627":40407,"50628":40756,"50629":40812,"50630":40810,"50631":40852,"50632":22220,"50633":24022,"50634":25088,"50635":25891,"50636":25899,"50637":25898,"50638":26348,"50639":27408,"50640":29914,"50641":31434,"50642":31844,"50643":31843,"50644":31845,"50645":32403,"50646":32406,"50647":32404,"50648":33250,"50649":34360,"50650":34367,"50651":34865,"50652":35722,"50653":37008,"50654":37007,"50655":37987,"50656":37984,"50657":37988,"50658":38760,"50659":39023,"50660":39260,"50661":39514,"50662":39515,"50663":39511,"50664":39635,"50665":39636,"50666":39633,"50667":40020,"50668":40023,"50669":40022,"50670":40421,"50671":40607,"50672":40692,"50673":22225,"50674":22761,"50675":25900,"50676":28766,"50677":30321,"50678":30322,"50679":30679,"50680":32592,"50681":32648,"50682":34870,"50683":34873,"50684":34914,"50685":35731,"50686":35730,"50752":35734,"50753":33399,"50754":36123,"50755":37312,"50756":37994,"50757":38722,"50758":38728,"50759":38724,"50760":38854,"50761":39024,"50762":39519,"50763":39714,"50764":39768,"50765":40031,"50766":40441,"50767":40442,"50768":40572,"50769":40573,"50770":40711,"50771":40823,"50772":40818,"50773":24307,"50774":27414,"50775":28771,"50776":31852,"50777":31854,"50778":34875,"50779":35264,"50780":36513,"50781":37313,"50782":38002,"50783":38000,"50784":39025,"50785":39262,"50786":39638,"50787":39715,"50788":40652,"50789":28772,"50790":30682,"50791":35738,"50792":38007,"50793":38857,"50794":39522,"50795":39525,"50796":32412,"50797":35740,"50798":36522,"50799":37317,"50800":38013,"50801":38014,"50802":38012,"50803":40055,"50804":40056,"50805":40695,"50806":35924,"50807":38015,"50808":40474,"50809":29224,"50810":39530,"50811":39729,"50812":40475,"50813":40478,"50814":31858,"50849":9312,"50850":9313,"50851":9314,"50852":9315,"50853":9316,"50854":9317,"50855":9318,"50856":9319,"50857":9320,"50858":9321,"50859":9332,"50860":9333,"50861":9334,"50862":9335,"50863":9336,"50864":9337,"50865":9338,"50866":9339,"50867":9340,"50868":9341,"50869":8560,"50870":8561,"50871":8562,"50872":8563,"50873":8564,"50874":8565,"50875":8566,"50876":8567,"50877":8568,"50878":8569,"50879":20022,"50880":20031,"50881":20101,"50882":20128,"50883":20866,"50884":20886,"50885":20907,"50886":21241,"50887":21304,"50888":21353,"50889":21430,"50890":22794,"50891":23424,"50892":24027,"50893":24186,"50894":24191,"50895":24308,"50896":24400,"50897":24417,"50898":25908,"50899":26080,"50900":30098,"50901":30326,"50902":36789,"50903":38582,"50904":168,"50905":710,"50906":12541,"50907":12542,"50908":12445,"50909":12446,"50910":12291,"50911":20189,"50912":12293,"50913":12294,"50914":12295,"50915":12540,"50916":65339,"50917":65341,"50918":10045,"50919":12353,"50920":12354,"50921":12355,"50922":12356,"50923":12357,"50924":12358,"50925":12359,"50926":12360,"50927":12361,"50928":12362,"50929":12363,"50930":12364,"50931":12365,"50932":12366,"50933":12367,"50934":12368,"50935":12369,"50936":12370,"50937":12371,"50938":12372,"50939":12373,"50940":12374,"50941":12375,"50942":12376,"51008":12377,"51009":12378,"51010":12379,"51011":12380,"51012":12381,"51013":12382,"51014":12383,"51015":12384,"51016":12385,"51017":12386,"51018":12387,"51019":12388,"51020":12389,"51021":12390,"51022":12391,"51023":12392,"51024":12393,"51025":12394,"51026":12395,"51027":12396,"51028":12397,"51029":12398,"51030":12399,"51031":12400,"51032":12401,"51033":12402,"51034":12403,"51035":12404,"51036":12405,"51037":12406,"51038":12407,"51039":12408,"51040":12409,"51041":12410,"51042":12411,"51043":12412,"51044":12413,"51045":12414,"51046":12415,"51047":12416,"51048":12417,"51049":12418,"51050":12419,"51051":12420,"51052":12421,"51053":12422,"51054":12423,"51055":12424,"51056":12425,"51057":12426,"51058":12427,"51059":12428,"51060":12429,"51061":12430,"51062":12431,"51063":12432,"51064":12433,"51065":12434,"51066":12435,"51067":12449,"51068":12450,"51069":12451,"51070":12452,"51105":12453,"51106":12454,"51107":12455,"51108":12456,"51109":12457,"51110":12458,"51111":12459,"51112":12460,"51113":12461,"51114":12462,"51115":12463,"51116":12464,"51117":12465,"51118":12466,"51119":12467,"51120":12468,"51121":12469,"51122":12470,"51123":12471,"51124":12472,"51125":12473,"51126":12474,"51127":12475,"51128":12476,"51129":12477,"51130":12478,"51131":12479,"51132":12480,"51133":12481,"51134":12482,"51135":12483,"51136":12484,"51137":12485,"51138":12486,"51139":12487,"51140":12488,"51141":12489,"51142":12490,"51143":12491,"51144":12492,"51145":12493,"51146":12494,"51147":12495,"51148":12496,"51149":12497,"51150":12498,"51151":12499,"51152":12500,"51153":12501,"51154":12502,"51155":12503,"51156":12504,"51157":12505,"51158":12506,"51159":12507,"51160":12508,"51161":12509,"51162":12510,"51163":12511,"51164":12512,"51165":12513,"51166":12514,"51167":12515,"51168":12516,"51169":12517,"51170":12518,"51171":12519,"51172":12520,"51173":12521,"51174":12522,"51175":12523,"51176":12524,"51177":12525,"51178":12526,"51179":12527,"51180":12528,"51181":12529,"51182":12530,"51183":12531,"51184":12532,"51185":12533,"51186":12534,"51187":1040,"51188":1041,"51189":1042,"51190":1043,"51191":1044,"51192":1045,"51193":1025,"51194":1046,"51195":1047,"51196":1048,"51197":1049,"51198":1050,"51264":1051,"51265":1052,"51266":1053,"51267":1054,"51268":1055,"51269":1056,"51270":1057,"51271":1058,"51272":1059,"51273":1060,"51274":1061,"51275":1062,"51276":1063,"51277":1064,"51278":1065,"51279":1066,"51280":1067,"51281":1068,"51282":1069,"51283":1070,"51284":1071,"51285":1072,"51286":1073,"51287":1074,"51288":1075,"51289":1076,"51290":1077,"51291":1105,"51292":1078,"51293":1079,"51294":1080,"51295":1081,"51296":1082,"51297":1083,"51298":1084,"51299":1085,"51300":1086,"51301":1087,"51302":1088,"51303":1089,"51304":1090,"51305":1091,"51306":1092,"51307":1093,"51308":1094,"51309":1095,"51310":1096,"51311":1097,"51312":1098,"51313":1099,"51314":1100,"51315":1101,"51316":1102,"51317":1103,"51318":8679,"51319":8632,"51320":8633,"51321":12751,"51322":63462,"51323":20058,"51324":63464,"51325":20994,"51326":17553,"51361":40880,"51362":20872,"51363":40881,"51364":63470,"51365":63471,"51366":63472,"51367":63473,"51368":63474,"51369":63475,"51370":63476,"51371":63477,"51372":63478,"51373":63479,"51374":63480,"51375":63481,"51376":63482,"51377":12443,"51378":12444,"51379":12436,"51380":12535,"51381":12536,"51382":12537,"51383":12538,"51384":12539,"51385":65377,"51386":65378,"51387":65379,"51388":65380,"51389":65381,"51390":65382,"51391":65383,"51392":65384,"51393":65385,"51394":65386,"51395":65387,"51396":65388,"51397":65389,"51398":65390,"51399":65391,"51400":65392,"51401":65393,"51402":65394,"51403":65395,"51404":65396,"51405":65506,"51406":65508,"51407":65287,"51408":65282,"51409":12849,"51410":8470,"51411":8481,"51412":65397,"51413":65398,"51414":65399,"51415":65400,"51416":65401,"51417":65402,"51418":65403,"51419":65404,"51420":65405,"51421":65406,"51422":65407,"51423":65408,"51424":65409,"51425":65410,"51426":65411,"51427":65412,"51428":65413,"51429":65414,"51430":65415,"51431":65416,"51432":65417,"51433":65418,"51434":65419,"51435":65420,"51436":65421,"51437":65422,"51438":65423,"51439":65424,"51440":65425,"51441":65426,"51442":65427,"51443":65428,"51444":65429,"51445":65430,"51446":65431,"51447":65432,"51448":65433,"51449":65434,"51450":65435,"51451":65436,"51452":65437,"51453":65438,"51454":65439,"51520":20034,"51521":20060,"51522":20981,"51523":21274,"51524":21378,"51525":19975,"51526":19980,"51527":20039,"51528":20109,"51529":22231,"51530":64012,"51531":23662,"51532":24435,"51533":19983,"51534":20871,"51535":19982,"51536":20014,"51537":20115,"51538":20162,"51539":20169,"51540":20168,"51541":20888,"51542":21244,"51543":21356,"51544":21433,"51545":22304,"51546":22787,"51547":22828,"51548":23568,"51549":24063,"51550":26081,"51551":27571,"51552":27596,"51553":27668,"51554":29247,"51555":20017,"51556":20028,"51557":20200,"51558":20188,"51559":20201,"51560":20193,"51561":20189,"51562":20186,"51563":21004,"51564":21276,"51565":21324,"51566":22306,"51567":22307,"51568":22807,"51569":22831,"51570":23425,"51571":23428,"51572":23570,"51573":23611,"51574":23668,"51575":23667,"51576":24068,"51577":24192,"51578":24194,"51579":24521,"51580":25097,"51581":25168,"51582":27669,"51617":27702,"51618":27715,"51619":27711,"51620":27707,"51621":29358,"51622":29360,"51623":29578,"51624":31160,"51625":32906,"51626":38430,"51627":20238,"51628":20248,"51629":20268,"51630":20213,"51631":20244,"51632":20209,"51633":20224,"51634":20215,"51635":20232,"51636":20253,"51637":20226,"51638":20229,"51639":20258,"51640":20243,"51641":20228,"51642":20212,"51643":20242,"51644":20913,"51645":21011,"51646":21001,"51647":21008,"51648":21158,"51649":21282,"51650":21279,"51651":21325,"51652":21386,"51653":21511,"51654":22241,"51655":22239,"51656":22318,"51657":22314,"51658":22324,"51659":22844,"51660":22912,"51661":22908,"51662":22917,"51663":22907,"51664":22910,"51665":22903,"51666":22911,"51667":23382,"51668":23573,"51669":23589,"51670":23676,"51671":23674,"51672":23675,"51673":23678,"51674":24031,"51675":24181,"51676":24196,"51677":24322,"51678":24346,"51679":24436,"51680":24533,"51681":24532,"51682":24527,"51683":25180,"51684":25182,"51685":25188,"51686":25185,"51687":25190,"51688":25186,"51689":25177,"51690":25184,"51691":25178,"51692":25189,"51693":26095,"51694":26094,"51695":26430,"51696":26425,"51697":26424,"51698":26427,"51699":26426,"51700":26431,"51701":26428,"51702":26419,"51703":27672,"51704":27718,"51705":27730,"51706":27740,"51707":27727,"51708":27722,"51709":27732,"51710":27723,"51776":27724,"51777":28785,"51778":29278,"51779":29364,"51780":29365,"51781":29582,"51782":29994,"51783":30335,"51784":31349,"51785":32593,"51786":33400,"51787":33404,"51788":33408,"51789":33405,"51790":33407,"51791":34381,"51792":35198,"51793":37017,"51794":37015,"51795":37016,"51796":37019,"51797":37012,"51798":38434,"51799":38436,"51800":38432,"51801":38435,"51802":20310,"51803":20283,"51804":20322,"51805":20297,"51806":20307,"51807":20324,"51808":20286,"51809":20327,"51810":20306,"51811":20319,"51812":20289,"51813":20312,"51814":20269,"51815":20275,"51816":20287,"51817":20321,"51818":20879,"51819":20921,"51820":21020,"51821":21022,"51822":21025,"51823":21165,"51824":21166,"51825":21257,"51826":21347,"51827":21362,"51828":21390,"51829":21391,"51830":21552,"51831":21559,"51832":21546,"51833":21588,"51834":21573,"51835":21529,"51836":21532,"51837":21541,"51838":21528,"51873":21565,"51874":21583,"51875":21569,"51876":21544,"51877":21540,"51878":21575,"51879":22254,"51880":22247,"51881":22245,"51882":22337,"51883":22341,"51884":22348,"51885":22345,"51886":22347,"51887":22354,"51888":22790,"51889":22848,"51890":22950,"51891":22936,"51892":22944,"51893":22935,"51894":22926,"51895":22946,"51896":22928,"51897":22927,"51898":22951,"51899":22945,"51900":23438,"51901":23442,"51902":23592,"51903":23594,"51904":23693,"51905":23695,"51906":23688,"51907":23691,"51908":23689,"51909":23698,"51910":23690,"51911":23686,"51912":23699,"51913":23701,"51914":24032,"51915":24074,"51916":24078,"51917":24203,"51918":24201,"51919":24204,"51920":24200,"51921":24205,"51922":24325,"51923":24349,"51924":24440,"51925":24438,"51926":24530,"51927":24529,"51928":24528,"51929":24557,"51930":24552,"51931":24558,"51932":24563,"51933":24545,"51934":24548,"51935":24547,"51936":24570,"51937":24559,"51938":24567,"51939":24571,"51940":24576,"51941":24564,"51942":25146,"51943":25219,"51944":25228,"51945":25230,"51946":25231,"51947":25236,"51948":25223,"51949":25201,"51950":25211,"51951":25210,"51952":25200,"51953":25217,"51954":25224,"51955":25207,"51956":25213,"51957":25202,"51958":25204,"51959":25911,"51960":26096,"51961":26100,"51962":26099,"51963":26098,"51964":26101,"51965":26437,"51966":26439,"52032":26457,"52033":26453,"52034":26444,"52035":26440,"52036":26461,"52037":26445,"52038":26458,"52039":26443,"52040":27600,"52041":27673,"52042":27674,"52043":27768,"52044":27751,"52045":27755,"52046":27780,"52047":27787,"52048":27791,"52049":27761,"52050":27759,"52051":27753,"52052":27802,"52053":27757,"52054":27783,"52055":27797,"52056":27804,"52057":27750,"52058":27763,"52059":27749,"52060":27771,"52061":27790,"52062":28788,"52063":28794,"52064":29283,"52065":29375,"52066":29373,"52067":29379,"52068":29382,"52069":29377,"52070":29370,"52071":29381,"52072":29589,"52073":29591,"52074":29587,"52075":29588,"52076":29586,"52077":30010,"52078":30009,"52079":30100,"52080":30101,"52081":30337,"52082":31037,"52083":32820,"52084":32917,"52085":32921,"52086":32912,"52087":32914,"52088":32924,"52089":33424,"52090":33423,"52091":33413,"52092":33422,"52093":33425,"52094":33427,"52129":33418,"52130":33411,"52131":33412,"52132":35960,"52133":36809,"52134":36799,"52135":37023,"52136":37025,"52137":37029,"52138":37022,"52139":37031,"52140":37024,"52141":38448,"52142":38440,"52143":38447,"52144":38445,"52145":20019,"52146":20376,"52147":20348,"52148":20357,"52149":20349,"52150":20352,"52151":20359,"52152":20342,"52153":20340,"52154":20361,"52155":20356,"52156":20343,"52157":20300,"52158":20375,"52159":20330,"52160":20378,"52161":20345,"52162":20353,"52163":20344,"52164":20368,"52165":20380,"52166":20372,"52167":20382,"52168":20370,"52169":20354,"52170":20373,"52171":20331,"52172":20334,"52173":20894,"52174":20924,"52175":20926,"52176":21045,"52177":21042,"52178":21043,"52179":21062,"52180":21041,"52181":21180,"52182":21258,"52183":21259,"52184":21308,"52185":21394,"52186":21396,"52187":21639,"52188":21631,"52189":21633,"52190":21649,"52191":21634,"52192":21640,"52193":21611,"52194":21626,"52195":21630,"52196":21605,"52197":21612,"52198":21620,"52199":21606,"52200":21645,"52201":21615,"52202":21601,"52203":21600,"52204":21656,"52205":21603,"52206":21607,"52207":21604,"52208":22263,"52209":22265,"52210":22383,"52211":22386,"52212":22381,"52213":22379,"52214":22385,"52215":22384,"52216":22390,"52217":22400,"52218":22389,"52219":22395,"52220":22387,"52221":22388,"52222":22370,"52288":22376,"52289":22397,"52290":22796,"52291":22853,"52292":22965,"52293":22970,"52294":22991,"52295":22990,"52296":22962,"52297":22988,"52298":22977,"52299":22966,"52300":22972,"52301":22979,"52302":22998,"52303":22961,"52304":22973,"52305":22976,"52306":22984,"52307":22964,"52308":22983,"52309":23394,"52310":23397,"52311":23443,"52312":23445,"52313":23620,"52314":23623,"52315":23726,"52316":23716,"52317":23712,"52318":23733,"52319":23727,"52320":23720,"52321":23724,"52322":23711,"52323":23715,"52324":23725,"52325":23714,"52326":23722,"52327":23719,"52328":23709,"52329":23717,"52330":23734,"52331":23728,"52332":23718,"52333":24087,"52334":24084,"52335":24089,"52336":24360,"52337":24354,"52338":24355,"52339":24356,"52340":24404,"52341":24450,"52342":24446,"52343":24445,"52344":24542,"52345":24549,"52346":24621,"52347":24614,"52348":24601,"52349":24626,"52350":24587,"52385":24628,"52386":24586,"52387":24599,"52388":24627,"52389":24602,"52390":24606,"52391":24620,"52392":24610,"52393":24589,"52394":24592,"52395":24622,"52396":24595,"52397":24593,"52398":24588,"52399":24585,"52400":24604,"52401":25108,"52402":25149,"52403":25261,"52404":25268,"52405":25297,"52406":25278,"52407":25258,"52408":25270,"52409":25290,"52410":25262,"52411":25267,"52412":25263,"52413":25275,"52414":25257,"52415":25264,"52416":25272,"52417":25917,"52418":26024,"52419":26043,"52420":26121,"52421":26108,"52422":26116,"52423":26130,"52424":26120,"52425":26107,"52426":26115,"52427":26123,"52428":26125,"52429":26117,"52430":26109,"52431":26129,"52432":26128,"52433":26358,"52434":26378,"52435":26501,"52436":26476,"52437":26510,"52438":26514,"52439":26486,"52440":26491,"52441":26520,"52442":26502,"52443":26500,"52444":26484,"52445":26509,"52446":26508,"52447":26490,"52448":26527,"52449":26513,"52450":26521,"52451":26499,"52452":26493,"52453":26497,"52454":26488,"52455":26489,"52456":26516,"52457":27429,"52458":27520,"52459":27518,"52460":27614,"52461":27677,"52462":27795,"52463":27884,"52464":27883,"52465":27886,"52466":27865,"52467":27830,"52468":27860,"52469":27821,"52470":27879,"52471":27831,"52472":27856,"52473":27842,"52474":27834,"52475":27843,"52476":27846,"52477":27885,"52478":27890,"52544":27858,"52545":27869,"52546":27828,"52547":27786,"52548":27805,"52549":27776,"52550":27870,"52551":27840,"52552":27952,"52553":27853,"52554":27847,"52555":27824,"52556":27897,"52557":27855,"52558":27881,"52559":27857,"52560":28820,"52561":28824,"52562":28805,"52563":28819,"52564":28806,"52565":28804,"52566":28817,"52567":28822,"52568":28802,"52569":28826,"52570":28803,"52571":29290,"52572":29398,"52573":29387,"52574":29400,"52575":29385,"52576":29404,"52577":29394,"52578":29396,"52579":29402,"52580":29388,"52581":29393,"52582":29604,"52583":29601,"52584":29613,"52585":29606,"52586":29602,"52587":29600,"52588":29612,"52589":29597,"52590":29917,"52591":29928,"52592":30015,"52593":30016,"52594":30014,"52595":30092,"52596":30104,"52597":30383,"52598":30451,"52599":30449,"52600":30448,"52601":30453,"52602":30712,"52603":30716,"52604":30713,"52605":30715,"52606":30714,"52641":30711,"52642":31042,"52643":31039,"52644":31173,"52645":31352,"52646":31355,"52647":31483,"52648":31861,"52649":31997,"52650":32821,"52651":32911,"52652":32942,"52653":32931,"52654":32952,"52655":32949,"52656":32941,"52657":33312,"52658":33440,"52659":33472,"52660":33451,"52661":33434,"52662":33432,"52663":33435,"52664":33461,"52665":33447,"52666":33454,"52667":33468,"52668":33438,"52669":33466,"52670":33460,"52671":33448,"52672":33441,"52673":33449,"52674":33474,"52675":33444,"52676":33475,"52677":33462,"52678":33442,"52679":34416,"52680":34415,"52681":34413,"52682":34414,"52683":35926,"52684":36818,"52685":36811,"52686":36819,"52687":36813,"52688":36822,"52689":36821,"52690":36823,"52691":37042,"52692":37044,"52693":37039,"52694":37043,"52695":37040,"52696":38457,"52697":38461,"52698":38460,"52699":38458,"52700":38467,"52701":20429,"52702":20421,"52703":20435,"52704":20402,"52705":20425,"52706":20427,"52707":20417,"52708":20436,"52709":20444,"52710":20441,"52711":20411,"52712":20403,"52713":20443,"52714":20423,"52715":20438,"52716":20410,"52717":20416,"52718":20409,"52719":20460,"52720":21060,"52721":21065,"52722":21184,"52723":21186,"52724":21309,"52725":21372,"52726":21399,"52727":21398,"52728":21401,"52729":21400,"52730":21690,"52731":21665,"52732":21677,"52733":21669,"52734":21711,"52800":21699,"52801":33549,"52802":21687,"52803":21678,"52804":21718,"52805":21686,"52806":21701,"52807":21702,"52808":21664,"52809":21616,"52810":21692,"52811":21666,"52812":21694,"52813":21618,"52814":21726,"52815":21680,"52816":22453,"52817":22430,"52818":22431,"52819":22436,"52820":22412,"52821":22423,"52822":22429,"52823":22427,"52824":22420,"52825":22424,"52826":22415,"52827":22425,"52828":22437,"52829":22426,"52830":22421,"52831":22772,"52832":22797,"52833":22867,"52834":23009,"52835":23006,"52836":23022,"52837":23040,"52838":23025,"52839":23005,"52840":23034,"52841":23037,"52842":23036,"52843":23030,"52844":23012,"52845":23026,"52846":23031,"52847":23003,"52848":23017,"52849":23027,"52850":23029,"52851":23008,"52852":23038,"52853":23028,"52854":23021,"52855":23464,"52856":23628,"52857":23760,"52858":23768,"52859":23756,"52860":23767,"52861":23755,"52862":23771,"52897":23774,"52898":23770,"52899":23753,"52900":23751,"52901":23754,"52902":23766,"52903":23763,"52904":23764,"52905":23759,"52906":23752,"52907":23750,"52908":23758,"52909":23775,"52910":23800,"52911":24057,"52912":24097,"52913":24098,"52914":24099,"52915":24096,"52916":24100,"52917":24240,"52918":24228,"52919":24226,"52920":24219,"52921":24227,"52922":24229,"52923":24327,"52924":24366,"52925":24406,"52926":24454,"52927":24631,"52928":24633,"52929":24660,"52930":24690,"52931":24670,"52932":24645,"52933":24659,"52934":24647,"52935":24649,"52936":24667,"52937":24652,"52938":24640,"52939":24642,"52940":24671,"52941":24612,"52942":24644,"52943":24664,"52944":24678,"52945":24686,"52946":25154,"52947":25155,"52948":25295,"52949":25357,"52950":25355,"52951":25333,"52952":25358,"52953":25347,"52954":25323,"52955":25337,"52956":25359,"52957":25356,"52958":25336,"52959":25334,"52960":25344,"52961":25363,"52962":25364,"52963":25338,"52964":25365,"52965":25339,"52966":25328,"52967":25921,"52968":25923,"52969":26026,"52970":26047,"52971":26166,"52972":26145,"52973":26162,"52974":26165,"52975":26140,"52976":26150,"52977":26146,"52978":26163,"52979":26155,"52980":26170,"52981":26141,"52982":26164,"52983":26169,"52984":26158,"52985":26383,"52986":26384,"52987":26561,"52988":26610,"52989":26568,"52990":26554,"53056":26588,"53057":26555,"53058":26616,"53059":26584,"53060":26560,"53061":26551,"53062":26565,"53063":26603,"53064":26596,"53065":26591,"53066":26549,"53067":26573,"53068":26547,"53069":26615,"53070":26614,"53071":26606,"53072":26595,"53073":26562,"53074":26553,"53075":26574,"53076":26599,"53077":26608,"53078":26546,"53079":26620,"53080":26566,"53081":26605,"53082":26572,"53083":26542,"53084":26598,"53085":26587,"53086":26618,"53087":26569,"53088":26570,"53089":26563,"53090":26602,"53091":26571,"53092":27432,"53093":27522,"53094":27524,"53095":27574,"53096":27606,"53097":27608,"53098":27616,"53099":27680,"53100":27681,"53101":27944,"53102":27956,"53103":27949,"53104":27935,"53105":27964,"53106":27967,"53107":27922,"53108":27914,"53109":27866,"53110":27955,"53111":27908,"53112":27929,"53113":27962,"53114":27930,"53115":27921,"53116":27904,"53117":27933,"53118":27970,"53153":27905,"53154":27928,"53155":27959,"53156":27907,"53157":27919,"53158":27968,"53159":27911,"53160":27936,"53161":27948,"53162":27912,"53163":27938,"53164":27913,"53165":27920,"53166":28855,"53167":28831,"53168":28862,"53169":28849,"53170":28848,"53171":28833,"53172":28852,"53173":28853,"53174":28841,"53175":29249,"53176":29257,"53177":29258,"53178":29292,"53179":29296,"53180":29299,"53181":29294,"53182":29386,"53183":29412,"53184":29416,"53185":29419,"53186":29407,"53187":29418,"53188":29414,"53189":29411,"53190":29573,"53191":29644,"53192":29634,"53193":29640,"53194":29637,"53195":29625,"53196":29622,"53197":29621,"53198":29620,"53199":29675,"53200":29631,"53201":29639,"53202":29630,"53203":29635,"53204":29638,"53205":29624,"53206":29643,"53207":29932,"53208":29934,"53209":29998,"53210":30023,"53211":30024,"53212":30119,"53213":30122,"53214":30329,"53215":30404,"53216":30472,"53217":30467,"53218":30468,"53219":30469,"53220":30474,"53221":30455,"53222":30459,"53223":30458,"53224":30695,"53225":30696,"53226":30726,"53227":30737,"53228":30738,"53229":30725,"53230":30736,"53231":30735,"53232":30734,"53233":30729,"53234":30723,"53235":30739,"53236":31050,"53237":31052,"53238":31051,"53239":31045,"53240":31044,"53241":31189,"53242":31181,"53243":31183,"53244":31190,"53245":31182,"53246":31360,"53312":31358,"53313":31441,"53314":31488,"53315":31489,"53316":31866,"53317":31864,"53318":31865,"53319":31871,"53320":31872,"53321":31873,"53322":32003,"53323":32008,"53324":32001,"53325":32600,"53326":32657,"53327":32653,"53328":32702,"53329":32775,"53330":32782,"53331":32783,"53332":32788,"53333":32823,"53334":32984,"53335":32967,"53336":32992,"53337":32977,"53338":32968,"53339":32962,"53340":32976,"53341":32965,"53342":32995,"53343":32985,"53344":32988,"53345":32970,"53346":32981,"53347":32969,"53348":32975,"53349":32983,"53350":32998,"53351":32973,"53352":33279,"53353":33313,"53354":33428,"53355":33497,"53356":33534,"53357":33529,"53358":33543,"53359":33512,"53360":33536,"53361":33493,"53362":33594,"53363":33515,"53364":33494,"53365":33524,"53366":33516,"53367":33505,"53368":33522,"53369":33525,"53370":33548,"53371":33531,"53372":33526,"53373":33520,"53374":33514,"53409":33508,"53410":33504,"53411":33530,"53412":33523,"53413":33517,"53414":34423,"53415":34420,"53416":34428,"53417":34419,"53418":34881,"53419":34894,"53420":34919,"53421":34922,"53422":34921,"53423":35283,"53424":35332,"53425":35335,"53426":36210,"53427":36835,"53428":36833,"53429":36846,"53430":36832,"53431":37105,"53432":37053,"53433":37055,"53434":37077,"53435":37061,"53436":37054,"53437":37063,"53438":37067,"53439":37064,"53440":37332,"53441":37331,"53442":38484,"53443":38479,"53444":38481,"53445":38483,"53446":38474,"53447":38478,"53448":20510,"53449":20485,"53450":20487,"53451":20499,"53452":20514,"53453":20528,"53454":20507,"53455":20469,"53456":20468,"53457":20531,"53458":20535,"53459":20524,"53460":20470,"53461":20471,"53462":20503,"53463":20508,"53464":20512,"53465":20519,"53466":20533,"53467":20527,"53468":20529,"53469":20494,"53470":20826,"53471":20884,"53472":20883,"53473":20938,"53474":20932,"53475":20933,"53476":20936,"53477":20942,"53478":21089,"53479":21082,"53480":21074,"53481":21086,"53482":21087,"53483":21077,"53484":21090,"53485":21197,"53486":21262,"53487":21406,"53488":21798,"53489":21730,"53490":21783,"53491":21778,"53492":21735,"53493":21747,"53494":21732,"53495":21786,"53496":21759,"53497":21764,"53498":21768,"53499":21739,"53500":21777,"53501":21765,"53502":21745,"53568":21770,"53569":21755,"53570":21751,"53571":21752,"53572":21728,"53573":21774,"53574":21763,"53575":21771,"53576":22273,"53577":22274,"53578":22476,"53579":22578,"53580":22485,"53581":22482,"53582":22458,"53583":22470,"53584":22461,"53585":22460,"53586":22456,"53587":22454,"53588":22463,"53589":22471,"53590":22480,"53591":22457,"53592":22465,"53593":22798,"53594":22858,"53595":23065,"53596":23062,"53597":23085,"53598":23086,"53599":23061,"53600":23055,"53601":23063,"53602":23050,"53603":23070,"53604":23091,"53605":23404,"53606":23463,"53607":23469,"53608":23468,"53609":23555,"53610":23638,"53611":23636,"53612":23788,"53613":23807,"53614":23790,"53615":23793,"53616":23799,"53617":23808,"53618":23801,"53619":24105,"53620":24104,"53621":24232,"53622":24238,"53623":24234,"53624":24236,"53625":24371,"53626":24368,"53627":24423,"53628":24669,"53629":24666,"53630":24679,"53665":24641,"53666":24738,"53667":24712,"53668":24704,"53669":24722,"53670":24705,"53671":24733,"53672":24707,"53673":24725,"53674":24731,"53675":24727,"53676":24711,"53677":24732,"53678":24718,"53679":25113,"53680":25158,"53681":25330,"53682":25360,"53683":25430,"53684":25388,"53685":25412,"53686":25413,"53687":25398,"53688":25411,"53689":25572,"53690":25401,"53691":25419,"53692":25418,"53693":25404,"53694":25385,"53695":25409,"53696":25396,"53697":25432,"53698":25428,"53699":25433,"53700":25389,"53701":25415,"53702":25395,"53703":25434,"53704":25425,"53705":25400,"53706":25431,"53707":25408,"53708":25416,"53709":25930,"53710":25926,"53711":26054,"53712":26051,"53713":26052,"53714":26050,"53715":26186,"53716":26207,"53717":26183,"53718":26193,"53719":26386,"53720":26387,"53721":26655,"53722":26650,"53723":26697,"53724":26674,"53725":26675,"53726":26683,"53727":26699,"53728":26703,"53729":26646,"53730":26673,"53731":26652,"53732":26677,"53733":26667,"53734":26669,"53735":26671,"53736":26702,"53737":26692,"53738":26676,"53739":26653,"53740":26642,"53741":26644,"53742":26662,"53743":26664,"53744":26670,"53745":26701,"53746":26682,"53747":26661,"53748":26656,"53749":27436,"53750":27439,"53751":27437,"53752":27441,"53753":27444,"53754":27501,"53755":32898,"53756":27528,"53757":27622,"53758":27620,"53824":27624,"53825":27619,"53826":27618,"53827":27623,"53828":27685,"53829":28026,"53830":28003,"53831":28004,"53832":28022,"53833":27917,"53834":28001,"53835":28050,"53836":27992,"53837":28002,"53838":28013,"53839":28015,"53840":28049,"53841":28045,"53842":28143,"53843":28031,"53844":28038,"53845":27998,"53846":28007,"53847":28000,"53848":28055,"53849":28016,"53850":28028,"53851":27999,"53852":28034,"53853":28056,"53854":27951,"53855":28008,"53856":28043,"53857":28030,"53858":28032,"53859":28036,"53860":27926,"53861":28035,"53862":28027,"53863":28029,"53864":28021,"53865":28048,"53866":28892,"53867":28883,"53868":28881,"53869":28893,"53870":28875,"53871":32569,"53872":28898,"53873":28887,"53874":28882,"53875":28894,"53876":28896,"53877":28884,"53878":28877,"53879":28869,"53880":28870,"53881":28871,"53882":28890,"53883":28878,"53884":28897,"53885":29250,"53886":29304,"53921":29303,"53922":29302,"53923":29440,"53924":29434,"53925":29428,"53926":29438,"53927":29430,"53928":29427,"53929":29435,"53930":29441,"53931":29651,"53932":29657,"53933":29669,"53934":29654,"53935":29628,"53936":29671,"53937":29667,"53938":29673,"53939":29660,"53940":29650,"53941":29659,"53942":29652,"53943":29661,"53944":29658,"53945":29655,"53946":29656,"53947":29672,"53948":29918,"53949":29919,"53950":29940,"53951":29941,"53952":29985,"53953":30043,"53954":30047,"53955":30128,"53956":30145,"53957":30139,"53958":30148,"53959":30144,"53960":30143,"53961":30134,"53962":30138,"53963":30346,"53964":30409,"53965":30493,"53966":30491,"53967":30480,"53968":30483,"53969":30482,"53970":30499,"53971":30481,"53972":30485,"53973":30489,"53974":30490,"53975":30498,"53976":30503,"53977":30755,"53978":30764,"53979":30754,"53980":30773,"53981":30767,"53982":30760,"53983":30766,"53984":30763,"53985":30753,"53986":30761,"53987":30771,"53988":30762,"53989":30769,"53990":31060,"53991":31067,"53992":31055,"53993":31068,"53994":31059,"53995":31058,"53996":31057,"53997":31211,"53998":31212,"53999":31200,"54000":31214,"54001":31213,"54002":31210,"54003":31196,"54004":31198,"54005":31197,"54006":31366,"54007":31369,"54008":31365,"54009":31371,"54010":31372,"54011":31370,"54012":31367,"54013":31448,"54014":31504,"54080":31492,"54081":31507,"54082":31493,"54083":31503,"54084":31496,"54085":31498,"54086":31502,"54087":31497,"54088":31506,"54089":31876,"54090":31889,"54091":31882,"54092":31884,"54093":31880,"54094":31885,"54095":31877,"54096":32030,"54097":32029,"54098":32017,"54099":32014,"54100":32024,"54101":32022,"54102":32019,"54103":32031,"54104":32018,"54105":32015,"54106":32012,"54107":32604,"54108":32609,"54109":32606,"54110":32608,"54111":32605,"54112":32603,"54113":32662,"54114":32658,"54115":32707,"54116":32706,"54117":32704,"54118":32790,"54119":32830,"54120":32825,"54121":33018,"54122":33010,"54123":33017,"54124":33013,"54125":33025,"54126":33019,"54127":33024,"54128":33281,"54129":33327,"54130":33317,"54131":33587,"54132":33581,"54133":33604,"54134":33561,"54135":33617,"54136":33573,"54137":33622,"54138":33599,"54139":33601,"54140":33574,"54141":33564,"54142":33570,"54177":33602,"54178":33614,"54179":33563,"54180":33578,"54181":33544,"54182":33596,"54183":33613,"54184":33558,"54185":33572,"54186":33568,"54187":33591,"54188":33583,"54189":33577,"54190":33607,"54191":33605,"54192":33612,"54193":33619,"54194":33566,"54195":33580,"54196":33611,"54197":33575,"54198":33608,"54199":34387,"54200":34386,"54201":34466,"54202":34472,"54203":34454,"54204":34445,"54205":34449,"54206":34462,"54207":34439,"54208":34455,"54209":34438,"54210":34443,"54211":34458,"54212":34437,"54213":34469,"54214":34457,"54215":34465,"54216":34471,"54217":34453,"54218":34456,"54219":34446,"54220":34461,"54221":34448,"54222":34452,"54223":34883,"54224":34884,"54225":34925,"54226":34933,"54227":34934,"54228":34930,"54229":34944,"54230":34929,"54231":34943,"54232":34927,"54233":34947,"54234":34942,"54235":34932,"54236":34940,"54237":35346,"54238":35911,"54239":35927,"54240":35963,"54241":36004,"54242":36003,"54243":36214,"54244":36216,"54245":36277,"54246":36279,"54247":36278,"54248":36561,"54249":36563,"54250":36862,"54251":36853,"54252":36866,"54253":36863,"54254":36859,"54255":36868,"54256":36860,"54257":36854,"54258":37078,"54259":37088,"54260":37081,"54261":37082,"54262":37091,"54263":37087,"54264":37093,"54265":37080,"54266":37083,"54267":37079,"54268":37084,"54269":37092,"54270":37200,"54336":37198,"54337":37199,"54338":37333,"54339":37346,"54340":37338,"54341":38492,"54342":38495,"54343":38588,"54344":39139,"54345":39647,"54346":39727,"54347":20095,"54348":20592,"54349":20586,"54350":20577,"54351":20574,"54352":20576,"54353":20563,"54354":20555,"54355":20573,"54356":20594,"54357":20552,"54358":20557,"54359":20545,"54360":20571,"54361":20554,"54362":20578,"54363":20501,"54364":20549,"54365":20575,"54366":20585,"54367":20587,"54368":20579,"54369":20580,"54370":20550,"54371":20544,"54372":20590,"54373":20595,"54374":20567,"54375":20561,"54376":20944,"54377":21099,"54378":21101,"54379":21100,"54380":21102,"54381":21206,"54382":21203,"54383":21293,"54384":21404,"54385":21877,"54386":21878,"54387":21820,"54388":21837,"54389":21840,"54390":21812,"54391":21802,"54392":21841,"54393":21858,"54394":21814,"54395":21813,"54396":21808,"54397":21842,"54398":21829,"54433":21772,"54434":21810,"54435":21861,"54436":21838,"54437":21817,"54438":21832,"54439":21805,"54440":21819,"54441":21824,"54442":21835,"54443":22282,"54444":22279,"54445":22523,"54446":22548,"54447":22498,"54448":22518,"54449":22492,"54450":22516,"54451":22528,"54452":22509,"54453":22525,"54454":22536,"54455":22520,"54456":22539,"54457":22515,"54458":22479,"54459":22535,"54460":22510,"54461":22499,"54462":22514,"54463":22501,"54464":22508,"54465":22497,"54466":22542,"54467":22524,"54468":22544,"54469":22503,"54470":22529,"54471":22540,"54472":22513,"54473":22505,"54474":22512,"54475":22541,"54476":22532,"54477":22876,"54478":23136,"54479":23128,"54480":23125,"54481":23143,"54482":23134,"54483":23096,"54484":23093,"54485":23149,"54486":23120,"54487":23135,"54488":23141,"54489":23148,"54490":23123,"54491":23140,"54492":23127,"54493":23107,"54494":23133,"54495":23122,"54496":23108,"54497":23131,"54498":23112,"54499":23182,"54500":23102,"54501":23117,"54502":23097,"54503":23116,"54504":23152,"54505":23145,"54506":23111,"54507":23121,"54508":23126,"54509":23106,"54510":23132,"54511":23410,"54512":23406,"54513":23489,"54514":23488,"54515":23641,"54516":23838,"54517":23819,"54518":23837,"54519":23834,"54520":23840,"54521":23820,"54522":23848,"54523":23821,"54524":23846,"54525":23845,"54526":23823,"54592":23856,"54593":23826,"54594":23843,"54595":23839,"54596":23854,"54597":24126,"54598":24116,"54599":24241,"54600":24244,"54601":24249,"54602":24242,"54603":24243,"54604":24374,"54605":24376,"54606":24475,"54607":24470,"54608":24479,"54609":24714,"54610":24720,"54611":24710,"54612":24766,"54613":24752,"54614":24762,"54615":24787,"54616":24788,"54617":24783,"54618":24804,"54619":24793,"54620":24797,"54621":24776,"54622":24753,"54623":24795,"54624":24759,"54625":24778,"54626":24767,"54627":24771,"54628":24781,"54629":24768,"54630":25394,"54631":25445,"54632":25482,"54633":25474,"54634":25469,"54635":25533,"54636":25502,"54637":25517,"54638":25501,"54639":25495,"54640":25515,"54641":25486,"54642":25455,"54643":25479,"54644":25488,"54645":25454,"54646":25519,"54647":25461,"54648":25500,"54649":25453,"54650":25518,"54651":25468,"54652":25508,"54653":25403,"54654":25503,"54689":25464,"54690":25477,"54691":25473,"54692":25489,"54693":25485,"54694":25456,"54695":25939,"54696":26061,"54697":26213,"54698":26209,"54699":26203,"54700":26201,"54701":26204,"54702":26210,"54703":26392,"54704":26745,"54705":26759,"54706":26768,"54707":26780,"54708":26733,"54709":26734,"54710":26798,"54711":26795,"54712":26966,"54713":26735,"54714":26787,"54715":26796,"54716":26793,"54717":26741,"54718":26740,"54719":26802,"54720":26767,"54721":26743,"54722":26770,"54723":26748,"54724":26731,"54725":26738,"54726":26794,"54727":26752,"54728":26737,"54729":26750,"54730":26779,"54731":26774,"54732":26763,"54733":26784,"54734":26761,"54735":26788,"54736":26744,"54737":26747,"54738":26769,"54739":26764,"54740":26762,"54741":26749,"54742":27446,"54743":27443,"54744":27447,"54745":27448,"54746":27537,"54747":27535,"54748":27533,"54749":27534,"54750":27532,"54751":27690,"54752":28096,"54753":28075,"54754":28084,"54755":28083,"54756":28276,"54757":28076,"54758":28137,"54759":28130,"54760":28087,"54761":28150,"54762":28116,"54763":28160,"54764":28104,"54765":28128,"54766":28127,"54767":28118,"54768":28094,"54769":28133,"54770":28124,"54771":28125,"54772":28123,"54773":28148,"54774":28106,"54775":28093,"54776":28141,"54777":28144,"54778":28090,"54779":28117,"54780":28098,"54781":28111,"54782":28105,"54848":28112,"54849":28146,"54850":28115,"54851":28157,"54852":28119,"54853":28109,"54854":28131,"54855":28091,"54856":28922,"54857":28941,"54858":28919,"54859":28951,"54860":28916,"54861":28940,"54862":28912,"54863":28932,"54864":28915,"54865":28944,"54866":28924,"54867":28927,"54868":28934,"54869":28947,"54870":28928,"54871":28920,"54872":28918,"54873":28939,"54874":28930,"54875":28942,"54876":29310,"54877":29307,"54878":29308,"54879":29311,"54880":29469,"54881":29463,"54882":29447,"54883":29457,"54884":29464,"54885":29450,"54886":29448,"54887":29439,"54888":29455,"54889":29470,"54890":29576,"54891":29686,"54892":29688,"54893":29685,"54894":29700,"54895":29697,"54896":29693,"54897":29703,"54898":29696,"54899":29690,"54900":29692,"54901":29695,"54902":29708,"54903":29707,"54904":29684,"54905":29704,"54906":30052,"54907":30051,"54908":30158,"54909":30162,"54910":30159,"54945":30155,"54946":30156,"54947":30161,"54948":30160,"54949":30351,"54950":30345,"54951":30419,"54952":30521,"54953":30511,"54954":30509,"54955":30513,"54956":30514,"54957":30516,"54958":30515,"54959":30525,"54960":30501,"54961":30523,"54962":30517,"54963":30792,"54964":30802,"54965":30793,"54966":30797,"54967":30794,"54968":30796,"54969":30758,"54970":30789,"54971":30800,"54972":31076,"54973":31079,"54974":31081,"54975":31082,"54976":31075,"54977":31083,"54978":31073,"54979":31163,"54980":31226,"54981":31224,"54982":31222,"54983":31223,"54984":31375,"54985":31380,"54986":31376,"54987":31541,"54988":31559,"54989":31540,"54990":31525,"54991":31536,"54992":31522,"54993":31524,"54994":31539,"54995":31512,"54996":31530,"54997":31517,"54998":31537,"54999":31531,"55000":31533,"55001":31535,"55002":31538,"55003":31544,"55004":31514,"55005":31523,"55006":31892,"55007":31896,"55008":31894,"55009":31907,"55010":32053,"55011":32061,"55012":32056,"55013":32054,"55014":32058,"55015":32069,"55016":32044,"55017":32041,"55018":32065,"55019":32071,"55020":32062,"55021":32063,"55022":32074,"55023":32059,"55024":32040,"55025":32611,"55026":32661,"55027":32668,"55028":32669,"55029":32667,"55030":32714,"55031":32715,"55032":32717,"55033":32720,"55034":32721,"55035":32711,"55036":32719,"55037":32713,"55038":32799,"55104":32798,"55105":32795,"55106":32839,"55107":32835,"55108":32840,"55109":33048,"55110":33061,"55111":33049,"55112":33051,"55113":33069,"55114":33055,"55115":33068,"55116":33054,"55117":33057,"55118":33045,"55119":33063,"55120":33053,"55121":33058,"55122":33297,"55123":33336,"55124":33331,"55125":33338,"55126":33332,"55127":33330,"55128":33396,"55129":33680,"55130":33699,"55131":33704,"55132":33677,"55133":33658,"55134":33651,"55135":33700,"55136":33652,"55137":33679,"55138":33665,"55139":33685,"55140":33689,"55141":33653,"55142":33684,"55143":33705,"55144":33661,"55145":33667,"55146":33676,"55147":33693,"55148":33691,"55149":33706,"55150":33675,"55151":33662,"55152":33701,"55153":33711,"55154":33672,"55155":33687,"55156":33712,"55157":33663,"55158":33702,"55159":33671,"55160":33710,"55161":33654,"55162":33690,"55163":34393,"55164":34390,"55165":34495,"55166":34487,"55201":34498,"55202":34497,"55203":34501,"55204":34490,"55205":34480,"55206":34504,"55207":34489,"55208":34483,"55209":34488,"55210":34508,"55211":34484,"55212":34491,"55213":34492,"55214":34499,"55215":34493,"55216":34494,"55217":34898,"55218":34953,"55219":34965,"55220":34984,"55221":34978,"55222":34986,"55223":34970,"55224":34961,"55225":34977,"55226":34975,"55227":34968,"55228":34983,"55229":34969,"55230":34971,"55231":34967,"55232":34980,"55233":34988,"55234":34956,"55235":34963,"55236":34958,"55237":35202,"55238":35286,"55239":35289,"55240":35285,"55241":35376,"55242":35367,"55243":35372,"55244":35358,"55245":35897,"55246":35899,"55247":35932,"55248":35933,"55249":35965,"55250":36005,"55251":36221,"55252":36219,"55253":36217,"55254":36284,"55255":36290,"55256":36281,"55257":36287,"55258":36289,"55259":36568,"55260":36574,"55261":36573,"55262":36572,"55263":36567,"55264":36576,"55265":36577,"55266":36900,"55267":36875,"55268":36881,"55269":36892,"55270":36876,"55271":36897,"55272":37103,"55273":37098,"55274":37104,"55275":37108,"55276":37106,"55277":37107,"55278":37076,"55279":37099,"55280":37100,"55281":37097,"55282":37206,"55283":37208,"55284":37210,"55285":37203,"55286":37205,"55287":37356,"55288":37364,"55289":37361,"55290":37363,"55291":37368,"55292":37348,"55293":37369,"55294":37354,"55360":37355,"55361":37367,"55362":37352,"55363":37358,"55364":38266,"55365":38278,"55366":38280,"55367":38524,"55368":38509,"55369":38507,"55370":38513,"55371":38511,"55372":38591,"55373":38762,"55374":38916,"55375":39141,"55376":39319,"55377":20635,"55378":20629,"55379":20628,"55380":20638,"55381":20619,"55382":20643,"55383":20611,"55384":20620,"55385":20622,"55386":20637,"55387":20584,"55388":20636,"55389":20626,"55390":20610,"55391":20615,"55392":20831,"55393":20948,"55394":21266,"55395":21265,"55396":21412,"55397":21415,"55398":21905,"55399":21928,"55400":21925,"55401":21933,"55402":21879,"55403":22085,"55404":21922,"55405":21907,"55406":21896,"55407":21903,"55408":21941,"55409":21889,"55410":21923,"55411":21906,"55412":21924,"55413":21885,"55414":21900,"55415":21926,"55416":21887,"55417":21909,"55418":21921,"55419":21902,"55420":22284,"55421":22569,"55422":22583,"55457":22553,"55458":22558,"55459":22567,"55460":22563,"55461":22568,"55462":22517,"55463":22600,"55464":22565,"55465":22556,"55466":22555,"55467":22579,"55468":22591,"55469":22582,"55470":22574,"55471":22585,"55472":22584,"55473":22573,"55474":22572,"55475":22587,"55476":22881,"55477":23215,"55478":23188,"55479":23199,"55480":23162,"55481":23202,"55482":23198,"55483":23160,"55484":23206,"55485":23164,"55486":23205,"55487":23212,"55488":23189,"55489":23214,"55490":23095,"55491":23172,"55492":23178,"55493":23191,"55494":23171,"55495":23179,"55496":23209,"55497":23163,"55498":23165,"55499":23180,"55500":23196,"55501":23183,"55502":23187,"55503":23197,"55504":23530,"55505":23501,"55506":23499,"55507":23508,"55508":23505,"55509":23498,"55510":23502,"55511":23564,"55512":23600,"55513":23863,"55514":23875,"55515":23915,"55516":23873,"55517":23883,"55518":23871,"55519":23861,"55520":23889,"55521":23886,"55522":23893,"55523":23859,"55524":23866,"55525":23890,"55526":23869,"55527":23857,"55528":23897,"55529":23874,"55530":23865,"55531":23881,"55532":23864,"55533":23868,"55534":23858,"55535":23862,"55536":23872,"55537":23877,"55538":24132,"55539":24129,"55540":24408,"55541":24486,"55542":24485,"55543":24491,"55544":24777,"55545":24761,"55546":24780,"55547":24802,"55548":24782,"55549":24772,"55550":24852,"55616":24818,"55617":24842,"55618":24854,"55619":24837,"55620":24821,"55621":24851,"55622":24824,"55623":24828,"55624":24830,"55625":24769,"55626":24835,"55627":24856,"55628":24861,"55629":24848,"55630":24831,"55631":24836,"55632":24843,"55633":25162,"55634":25492,"55635":25521,"55636":25520,"55637":25550,"55638":25573,"55639":25576,"55640":25583,"55641":25539,"55642":25757,"55643":25587,"55644":25546,"55645":25568,"55646":25590,"55647":25557,"55648":25586,"55649":25589,"55650":25697,"55651":25567,"55652":25534,"55653":25565,"55654":25564,"55655":25540,"55656":25560,"55657":25555,"55658":25538,"55659":25543,"55660":25548,"55661":25547,"55662":25544,"55663":25584,"55664":25559,"55665":25561,"55666":25906,"55667":25959,"55668":25962,"55669":25956,"55670":25948,"55671":25960,"55672":25957,"55673":25996,"55674":26013,"55675":26014,"55676":26030,"55677":26064,"55678":26066,"55713":26236,"55714":26220,"55715":26235,"55716":26240,"55717":26225,"55718":26233,"55719":26218,"55720":26226,"55721":26369,"55722":26892,"55723":26835,"55724":26884,"55725":26844,"55726":26922,"55727":26860,"55728":26858,"55729":26865,"55730":26895,"55731":26838,"55732":26871,"55733":26859,"55734":26852,"55735":26870,"55736":26899,"55737":26896,"55738":26867,"55739":26849,"55740":26887,"55741":26828,"55742":26888,"55743":26992,"55744":26804,"55745":26897,"55746":26863,"55747":26822,"55748":26900,"55749":26872,"55750":26832,"55751":26877,"55752":26876,"55753":26856,"55754":26891,"55755":26890,"55756":26903,"55757":26830,"55758":26824,"55759":26845,"55760":26846,"55761":26854,"55762":26868,"55763":26833,"55764":26886,"55765":26836,"55766":26857,"55767":26901,"55768":26917,"55769":26823,"55770":27449,"55771":27451,"55772":27455,"55773":27452,"55774":27540,"55775":27543,"55776":27545,"55777":27541,"55778":27581,"55779":27632,"55780":27634,"55781":27635,"55782":27696,"55783":28156,"55784":28230,"55785":28231,"55786":28191,"55787":28233,"55788":28296,"55789":28220,"55790":28221,"55791":28229,"55792":28258,"55793":28203,"55794":28223,"55795":28225,"55796":28253,"55797":28275,"55798":28188,"55799":28211,"55800":28235,"55801":28224,"55802":28241,"55803":28219,"55804":28163,"55805":28206,"55806":28254,"55872":28264,"55873":28252,"55874":28257,"55875":28209,"55876":28200,"55877":28256,"55878":28273,"55879":28267,"55880":28217,"55881":28194,"55882":28208,"55883":28243,"55884":28261,"55885":28199,"55886":28280,"55887":28260,"55888":28279,"55889":28245,"55890":28281,"55891":28242,"55892":28262,"55893":28213,"55894":28214,"55895":28250,"55896":28960,"55897":28958,"55898":28975,"55899":28923,"55900":28974,"55901":28977,"55902":28963,"55903":28965,"55904":28962,"55905":28978,"55906":28959,"55907":28968,"55908":28986,"55909":28955,"55910":29259,"55911":29274,"55912":29320,"55913":29321,"55914":29318,"55915":29317,"55916":29323,"55917":29458,"55918":29451,"55919":29488,"55920":29474,"55921":29489,"55922":29491,"55923":29479,"55924":29490,"55925":29485,"55926":29478,"55927":29475,"55928":29493,"55929":29452,"55930":29742,"55931":29740,"55932":29744,"55933":29739,"55934":29718,"55969":29722,"55970":29729,"55971":29741,"55972":29745,"55973":29732,"55974":29731,"55975":29725,"55976":29737,"55977":29728,"55978":29746,"55979":29947,"55980":29999,"55981":30063,"55982":30060,"55983":30183,"55984":30170,"55985":30177,"55986":30182,"55987":30173,"55988":30175,"55989":30180,"55990":30167,"55991":30357,"55992":30354,"55993":30426,"55994":30534,"55995":30535,"55996":30532,"55997":30541,"55998":30533,"55999":30538,"56000":30542,"56001":30539,"56002":30540,"56003":30686,"56004":30700,"56005":30816,"56006":30820,"56007":30821,"56008":30812,"56009":30829,"56010":30833,"56011":30826,"56012":30830,"56013":30832,"56014":30825,"56015":30824,"56016":30814,"56017":30818,"56018":31092,"56019":31091,"56020":31090,"56021":31088,"56022":31234,"56023":31242,"56024":31235,"56025":31244,"56026":31236,"56027":31385,"56028":31462,"56029":31460,"56030":31562,"56031":31547,"56032":31556,"56033":31560,"56034":31564,"56035":31566,"56036":31552,"56037":31576,"56038":31557,"56039":31906,"56040":31902,"56041":31912,"56042":31905,"56043":32088,"56044":32111,"56045":32099,"56046":32083,"56047":32086,"56048":32103,"56049":32106,"56050":32079,"56051":32109,"56052":32092,"56053":32107,"56054":32082,"56055":32084,"56056":32105,"56057":32081,"56058":32095,"56059":32078,"56060":32574,"56061":32575,"56062":32613,"56128":32614,"56129":32674,"56130":32672,"56131":32673,"56132":32727,"56133":32849,"56134":32847,"56135":32848,"56136":33022,"56137":32980,"56138":33091,"56139":33098,"56140":33106,"56141":33103,"56142":33095,"56143":33085,"56144":33101,"56145":33082,"56146":33254,"56147":33262,"56148":33271,"56149":33272,"56150":33273,"56151":33284,"56152":33340,"56153":33341,"56154":33343,"56155":33397,"56156":33595,"56157":33743,"56158":33785,"56159":33827,"56160":33728,"56161":33768,"56162":33810,"56163":33767,"56164":33764,"56165":33788,"56166":33782,"56167":33808,"56168":33734,"56169":33736,"56170":33771,"56171":33763,"56172":33727,"56173":33793,"56174":33757,"56175":33765,"56176":33752,"56177":33791,"56178":33761,"56179":33739,"56180":33742,"56181":33750,"56182":33781,"56183":33737,"56184":33801,"56185":33807,"56186":33758,"56187":33809,"56188":33798,"56189":33730,"56190":33779,"56225":33749,"56226":33786,"56227":33735,"56228":33745,"56229":33770,"56230":33811,"56231":33731,"56232":33772,"56233":33774,"56234":33732,"56235":33787,"56236":33751,"56237":33762,"56238":33819,"56239":33755,"56240":33790,"56241":34520,"56242":34530,"56243":34534,"56244":34515,"56245":34531,"56246":34522,"56247":34538,"56248":34525,"56249":34539,"56250":34524,"56251":34540,"56252":34537,"56253":34519,"56254":34536,"56255":34513,"56256":34888,"56257":34902,"56258":34901,"56259":35002,"56260":35031,"56261":35001,"56262":35000,"56263":35008,"56264":35006,"56265":34998,"56266":35004,"56267":34999,"56268":35005,"56269":34994,"56270":35073,"56271":35017,"56272":35221,"56273":35224,"56274":35223,"56275":35293,"56276":35290,"56277":35291,"56278":35406,"56279":35405,"56280":35385,"56281":35417,"56282":35392,"56283":35415,"56284":35416,"56285":35396,"56286":35397,"56287":35410,"56288":35400,"56289":35409,"56290":35402,"56291":35404,"56292":35407,"56293":35935,"56294":35969,"56295":35968,"56296":36026,"56297":36030,"56298":36016,"56299":36025,"56300":36021,"56301":36228,"56302":36224,"56303":36233,"56304":36312,"56305":36307,"56306":36301,"56307":36295,"56308":36310,"56309":36316,"56310":36303,"56311":36309,"56312":36313,"56313":36296,"56314":36311,"56315":36293,"56316":36591,"56317":36599,"56318":36602,"56384":36601,"56385":36582,"56386":36590,"56387":36581,"56388":36597,"56389":36583,"56390":36584,"56391":36598,"56392":36587,"56393":36593,"56394":36588,"56395":36596,"56396":36585,"56397":36909,"56398":36916,"56399":36911,"56400":37126,"56401":37164,"56402":37124,"56403":37119,"56404":37116,"56405":37128,"56406":37113,"56407":37115,"56408":37121,"56409":37120,"56410":37127,"56411":37125,"56412":37123,"56413":37217,"56414":37220,"56415":37215,"56416":37218,"56417":37216,"56418":37377,"56419":37386,"56420":37413,"56421":37379,"56422":37402,"56423":37414,"56424":37391,"56425":37388,"56426":37376,"56427":37394,"56428":37375,"56429":37373,"56430":37382,"56431":37380,"56432":37415,"56433":37378,"56434":37404,"56435":37412,"56436":37401,"56437":37399,"56438":37381,"56439":37398,"56440":38267,"56441":38285,"56442":38284,"56443":38288,"56444":38535,"56445":38526,"56446":38536,"56481":38537,"56482":38531,"56483":38528,"56484":38594,"56485":38600,"56486":38595,"56487":38641,"56488":38640,"56489":38764,"56490":38768,"56491":38766,"56492":38919,"56493":39081,"56494":39147,"56495":40166,"56496":40697,"56497":20099,"56498":20100,"56499":20150,"56500":20669,"56501":20671,"56502":20678,"56503":20654,"56504":20676,"56505":20682,"56506":20660,"56507":20680,"56508":20674,"56509":20656,"56510":20673,"56511":20666,"56512":20657,"56513":20683,"56514":20681,"56515":20662,"56516":20664,"56517":20951,"56518":21114,"56519":21112,"56520":21115,"56521":21116,"56522":21955,"56523":21979,"56524":21964,"56525":21968,"56526":21963,"56527":21962,"56528":21981,"56529":21952,"56530":21972,"56531":21956,"56532":21993,"56533":21951,"56534":21970,"56535":21901,"56536":21967,"56537":21973,"56538":21986,"56539":21974,"56540":21960,"56541":22002,"56542":21965,"56543":21977,"56544":21954,"56545":22292,"56546":22611,"56547":22632,"56548":22628,"56549":22607,"56550":22605,"56551":22601,"56552":22639,"56553":22613,"56554":22606,"56555":22621,"56556":22617,"56557":22629,"56558":22619,"56559":22589,"56560":22627,"56561":22641,"56562":22780,"56563":23239,"56564":23236,"56565":23243,"56566":23226,"56567":23224,"56568":23217,"56569":23221,"56570":23216,"56571":23231,"56572":23240,"56573":23227,"56574":23238,"56640":23223,"56641":23232,"56642":23242,"56643":23220,"56644":23222,"56645":23245,"56646":23225,"56647":23184,"56648":23510,"56649":23512,"56650":23513,"56651":23583,"56652":23603,"56653":23921,"56654":23907,"56655":23882,"56656":23909,"56657":23922,"56658":23916,"56659":23902,"56660":23912,"56661":23911,"56662":23906,"56663":24048,"56664":24143,"56665":24142,"56666":24138,"56667":24141,"56668":24139,"56669":24261,"56670":24268,"56671":24262,"56672":24267,"56673":24263,"56674":24384,"56675":24495,"56676":24493,"56677":24823,"56678":24905,"56679":24906,"56680":24875,"56681":24901,"56682":24886,"56683":24882,"56684":24878,"56685":24902,"56686":24879,"56687":24911,"56688":24873,"56689":24896,"56690":25120,"56691":37224,"56692":25123,"56693":25125,"56694":25124,"56695":25541,"56696":25585,"56697":25579,"56698":25616,"56699":25618,"56700":25609,"56701":25632,"56702":25636,"56737":25651,"56738":25667,"56739":25631,"56740":25621,"56741":25624,"56742":25657,"56743":25655,"56744":25634,"56745":25635,"56746":25612,"56747":25638,"56748":25648,"56749":25640,"56750":25665,"56751":25653,"56752":25647,"56753":25610,"56754":25626,"56755":25664,"56756":25637,"56757":25639,"56758":25611,"56759":25575,"56760":25627,"56761":25646,"56762":25633,"56763":25614,"56764":25967,"56765":26002,"56766":26067,"56767":26246,"56768":26252,"56769":26261,"56770":26256,"56771":26251,"56772":26250,"56773":26265,"56774":26260,"56775":26232,"56776":26400,"56777":26982,"56778":26975,"56779":26936,"56780":26958,"56781":26978,"56782":26993,"56783":26943,"56784":26949,"56785":26986,"56786":26937,"56787":26946,"56788":26967,"56789":26969,"56790":27002,"56791":26952,"56792":26953,"56793":26933,"56794":26988,"56795":26931,"56796":26941,"56797":26981,"56798":26864,"56799":27000,"56800":26932,"56801":26985,"56802":26944,"56803":26991,"56804":26948,"56805":26998,"56806":26968,"56807":26945,"56808":26996,"56809":26956,"56810":26939,"56811":26955,"56812":26935,"56813":26972,"56814":26959,"56815":26961,"56816":26930,"56817":26962,"56818":26927,"56819":27003,"56820":26940,"56821":27462,"56822":27461,"56823":27459,"56824":27458,"56825":27464,"56826":27457,"56827":27547,"56828":64013,"56829":27643,"56830":27644,"56896":27641,"56897":27639,"56898":27640,"56899":28315,"56900":28374,"56901":28360,"56902":28303,"56903":28352,"56904":28319,"56905":28307,"56906":28308,"56907":28320,"56908":28337,"56909":28345,"56910":28358,"56911":28370,"56912":28349,"56913":28353,"56914":28318,"56915":28361,"56916":28343,"56917":28336,"56918":28365,"56919":28326,"56920":28367,"56921":28338,"56922":28350,"56923":28355,"56924":28380,"56925":28376,"56926":28313,"56927":28306,"56928":28302,"56929":28301,"56930":28324,"56931":28321,"56932":28351,"56933":28339,"56934":28368,"56935":28362,"56936":28311,"56937":28334,"56938":28323,"56939":28999,"56940":29012,"56941":29010,"56942":29027,"56943":29024,"56944":28993,"56945":29021,"56946":29026,"56947":29042,"56948":29048,"56949":29034,"56950":29025,"56951":28994,"56952":29016,"56953":28995,"56954":29003,"56955":29040,"56956":29023,"56957":29008,"56958":29011,"56993":28996,"56994":29005,"56995":29018,"56996":29263,"56997":29325,"56998":29324,"56999":29329,"57000":29328,"57001":29326,"57002":29500,"57003":29506,"57004":29499,"57005":29498,"57006":29504,"57007":29514,"57008":29513,"57009":29764,"57010":29770,"57011":29771,"57012":29778,"57013":29777,"57014":29783,"57015":29760,"57016":29775,"57017":29776,"57018":29774,"57019":29762,"57020":29766,"57021":29773,"57022":29780,"57023":29921,"57024":29951,"57025":29950,"57026":29949,"57027":29981,"57028":30073,"57029":30071,"57030":27011,"57031":30191,"57032":30223,"57033":30211,"57034":30199,"57035":30206,"57036":30204,"57037":30201,"57038":30200,"57039":30224,"57040":30203,"57041":30198,"57042":30189,"57043":30197,"57044":30205,"57045":30361,"57046":30389,"57047":30429,"57048":30549,"57049":30559,"57050":30560,"57051":30546,"57052":30550,"57053":30554,"57054":30569,"57055":30567,"57056":30548,"57057":30553,"57058":30573,"57059":30688,"57060":30855,"57061":30874,"57062":30868,"57063":30863,"57064":30852,"57065":30869,"57066":30853,"57067":30854,"57068":30881,"57069":30851,"57070":30841,"57071":30873,"57072":30848,"57073":30870,"57074":30843,"57075":31100,"57076":31106,"57077":31101,"57078":31097,"57079":31249,"57080":31256,"57081":31257,"57082":31250,"57083":31255,"57084":31253,"57085":31266,"57086":31251,"57152":31259,"57153":31248,"57154":31395,"57155":31394,"57156":31390,"57157":31467,"57158":31590,"57159":31588,"57160":31597,"57161":31604,"57162":31593,"57163":31602,"57164":31589,"57165":31603,"57166":31601,"57167":31600,"57168":31585,"57169":31608,"57170":31606,"57171":31587,"57172":31922,"57173":31924,"57174":31919,"57175":32136,"57176":32134,"57177":32128,"57178":32141,"57179":32127,"57180":32133,"57181":32122,"57182":32142,"57183":32123,"57184":32131,"57185":32124,"57186":32140,"57187":32148,"57188":32132,"57189":32125,"57190":32146,"57191":32621,"57192":32619,"57193":32615,"57194":32616,"57195":32620,"57196":32678,"57197":32677,"57198":32679,"57199":32731,"57200":32732,"57201":32801,"57202":33124,"57203":33120,"57204":33143,"57205":33116,"57206":33129,"57207":33115,"57208":33122,"57209":33138,"57210":26401,"57211":33118,"57212":33142,"57213":33127,"57214":33135,"57249":33092,"57250":33121,"57251":33309,"57252":33353,"57253":33348,"57254":33344,"57255":33346,"57256":33349,"57257":34033,"57258":33855,"57259":33878,"57260":33910,"57261":33913,"57262":33935,"57263":33933,"57264":33893,"57265":33873,"57266":33856,"57267":33926,"57268":33895,"57269":33840,"57270":33869,"57271":33917,"57272":33882,"57273":33881,"57274":33908,"57275":33907,"57276":33885,"57277":34055,"57278":33886,"57279":33847,"57280":33850,"57281":33844,"57282":33914,"57283":33859,"57284":33912,"57285":33842,"57286":33861,"57287":33833,"57288":33753,"57289":33867,"57290":33839,"57291":33858,"57292":33837,"57293":33887,"57294":33904,"57295":33849,"57296":33870,"57297":33868,"57298":33874,"57299":33903,"57300":33989,"57301":33934,"57302":33851,"57303":33863,"57304":33846,"57305":33843,"57306":33896,"57307":33918,"57308":33860,"57309":33835,"57310":33888,"57311":33876,"57312":33902,"57313":33872,"57314":34571,"57315":34564,"57316":34551,"57317":34572,"57318":34554,"57319":34518,"57320":34549,"57321":34637,"57322":34552,"57323":34574,"57324":34569,"57325":34561,"57326":34550,"57327":34573,"57328":34565,"57329":35030,"57330":35019,"57331":35021,"57332":35022,"57333":35038,"57334":35035,"57335":35034,"57336":35020,"57337":35024,"57338":35205,"57339":35227,"57340":35295,"57341":35301,"57342":35300,"57408":35297,"57409":35296,"57410":35298,"57411":35292,"57412":35302,"57413":35446,"57414":35462,"57415":35455,"57416":35425,"57417":35391,"57418":35447,"57419":35458,"57420":35460,"57421":35445,"57422":35459,"57423":35457,"57424":35444,"57425":35450,"57426":35900,"57427":35915,"57428":35914,"57429":35941,"57430":35940,"57431":35942,"57432":35974,"57433":35972,"57434":35973,"57435":36044,"57436":36200,"57437":36201,"57438":36241,"57439":36236,"57440":36238,"57441":36239,"57442":36237,"57443":36243,"57444":36244,"57445":36240,"57446":36242,"57447":36336,"57448":36320,"57449":36332,"57450":36337,"57451":36334,"57452":36304,"57453":36329,"57454":36323,"57455":36322,"57456":36327,"57457":36338,"57458":36331,"57459":36340,"57460":36614,"57461":36607,"57462":36609,"57463":36608,"57464":36613,"57465":36615,"57466":36616,"57467":36610,"57468":36619,"57469":36946,"57470":36927,"57505":36932,"57506":36937,"57507":36925,"57508":37136,"57509":37133,"57510":37135,"57511":37137,"57512":37142,"57513":37140,"57514":37131,"57515":37134,"57516":37230,"57517":37231,"57518":37448,"57519":37458,"57520":37424,"57521":37434,"57522":37478,"57523":37427,"57524":37477,"57525":37470,"57526":37507,"57527":37422,"57528":37450,"57529":37446,"57530":37485,"57531":37484,"57532":37455,"57533":37472,"57534":37479,"57535":37487,"57536":37430,"57537":37473,"57538":37488,"57539":37425,"57540":37460,"57541":37475,"57542":37456,"57543":37490,"57544":37454,"57545":37459,"57546":37452,"57547":37462,"57548":37426,"57549":38303,"57550":38300,"57551":38302,"57552":38299,"57553":38546,"57554":38547,"57555":38545,"57556":38551,"57557":38606,"57558":38650,"57559":38653,"57560":38648,"57561":38645,"57562":38771,"57563":38775,"57564":38776,"57565":38770,"57566":38927,"57567":38925,"57568":38926,"57569":39084,"57570":39158,"57571":39161,"57572":39343,"57573":39346,"57574":39344,"57575":39349,"57576":39597,"57577":39595,"57578":39771,"57579":40170,"57580":40173,"57581":40167,"57582":40576,"57583":40701,"57584":20710,"57585":20692,"57586":20695,"57587":20712,"57588":20723,"57589":20699,"57590":20714,"57591":20701,"57592":20708,"57593":20691,"57594":20716,"57595":20720,"57596":20719,"57597":20707,"57598":20704,"57664":20952,"57665":21120,"57666":21121,"57667":21225,"57668":21227,"57669":21296,"57670":21420,"57671":22055,"57672":22037,"57673":22028,"57674":22034,"57675":22012,"57676":22031,"57677":22044,"57678":22017,"57679":22035,"57680":22018,"57681":22010,"57682":22045,"57683":22020,"57684":22015,"57685":22009,"57686":22665,"57687":22652,"57688":22672,"57689":22680,"57690":22662,"57691":22657,"57692":22655,"57693":22644,"57694":22667,"57695":22650,"57696":22663,"57697":22673,"57698":22670,"57699":22646,"57700":22658,"57701":22664,"57702":22651,"57703":22676,"57704":22671,"57705":22782,"57706":22891,"57707":23260,"57708":23278,"57709":23269,"57710":23253,"57711":23274,"57712":23258,"57713":23277,"57714":23275,"57715":23283,"57716":23266,"57717":23264,"57718":23259,"57719":23276,"57720":23262,"57721":23261,"57722":23257,"57723":23272,"57724":23263,"57725":23415,"57726":23520,"57761":23523,"57762":23651,"57763":23938,"57764":23936,"57765":23933,"57766":23942,"57767":23930,"57768":23937,"57769":23927,"57770":23946,"57771":23945,"57772":23944,"57773":23934,"57774":23932,"57775":23949,"57776":23929,"57777":23935,"57778":24152,"57779":24153,"57780":24147,"57781":24280,"57782":24273,"57783":24279,"57784":24270,"57785":24284,"57786":24277,"57787":24281,"57788":24274,"57789":24276,"57790":24388,"57791":24387,"57792":24431,"57793":24502,"57794":24876,"57795":24872,"57796":24897,"57797":24926,"57798":24945,"57799":24947,"57800":24914,"57801":24915,"57802":24946,"57803":24940,"57804":24960,"57805":24948,"57806":24916,"57807":24954,"57808":24923,"57809":24933,"57810":24891,"57811":24938,"57812":24929,"57813":24918,"57814":25129,"57815":25127,"57816":25131,"57817":25643,"57818":25677,"57819":25691,"57820":25693,"57821":25716,"57822":25718,"57823":25714,"57824":25715,"57825":25725,"57826":25717,"57827":25702,"57828":25766,"57829":25678,"57830":25730,"57831":25694,"57832":25692,"57833":25675,"57834":25683,"57835":25696,"57836":25680,"57837":25727,"57838":25663,"57839":25708,"57840":25707,"57841":25689,"57842":25701,"57843":25719,"57844":25971,"57845":26016,"57846":26273,"57847":26272,"57848":26271,"57849":26373,"57850":26372,"57851":26402,"57852":27057,"57853":27062,"57854":27081,"57920":27040,"57921":27086,"57922":27030,"57923":27056,"57924":27052,"57925":27068,"57926":27025,"57927":27033,"57928":27022,"57929":27047,"57930":27021,"57931":27049,"57932":27070,"57933":27055,"57934":27071,"57935":27076,"57936":27069,"57937":27044,"57938":27092,"57939":27065,"57940":27082,"57941":27034,"57942":27087,"57943":27059,"57944":27027,"57945":27050,"57946":27041,"57947":27038,"57948":27097,"57949":27031,"57950":27024,"57951":27074,"57952":27061,"57953":27045,"57954":27078,"57955":27466,"57956":27469,"57957":27467,"57958":27550,"57959":27551,"57960":27552,"57961":27587,"57962":27588,"57963":27646,"57964":28366,"57965":28405,"57966":28401,"57967":28419,"57968":28453,"57969":28408,"57970":28471,"57971":28411,"57972":28462,"57973":28425,"57974":28494,"57975":28441,"57976":28442,"57977":28455,"57978":28440,"57979":28475,"57980":28434,"57981":28397,"57982":28426,"58017":28470,"58018":28531,"58019":28409,"58020":28398,"58021":28461,"58022":28480,"58023":28464,"58024":28476,"58025":28469,"58026":28395,"58027":28423,"58028":28430,"58029":28483,"58030":28421,"58031":28413,"58032":28406,"58033":28473,"58034":28444,"58035":28412,"58036":28474,"58037":28447,"58038":28429,"58039":28446,"58040":28424,"58041":28449,"58042":29063,"58043":29072,"58044":29065,"58045":29056,"58046":29061,"58047":29058,"58048":29071,"58049":29051,"58050":29062,"58051":29057,"58052":29079,"58053":29252,"58054":29267,"58055":29335,"58056":29333,"58057":29331,"58058":29507,"58059":29517,"58060":29521,"58061":29516,"58062":29794,"58063":29811,"58064":29809,"58065":29813,"58066":29810,"58067":29799,"58068":29806,"58069":29952,"58070":29954,"58071":29955,"58072":30077,"58073":30096,"58074":30230,"58075":30216,"58076":30220,"58077":30229,"58078":30225,"58079":30218,"58080":30228,"58081":30392,"58082":30593,"58083":30588,"58084":30597,"58085":30594,"58086":30574,"58087":30592,"58088":30575,"58089":30590,"58090":30595,"58091":30898,"58092":30890,"58093":30900,"58094":30893,"58095":30888,"58096":30846,"58097":30891,"58098":30878,"58099":30885,"58100":30880,"58101":30892,"58102":30882,"58103":30884,"58104":31128,"58105":31114,"58106":31115,"58107":31126,"58108":31125,"58109":31124,"58110":31123,"58176":31127,"58177":31112,"58178":31122,"58179":31120,"58180":31275,"58181":31306,"58182":31280,"58183":31279,"58184":31272,"58185":31270,"58186":31400,"58187":31403,"58188":31404,"58189":31470,"58190":31624,"58191":31644,"58192":31626,"58193":31633,"58194":31632,"58195":31638,"58196":31629,"58197":31628,"58198":31643,"58199":31630,"58200":31621,"58201":31640,"58202":21124,"58203":31641,"58204":31652,"58205":31618,"58206":31931,"58207":31935,"58208":31932,"58209":31930,"58210":32167,"58211":32183,"58212":32194,"58213":32163,"58214":32170,"58215":32193,"58216":32192,"58217":32197,"58218":32157,"58219":32206,"58220":32196,"58221":32198,"58222":32203,"58223":32204,"58224":32175,"58225":32185,"58226":32150,"58227":32188,"58228":32159,"58229":32166,"58230":32174,"58231":32169,"58232":32161,"58233":32201,"58234":32627,"58235":32738,"58236":32739,"58237":32741,"58238":32734,"58273":32804,"58274":32861,"58275":32860,"58276":33161,"58277":33158,"58278":33155,"58279":33159,"58280":33165,"58281":33164,"58282":33163,"58283":33301,"58284":33943,"58285":33956,"58286":33953,"58287":33951,"58288":33978,"58289":33998,"58290":33986,"58291":33964,"58292":33966,"58293":33963,"58294":33977,"58295":33972,"58296":33985,"58297":33997,"58298":33962,"58299":33946,"58300":33969,"58301":34000,"58302":33949,"58303":33959,"58304":33979,"58305":33954,"58306":33940,"58307":33991,"58308":33996,"58309":33947,"58310":33961,"58311":33967,"58312":33960,"58313":34006,"58314":33944,"58315":33974,"58316":33999,"58317":33952,"58318":34007,"58319":34004,"58320":34002,"58321":34011,"58322":33968,"58323":33937,"58324":34401,"58325":34611,"58326":34595,"58327":34600,"58328":34667,"58329":34624,"58330":34606,"58331":34590,"58332":34593,"58333":34585,"58334":34587,"58335":34627,"58336":34604,"58337":34625,"58338":34622,"58339":34630,"58340":34592,"58341":34610,"58342":34602,"58343":34605,"58344":34620,"58345":34578,"58346":34618,"58347":34609,"58348":34613,"58349":34626,"58350":34598,"58351":34599,"58352":34616,"58353":34596,"58354":34586,"58355":34608,"58356":34577,"58357":35063,"58358":35047,"58359":35057,"58360":35058,"58361":35066,"58362":35070,"58363":35054,"58364":35068,"58365":35062,"58366":35067,"58432":35056,"58433":35052,"58434":35051,"58435":35229,"58436":35233,"58437":35231,"58438":35230,"58439":35305,"58440":35307,"58441":35304,"58442":35499,"58443":35481,"58444":35467,"58445":35474,"58446":35471,"58447":35478,"58448":35901,"58449":35944,"58450":35945,"58451":36053,"58452":36047,"58453":36055,"58454":36246,"58455":36361,"58456":36354,"58457":36351,"58458":36365,"58459":36349,"58460":36362,"58461":36355,"58462":36359,"58463":36358,"58464":36357,"58465":36350,"58466":36352,"58467":36356,"58468":36624,"58469":36625,"58470":36622,"58471":36621,"58472":37155,"58473":37148,"58474":37152,"58475":37154,"58476":37151,"58477":37149,"58478":37146,"58479":37156,"58480":37153,"58481":37147,"58482":37242,"58483":37234,"58484":37241,"58485":37235,"58486":37541,"58487":37540,"58488":37494,"58489":37531,"58490":37498,"58491":37536,"58492":37524,"58493":37546,"58494":37517,"58529":37542,"58530":37530,"58531":37547,"58532":37497,"58533":37527,"58534":37503,"58535":37539,"58536":37614,"58537":37518,"58538":37506,"58539":37525,"58540":37538,"58541":37501,"58542":37512,"58543":37537,"58544":37514,"58545":37510,"58546":37516,"58547":37529,"58548":37543,"58549":37502,"58550":37511,"58551":37545,"58552":37533,"58553":37515,"58554":37421,"58555":38558,"58556":38561,"58557":38655,"58558":38744,"58559":38781,"58560":38778,"58561":38782,"58562":38787,"58563":38784,"58564":38786,"58565":38779,"58566":38788,"58567":38785,"58568":38783,"58569":38862,"58570":38861,"58571":38934,"58572":39085,"58573":39086,"58574":39170,"58575":39168,"58576":39175,"58577":39325,"58578":39324,"58579":39363,"58580":39353,"58581":39355,"58582":39354,"58583":39362,"58584":39357,"58585":39367,"58586":39601,"58587":39651,"58588":39655,"58589":39742,"58590":39743,"58591":39776,"58592":39777,"58593":39775,"58594":40177,"58595":40178,"58596":40181,"58597":40615,"58598":20735,"58599":20739,"58600":20784,"58601":20728,"58602":20742,"58603":20743,"58604":20726,"58605":20734,"58606":20747,"58607":20748,"58608":20733,"58609":20746,"58610":21131,"58611":21132,"58612":21233,"58613":21231,"58614":22088,"58615":22082,"58616":22092,"58617":22069,"58618":22081,"58619":22090,"58620":22089,"58621":22086,"58622":22104,"58688":22106,"58689":22080,"58690":22067,"58691":22077,"58692":22060,"58693":22078,"58694":22072,"58695":22058,"58696":22074,"58697":22298,"58698":22699,"58699":22685,"58700":22705,"58701":22688,"58702":22691,"58703":22703,"58704":22700,"58705":22693,"58706":22689,"58707":22783,"58708":23295,"58709":23284,"58710":23293,"58711":23287,"58712":23286,"58713":23299,"58714":23288,"58715":23298,"58716":23289,"58717":23297,"58718":23303,"58719":23301,"58720":23311,"58721":23655,"58722":23961,"58723":23959,"58724":23967,"58725":23954,"58726":23970,"58727":23955,"58728":23957,"58729":23968,"58730":23964,"58731":23969,"58732":23962,"58733":23966,"58734":24169,"58735":24157,"58736":24160,"58737":24156,"58738":32243,"58739":24283,"58740":24286,"58741":24289,"58742":24393,"58743":24498,"58744":24971,"58745":24963,"58746":24953,"58747":25009,"58748":25008,"58749":24994,"58750":24969,"58785":24987,"58786":24979,"58787":25007,"58788":25005,"58789":24991,"58790":24978,"58791":25002,"58792":24993,"58793":24973,"58794":24934,"58795":25011,"58796":25133,"58797":25710,"58798":25712,"58799":25750,"58800":25760,"58801":25733,"58802":25751,"58803":25756,"58804":25743,"58805":25739,"58806":25738,"58807":25740,"58808":25763,"58809":25759,"58810":25704,"58811":25777,"58812":25752,"58813":25974,"58814":25978,"58815":25977,"58816":25979,"58817":26034,"58818":26035,"58819":26293,"58820":26288,"58821":26281,"58822":26290,"58823":26295,"58824":26282,"58825":26287,"58826":27136,"58827":27142,"58828":27159,"58829":27109,"58830":27128,"58831":27157,"58832":27121,"58833":27108,"58834":27168,"58835":27135,"58836":27116,"58837":27106,"58838":27163,"58839":27165,"58840":27134,"58841":27175,"58842":27122,"58843":27118,"58844":27156,"58845":27127,"58846":27111,"58847":27200,"58848":27144,"58849":27110,"58850":27131,"58851":27149,"58852":27132,"58853":27115,"58854":27145,"58855":27140,"58856":27160,"58857":27173,"58858":27151,"58859":27126,"58860":27174,"58861":27143,"58862":27124,"58863":27158,"58864":27473,"58865":27557,"58866":27555,"58867":27554,"58868":27558,"58869":27649,"58870":27648,"58871":27647,"58872":27650,"58873":28481,"58874":28454,"58875":28542,"58876":28551,"58877":28614,"58878":28562,"58944":28557,"58945":28553,"58946":28556,"58947":28514,"58948":28495,"58949":28549,"58950":28506,"58951":28566,"58952":28534,"58953":28524,"58954":28546,"58955":28501,"58956":28530,"58957":28498,"58958":28496,"58959":28503,"58960":28564,"58961":28563,"58962":28509,"58963":28416,"58964":28513,"58965":28523,"58966":28541,"58967":28519,"58968":28560,"58969":28499,"58970":28555,"58971":28521,"58972":28543,"58973":28565,"58974":28515,"58975":28535,"58976":28522,"58977":28539,"58978":29106,"58979":29103,"58980":29083,"58981":29104,"58982":29088,"58983":29082,"58984":29097,"58985":29109,"58986":29085,"58987":29093,"58988":29086,"58989":29092,"58990":29089,"58991":29098,"58992":29084,"58993":29095,"58994":29107,"58995":29336,"58996":29338,"58997":29528,"58998":29522,"58999":29534,"59000":29535,"59001":29536,"59002":29533,"59003":29531,"59004":29537,"59005":29530,"59006":29529,"59041":29538,"59042":29831,"59043":29833,"59044":29834,"59045":29830,"59046":29825,"59047":29821,"59048":29829,"59049":29832,"59050":29820,"59051":29817,"59052":29960,"59053":29959,"59054":30078,"59055":30245,"59056":30238,"59057":30233,"59058":30237,"59059":30236,"59060":30243,"59061":30234,"59062":30248,"59063":30235,"59064":30364,"59065":30365,"59066":30366,"59067":30363,"59068":30605,"59069":30607,"59070":30601,"59071":30600,"59072":30925,"59073":30907,"59074":30927,"59075":30924,"59076":30929,"59077":30926,"59078":30932,"59079":30920,"59080":30915,"59081":30916,"59082":30921,"59083":31130,"59084":31137,"59085":31136,"59086":31132,"59087":31138,"59088":31131,"59089":27510,"59090":31289,"59091":31410,"59092":31412,"59093":31411,"59094":31671,"59095":31691,"59096":31678,"59097":31660,"59098":31694,"59099":31663,"59100":31673,"59101":31690,"59102":31669,"59103":31941,"59104":31944,"59105":31948,"59106":31947,"59107":32247,"59108":32219,"59109":32234,"59110":32231,"59111":32215,"59112":32225,"59113":32259,"59114":32250,"59115":32230,"59116":32246,"59117":32241,"59118":32240,"59119":32238,"59120":32223,"59121":32630,"59122":32684,"59123":32688,"59124":32685,"59125":32749,"59126":32747,"59127":32746,"59128":32748,"59129":32742,"59130":32744,"59131":32868,"59132":32871,"59133":33187,"59134":33183,"59200":33182,"59201":33173,"59202":33186,"59203":33177,"59204":33175,"59205":33302,"59206":33359,"59207":33363,"59208":33362,"59209":33360,"59210":33358,"59211":33361,"59212":34084,"59213":34107,"59214":34063,"59215":34048,"59216":34089,"59217":34062,"59218":34057,"59219":34061,"59220":34079,"59221":34058,"59222":34087,"59223":34076,"59224":34043,"59225":34091,"59226":34042,"59227":34056,"59228":34060,"59229":34036,"59230":34090,"59231":34034,"59232":34069,"59233":34039,"59234":34027,"59235":34035,"59236":34044,"59237":34066,"59238":34026,"59239":34025,"59240":34070,"59241":34046,"59242":34088,"59243":34077,"59244":34094,"59245":34050,"59246":34045,"59247":34078,"59248":34038,"59249":34097,"59250":34086,"59251":34023,"59252":34024,"59253":34032,"59254":34031,"59255":34041,"59256":34072,"59257":34080,"59258":34096,"59259":34059,"59260":34073,"59261":34095,"59262":34402,"59297":34646,"59298":34659,"59299":34660,"59300":34679,"59301":34785,"59302":34675,"59303":34648,"59304":34644,"59305":34651,"59306":34642,"59307":34657,"59308":34650,"59309":34641,"59310":34654,"59311":34669,"59312":34666,"59313":34640,"59314":34638,"59315":34655,"59316":34653,"59317":34671,"59318":34668,"59319":34682,"59320":34670,"59321":34652,"59322":34661,"59323":34639,"59324":34683,"59325":34677,"59326":34658,"59327":34663,"59328":34665,"59329":34906,"59330":35077,"59331":35084,"59332":35092,"59333":35083,"59334":35095,"59335":35096,"59336":35097,"59337":35078,"59338":35094,"59339":35089,"59340":35086,"59341":35081,"59342":35234,"59343":35236,"59344":35235,"59345":35309,"59346":35312,"59347":35308,"59348":35535,"59349":35526,"59350":35512,"59351":35539,"59352":35537,"59353":35540,"59354":35541,"59355":35515,"59356":35543,"59357":35518,"59358":35520,"59359":35525,"59360":35544,"59361":35523,"59362":35514,"59363":35517,"59364":35545,"59365":35902,"59366":35917,"59367":35983,"59368":36069,"59369":36063,"59370":36057,"59371":36072,"59372":36058,"59373":36061,"59374":36071,"59375":36256,"59376":36252,"59377":36257,"59378":36251,"59379":36384,"59380":36387,"59381":36389,"59382":36388,"59383":36398,"59384":36373,"59385":36379,"59386":36374,"59387":36369,"59388":36377,"59389":36390,"59390":36391,"59456":36372,"59457":36370,"59458":36376,"59459":36371,"59460":36380,"59461":36375,"59462":36378,"59463":36652,"59464":36644,"59465":36632,"59466":36634,"59467":36640,"59468":36643,"59469":36630,"59470":36631,"59471":36979,"59472":36976,"59473":36975,"59474":36967,"59475":36971,"59476":37167,"59477":37163,"59478":37161,"59479":37162,"59480":37170,"59481":37158,"59482":37166,"59483":37253,"59484":37254,"59485":37258,"59486":37249,"59487":37250,"59488":37252,"59489":37248,"59490":37584,"59491":37571,"59492":37572,"59493":37568,"59494":37593,"59495":37558,"59496":37583,"59497":37617,"59498":37599,"59499":37592,"59500":37609,"59501":37591,"59502":37597,"59503":37580,"59504":37615,"59505":37570,"59506":37608,"59507":37578,"59508":37576,"59509":37582,"59510":37606,"59511":37581,"59512":37589,"59513":37577,"59514":37600,"59515":37598,"59516":37607,"59517":37585,"59518":37587,"59553":37557,"59554":37601,"59555":37574,"59556":37556,"59557":38268,"59558":38316,"59559":38315,"59560":38318,"59561":38320,"59562":38564,"59563":38562,"59564":38611,"59565":38661,"59566":38664,"59567":38658,"59568":38746,"59569":38794,"59570":38798,"59571":38792,"59572":38864,"59573":38863,"59574":38942,"59575":38941,"59576":38950,"59577":38953,"59578":38952,"59579":38944,"59580":38939,"59581":38951,"59582":39090,"59583":39176,"59584":39162,"59585":39185,"59586":39188,"59587":39190,"59588":39191,"59589":39189,"59590":39388,"59591":39373,"59592":39375,"59593":39379,"59594":39380,"59595":39374,"59596":39369,"59597":39382,"59598":39384,"59599":39371,"59600":39383,"59601":39372,"59602":39603,"59603":39660,"59604":39659,"59605":39667,"59606":39666,"59607":39665,"59608":39750,"59609":39747,"59610":39783,"59611":39796,"59612":39793,"59613":39782,"59614":39798,"59615":39797,"59616":39792,"59617":39784,"59618":39780,"59619":39788,"59620":40188,"59621":40186,"59622":40189,"59623":40191,"59624":40183,"59625":40199,"59626":40192,"59627":40185,"59628":40187,"59629":40200,"59630":40197,"59631":40196,"59632":40579,"59633":40659,"59634":40719,"59635":40720,"59636":20764,"59637":20755,"59638":20759,"59639":20762,"59640":20753,"59641":20958,"59642":21300,"59643":21473,"59644":22128,"59645":22112,"59646":22126,"59712":22131,"59713":22118,"59714":22115,"59715":22125,"59716":22130,"59717":22110,"59718":22135,"59719":22300,"59720":22299,"59721":22728,"59722":22717,"59723":22729,"59724":22719,"59725":22714,"59726":22722,"59727":22716,"59728":22726,"59729":23319,"59730":23321,"59731":23323,"59732":23329,"59733":23316,"59734":23315,"59735":23312,"59736":23318,"59737":23336,"59738":23322,"59739":23328,"59740":23326,"59741":23535,"59742":23980,"59743":23985,"59744":23977,"59745":23975,"59746":23989,"59747":23984,"59748":23982,"59749":23978,"59750":23976,"59751":23986,"59752":23981,"59753":23983,"59754":23988,"59755":24167,"59756":24168,"59757":24166,"59758":24175,"59759":24297,"59760":24295,"59761":24294,"59762":24296,"59763":24293,"59764":24395,"59765":24508,"59766":24989,"59767":25000,"59768":24982,"59769":25029,"59770":25012,"59771":25030,"59772":25025,"59773":25036,"59774":25018,"59809":25023,"59810":25016,"59811":24972,"59812":25815,"59813":25814,"59814":25808,"59815":25807,"59816":25801,"59817":25789,"59818":25737,"59819":25795,"59820":25819,"59821":25843,"59822":25817,"59823":25907,"59824":25983,"59825":25980,"59826":26018,"59827":26312,"59828":26302,"59829":26304,"59830":26314,"59831":26315,"59832":26319,"59833":26301,"59834":26299,"59835":26298,"59836":26316,"59837":26403,"59838":27188,"59839":27238,"59840":27209,"59841":27239,"59842":27186,"59843":27240,"59844":27198,"59845":27229,"59846":27245,"59847":27254,"59848":27227,"59849":27217,"59850":27176,"59851":27226,"59852":27195,"59853":27199,"59854":27201,"59855":27242,"59856":27236,"59857":27216,"59858":27215,"59859":27220,"59860":27247,"59861":27241,"59862":27232,"59863":27196,"59864":27230,"59865":27222,"59866":27221,"59867":27213,"59868":27214,"59869":27206,"59870":27477,"59871":27476,"59872":27478,"59873":27559,"59874":27562,"59875":27563,"59876":27592,"59877":27591,"59878":27652,"59879":27651,"59880":27654,"59881":28589,"59882":28619,"59883":28579,"59884":28615,"59885":28604,"59886":28622,"59887":28616,"59888":28510,"59889":28612,"59890":28605,"59891":28574,"59892":28618,"59893":28584,"59894":28676,"59895":28581,"59896":28590,"59897":28602,"59898":28588,"59899":28586,"59900":28623,"59901":28607,"59902":28600,"59968":28578,"59969":28617,"59970":28587,"59971":28621,"59972":28591,"59973":28594,"59974":28592,"59975":29125,"59976":29122,"59977":29119,"59978":29112,"59979":29142,"59980":29120,"59981":29121,"59982":29131,"59983":29140,"59984":29130,"59985":29127,"59986":29135,"59987":29117,"59988":29144,"59989":29116,"59990":29126,"59991":29146,"59992":29147,"59993":29341,"59994":29342,"59995":29545,"59996":29542,"59997":29543,"59998":29548,"59999":29541,"60000":29547,"60001":29546,"60002":29823,"60003":29850,"60004":29856,"60005":29844,"60006":29842,"60007":29845,"60008":29857,"60009":29963,"60010":30080,"60011":30255,"60012":30253,"60013":30257,"60014":30269,"60015":30259,"60016":30268,"60017":30261,"60018":30258,"60019":30256,"60020":30395,"60021":30438,"60022":30618,"60023":30621,"60024":30625,"60025":30620,"60026":30619,"60027":30626,"60028":30627,"60029":30613,"60030":30617,"60065":30615,"60066":30941,"60067":30953,"60068":30949,"60069":30954,"60070":30942,"60071":30947,"60072":30939,"60073":30945,"60074":30946,"60075":30957,"60076":30943,"60077":30944,"60078":31140,"60079":31300,"60080":31304,"60081":31303,"60082":31414,"60083":31416,"60084":31413,"60085":31409,"60086":31415,"60087":31710,"60088":31715,"60089":31719,"60090":31709,"60091":31701,"60092":31717,"60093":31706,"60094":31720,"60095":31737,"60096":31700,"60097":31722,"60098":31714,"60099":31708,"60100":31723,"60101":31704,"60102":31711,"60103":31954,"60104":31956,"60105":31959,"60106":31952,"60107":31953,"60108":32274,"60109":32289,"60110":32279,"60111":32268,"60112":32287,"60113":32288,"60114":32275,"60115":32270,"60116":32284,"60117":32277,"60118":32282,"60119":32290,"60120":32267,"60121":32271,"60122":32278,"60123":32269,"60124":32276,"60125":32293,"60126":32292,"60127":32579,"60128":32635,"60129":32636,"60130":32634,"60131":32689,"60132":32751,"60133":32810,"60134":32809,"60135":32876,"60136":33201,"60137":33190,"60138":33198,"60139":33209,"60140":33205,"60141":33195,"60142":33200,"60143":33196,"60144":33204,"60145":33202,"60146":33207,"60147":33191,"60148":33266,"60149":33365,"60150":33366,"60151":33367,"60152":34134,"60153":34117,"60154":34155,"60155":34125,"60156":34131,"60157":34145,"60158":34136,"60224":34112,"60225":34118,"60226":34148,"60227":34113,"60228":34146,"60229":34116,"60230":34129,"60231":34119,"60232":34147,"60233":34110,"60234":34139,"60235":34161,"60236":34126,"60237":34158,"60238":34165,"60239":34133,"60240":34151,"60241":34144,"60242":34188,"60243":34150,"60244":34141,"60245":34132,"60246":34149,"60247":34156,"60248":34403,"60249":34405,"60250":34404,"60251":34715,"60252":34703,"60253":34711,"60254":34707,"60255":34706,"60256":34696,"60257":34689,"60258":34710,"60259":34712,"60260":34681,"60261":34695,"60262":34723,"60263":34693,"60264":34704,"60265":34705,"60266":34717,"60267":34692,"60268":34708,"60269":34716,"60270":34714,"60271":34697,"60272":35102,"60273":35110,"60274":35120,"60275":35117,"60276":35118,"60277":35111,"60278":35121,"60279":35106,"60280":35113,"60281":35107,"60282":35119,"60283":35116,"60284":35103,"60285":35313,"60286":35552,"60321":35554,"60322":35570,"60323":35572,"60324":35573,"60325":35549,"60326":35604,"60327":35556,"60328":35551,"60329":35568,"60330":35528,"60331":35550,"60332":35553,"60333":35560,"60334":35583,"60335":35567,"60336":35579,"60337":35985,"60338":35986,"60339":35984,"60340":36085,"60341":36078,"60342":36081,"60343":36080,"60344":36083,"60345":36204,"60346":36206,"60347":36261,"60348":36263,"60349":36403,"60350":36414,"60351":36408,"60352":36416,"60353":36421,"60354":36406,"60355":36412,"60356":36413,"60357":36417,"60358":36400,"60359":36415,"60360":36541,"60361":36662,"60362":36654,"60363":36661,"60364":36658,"60365":36665,"60366":36663,"60367":36660,"60368":36982,"60369":36985,"60370":36987,"60371":36998,"60372":37114,"60373":37171,"60374":37173,"60375":37174,"60376":37267,"60377":37264,"60378":37265,"60379":37261,"60380":37263,"60381":37671,"60382":37662,"60383":37640,"60384":37663,"60385":37638,"60386":37647,"60387":37754,"60388":37688,"60389":37692,"60390":37659,"60391":37667,"60392":37650,"60393":37633,"60394":37702,"60395":37677,"60396":37646,"60397":37645,"60398":37579,"60399":37661,"60400":37626,"60401":37669,"60402":37651,"60403":37625,"60404":37623,"60405":37684,"60406":37634,"60407":37668,"60408":37631,"60409":37673,"60410":37689,"60411":37685,"60412":37674,"60413":37652,"60414":37644,"60480":37643,"60481":37630,"60482":37641,"60483":37632,"60484":37627,"60485":37654,"60486":38332,"60487":38349,"60488":38334,"60489":38329,"60490":38330,"60491":38326,"60492":38335,"60493":38325,"60494":38333,"60495":38569,"60496":38612,"60497":38667,"60498":38674,"60499":38672,"60500":38809,"60501":38807,"60502":38804,"60503":38896,"60504":38904,"60505":38965,"60506":38959,"60507":38962,"60508":39204,"60509":39199,"60510":39207,"60511":39209,"60512":39326,"60513":39406,"60514":39404,"60515":39397,"60516":39396,"60517":39408,"60518":39395,"60519":39402,"60520":39401,"60521":39399,"60522":39609,"60523":39615,"60524":39604,"60525":39611,"60526":39670,"60527":39674,"60528":39673,"60529":39671,"60530":39731,"60531":39808,"60532":39813,"60533":39815,"60534":39804,"60535":39806,"60536":39803,"60537":39810,"60538":39827,"60539":39826,"60540":39824,"60541":39802,"60542":39829,"60577":39805,"60578":39816,"60579":40229,"60580":40215,"60581":40224,"60582":40222,"60583":40212,"60584":40233,"60585":40221,"60586":40216,"60587":40226,"60588":40208,"60589":40217,"60590":40223,"60591":40584,"60592":40582,"60593":40583,"60594":40622,"60595":40621,"60596":40661,"60597":40662,"60598":40698,"60599":40722,"60600":40765,"60601":20774,"60602":20773,"60603":20770,"60604":20772,"60605":20768,"60606":20777,"60607":21236,"60608":22163,"60609":22156,"60610":22157,"60611":22150,"60612":22148,"60613":22147,"60614":22142,"60615":22146,"60616":22143,"60617":22145,"60618":22742,"60619":22740,"60620":22735,"60621":22738,"60622":23341,"60623":23333,"60624":23346,"60625":23331,"60626":23340,"60627":23335,"60628":23334,"60629":23343,"60630":23342,"60631":23419,"60632":23537,"60633":23538,"60634":23991,"60635":24172,"60636":24170,"60637":24510,"60638":24507,"60639":25027,"60640":25013,"60641":25020,"60642":25063,"60643":25056,"60644":25061,"60645":25060,"60646":25064,"60647":25054,"60648":25839,"60649":25833,"60650":25827,"60651":25835,"60652":25828,"60653":25832,"60654":25985,"60655":25984,"60656":26038,"60657":26074,"60658":26322,"60659":27277,"60660":27286,"60661":27265,"60662":27301,"60663":27273,"60664":27295,"60665":27291,"60666":27297,"60667":27294,"60668":27271,"60669":27283,"60670":27278,"60736":27285,"60737":27267,"60738":27304,"60739":27300,"60740":27281,"60741":27263,"60742":27302,"60743":27290,"60744":27269,"60745":27276,"60746":27282,"60747":27483,"60748":27565,"60749":27657,"60750":28620,"60751":28585,"60752":28660,"60753":28628,"60754":28643,"60755":28636,"60756":28653,"60757":28647,"60758":28646,"60759":28638,"60760":28658,"60761":28637,"60762":28642,"60763":28648,"60764":29153,"60765":29169,"60766":29160,"60767":29170,"60768":29156,"60769":29168,"60770":29154,"60771":29555,"60772":29550,"60773":29551,"60774":29847,"60775":29874,"60776":29867,"60777":29840,"60778":29866,"60779":29869,"60780":29873,"60781":29861,"60782":29871,"60783":29968,"60784":29969,"60785":29970,"60786":29967,"60787":30084,"60788":30275,"60789":30280,"60790":30281,"60791":30279,"60792":30372,"60793":30441,"60794":30645,"60795":30635,"60796":30642,"60797":30647,"60798":30646,"60833":30644,"60834":30641,"60835":30632,"60836":30704,"60837":30963,"60838":30973,"60839":30978,"60840":30971,"60841":30972,"60842":30962,"60843":30981,"60844":30969,"60845":30974,"60846":30980,"60847":31147,"60848":31144,"60849":31324,"60850":31323,"60851":31318,"60852":31320,"60853":31316,"60854":31322,"60855":31422,"60856":31424,"60857":31425,"60858":31749,"60859":31759,"60860":31730,"60861":31744,"60862":31743,"60863":31739,"60864":31758,"60865":31732,"60866":31755,"60867":31731,"60868":31746,"60869":31753,"60870":31747,"60871":31745,"60872":31736,"60873":31741,"60874":31750,"60875":31728,"60876":31729,"60877":31760,"60878":31754,"60879":31976,"60880":32301,"60881":32316,"60882":32322,"60883":32307,"60884":38984,"60885":32312,"60886":32298,"60887":32329,"60888":32320,"60889":32327,"60890":32297,"60891":32332,"60892":32304,"60893":32315,"60894":32310,"60895":32324,"60896":32314,"60897":32581,"60898":32639,"60899":32638,"60900":32637,"60901":32756,"60902":32754,"60903":32812,"60904":33211,"60905":33220,"60906":33228,"60907":33226,"60908":33221,"60909":33223,"60910":33212,"60911":33257,"60912":33371,"60913":33370,"60914":33372,"60915":34179,"60916":34176,"60917":34191,"60918":34215,"60919":34197,"60920":34208,"60921":34187,"60922":34211,"60923":34171,"60924":34212,"60925":34202,"60926":34206,"60992":34167,"60993":34172,"60994":34185,"60995":34209,"60996":34170,"60997":34168,"60998":34135,"60999":34190,"61000":34198,"61001":34182,"61002":34189,"61003":34201,"61004":34205,"61005":34177,"61006":34210,"61007":34178,"61008":34184,"61009":34181,"61010":34169,"61011":34166,"61012":34200,"61013":34192,"61014":34207,"61015":34408,"61016":34750,"61017":34730,"61018":34733,"61019":34757,"61020":34736,"61021":34732,"61022":34745,"61023":34741,"61024":34748,"61025":34734,"61026":34761,"61027":34755,"61028":34754,"61029":34764,"61030":34743,"61031":34735,"61032":34756,"61033":34762,"61034":34740,"61035":34742,"61036":34751,"61037":34744,"61038":34749,"61039":34782,"61040":34738,"61041":35125,"61042":35123,"61043":35132,"61044":35134,"61045":35137,"61046":35154,"61047":35127,"61048":35138,"61049":35245,"61050":35247,"61051":35246,"61052":35314,"61053":35315,"61054":35614,"61089":35608,"61090":35606,"61091":35601,"61092":35589,"61093":35595,"61094":35618,"61095":35599,"61096":35602,"61097":35605,"61098":35591,"61099":35597,"61100":35592,"61101":35590,"61102":35612,"61103":35603,"61104":35610,"61105":35919,"61106":35952,"61107":35954,"61108":35953,"61109":35951,"61110":35989,"61111":35988,"61112":36089,"61113":36207,"61114":36430,"61115":36429,"61116":36435,"61117":36432,"61118":36428,"61119":36423,"61120":36675,"61121":36672,"61122":36997,"61123":36990,"61124":37176,"61125":37274,"61126":37282,"61127":37275,"61128":37273,"61129":37279,"61130":37281,"61131":37277,"61132":37280,"61133":37793,"61134":37763,"61135":37807,"61136":37732,"61137":37718,"61138":37703,"61139":37756,"61140":37720,"61141":37724,"61142":37750,"61143":37705,"61144":37712,"61145":37713,"61146":37728,"61147":37741,"61148":37775,"61149":37708,"61150":37738,"61151":37753,"61152":37719,"61153":37717,"61154":37714,"61155":37711,"61156":37745,"61157":37751,"61158":37755,"61159":37729,"61160":37726,"61161":37731,"61162":37735,"61163":37760,"61164":37710,"61165":37721,"61166":38343,"61167":38336,"61168":38345,"61169":38339,"61170":38341,"61171":38327,"61172":38574,"61173":38576,"61174":38572,"61175":38688,"61176":38687,"61177":38680,"61178":38685,"61179":38681,"61180":38810,"61181":38817,"61182":38812,"61248":38814,"61249":38813,"61250":38869,"61251":38868,"61252":38897,"61253":38977,"61254":38980,"61255":38986,"61256":38985,"61257":38981,"61258":38979,"61259":39205,"61260":39211,"61261":39212,"61262":39210,"61263":39219,"61264":39218,"61265":39215,"61266":39213,"61267":39217,"61268":39216,"61269":39320,"61270":39331,"61271":39329,"61272":39426,"61273":39418,"61274":39412,"61275":39415,"61276":39417,"61277":39416,"61278":39414,"61279":39419,"61280":39421,"61281":39422,"61282":39420,"61283":39427,"61284":39614,"61285":39678,"61286":39677,"61287":39681,"61288":39676,"61289":39752,"61290":39834,"61291":39848,"61292":39838,"61293":39835,"61294":39846,"61295":39841,"61296":39845,"61297":39844,"61298":39814,"61299":39842,"61300":39840,"61301":39855,"61302":40243,"61303":40257,"61304":40295,"61305":40246,"61306":40238,"61307":40239,"61308":40241,"61309":40248,"61310":40240,"61345":40261,"61346":40258,"61347":40259,"61348":40254,"61349":40247,"61350":40256,"61351":40253,"61352":32757,"61353":40237,"61354":40586,"61355":40585,"61356":40589,"61357":40624,"61358":40648,"61359":40666,"61360":40699,"61361":40703,"61362":40740,"61363":40739,"61364":40738,"61365":40788,"61366":40864,"61367":20785,"61368":20781,"61369":20782,"61370":22168,"61371":22172,"61372":22167,"61373":22170,"61374":22173,"61375":22169,"61376":22896,"61377":23356,"61378":23657,"61379":23658,"61380":24000,"61381":24173,"61382":24174,"61383":25048,"61384":25055,"61385":25069,"61386":25070,"61387":25073,"61388":25066,"61389":25072,"61390":25067,"61391":25046,"61392":25065,"61393":25855,"61394":25860,"61395":25853,"61396":25848,"61397":25857,"61398":25859,"61399":25852,"61400":26004,"61401":26075,"61402":26330,"61403":26331,"61404":26328,"61405":27333,"61406":27321,"61407":27325,"61408":27361,"61409":27334,"61410":27322,"61411":27318,"61412":27319,"61413":27335,"61414":27316,"61415":27309,"61416":27486,"61417":27593,"61418":27659,"61419":28679,"61420":28684,"61421":28685,"61422":28673,"61423":28677,"61424":28692,"61425":28686,"61426":28671,"61427":28672,"61428":28667,"61429":28710,"61430":28668,"61431":28663,"61432":28682,"61433":29185,"61434":29183,"61435":29177,"61436":29187,"61437":29181,"61438":29558,"61504":29880,"61505":29888,"61506":29877,"61507":29889,"61508":29886,"61509":29878,"61510":29883,"61511":29890,"61512":29972,"61513":29971,"61514":30300,"61515":30308,"61516":30297,"61517":30288,"61518":30291,"61519":30295,"61520":30298,"61521":30374,"61522":30397,"61523":30444,"61524":30658,"61525":30650,"61526":30975,"61527":30988,"61528":30995,"61529":30996,"61530":30985,"61531":30992,"61532":30994,"61533":30993,"61534":31149,"61535":31148,"61536":31327,"61537":31772,"61538":31785,"61539":31769,"61540":31776,"61541":31775,"61542":31789,"61543":31773,"61544":31782,"61545":31784,"61546":31778,"61547":31781,"61548":31792,"61549":32348,"61550":32336,"61551":32342,"61552":32355,"61553":32344,"61554":32354,"61555":32351,"61556":32337,"61557":32352,"61558":32343,"61559":32339,"61560":32693,"61561":32691,"61562":32759,"61563":32760,"61564":32885,"61565":33233,"61566":33234,"61601":33232,"61602":33375,"61603":33374,"61604":34228,"61605":34246,"61606":34240,"61607":34243,"61608":34242,"61609":34227,"61610":34229,"61611":34237,"61612":34247,"61613":34244,"61614":34239,"61615":34251,"61616":34254,"61617":34248,"61618":34245,"61619":34225,"61620":34230,"61621":34258,"61622":34340,"61623":34232,"61624":34231,"61625":34238,"61626":34409,"61627":34791,"61628":34790,"61629":34786,"61630":34779,"61631":34795,"61632":34794,"61633":34789,"61634":34783,"61635":34803,"61636":34788,"61637":34772,"61638":34780,"61639":34771,"61640":34797,"61641":34776,"61642":34787,"61643":34724,"61644":34775,"61645":34777,"61646":34817,"61647":34804,"61648":34792,"61649":34781,"61650":35155,"61651":35147,"61652":35151,"61653":35148,"61654":35142,"61655":35152,"61656":35153,"61657":35145,"61658":35626,"61659":35623,"61660":35619,"61661":35635,"61662":35632,"61663":35637,"61664":35655,"61665":35631,"61666":35644,"61667":35646,"61668":35633,"61669":35621,"61670":35639,"61671":35622,"61672":35638,"61673":35630,"61674":35620,"61675":35643,"61676":35645,"61677":35642,"61678":35906,"61679":35957,"61680":35993,"61681":35992,"61682":35991,"61683":36094,"61684":36100,"61685":36098,"61686":36096,"61687":36444,"61688":36450,"61689":36448,"61690":36439,"61691":36438,"61692":36446,"61693":36453,"61694":36455,"61760":36443,"61761":36442,"61762":36449,"61763":36445,"61764":36457,"61765":36436,"61766":36678,"61767":36679,"61768":36680,"61769":36683,"61770":37160,"61771":37178,"61772":37179,"61773":37182,"61774":37288,"61775":37285,"61776":37287,"61777":37295,"61778":37290,"61779":37813,"61780":37772,"61781":37778,"61782":37815,"61783":37787,"61784":37789,"61785":37769,"61786":37799,"61787":37774,"61788":37802,"61789":37790,"61790":37798,"61791":37781,"61792":37768,"61793":37785,"61794":37791,"61795":37773,"61796":37809,"61797":37777,"61798":37810,"61799":37796,"61800":37800,"61801":37812,"61802":37795,"61803":37797,"61804":38354,"61805":38355,"61806":38353,"61807":38579,"61808":38615,"61809":38618,"61810":24002,"61811":38623,"61812":38616,"61813":38621,"61814":38691,"61815":38690,"61816":38693,"61817":38828,"61818":38830,"61819":38824,"61820":38827,"61821":38820,"61822":38826,"61857":38818,"61858":38821,"61859":38871,"61860":38873,"61861":38870,"61862":38872,"61863":38906,"61864":38992,"61865":38993,"61866":38994,"61867":39096,"61868":39233,"61869":39228,"61870":39226,"61871":39439,"61872":39435,"61873":39433,"61874":39437,"61875":39428,"61876":39441,"61877":39434,"61878":39429,"61879":39431,"61880":39430,"61881":39616,"61882":39644,"61883":39688,"61884":39684,"61885":39685,"61886":39721,"61887":39733,"61888":39754,"61889":39756,"61890":39755,"61891":39879,"61892":39878,"61893":39875,"61894":39871,"61895":39873,"61896":39861,"61897":39864,"61898":39891,"61899":39862,"61900":39876,"61901":39865,"61902":39869,"61903":40284,"61904":40275,"61905":40271,"61906":40266,"61907":40283,"61908":40267,"61909":40281,"61910":40278,"61911":40268,"61912":40279,"61913":40274,"61914":40276,"61915":40287,"61916":40280,"61917":40282,"61918":40590,"61919":40588,"61920":40671,"61921":40705,"61922":40704,"61923":40726,"61924":40741,"61925":40747,"61926":40746,"61927":40745,"61928":40744,"61929":40780,"61930":40789,"61931":20788,"61932":20789,"61933":21142,"61934":21239,"61935":21428,"61936":22187,"61937":22189,"61938":22182,"61939":22183,"61940":22186,"61941":22188,"61942":22746,"61943":22749,"61944":22747,"61945":22802,"61946":23357,"61947":23358,"61948":23359,"61949":24003,"61950":24176,"62016":24511,"62017":25083,"62018":25863,"62019":25872,"62020":25869,"62021":25865,"62022":25868,"62023":25870,"62024":25988,"62025":26078,"62026":26077,"62027":26334,"62028":27367,"62029":27360,"62030":27340,"62031":27345,"62032":27353,"62033":27339,"62034":27359,"62035":27356,"62036":27344,"62037":27371,"62038":27343,"62039":27341,"62040":27358,"62041":27488,"62042":27568,"62043":27660,"62044":28697,"62045":28711,"62046":28704,"62047":28694,"62048":28715,"62049":28705,"62050":28706,"62051":28707,"62052":28713,"62053":28695,"62054":28708,"62055":28700,"62056":28714,"62057":29196,"62058":29194,"62059":29191,"62060":29186,"62061":29189,"62062":29349,"62063":29350,"62064":29348,"62065":29347,"62066":29345,"62067":29899,"62068":29893,"62069":29879,"62070":29891,"62071":29974,"62072":30304,"62073":30665,"62074":30666,"62075":30660,"62076":30705,"62077":31005,"62078":31003,"62113":31009,"62114":31004,"62115":30999,"62116":31006,"62117":31152,"62118":31335,"62119":31336,"62120":31795,"62121":31804,"62122":31801,"62123":31788,"62124":31803,"62125":31980,"62126":31978,"62127":32374,"62128":32373,"62129":32376,"62130":32368,"62131":32375,"62132":32367,"62133":32378,"62134":32370,"62135":32372,"62136":32360,"62137":32587,"62138":32586,"62139":32643,"62140":32646,"62141":32695,"62142":32765,"62143":32766,"62144":32888,"62145":33239,"62146":33237,"62147":33380,"62148":33377,"62149":33379,"62150":34283,"62151":34289,"62152":34285,"62153":34265,"62154":34273,"62155":34280,"62156":34266,"62157":34263,"62158":34284,"62159":34290,"62160":34296,"62161":34264,"62162":34271,"62163":34275,"62164":34268,"62165":34257,"62166":34288,"62167":34278,"62168":34287,"62169":34270,"62170":34274,"62171":34816,"62172":34810,"62173":34819,"62174":34806,"62175":34807,"62176":34825,"62177":34828,"62178":34827,"62179":34822,"62180":34812,"62181":34824,"62182":34815,"62183":34826,"62184":34818,"62185":35170,"62186":35162,"62187":35163,"62188":35159,"62189":35169,"62190":35164,"62191":35160,"62192":35165,"62193":35161,"62194":35208,"62195":35255,"62196":35254,"62197":35318,"62198":35664,"62199":35656,"62200":35658,"62201":35648,"62202":35667,"62203":35670,"62204":35668,"62205":35659,"62206":35669,"62272":35665,"62273":35650,"62274":35666,"62275":35671,"62276":35907,"62277":35959,"62278":35958,"62279":35994,"62280":36102,"62281":36103,"62282":36105,"62283":36268,"62284":36266,"62285":36269,"62286":36267,"62287":36461,"62288":36472,"62289":36467,"62290":36458,"62291":36463,"62292":36475,"62293":36546,"62294":36690,"62295":36689,"62296":36687,"62297":36688,"62298":36691,"62299":36788,"62300":37184,"62301":37183,"62302":37296,"62303":37293,"62304":37854,"62305":37831,"62306":37839,"62307":37826,"62308":37850,"62309":37840,"62310":37881,"62311":37868,"62312":37836,"62313":37849,"62314":37801,"62315":37862,"62316":37834,"62317":37844,"62318":37870,"62319":37859,"62320":37845,"62321":37828,"62322":37838,"62323":37824,"62324":37842,"62325":37863,"62326":38269,"62327":38362,"62328":38363,"62329":38625,"62330":38697,"62331":38699,"62332":38700,"62333":38696,"62334":38694,"62369":38835,"62370":38839,"62371":38838,"62372":38877,"62373":38878,"62374":38879,"62375":39004,"62376":39001,"62377":39005,"62378":38999,"62379":39103,"62380":39101,"62381":39099,"62382":39102,"62383":39240,"62384":39239,"62385":39235,"62386":39334,"62387":39335,"62388":39450,"62389":39445,"62390":39461,"62391":39453,"62392":39460,"62393":39451,"62394":39458,"62395":39456,"62396":39463,"62397":39459,"62398":39454,"62399":39452,"62400":39444,"62401":39618,"62402":39691,"62403":39690,"62404":39694,"62405":39692,"62406":39735,"62407":39914,"62408":39915,"62409":39904,"62410":39902,"62411":39908,"62412":39910,"62413":39906,"62414":39920,"62415":39892,"62416":39895,"62417":39916,"62418":39900,"62419":39897,"62420":39909,"62421":39893,"62422":39905,"62423":39898,"62424":40311,"62425":40321,"62426":40330,"62427":40324,"62428":40328,"62429":40305,"62430":40320,"62431":40312,"62432":40326,"62433":40331,"62434":40332,"62435":40317,"62436":40299,"62437":40308,"62438":40309,"62439":40304,"62440":40297,"62441":40325,"62442":40307,"62443":40315,"62444":40322,"62445":40303,"62446":40313,"62447":40319,"62448":40327,"62449":40296,"62450":40596,"62451":40593,"62452":40640,"62453":40700,"62454":40749,"62455":40768,"62456":40769,"62457":40781,"62458":40790,"62459":40791,"62460":40792,"62461":21303,"62462":22194,"62528":22197,"62529":22195,"62530":22755,"62531":23365,"62532":24006,"62533":24007,"62534":24302,"62535":24303,"62536":24512,"62537":24513,"62538":25081,"62539":25879,"62540":25878,"62541":25877,"62542":25875,"62543":26079,"62544":26344,"62545":26339,"62546":26340,"62547":27379,"62548":27376,"62549":27370,"62550":27368,"62551":27385,"62552":27377,"62553":27374,"62554":27375,"62555":28732,"62556":28725,"62557":28719,"62558":28727,"62559":28724,"62560":28721,"62561":28738,"62562":28728,"62563":28735,"62564":28730,"62565":28729,"62566":28736,"62567":28731,"62568":28723,"62569":28737,"62570":29203,"62571":29204,"62572":29352,"62573":29565,"62574":29564,"62575":29882,"62576":30379,"62577":30378,"62578":30398,"62579":30445,"62580":30668,"62581":30670,"62582":30671,"62583":30669,"62584":30706,"62585":31013,"62586":31011,"62587":31015,"62588":31016,"62589":31012,"62590":31017,"62625":31154,"62626":31342,"62627":31340,"62628":31341,"62629":31479,"62630":31817,"62631":31816,"62632":31818,"62633":31815,"62634":31813,"62635":31982,"62636":32379,"62637":32382,"62638":32385,"62639":32384,"62640":32698,"62641":32767,"62642":32889,"62643":33243,"62644":33241,"62645":33291,"62646":33384,"62647":33385,"62648":34338,"62649":34303,"62650":34305,"62651":34302,"62652":34331,"62653":34304,"62654":34294,"62655":34308,"62656":34313,"62657":34309,"62658":34316,"62659":34301,"62660":34841,"62661":34832,"62662":34833,"62663":34839,"62664":34835,"62665":34838,"62666":35171,"62667":35174,"62668":35257,"62669":35319,"62670":35680,"62671":35690,"62672":35677,"62673":35688,"62674":35683,"62675":35685,"62676":35687,"62677":35693,"62678":36270,"62679":36486,"62680":36488,"62681":36484,"62682":36697,"62683":36694,"62684":36695,"62685":36693,"62686":36696,"62687":36698,"62688":37005,"62689":37187,"62690":37185,"62691":37303,"62692":37301,"62693":37298,"62694":37299,"62695":37899,"62696":37907,"62697":37883,"62698":37920,"62699":37903,"62700":37908,"62701":37886,"62702":37909,"62703":37904,"62704":37928,"62705":37913,"62706":37901,"62707":37877,"62708":37888,"62709":37879,"62710":37895,"62711":37902,"62712":37910,"62713":37906,"62714":37882,"62715":37897,"62716":37880,"62717":37898,"62718":37887,"62784":37884,"62785":37900,"62786":37878,"62787":37905,"62788":37894,"62789":38366,"62790":38368,"62791":38367,"62792":38702,"62793":38703,"62794":38841,"62795":38843,"62796":38909,"62797":38910,"62798":39008,"62799":39010,"62800":39011,"62801":39007,"62802":39105,"62803":39106,"62804":39248,"62805":39246,"62806":39257,"62807":39244,"62808":39243,"62809":39251,"62810":39474,"62811":39476,"62812":39473,"62813":39468,"62814":39466,"62815":39478,"62816":39465,"62817":39470,"62818":39480,"62819":39469,"62820":39623,"62821":39626,"62822":39622,"62823":39696,"62824":39698,"62825":39697,"62826":39947,"62827":39944,"62828":39927,"62829":39941,"62830":39954,"62831":39928,"62832":40000,"62833":39943,"62834":39950,"62835":39942,"62836":39959,"62837":39956,"62838":39945,"62839":40351,"62840":40345,"62841":40356,"62842":40349,"62843":40338,"62844":40344,"62845":40336,"62846":40347,"62881":40352,"62882":40340,"62883":40348,"62884":40362,"62885":40343,"62886":40353,"62887":40346,"62888":40354,"62889":40360,"62890":40350,"62891":40355,"62892":40383,"62893":40361,"62894":40342,"62895":40358,"62896":40359,"62897":40601,"62898":40603,"62899":40602,"62900":40677,"62901":40676,"62902":40679,"62903":40678,"62904":40752,"62905":40750,"62906":40795,"62907":40800,"62908":40798,"62909":40797,"62910":40793,"62911":40849,"62912":20794,"62913":20793,"62914":21144,"62915":21143,"62916":22211,"62917":22205,"62918":22206,"62919":23368,"62920":23367,"62921":24011,"62922":24015,"62923":24305,"62924":25085,"62925":25883,"62926":27394,"62927":27388,"62928":27395,"62929":27384,"62930":27392,"62931":28739,"62932":28740,"62933":28746,"62934":28744,"62935":28745,"62936":28741,"62937":28742,"62938":29213,"62939":29210,"62940":29209,"62941":29566,"62942":29975,"62943":30314,"62944":30672,"62945":31021,"62946":31025,"62947":31023,"62948":31828,"62949":31827,"62950":31986,"62951":32394,"62952":32391,"62953":32392,"62954":32395,"62955":32390,"62956":32397,"62957":32589,"62958":32699,"62959":32816,"62960":33245,"62961":34328,"62962":34346,"62963":34342,"62964":34335,"62965":34339,"62966":34332,"62967":34329,"62968":34343,"62969":34350,"62970":34337,"62971":34336,"62972":34345,"62973":34334,"62974":34341,"63040":34857,"63041":34845,"63042":34843,"63043":34848,"63044":34852,"63045":34844,"63046":34859,"63047":34890,"63048":35181,"63049":35177,"63050":35182,"63051":35179,"63052":35322,"63053":35705,"63054":35704,"63055":35653,"63056":35706,"63057":35707,"63058":36112,"63059":36116,"63060":36271,"63061":36494,"63062":36492,"63063":36702,"63064":36699,"63065":36701,"63066":37190,"63067":37188,"63068":37189,"63069":37305,"63070":37951,"63071":37947,"63072":37942,"63073":37929,"63074":37949,"63075":37948,"63076":37936,"63077":37945,"63078":37930,"63079":37943,"63080":37932,"63081":37952,"63082":37937,"63083":38373,"63084":38372,"63085":38371,"63086":38709,"63087":38714,"63088":38847,"63089":38881,"63090":39012,"63091":39113,"63092":39110,"63093":39104,"63094":39256,"63095":39254,"63096":39481,"63097":39485,"63098":39494,"63099":39492,"63100":39490,"63101":39489,"63102":39482,"63137":39487,"63138":39629,"63139":39701,"63140":39703,"63141":39704,"63142":39702,"63143":39738,"63144":39762,"63145":39979,"63146":39965,"63147":39964,"63148":39980,"63149":39971,"63150":39976,"63151":39977,"63152":39972,"63153":39969,"63154":40375,"63155":40374,"63156":40380,"63157":40385,"63158":40391,"63159":40394,"63160":40399,"63161":40382,"63162":40389,"63163":40387,"63164":40379,"63165":40373,"63166":40398,"63167":40377,"63168":40378,"63169":40364,"63170":40392,"63171":40369,"63172":40365,"63173":40396,"63174":40371,"63175":40397,"63176":40370,"63177":40570,"63178":40604,"63179":40683,"63180":40686,"63181":40685,"63182":40731,"63183":40728,"63184":40730,"63185":40753,"63186":40782,"63187":40805,"63188":40804,"63189":40850,"63190":20153,"63191":22214,"63192":22213,"63193":22219,"63194":22897,"63195":23371,"63196":23372,"63197":24021,"63198":24017,"63199":24306,"63200":25889,"63201":25888,"63202":25894,"63203":25890,"63204":27403,"63205":27400,"63206":27401,"63207":27661,"63208":28757,"63209":28758,"63210":28759,"63211":28754,"63212":29214,"63213":29215,"63214":29353,"63215":29567,"63216":29912,"63217":29909,"63218":29913,"63219":29911,"63220":30317,"63221":30381,"63222":31029,"63223":31156,"63224":31344,"63225":31345,"63226":31831,"63227":31836,"63228":31833,"63229":31835,"63230":31834,"63296":31988,"63297":31985,"63298":32401,"63299":32591,"63300":32647,"63301":33246,"63302":33387,"63303":34356,"63304":34357,"63305":34355,"63306":34348,"63307":34354,"63308":34358,"63309":34860,"63310":34856,"63311":34854,"63312":34858,"63313":34853,"63314":35185,"63315":35263,"63316":35262,"63317":35323,"63318":35710,"63319":35716,"63320":35714,"63321":35718,"63322":35717,"63323":35711,"63324":36117,"63325":36501,"63326":36500,"63327":36506,"63328":36498,"63329":36496,"63330":36502,"63331":36503,"63332":36704,"63333":36706,"63334":37191,"63335":37964,"63336":37968,"63337":37962,"63338":37963,"63339":37967,"63340":37959,"63341":37957,"63342":37960,"63343":37961,"63344":37958,"63345":38719,"63346":38883,"63347":39018,"63348":39017,"63349":39115,"63350":39252,"63351":39259,"63352":39502,"63353":39507,"63354":39508,"63355":39500,"63356":39503,"63357":39496,"63358":39498,"63393":39497,"63394":39506,"63395":39504,"63396":39632,"63397":39705,"63398":39723,"63399":39739,"63400":39766,"63401":39765,"63402":40006,"63403":40008,"63404":39999,"63405":40004,"63406":39993,"63407":39987,"63408":40001,"63409":39996,"63410":39991,"63411":39988,"63412":39986,"63413":39997,"63414":39990,"63415":40411,"63416":40402,"63417":40414,"63418":40410,"63419":40395,"63420":40400,"63421":40412,"63422":40401,"63423":40415,"63424":40425,"63425":40409,"63426":40408,"63427":40406,"63428":40437,"63429":40405,"63430":40413,"63431":40630,"63432":40688,"63433":40757,"63434":40755,"63435":40754,"63436":40770,"63437":40811,"63438":40853,"63439":40866,"63440":20797,"63441":21145,"63442":22760,"63443":22759,"63444":22898,"63445":23373,"63446":24024,"63447":34863,"63448":24399,"63449":25089,"63450":25091,"63451":25092,"63452":25897,"63453":25893,"63454":26006,"63455":26347,"63456":27409,"63457":27410,"63458":27407,"63459":27594,"63460":28763,"63461":28762,"63462":29218,"63463":29570,"63464":29569,"63465":29571,"63466":30320,"63467":30676,"63468":31847,"63469":31846,"63470":32405,"63471":33388,"63472":34362,"63473":34368,"63474":34361,"63475":34364,"63476":34353,"63477":34363,"63478":34366,"63479":34864,"63480":34866,"63481":34862,"63482":34867,"63483":35190,"63484":35188,"63485":35187,"63486":35326,"63552":35724,"63553":35726,"63554":35723,"63555":35720,"63556":35909,"63557":36121,"63558":36504,"63559":36708,"63560":36707,"63561":37308,"63562":37986,"63563":37973,"63564":37981,"63565":37975,"63566":37982,"63567":38852,"63568":38853,"63569":38912,"63570":39510,"63571":39513,"63572":39710,"63573":39711,"63574":39712,"63575":40018,"63576":40024,"63577":40016,"63578":40010,"63579":40013,"63580":40011,"63581":40021,"63582":40025,"63583":40012,"63584":40014,"63585":40443,"63586":40439,"63587":40431,"63588":40419,"63589":40427,"63590":40440,"63591":40420,"63592":40438,"63593":40417,"63594":40430,"63595":40422,"63596":40434,"63597":40432,"63598":40418,"63599":40428,"63600":40436,"63601":40435,"63602":40424,"63603":40429,"63604":40642,"63605":40656,"63606":40690,"63607":40691,"63608":40710,"63609":40732,"63610":40760,"63611":40759,"63612":40758,"63613":40771,"63614":40783,"63649":40817,"63650":40816,"63651":40814,"63652":40815,"63653":22227,"63654":22221,"63655":23374,"63656":23661,"63657":25901,"63658":26349,"63659":26350,"63660":27411,"63661":28767,"63662":28769,"63663":28765,"63664":28768,"63665":29219,"63666":29915,"63667":29925,"63668":30677,"63669":31032,"63670":31159,"63671":31158,"63672":31850,"63673":32407,"63674":32649,"63675":33389,"63676":34371,"63677":34872,"63678":34871,"63679":34869,"63680":34891,"63681":35732,"63682":35733,"63683":36510,"63684":36511,"63685":36512,"63686":36509,"63687":37310,"63688":37309,"63689":37314,"63690":37995,"63691":37992,"63692":37993,"63693":38629,"63694":38726,"63695":38723,"63696":38727,"63697":38855,"63698":38885,"63699":39518,"63700":39637,"63701":39769,"63702":40035,"63703":40039,"63704":40038,"63705":40034,"63706":40030,"63707":40032,"63708":40450,"63709":40446,"63710":40455,"63711":40451,"63712":40454,"63713":40453,"63714":40448,"63715":40449,"63716":40457,"63717":40447,"63718":40445,"63719":40452,"63720":40608,"63721":40734,"63722":40774,"63723":40820,"63724":40821,"63725":40822,"63726":22228,"63727":25902,"63728":26040,"63729":27416,"63730":27417,"63731":27415,"63732":27418,"63733":28770,"63734":29222,"63735":29354,"63736":30680,"63737":30681,"63738":31033,"63739":31849,"63740":31851,"63741":31990,"63742":32410,"63808":32408,"63809":32411,"63810":32409,"63811":33248,"63812":33249,"63813":34374,"63814":34375,"63815":34376,"63816":35193,"63817":35194,"63818":35196,"63819":35195,"63820":35327,"63821":35736,"63822":35737,"63823":36517,"63824":36516,"63825":36515,"63826":37998,"63827":37997,"63828":37999,"63829":38001,"63830":38003,"63831":38729,"63832":39026,"63833":39263,"63834":40040,"63835":40046,"63836":40045,"63837":40459,"63838":40461,"63839":40464,"63840":40463,"63841":40466,"63842":40465,"63843":40609,"63844":40693,"63845":40713,"63846":40775,"63847":40824,"63848":40827,"63849":40826,"63850":40825,"63851":22302,"63852":28774,"63853":31855,"63854":34876,"63855":36274,"63856":36518,"63857":37315,"63858":38004,"63859":38008,"63860":38006,"63861":38005,"63862":39520,"63863":40052,"63864":40051,"63865":40049,"63866":40053,"63867":40468,"63868":40467,"63869":40694,"63870":40714,"63905":40868,"63906":28776,"63907":28773,"63908":31991,"63909":34410,"63910":34878,"63911":34877,"63912":34879,"63913":35742,"63914":35996,"63915":36521,"63916":36553,"63917":38731,"63918":39027,"63919":39028,"63920":39116,"63921":39265,"63922":39339,"63923":39524,"63924":39526,"63925":39527,"63926":39716,"63927":40469,"63928":40471,"63929":40776,"63930":25095,"63931":27422,"63932":29223,"63933":34380,"63934":36520,"63935":38018,"63936":38016,"63937":38017,"63938":39529,"63939":39528,"63940":39726,"63941":40473,"63942":29225,"63943":34379,"63944":35743,"63945":38019,"63946":40057,"63947":40631,"63948":30325,"63949":39531,"63950":40058,"63951":40477,"63952":28777,"63953":28778,"63954":40612,"63955":40830,"63956":40777,"63957":40856,"63958":30849,"63959":37561,"63960":35023,"63961":22715,"63962":24658,"63963":31911,"63964":23290,"63965":9556,"63966":9574,"63967":9559,"63968":9568,"63969":9580,"63970":9571,"63971":9562,"63972":9577,"63973":9565,"63974":9554,"63975":9572,"63976":9557,"63977":9566,"63978":9578,"63979":9569,"63980":9560,"63981":9575,"63982":9563,"63983":9555,"63984":9573,"63985":9558,"63986":9567,"63987":9579,"63988":9570,"63989":9561,"63990":9576,"63991":9564,"63992":9553,"63993":9552,"63994":9581,"63995":9582,"63996":9584,"63997":9583,"63998":9619,"64064":57344,"64065":57345,"64066":57346,"64067":57347,"64068":57348,"64069":57349,"64070":57350,"64071":57351,"64072":57352,"64073":57353,"64074":57354,"64075":57355,"64076":57356,"64077":57357,"64078":57358,"64079":57359,"64080":57360,"64081":57361,"64082":57362,"64083":57363,"64084":57364,"64085":57365,"64086":57366,"64087":57367,"64088":57368,"64089":57369,"64090":57370,"64091":57371,"64092":57372,"64093":57373,"64094":57374,"64095":57375,"64096":57376,"64097":57377,"64098":57378,"64099":57379,"64100":29234,"64101":29244,"64102":29286,"64103":29314,"64104":29327,"64105":29343,"64106":29357,"64107":29361,"64108":29368,"64109":29374,"64110":29389,"64111":29403,"64112":29476,"64113":29487,"64114":29496,"64115":29497,"64116":29629,"64117":29646,"64118":29681,"64119":29814,"64120":29858,"64121":29953,"64122":29977,"64123":29987,"64124":30012,"64125":30020,"64126":30025,"64161":30029,"64162":30061,"64163":30082,"64164":30083,"64165":30089,"64166":30124,"64167":30166,"64168":30185,"64169":30272,"64170":30285,"64171":30292,"64172":30312,"64173":30336,"64174":30339,"64175":30352,"64176":30391,"64177":30393,"64178":30477,"64179":30494,"64180":30531,"64181":30744,"64182":30748,"64183":30777,"64184":30780,"64185":30791,"64186":30806,"64187":30842,"64188":30901,"64189":30905,"64190":30918,"64191":30937,"64192":30983,"64193":31024,"64194":31028,"64195":31035,"64196":31104,"64197":31133,"64198":31171,"64199":31201,"64200":31238,"64201":31246,"64202":31299,"64203":31312,"64204":31427,"64205":31442,"64206":31458,"64207":31463,"64208":31480,"64209":31542,"64210":31586,"64211":31596,"64212":31610,"64213":31611,"64214":31642,"64215":31646,"64216":31647,"64217":31650,"64218":31655,"64219":31734,"64220":31762,"64221":31764,"64222":31823,"64223":31830,"64224":31832,"64225":31915,"64226":31994,"64227":32072,"64228":32075,"64229":32119,"64230":32212,"64231":32213,"64232":32214,"64233":32228,"64234":32333,"64235":32349,"64236":32383,"64237":32393,"64238":32398,"64239":32402,"64240":32468,"64241":32497,"64242":32530,"64243":32560,"64244":32625,"64245":32642,"64246":32686,"64247":32710,"64248":32800,"64249":32802,"64250":32805,"64251":32817,"64252":32863,"64253":32872,"64254":32940,"64320":32951,"64321":20890,"64322":21526,"64323":21524,"64324":13535,"64325":19581,"64326":25283,"64327":57508,"64328":57509,"64329":57510,"64330":21707,"64331":57512,"64332":21948,"64333":32950,"64334":20903,"64335":57516,"64336":57517,"64337":57518,"64338":21779,"64339":33318,"64340":57521,"64341":21790,"64342":21982,"64343":25529,"64344":26776,"64345":57526,"64346":21762,"64347":21865,"64348":30132,"64349":25596,"64350":40580,"64351":37418,"64352":57533,"64353":57534,"64354":57535,"64355":35015,"64356":24734,"64357":22053,"64358":28997,"64359":23282,"64360":57541,"64361":21135,"64362":22095,"64363":30611,"64364":34694,"64365":36397,"64366":33206,"64367":13822,"64368":29174,"64369":57550,"64370":34820,"64371":37765,"64372":57553,"64373":57554,"64374":30310,"64375":57556,"64376":40050,"64377":57558,"64378":25294,"64379":57560,"64380":40598,"64381":18825,"64382":31955,"64417":36570,"64418":40619,"64419":25831,"64420":57567,"64421":33450,"64422":26471,"64423":28018,"64424":30982,"64425":31172,"64426":32590,"64427":34798,"64428":57575,"64429":33726,"64430":34351,"64431":35237,"64432":17935,"64433":57580,"64434":39112,"64435":39232,"64436":39245,"64437":39436,"64438":39639,"64439":40600,"64440":40742,"64441":57588,"64442":20227,"64443":57590,"64444":20281,"64445":20274,"64446":20395,"64447":20566,"64448":57595,"64449":20526,"64450":20646,"64451":20697,"64452":20750,"64453":20717,"64454":20737,"64455":20980,"64456":21023,"64457":21088,"64458":21079,"64459":21146,"64460":21201,"64461":21216,"64462":21217,"64463":20947,"64464":20959,"64465":30022,"64466":20990,"64467":21298,"64468":21292,"64469":21299,"64470":21419,"64471":21418,"64472":40846,"64473":21609,"64474":21660,"64475":21466,"64476":27338,"64477":21875,"64478":57625,"64479":13782,"64480":57627,"64481":22033,"64482":22093,"64483":57630,"64484":22100,"64485":13811,"64486":57633,"64487":22342,"64488":22394,"64489":22375,"64490":22586,"64491":22502,"64492":22493,"64493":22592,"64494":57641,"64495":22566,"64496":22748,"64497":22967,"64498":23001,"64499":23584,"64500":57647,"64501":23761,"64502":23785,"64503":23878,"64504":23950,"64505":57652,"64506":24053,"64507":24075,"64508":24082,"64509":24110,"64510":24158,"64576":57658,"64577":24397,"64578":31357,"64579":23491,"64580":31419,"64581":57663,"64582":57664,"64583":24484,"64584":24506,"64585":24508,"64586":57668,"64587":24695,"64588":24740,"64589":24755,"64590":24829,"64591":24880,"64592":57674,"64593":24988,"64594":24921,"64595":24957,"64596":24924,"64597":25471,"64598":25058,"64599":28885,"64600":25145,"64601":25192,"64602":25221,"64603":25218,"64604":25254,"64605":25301,"64606":25444,"64607":25397,"64608":25744,"64609":14940,"64610":26184,"64611":26215,"64612":26398,"64613":26627,"64614":26540,"64615":26617,"64616":26806,"64617":26924,"64618":26881,"64619":26880,"64620":26826,"64621":26995,"64622":27008,"64623":26942,"64624":57706,"64625":27058,"64626":27072,"64627":27018,"64628":27130,"64629":27113,"64630":27314,"64631":27218,"64632":27293,"64633":27421,"64634":27474,"64635":27642,"64636":15569,"64637":27854,"64638":28239,"64673":28089,"64674":28484,"64675":57723,"64676":28634,"64677":28801,"64678":31180,"64679":28980,"64680":15820,"64681":29046,"64682":57730,"64683":57731,"64684":29205,"64685":29264,"64686":29319,"64687":29484,"64688":29362,"64689":29410,"64690":29442,"64691":29512,"64692":29480,"64693":29519,"64694":29553,"64695":25989,"64696":57744,"64697":29789,"64698":29800,"64699":29982,"64700":30035,"64701":30074,"64702":30369,"64703":30412,"64704":30500,"64705":30507,"64706":16485,"64707":30803,"64708":30931,"64709":30936,"64710":40318,"64711":30895,"64712":57760,"64713":24898,"64714":31145,"64715":39994,"64716":31188,"64717":57765,"64718":31277,"64719":31294,"64720":31305,"64721":31453,"64722":31450,"64723":30147,"64724":30215,"64725":30210,"64726":57774,"64727":30311,"64728":30319,"64729":22048,"64730":35431,"64731":40727,"64732":31519,"64733":31634,"64734":31651,"64735":31695,"64736":57784,"64737":31740,"64738":31810,"64739":31825,"64740":31837,"64741":31856,"64742":31870,"64743":31878,"64744":31875,"64745":31916,"64746":31943,"64747":31938,"64748":57796,"64749":31962,"64750":57798,"64751":32077,"64752":32090,"64753":32245,"64754":32295,"64755":32366,"64756":40597,"64757":21107,"64758":32797,"64759":32866,"64760":32867,"64761":32870,"64762":32859,"64763":32934,"64764":33027,"64765":40577,"64766":33224,"64832":57815,"64833":36768,"64834":33270,"64835":33306,"64836":57819,"64837":34673,"64838":34729,"64839":34700,"64840":40606,"64841":34753,"64842":40476,"64843":57826,"64844":34774,"64845":34805,"64846":34831,"64847":34840,"64848":34861,"64849":34882,"64850":34885,"64851":39989,"64852":34926,"64853":34986,"64854":34976,"64855":25245,"64856":35139,"64857":35149,"64858":29042,"64859":34910,"64860":57843,"64861":33533,"64862":17591,"64863":33488,"64864":33669,"64865":40194,"64866":40809,"64867":33824,"64868":57851,"64869":34010,"64870":33965,"64871":17659,"64872":34123,"64873":57856,"64874":34306,"64875":34320,"64876":25553,"64877":35209,"64878":35210,"64879":35220,"64880":40005,"64881":35260,"64882":35454,"64883":35401,"64884":35596,"64885":35651,"64886":35713,"64887":35660,"64888":57871,"64889":36013,"64890":36075,"64891":36087,"64892":36108,"64893":36226,"64894":36262,"64929":36308,"64930":36392,"64931":36431,"64932":36471,"64933":36469,"64934":36519,"64935":36633,"64936":57885,"64937":36700,"64938":40260,"64939":37060,"64940":37201,"64941":57890,"64942":37212,"64943":37209,"64944":37223,"64945":37244,"64946":37262,"64947":37307,"64948":40616,"64949":36950,"64950":36940,"64951":37374,"64952":37474,"64953":37566,"64954":37739,"64955":37742,"64956":37818,"64957":37927,"64958":38295,"64959":38311,"64960":57909,"64961":38456,"64962":57911,"64963":38531,"64964":38550,"64965":38529,"64966":38589,"64967":38659,"64968":38689,"64969":38705,"64970":38751,"64971":38815,"64972":38836,"64973":38840,"64974":38842,"64975":38846,"64976":38856,"64977":40639,"64978":38943,"64979":38958,"64980":40869,"64981":38983,"64982":38987,"64983":39014,"64984":39020,"64985":39092,"64986":40794,"64987":39132,"64988":39142,"64989":39234,"64990":39225,"64991":39227,"64992":40787,"64993":39242,"64994":40773,"64995":19326,"64996":39386,"64997":31432,"64998":39610,"64999":39613,"65000":40706,"65001":39722,"65002":57951,"65003":39725,"65004":39650,"65005":39682,"65006":39679,"65007":19463,"65008":39689,"65009":19460,"65010":19515,"65011":39823,"65012":39837,"65013":39856,"65014":39948,"65015":39957,"65016":39946,"65017":39935,"65018":39982,"65019":33000,"65020":33001,"65021":33004,"65022":33038,"65088":27705,"65089":20074,"65090":38465,"65091":22770,"65092":31074,"65093":26658,"65094":57978,"65095":57979,"65096":33031,"65097":22487,"65098":17642,"65099":25653,"65100":34100,"65101":16607,"65102":57986,"65103":26906,"65104":39938,"65105":30129,"65106":33747,"65107":29041,"65108":27147,"65109":57993,"65110":27258,"65111":39668,"65112":57996,"65113":57997,"65114":30649,"65115":25904,"65116":28054,"65117":22071,"65118":26405,"65119":27179,"65120":32093,"65121":36961,"65122":20120,"65123":31910,"65124":31545,"65125":58009,"65126":22901,"65127":14023,"65128":28799,"65129":58013,"65130":28299,"65131":58015,"65132":58016,"65133":38749,"65134":37584,"65135":22356,"65136":58020,"65137":16089,"65138":58022,"65139":58023,"65140":24985,"65141":29792,"65142":28991,"65143":31022,"65144":23190,"65145":37704,"65146":26254,"65147":20477,"65148":37697,"65149":13908,"65150":23925,"65185":28702,"65186":25979,"65187":28813,"65188":24269,"65189":58039,"65190":24743,"65191":31408,"65192":24419,"65193":58043,"65194":29687,"65195":58045,"65196":29800,"65197":30132,"65198":58048,"65199":39785,"65200":189,"65201":8531,"65202":8532,"65203":188,"65204":190,"65205":8533,"65206":8534,"65207":8535,"65208":8536,"65209":8537,"65210":8538,"65211":34450,"65212":34464,"65213":34477,"65214":34482,"65215":34725,"65216":34737,"65217":8539,"65218":8540,"65219":8541,"65220":8542,"65221":34778,"65222":34895,"65223":34912,"65224":34951,"65225":34959,"65226":34960,"65227":35046,"65228":35071,"65229":35072,"65230":35108,"65231":35143,"65232":35156,"65233":35173,"65234":35200,"65235":35217,"65236":35356,"65237":35369,"65238":35371,"65239":35384,"65240":35389,"65241":8978,"65242":35472,"65243":35476,"65244":35484,"65245":35497,"65246":35503,"65247":35508,"65248":35562,"65249":35615,"65250":8240,"65251":35647,"65252":35661,"65253":35678,"65254":35682,"65255":35689,"65256":35739,"65257":35921,"65258":35995,"65259":35999,"65260":36052,"65261":36054,"65262":33042,"65263":33073,"65264":33078,"65265":33119,"65266":33133,"65267":33149,"65268":33171,"65269":33194,"65270":33208,"65271":33217,"65272":33321,"65273":33325,"65274":33326,"65275":33342,"65276":33378,"65277":33386,"65278":33416,"NaN":null} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js new file mode 100644 index 0000000..c464623 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js @@ -0,0 +1 @@ +module.exports={33088:19970,33089:19972,33090:19973,33091:19974,33092:19983,33093:19986,33094:19991,33095:19999,33096:20000,33097:20001,33098:20003,33099:20006,33100:20009,33101:20014,33102:20015,33103:20017,33104:20019,33105:20021,33106:20023,33107:20028,33108:20032,33109:20033,33110:20034,33111:20036,33112:20038,33113:20042,33114:20049,33115:20053,33116:20055,33117:20058,33118:20059,33119:20066,33120:20067,33121:20068,33122:20069,33123:20071,33124:20072,33125:20074,33126:20075,33127:20076,33128:20077,33129:20078,33130:20079,33131:20082,33132:20084,33133:20085,33134:20086,33135:20087,33136:20088,33137:20089,33138:20090,33139:20091,33140:20092,33141:20093,33142:20095,33143:20096,33144:20097,33145:20098,33146:20099,33147:20100,33148:20101,33149:20103,33150:20106,33152:20112,33153:20118,33154:20119,33155:20121,33156:20124,33157:20125,33158:20126,33159:20131,33160:20138,33161:20143,33162:20144,33163:20145,33164:20148,33165:20150,33166:20151,33167:20152,33168:20153,33169:20156,33170:20157,33171:20158,33172:20168,33173:20172,33174:20175,33175:20176,33176:20178,33177:20186,33178:20187,33179:20188,33180:20192,33181:20194,33182:20198,33183:20199,33184:20201,33185:20205,33186:20206,33187:20207,33188:20209,33189:20212,33190:20216,33191:20217,33192:20218,33193:20220,33194:20222,33195:20224,33196:20226,33197:20227,33198:20228,33199:20229,33200:20230,33201:20231,33202:20232,33203:20235,33204:20236,33205:20242,33206:20243,33207:20244,33208:20245,33209:20246,33210:20252,33211:20253,33212:20257,33213:20259,33214:20264,33215:20265,33216:20268,33217:20269,33218:20270,33219:20273,33220:20275,33221:20277,33222:20279,33223:20281,33224:20283,33225:20286,33226:20287,33227:20288,33228:20289,33229:20290,33230:20292,33231:20293,33232:20295,33233:20296,33234:20297,33235:20298,33236:20299,33237:20300,33238:20306,33239:20308,33240:20310,33241:20321,33242:20322,33243:20326,33244:20328,33245:20330,33246:20331,33247:20333,33248:20334,33249:20337,33250:20338,33251:20341,33252:20343,33253:20344,33254:20345,33255:20346,33256:20349,33257:20352,33258:20353,33259:20354,33260:20357,33261:20358,33262:20359,33263:20362,33264:20364,33265:20366,33266:20368,33267:20370,33268:20371,33269:20373,33270:20374,33271:20376,33272:20377,33273:20378,33274:20380,33275:20382,33276:20383,33277:20385,33278:20386,33344:20388,33345:20395,33346:20397,33347:20400,33348:20401,33349:20402,33350:20403,33351:20404,33352:20406,33353:20407,33354:20408,33355:20409,33356:20410,33357:20411,33358:20412,33359:20413,33360:20414,33361:20416,33362:20417,33363:20418,33364:20422,33365:20423,33366:20424,33367:20425,33368:20427,33369:20428,33370:20429,33371:20434,33372:20435,33373:20436,33374:20437,33375:20438,33376:20441,33377:20443,33378:20448,33379:20450,33380:20452,33381:20453,33382:20455,33383:20459,33384:20460,33385:20464,33386:20466,33387:20468,33388:20469,33389:20470,33390:20471,33391:20473,33392:20475,33393:20476,33394:20477,33395:20479,33396:20480,33397:20481,33398:20482,33399:20483,33400:20484,33401:20485,33402:20486,33403:20487,33404:20488,33405:20489,33406:20490,33408:20491,33409:20494,33410:20496,33411:20497,33412:20499,33413:20501,33414:20502,33415:20503,33416:20507,33417:20509,33418:20510,33419:20512,33420:20514,33421:20515,33422:20516,33423:20519,33424:20523,33425:20527,33426:20528,33427:20529,33428:20530,33429:20531,33430:20532,33431:20533,33432:20534,33433:20535,33434:20536,33435:20537,33436:20539,33437:20541,33438:20543,33439:20544,33440:20545,33441:20546,33442:20548,33443:20549,33444:20550,33445:20553,33446:20554,33447:20555,33448:20557,33449:20560,33450:20561,33451:20562,33452:20563,33453:20564,33454:20566,33455:20567,33456:20568,33457:20569,33458:20571,33459:20573,33460:20574,33461:20575,33462:20576,33463:20577,33464:20578,33465:20579,33466:20580,33467:20582,33468:20583,33469:20584,33470:20585,33471:20586,33472:20587,33473:20589,33474:20590,33475:20591,33476:20592,33477:20593,33478:20594,33479:20595,33480:20596,33481:20597,33482:20600,33483:20601,33484:20602,33485:20604,33486:20605,33487:20609,33488:20610,33489:20611,33490:20612,33491:20614,33492:20615,33493:20617,33494:20618,33495:20619,33496:20620,33497:20622,33498:20623,33499:20624,33500:20625,33501:20626,33502:20627,33503:20628,33504:20629,33505:20630,33506:20631,33507:20632,33508:20633,33509:20634,33510:20635,33511:20636,33512:20637,33513:20638,33514:20639,33515:20640,33516:20641,33517:20642,33518:20644,33519:20646,33520:20650,33521:20651,33522:20653,33523:20654,33524:20655,33525:20656,33526:20657,33527:20659,33528:20660,33529:20661,33530:20662,33531:20663,33532:20664,33533:20665,33534:20668,33600:20669,33601:20670,33602:20671,33603:20672,33604:20673,33605:20674,33606:20675,33607:20676,33608:20677,33609:20678,33610:20679,33611:20680,33612:20681,33613:20682,33614:20683,33615:20684,33616:20685,33617:20686,33618:20688,33619:20689,33620:20690,33621:20691,33622:20692,33623:20693,33624:20695,33625:20696,33626:20697,33627:20699,33628:20700,33629:20701,33630:20702,33631:20703,33632:20704,33633:20705,33634:20706,33635:20707,33636:20708,33637:20709,33638:20712,33639:20713,33640:20714,33641:20715,33642:20719,33643:20720,33644:20721,33645:20722,33646:20724,33647:20726,33648:20727,33649:20728,33650:20729,33651:20730,33652:20732,33653:20733,33654:20734,33655:20735,33656:20736,33657:20737,33658:20738,33659:20739,33660:20740,33661:20741,33662:20744,33664:20745,33665:20746,33666:20748,33667:20749,33668:20750,33669:20751,33670:20752,33671:20753,33672:20755,33673:20756,33674:20757,33675:20758,33676:20759,33677:20760,33678:20761,33679:20762,33680:20763,33681:20764,33682:20765,33683:20766,33684:20767,33685:20768,33686:20770,33687:20771,33688:20772,33689:20773,33690:20774,33691:20775,33692:20776,33693:20777,33694:20778,33695:20779,33696:20780,33697:20781,33698:20782,33699:20783,33700:20784,33701:20785,33702:20786,33703:20787,33704:20788,33705:20789,33706:20790,33707:20791,33708:20792,33709:20793,33710:20794,33711:20795,33712:20796,33713:20797,33714:20798,33715:20802,33716:20807,33717:20810,33718:20812,33719:20814,33720:20815,33721:20816,33722:20818,33723:20819,33724:20823,33725:20824,33726:20825,33727:20827,33728:20829,33729:20830,33730:20831,33731:20832,33732:20833,33733:20835,33734:20836,33735:20838,33736:20839,33737:20841,33738:20842,33739:20847,33740:20850,33741:20858,33742:20862,33743:20863,33744:20867,33745:20868,33746:20870,33747:20871,33748:20874,33749:20875,33750:20878,33751:20879,33752:20880,33753:20881,33754:20883,33755:20884,33756:20888,33757:20890,33758:20893,33759:20894,33760:20895,33761:20897,33762:20899,33763:20902,33764:20903,33765:20904,33766:20905,33767:20906,33768:20909,33769:20910,33770:20916,33771:20920,33772:20921,33773:20922,33774:20926,33775:20927,33776:20929,33777:20930,33778:20931,33779:20933,33780:20936,33781:20938,33782:20941,33783:20942,33784:20944,33785:20946,33786:20947,33787:20948,33788:20949,33789:20950,33790:20951,33856:20952,33857:20953,33858:20954,33859:20956,33860:20958,33861:20959,33862:20962,33863:20963,33864:20965,33865:20966,33866:20967,33867:20968,33868:20969,33869:20970,33870:20972,33871:20974,33872:20977,33873:20978,33874:20980,33875:20983,33876:20990,33877:20996,33878:20997,33879:21001,33880:21003,33881:21004,33882:21007,33883:21008,33884:21011,33885:21012,33886:21013,33887:21020,33888:21022,33889:21023,33890:21025,33891:21026,33892:21027,33893:21029,33894:21030,33895:21031,33896:21034,33897:21036,33898:21039,33899:21041,33900:21042,33901:21044,33902:21045,33903:21052,33904:21054,33905:21060,33906:21061,33907:21062,33908:21063,33909:21064,33910:21065,33911:21067,33912:21070,33913:21071,33914:21074,33915:21075,33916:21077,33917:21079,33918:21080,33920:21081,33921:21082,33922:21083,33923:21085,33924:21087,33925:21088,33926:21090,33927:21091,33928:21092,33929:21094,33930:21096,33931:21099,33932:21100,33933:21101,33934:21102,33935:21104,33936:21105,33937:21107,33938:21108,33939:21109,33940:21110,33941:21111,33942:21112,33943:21113,33944:21114,33945:21115,33946:21116,33947:21118,33948:21120,33949:21123,33950:21124,33951:21125,33952:21126,33953:21127,33954:21129,33955:21130,33956:21131,33957:21132,33958:21133,33959:21134,33960:21135,33961:21137,33962:21138,33963:21140,33964:21141,33965:21142,33966:21143,33967:21144,33968:21145,33969:21146,33970:21148,33971:21156,33972:21157,33973:21158,33974:21159,33975:21166,33976:21167,33977:21168,33978:21172,33979:21173,33980:21174,33981:21175,33982:21176,33983:21177,33984:21178,33985:21179,33986:21180,33987:21181,33988:21184,33989:21185,33990:21186,33991:21188,33992:21189,33993:21190,33994:21192,33995:21194,33996:21196,33997:21197,33998:21198,33999:21199,34000:21201,34001:21203,34002:21204,34003:21205,34004:21207,34005:21209,34006:21210,34007:21211,34008:21212,34009:21213,34010:21214,34011:21216,34012:21217,34013:21218,34014:21219,34015:21221,34016:21222,34017:21223,34018:21224,34019:21225,34020:21226,34021:21227,34022:21228,34023:21229,34024:21230,34025:21231,34026:21233,34027:21234,34028:21235,34029:21236,34030:21237,34031:21238,34032:21239,34033:21240,34034:21243,34035:21244,34036:21245,34037:21249,34038:21250,34039:21251,34040:21252,34041:21255,34042:21257,34043:21258,34044:21259,34045:21260,34046:21262,34112:21265,34113:21266,34114:21267,34115:21268,34116:21272,34117:21275,34118:21276,34119:21278,34120:21279,34121:21282,34122:21284,34123:21285,34124:21287,34125:21288,34126:21289,34127:21291,34128:21292,34129:21293,34130:21295,34131:21296,34132:21297,34133:21298,34134:21299,34135:21300,34136:21301,34137:21302,34138:21303,34139:21304,34140:21308,34141:21309,34142:21312,34143:21314,34144:21316,34145:21318,34146:21323,34147:21324,34148:21325,34149:21328,34150:21332,34151:21336,34152:21337,34153:21339,34154:21341,34155:21349,34156:21352,34157:21354,34158:21356,34159:21357,34160:21362,34161:21366,34162:21369,34163:21371,34164:21372,34165:21373,34166:21374,34167:21376,34168:21377,34169:21379,34170:21383,34171:21384,34172:21386,34173:21390,34174:21391,34176:21392,34177:21393,34178:21394,34179:21395,34180:21396,34181:21398,34182:21399,34183:21401,34184:21403,34185:21404,34186:21406,34187:21408,34188:21409,34189:21412,34190:21415,34191:21418,34192:21419,34193:21420,34194:21421,34195:21423,34196:21424,34197:21425,34198:21426,34199:21427,34200:21428,34201:21429,34202:21431,34203:21432,34204:21433,34205:21434,34206:21436,34207:21437,34208:21438,34209:21440,34210:21443,34211:21444,34212:21445,34213:21446,34214:21447,34215:21454,34216:21455,34217:21456,34218:21458,34219:21459,34220:21461,34221:21466,34222:21468,34223:21469,34224:21470,34225:21473,34226:21474,34227:21479,34228:21492,34229:21498,34230:21502,34231:21503,34232:21504,34233:21506,34234:21509,34235:21511,34236:21515,34237:21524,34238:21528,34239:21529,34240:21530,34241:21532,34242:21538,34243:21540,34244:21541,34245:21546,34246:21552,34247:21555,34248:21558,34249:21559,34250:21562,34251:21565,34252:21567,34253:21569,34254:21570,34255:21572,34256:21573,34257:21575,34258:21577,34259:21580,34260:21581,34261:21582,34262:21583,34263:21585,34264:21594,34265:21597,34266:21598,34267:21599,34268:21600,34269:21601,34270:21603,34271:21605,34272:21607,34273:21609,34274:21610,34275:21611,34276:21612,34277:21613,34278:21614,34279:21615,34280:21616,34281:21620,34282:21625,34283:21626,34284:21630,34285:21631,34286:21633,34287:21635,34288:21637,34289:21639,34290:21640,34291:21641,34292:21642,34293:21645,34294:21649,34295:21651,34296:21655,34297:21656,34298:21660,34299:21662,34300:21663,34301:21664,34302:21665,34368:21666,34369:21669,34370:21678,34371:21680,34372:21682,34373:21685,34374:21686,34375:21687,34376:21689,34377:21690,34378:21692,34379:21694,34380:21699,34381:21701,34382:21706,34383:21707,34384:21718,34385:21720,34386:21723,34387:21728,34388:21729,34389:21730,34390:21731,34391:21732,34392:21739,34393:21740,34394:21743,34395:21744,34396:21745,34397:21748,34398:21749,34399:21750,34400:21751,34401:21752,34402:21753,34403:21755,34404:21758,34405:21760,34406:21762,34407:21763,34408:21764,34409:21765,34410:21768,34411:21770,34412:21771,34413:21772,34414:21773,34415:21774,34416:21778,34417:21779,34418:21781,34419:21782,34420:21783,34421:21784,34422:21785,34423:21786,34424:21788,34425:21789,34426:21790,34427:21791,34428:21793,34429:21797,34430:21798,34432:21800,34433:21801,34434:21803,34435:21805,34436:21810,34437:21812,34438:21813,34439:21814,34440:21816,34441:21817,34442:21818,34443:21819,34444:21821,34445:21824,34446:21826,34447:21829,34448:21831,34449:21832,34450:21835,34451:21836,34452:21837,34453:21838,34454:21839,34455:21841,34456:21842,34457:21843,34458:21844,34459:21847,34460:21848,34461:21849,34462:21850,34463:21851,34464:21853,34465:21854,34466:21855,34467:21856,34468:21858,34469:21859,34470:21864,34471:21865,34472:21867,34473:21871,34474:21872,34475:21873,34476:21874,34477:21875,34478:21876,34479:21881,34480:21882,34481:21885,34482:21887,34483:21893,34484:21894,34485:21900,34486:21901,34487:21902,34488:21904,34489:21906,34490:21907,34491:21909,34492:21910,34493:21911,34494:21914,34495:21915,34496:21918,34497:21920,34498:21921,34499:21922,34500:21923,34501:21924,34502:21925,34503:21926,34504:21928,34505:21929,34506:21930,34507:21931,34508:21932,34509:21933,34510:21934,34511:21935,34512:21936,34513:21938,34514:21940,34515:21942,34516:21944,34517:21946,34518:21948,34519:21951,34520:21952,34521:21953,34522:21954,34523:21955,34524:21958,34525:21959,34526:21960,34527:21962,34528:21963,34529:21966,34530:21967,34531:21968,34532:21973,34533:21975,34534:21976,34535:21977,34536:21978,34537:21979,34538:21982,34539:21984,34540:21986,34541:21991,34542:21993,34543:21997,34544:21998,34545:22000,34546:22001,34547:22004,34548:22006,34549:22008,34550:22009,34551:22010,34552:22011,34553:22012,34554:22015,34555:22018,34556:22019,34557:22020,34558:22021,34624:22022,34625:22023,34626:22026,34627:22027,34628:22029,34629:22032,34630:22033,34631:22034,34632:22035,34633:22036,34634:22037,34635:22038,34636:22039,34637:22041,34638:22042,34639:22044,34640:22045,34641:22048,34642:22049,34643:22050,34644:22053,34645:22054,34646:22056,34647:22057,34648:22058,34649:22059,34650:22062,34651:22063,34652:22064,34653:22067,34654:22069,34655:22071,34656:22072,34657:22074,34658:22076,34659:22077,34660:22078,34661:22080,34662:22081,34663:22082,34664:22083,34665:22084,34666:22085,34667:22086,34668:22087,34669:22088,34670:22089,34671:22090,34672:22091,34673:22095,34674:22096,34675:22097,34676:22098,34677:22099,34678:22101,34679:22102,34680:22106,34681:22107,34682:22109,34683:22110,34684:22111,34685:22112,34686:22113,34688:22115,34689:22117,34690:22118,34691:22119,34692:22125,34693:22126,34694:22127,34695:22128,34696:22130,34697:22131,34698:22132,34699:22133,34700:22135,34701:22136,34702:22137,34703:22138,34704:22141,34705:22142,34706:22143,34707:22144,34708:22145,34709:22146,34710:22147,34711:22148,34712:22151,34713:22152,34714:22153,34715:22154,34716:22155,34717:22156,34718:22157,34719:22160,34720:22161,34721:22162,34722:22164,34723:22165,34724:22166,34725:22167,34726:22168,34727:22169,34728:22170,34729:22171,34730:22172,34731:22173,34732:22174,34733:22175,34734:22176,34735:22177,34736:22178,34737:22180,34738:22181,34739:22182,34740:22183,34741:22184,34742:22185,34743:22186,34744:22187,34745:22188,34746:22189,34747:22190,34748:22192,34749:22193,34750:22194,34751:22195,34752:22196,34753:22197,34754:22198,34755:22200,34756:22201,34757:22202,34758:22203,34759:22205,34760:22206,34761:22207,34762:22208,34763:22209,34764:22210,34765:22211,34766:22212,34767:22213,34768:22214,34769:22215,34770:22216,34771:22217,34772:22219,34773:22220,34774:22221,34775:22222,34776:22223,34777:22224,34778:22225,34779:22226,34780:22227,34781:22229,34782:22230,34783:22232,34784:22233,34785:22236,34786:22243,34787:22245,34788:22246,34789:22247,34790:22248,34791:22249,34792:22250,34793:22252,34794:22254,34795:22255,34796:22258,34797:22259,34798:22262,34799:22263,34800:22264,34801:22267,34802:22268,34803:22272,34804:22273,34805:22274,34806:22277,34807:22279,34808:22283,34809:22284,34810:22285,34811:22286,34812:22287,34813:22288,34814:22289,34880:22290,34881:22291,34882:22292,34883:22293,34884:22294,34885:22295,34886:22296,34887:22297,34888:22298,34889:22299,34890:22301,34891:22302,34892:22304,34893:22305,34894:22306,34895:22308,34896:22309,34897:22310,34898:22311,34899:22315,34900:22321,34901:22322,34902:22324,34903:22325,34904:22326,34905:22327,34906:22328,34907:22332,34908:22333,34909:22335,34910:22337,34911:22339,34912:22340,34913:22341,34914:22342,34915:22344,34916:22345,34917:22347,34918:22354,34919:22355,34920:22356,34921:22357,34922:22358,34923:22360,34924:22361,34925:22370,34926:22371,34927:22373,34928:22375,34929:22380,34930:22382,34931:22384,34932:22385,34933:22386,34934:22388,34935:22389,34936:22392,34937:22393,34938:22394,34939:22397,34940:22398,34941:22399,34942:22400,34944:22401,34945:22407,34946:22408,34947:22409,34948:22410,34949:22413,34950:22414,34951:22415,34952:22416,34953:22417,34954:22420,34955:22421,34956:22422,34957:22423,34958:22424,34959:22425,34960:22426,34961:22428,34962:22429,34963:22430,34964:22431,34965:22437,34966:22440,34967:22442,34968:22444,34969:22447,34970:22448,34971:22449,34972:22451,34973:22453,34974:22454,34975:22455,34976:22457,34977:22458,34978:22459,34979:22460,34980:22461,34981:22462,34982:22463,34983:22464,34984:22465,34985:22468,34986:22469,34987:22470,34988:22471,34989:22472,34990:22473,34991:22474,34992:22476,34993:22477,34994:22480,34995:22481,34996:22483,34997:22486,34998:22487,34999:22491,35000:22492,35001:22494,35002:22497,35003:22498,35004:22499,35005:22501,35006:22502,35007:22503,35008:22504,35009:22505,35010:22506,35011:22507,35012:22508,35013:22510,35014:22512,35015:22513,35016:22514,35017:22515,35018:22517,35019:22518,35020:22519,35021:22523,35022:22524,35023:22526,35024:22527,35025:22529,35026:22531,35027:22532,35028:22533,35029:22536,35030:22537,35031:22538,35032:22540,35033:22542,35034:22543,35035:22544,35036:22546,35037:22547,35038:22548,35039:22550,35040:22551,35041:22552,35042:22554,35043:22555,35044:22556,35045:22557,35046:22559,35047:22562,35048:22563,35049:22565,35050:22566,35051:22567,35052:22568,35053:22569,35054:22571,35055:22572,35056:22573,35057:22574,35058:22575,35059:22577,35060:22578,35061:22579,35062:22580,35063:22582,35064:22583,35065:22584,35066:22585,35067:22586,35068:22587,35069:22588,35070:22589,35136:22590,35137:22591,35138:22592,35139:22593,35140:22594,35141:22595,35142:22597,35143:22598,35144:22599,35145:22600,35146:22601,35147:22602,35148:22603,35149:22606,35150:22607,35151:22608,35152:22610,35153:22611,35154:22613,35155:22614,35156:22615,35157:22617,35158:22618,35159:22619,35160:22620,35161:22621,35162:22623,35163:22624,35164:22625,35165:22626,35166:22627,35167:22628,35168:22630,35169:22631,35170:22632,35171:22633,35172:22634,35173:22637,35174:22638,35175:22639,35176:22640,35177:22641,35178:22642,35179:22643,35180:22644,35181:22645,35182:22646,35183:22647,35184:22648,35185:22649,35186:22650,35187:22651,35188:22652,35189:22653,35190:22655,35191:22658,35192:22660,35193:22662,35194:22663,35195:22664,35196:22666,35197:22667,35198:22668,35200:22669,35201:22670,35202:22671,35203:22672,35204:22673,35205:22676,35206:22677,35207:22678,35208:22679,35209:22680,35210:22683,35211:22684,35212:22685,35213:22688,35214:22689,35215:22690,35216:22691,35217:22692,35218:22693,35219:22694,35220:22695,35221:22698,35222:22699,35223:22700,35224:22701,35225:22702,35226:22703,35227:22704,35228:22705,35229:22706,35230:22707,35231:22708,35232:22709,35233:22710,35234:22711,35235:22712,35236:22713,35237:22714,35238:22715,35239:22717,35240:22718,35241:22719,35242:22720,35243:22722,35244:22723,35245:22724,35246:22726,35247:22727,35248:22728,35249:22729,35250:22730,35251:22731,35252:22732,35253:22733,35254:22734,35255:22735,35256:22736,35257:22738,35258:22739,35259:22740,35260:22742,35261:22743,35262:22744,35263:22745,35264:22746,35265:22747,35266:22748,35267:22749,35268:22750,35269:22751,35270:22752,35271:22753,35272:22754,35273:22755,35274:22757,35275:22758,35276:22759,35277:22760,35278:22761,35279:22762,35280:22765,35281:22767,35282:22769,35283:22770,35284:22772,35285:22773,35286:22775,35287:22776,35288:22778,35289:22779,35290:22780,35291:22781,35292:22782,35293:22783,35294:22784,35295:22785,35296:22787,35297:22789,35298:22790,35299:22792,35300:22793,35301:22794,35302:22795,35303:22796,35304:22798,35305:22800,35306:22801,35307:22802,35308:22803,35309:22807,35310:22808,35311:22811,35312:22813,35313:22814,35314:22816,35315:22817,35316:22818,35317:22819,35318:22822,35319:22824,35320:22828,35321:22832,35322:22834,35323:22835,35324:22837,35325:22838,35326:22843,35392:22845,35393:22846,35394:22847,35395:22848,35396:22851,35397:22853,35398:22854,35399:22858,35400:22860,35401:22861,35402:22864,35403:22866,35404:22867,35405:22873,35406:22875,35407:22876,35408:22877,35409:22878,35410:22879,35411:22881,35412:22883,35413:22884,35414:22886,35415:22887,35416:22888,35417:22889,35418:22890,35419:22891,35420:22892,35421:22893,35422:22894,35423:22895,35424:22896,35425:22897,35426:22898,35427:22901,35428:22903,35429:22906,35430:22907,35431:22908,35432:22910,35433:22911,35434:22912,35435:22917,35436:22921,35437:22923,35438:22924,35439:22926,35440:22927,35441:22928,35442:22929,35443:22932,35444:22933,35445:22936,35446:22938,35447:22939,35448:22940,35449:22941,35450:22943,35451:22944,35452:22945,35453:22946,35454:22950,35456:22951,35457:22956,35458:22957,35459:22960,35460:22961,35461:22963,35462:22964,35463:22965,35464:22966,35465:22967,35466:22968,35467:22970,35468:22972,35469:22973,35470:22975,35471:22976,35472:22977,35473:22978,35474:22979,35475:22980,35476:22981,35477:22983,35478:22984,35479:22985,35480:22988,35481:22989,35482:22990,35483:22991,35484:22997,35485:22998,35486:23001,35487:23003,35488:23006,35489:23007,35490:23008,35491:23009,35492:23010,35493:23012,35494:23014,35495:23015,35496:23017,35497:23018,35498:23019,35499:23021,35500:23022,35501:23023,35502:23024,35503:23025,35504:23026,35505:23027,35506:23028,35507:23029,35508:23030,35509:23031,35510:23032,35511:23034,35512:23036,35513:23037,35514:23038,35515:23040,35516:23042,35517:23050,35518:23051,35519:23053,35520:23054,35521:23055,35522:23056,35523:23058,35524:23060,35525:23061,35526:23062,35527:23063,35528:23065,35529:23066,35530:23067,35531:23069,35532:23070,35533:23073,35534:23074,35535:23076,35536:23078,35537:23079,35538:23080,35539:23082,35540:23083,35541:23084,35542:23085,35543:23086,35544:23087,35545:23088,35546:23091,35547:23093,35548:23095,35549:23096,35550:23097,35551:23098,35552:23099,35553:23101,35554:23102,35555:23103,35556:23105,35557:23106,35558:23107,35559:23108,35560:23109,35561:23111,35562:23112,35563:23115,35564:23116,35565:23117,35566:23118,35567:23119,35568:23120,35569:23121,35570:23122,35571:23123,35572:23124,35573:23126,35574:23127,35575:23128,35576:23129,35577:23131,35578:23132,35579:23133,35580:23134,35581:23135,35582:23136,35648:23137,35649:23139,35650:23140,35651:23141,35652:23142,35653:23144,35654:23145,35655:23147,35656:23148,35657:23149,35658:23150,35659:23151,35660:23152,35661:23153,35662:23154,35663:23155,35664:23160,35665:23161,35666:23163,35667:23164,35668:23165,35669:23166,35670:23168,35671:23169,35672:23170,35673:23171,35674:23172,35675:23173,35676:23174,35677:23175,35678:23176,35679:23177,35680:23178,35681:23179,35682:23180,35683:23181,35684:23182,35685:23183,35686:23184,35687:23185,35688:23187,35689:23188,35690:23189,35691:23190,35692:23191,35693:23192,35694:23193,35695:23196,35696:23197,35697:23198,35698:23199,35699:23200,35700:23201,35701:23202,35702:23203,35703:23204,35704:23205,35705:23206,35706:23207,35707:23208,35708:23209,35709:23211,35710:23212,35712:23213,35713:23214,35714:23215,35715:23216,35716:23217,35717:23220,35718:23222,35719:23223,35720:23225,35721:23226,35722:23227,35723:23228,35724:23229,35725:23231,35726:23232,35727:23235,35728:23236,35729:23237,35730:23238,35731:23239,35732:23240,35733:23242,35734:23243,35735:23245,35736:23246,35737:23247,35738:23248,35739:23249,35740:23251,35741:23253,35742:23255,35743:23257,35744:23258,35745:23259,35746:23261,35747:23262,35748:23263,35749:23266,35750:23268,35751:23269,35752:23271,35753:23272,35754:23274,35755:23276,35756:23277,35757:23278,35758:23279,35759:23280,35760:23282,35761:23283,35762:23284,35763:23285,35764:23286,35765:23287,35766:23288,35767:23289,35768:23290,35769:23291,35770:23292,35771:23293,35772:23294,35773:23295,35774:23296,35775:23297,35776:23298,35777:23299,35778:23300,35779:23301,35780:23302,35781:23303,35782:23304,35783:23306,35784:23307,35785:23308,35786:23309,35787:23310,35788:23311,35789:23312,35790:23313,35791:23314,35792:23315,35793:23316,35794:23317,35795:23320,35796:23321,35797:23322,35798:23323,35799:23324,35800:23325,35801:23326,35802:23327,35803:23328,35804:23329,35805:23330,35806:23331,35807:23332,35808:23333,35809:23334,35810:23335,35811:23336,35812:23337,35813:23338,35814:23339,35815:23340,35816:23341,35817:23342,35818:23343,35819:23344,35820:23345,35821:23347,35822:23349,35823:23350,35824:23352,35825:23353,35826:23354,35827:23355,35828:23356,35829:23357,35830:23358,35831:23359,35832:23361,35833:23362,35834:23363,35835:23364,35836:23365,35837:23366,35838:23367,35904:23368,35905:23369,35906:23370,35907:23371,35908:23372,35909:23373,35910:23374,35911:23375,35912:23378,35913:23382,35914:23390,35915:23392,35916:23393,35917:23399,35918:23400,35919:23403,35920:23405,35921:23406,35922:23407,35923:23410,35924:23412,35925:23414,35926:23415,35927:23416,35928:23417,35929:23419,35930:23420,35931:23422,35932:23423,35933:23426,35934:23430,35935:23434,35936:23437,35937:23438,35938:23440,35939:23441,35940:23442,35941:23444,35942:23446,35943:23455,35944:23463,35945:23464,35946:23465,35947:23468,35948:23469,35949:23470,35950:23471,35951:23473,35952:23474,35953:23479,35954:23482,35955:23483,35956:23484,35957:23488,35958:23489,35959:23491,35960:23496,35961:23497,35962:23498,35963:23499,35964:23501,35965:23502,35966:23503,35968:23505,35969:23508,35970:23509,35971:23510,35972:23511,35973:23512,35974:23513,35975:23514,35976:23515,35977:23516,35978:23520,35979:23522,35980:23523,35981:23526,35982:23527,35983:23529,35984:23530,35985:23531,35986:23532,35987:23533,35988:23535,35989:23537,35990:23538,35991:23539,35992:23540,35993:23541,35994:23542,35995:23543,35996:23549,35997:23550,35998:23552,35999:23554,36000:23555,36001:23557,36002:23559,36003:23560,36004:23563,36005:23564,36006:23565,36007:23566,36008:23568,36009:23570,36010:23571,36011:23575,36012:23577,36013:23579,36014:23582,36015:23583,36016:23584,36017:23585,36018:23587,36019:23590,36020:23592,36021:23593,36022:23594,36023:23595,36024:23597,36025:23598,36026:23599,36027:23600,36028:23602,36029:23603,36030:23605,36031:23606,36032:23607,36033:23619,36034:23620,36035:23622,36036:23623,36037:23628,36038:23629,36039:23634,36040:23635,36041:23636,36042:23638,36043:23639,36044:23640,36045:23642,36046:23643,36047:23644,36048:23645,36049:23647,36050:23650,36051:23652,36052:23655,36053:23656,36054:23657,36055:23658,36056:23659,36057:23660,36058:23661,36059:23664,36060:23666,36061:23667,36062:23668,36063:23669,36064:23670,36065:23671,36066:23672,36067:23675,36068:23676,36069:23677,36070:23678,36071:23680,36072:23683,36073:23684,36074:23685,36075:23686,36076:23687,36077:23689,36078:23690,36079:23691,36080:23694,36081:23695,36082:23698,36083:23699,36084:23701,36085:23709,36086:23710,36087:23711,36088:23712,36089:23713,36090:23716,36091:23717,36092:23718,36093:23719,36094:23720,36160:23722,36161:23726,36162:23727,36163:23728,36164:23730,36165:23732,36166:23734,36167:23737,36168:23738,36169:23739,36170:23740,36171:23742,36172:23744,36173:23746,36174:23747,36175:23749,36176:23750,36177:23751,36178:23752,36179:23753,36180:23754,36181:23756,36182:23757,36183:23758,36184:23759,36185:23760,36186:23761,36187:23763,36188:23764,36189:23765,36190:23766,36191:23767,36192:23768,36193:23770,36194:23771,36195:23772,36196:23773,36197:23774,36198:23775,36199:23776,36200:23778,36201:23779,36202:23783,36203:23785,36204:23787,36205:23788,36206:23790,36207:23791,36208:23793,36209:23794,36210:23795,36211:23796,36212:23797,36213:23798,36214:23799,36215:23800,36216:23801,36217:23802,36218:23804,36219:23805,36220:23806,36221:23807,36222:23808,36224:23809,36225:23812,36226:23813,36227:23816,36228:23817,36229:23818,36230:23819,36231:23820,36232:23821,36233:23823,36234:23824,36235:23825,36236:23826,36237:23827,36238:23829,36239:23831,36240:23832,36241:23833,36242:23834,36243:23836,36244:23837,36245:23839,36246:23840,36247:23841,36248:23842,36249:23843,36250:23845,36251:23848,36252:23850,36253:23851,36254:23852,36255:23855,36256:23856,36257:23857,36258:23858,36259:23859,36260:23861,36261:23862,36262:23863,36263:23864,36264:23865,36265:23866,36266:23867,36267:23868,36268:23871,36269:23872,36270:23873,36271:23874,36272:23875,36273:23876,36274:23877,36275:23878,36276:23880,36277:23881,36278:23885,36279:23886,36280:23887,36281:23888,36282:23889,36283:23890,36284:23891,36285:23892,36286:23893,36287:23894,36288:23895,36289:23897,36290:23898,36291:23900,36292:23902,36293:23903,36294:23904,36295:23905,36296:23906,36297:23907,36298:23908,36299:23909,36300:23910,36301:23911,36302:23912,36303:23914,36304:23917,36305:23918,36306:23920,36307:23921,36308:23922,36309:23923,36310:23925,36311:23926,36312:23927,36313:23928,36314:23929,36315:23930,36316:23931,36317:23932,36318:23933,36319:23934,36320:23935,36321:23936,36322:23937,36323:23939,36324:23940,36325:23941,36326:23942,36327:23943,36328:23944,36329:23945,36330:23946,36331:23947,36332:23948,36333:23949,36334:23950,36335:23951,36336:23952,36337:23953,36338:23954,36339:23955,36340:23956,36341:23957,36342:23958,36343:23959,36344:23960,36345:23962,36346:23963,36347:23964,36348:23966,36349:23967,36350:23968,36416:23969,36417:23970,36418:23971,36419:23972,36420:23973,36421:23974,36422:23975,36423:23976,36424:23977,36425:23978,36426:23979,36427:23980,36428:23981,36429:23982,36430:23983,36431:23984,36432:23985,36433:23986,36434:23987,36435:23988,36436:23989,36437:23990,36438:23992,36439:23993,36440:23994,36441:23995,36442:23996,36443:23997,36444:23998,36445:23999,36446:24000,36447:24001,36448:24002,36449:24003,36450:24004,36451:24006,36452:24007,36453:24008,36454:24009,36455:24010,36456:24011,36457:24012,36458:24014,36459:24015,36460:24016,36461:24017,36462:24018,36463:24019,36464:24020,36465:24021,36466:24022,36467:24023,36468:24024,36469:24025,36470:24026,36471:24028,36472:24031,36473:24032,36474:24035,36475:24036,36476:24042,36477:24044,36478:24045,36480:24048,36481:24053,36482:24054,36483:24056,36484:24057,36485:24058,36486:24059,36487:24060,36488:24063,36489:24064,36490:24068,36491:24071,36492:24073,36493:24074,36494:24075,36495:24077,36496:24078,36497:24082,36498:24083,36499:24087,36500:24094,36501:24095,36502:24096,36503:24097,36504:24098,36505:24099,36506:24100,36507:24101,36508:24104,36509:24105,36510:24106,36511:24107,36512:24108,36513:24111,36514:24112,36515:24114,36516:24115,36517:24116,36518:24117,36519:24118,36520:24121,36521:24122,36522:24126,36523:24127,36524:24128,36525:24129,36526:24131,36527:24134,36528:24135,36529:24136,36530:24137,36531:24138,36532:24139,36533:24141,36534:24142,36535:24143,36536:24144,36537:24145,36538:24146,36539:24147,36540:24150,36541:24151,36542:24152,36543:24153,36544:24154,36545:24156,36546:24157,36547:24159,36548:24160,36549:24163,36550:24164,36551:24165,36552:24166,36553:24167,36554:24168,36555:24169,36556:24170,36557:24171,36558:24172,36559:24173,36560:24174,36561:24175,36562:24176,36563:24177,36564:24181,36565:24183,36566:24185,36567:24190,36568:24193,36569:24194,36570:24195,36571:24197,36572:24200,36573:24201,36574:24204,36575:24205,36576:24206,36577:24210,36578:24216,36579:24219,36580:24221,36581:24225,36582:24226,36583:24227,36584:24228,36585:24232,36586:24233,36587:24234,36588:24235,36589:24236,36590:24238,36591:24239,36592:24240,36593:24241,36594:24242,36595:24244,36596:24250,36597:24251,36598:24252,36599:24253,36600:24255,36601:24256,36602:24257,36603:24258,36604:24259,36605:24260,36606:24261,36672:24262,36673:24263,36674:24264,36675:24267,36676:24268,36677:24269,36678:24270,36679:24271,36680:24272,36681:24276,36682:24277,36683:24279,36684:24280,36685:24281,36686:24282,36687:24284,36688:24285,36689:24286,36690:24287,36691:24288,36692:24289,36693:24290,36694:24291,36695:24292,36696:24293,36697:24294,36698:24295,36699:24297,36700:24299,36701:24300,36702:24301,36703:24302,36704:24303,36705:24304,36706:24305,36707:24306,36708:24307,36709:24309,36710:24312,36711:24313,36712:24315,36713:24316,36714:24317,36715:24325,36716:24326,36717:24327,36718:24329,36719:24332,36720:24333,36721:24334,36722:24336,36723:24338,36724:24340,36725:24342,36726:24345,36727:24346,36728:24348,36729:24349,36730:24350,36731:24353,36732:24354,36733:24355,36734:24356,36736:24360,36737:24363,36738:24364,36739:24366,36740:24368,36741:24370,36742:24371,36743:24372,36744:24373,36745:24374,36746:24375,36747:24376,36748:24379,36749:24381,36750:24382,36751:24383,36752:24385,36753:24386,36754:24387,36755:24388,36756:24389,36757:24390,36758:24391,36759:24392,36760:24393,36761:24394,36762:24395,36763:24396,36764:24397,36765:24398,36766:24399,36767:24401,36768:24404,36769:24409,36770:24410,36771:24411,36772:24412,36773:24414,36774:24415,36775:24416,36776:24419,36777:24421,36778:24423,36779:24424,36780:24427,36781:24430,36782:24431,36783:24434,36784:24436,36785:24437,36786:24438,36787:24440,36788:24442,36789:24445,36790:24446,36791:24447,36792:24451,36793:24454,36794:24461,36795:24462,36796:24463,36797:24465,36798:24467,36799:24468,36800:24470,36801:24474,36802:24475,36803:24477,36804:24478,36805:24479,36806:24480,36807:24482,36808:24483,36809:24484,36810:24485,36811:24486,36812:24487,36813:24489,36814:24491,36815:24492,36816:24495,36817:24496,36818:24497,36819:24498,36820:24499,36821:24500,36822:24502,36823:24504,36824:24505,36825:24506,36826:24507,36827:24510,36828:24511,36829:24512,36830:24513,36831:24514,36832:24519,36833:24520,36834:24522,36835:24523,36836:24526,36837:24531,36838:24532,36839:24533,36840:24538,36841:24539,36842:24540,36843:24542,36844:24543,36845:24546,36846:24547,36847:24549,36848:24550,36849:24552,36850:24553,36851:24556,36852:24559,36853:24560,36854:24562,36855:24563,36856:24564,36857:24566,36858:24567,36859:24569,36860:24570,36861:24572,36862:24583,36928:24584,36929:24585,36930:24587,36931:24588,36932:24592,36933:24593,36934:24595,36935:24599,36936:24600,36937:24602,36938:24606,36939:24607,36940:24610,36941:24611,36942:24612,36943:24620,36944:24621,36945:24622,36946:24624,36947:24625,36948:24626,36949:24627,36950:24628,36951:24630,36952:24631,36953:24632,36954:24633,36955:24634,36956:24637,36957:24638,36958:24640,36959:24644,36960:24645,36961:24646,36962:24647,36963:24648,36964:24649,36965:24650,36966:24652,36967:24654,36968:24655,36969:24657,36970:24659,36971:24660,36972:24662,36973:24663,36974:24664,36975:24667,36976:24668,36977:24670,36978:24671,36979:24672,36980:24673,36981:24677,36982:24678,36983:24686,36984:24689,36985:24690,36986:24692,36987:24693,36988:24695,36989:24702,36990:24704,36992:24705,36993:24706,36994:24709,36995:24710,36996:24711,36997:24712,36998:24714,36999:24715,37000:24718,37001:24719,37002:24720,37003:24721,37004:24723,37005:24725,37006:24727,37007:24728,37008:24729,37009:24732,37010:24734,37011:24737,37012:24738,37013:24740,37014:24741,37015:24743,37016:24745,37017:24746,37018:24750,37019:24752,37020:24755,37021:24757,37022:24758,37023:24759,37024:24761,37025:24762,37026:24765,37027:24766,37028:24767,37029:24768,37030:24769,37031:24770,37032:24771,37033:24772,37034:24775,37035:24776,37036:24777,37037:24780,37038:24781,37039:24782,37040:24783,37041:24784,37042:24786,37043:24787,37044:24788,37045:24790,37046:24791,37047:24793,37048:24795,37049:24798,37050:24801,37051:24802,37052:24803,37053:24804,37054:24805,37055:24810,37056:24817,37057:24818,37058:24821,37059:24823,37060:24824,37061:24827,37062:24828,37063:24829,37064:24830,37065:24831,37066:24834,37067:24835,37068:24836,37069:24837,37070:24839,37071:24842,37072:24843,37073:24844,37074:24848,37075:24849,37076:24850,37077:24851,37078:24852,37079:24854,37080:24855,37081:24856,37082:24857,37083:24859,37084:24860,37085:24861,37086:24862,37087:24865,37088:24866,37089:24869,37090:24872,37091:24873,37092:24874,37093:24876,37094:24877,37095:24878,37096:24879,37097:24880,37098:24881,37099:24882,37100:24883,37101:24884,37102:24885,37103:24886,37104:24887,37105:24888,37106:24889,37107:24890,37108:24891,37109:24892,37110:24893,37111:24894,37112:24896,37113:24897,37114:24898,37115:24899,37116:24900,37117:24901,37118:24902,37184:24903,37185:24905,37186:24907,37187:24909,37188:24911,37189:24912,37190:24914,37191:24915,37192:24916,37193:24918,37194:24919,37195:24920,37196:24921,37197:24922,37198:24923,37199:24924,37200:24926,37201:24927,37202:24928,37203:24929,37204:24931,37205:24932,37206:24933,37207:24934,37208:24937,37209:24938,37210:24939,37211:24940,37212:24941,37213:24942,37214:24943,37215:24945,37216:24946,37217:24947,37218:24948,37219:24950,37220:24952,37221:24953,37222:24954,37223:24955,37224:24956,37225:24957,37226:24958,37227:24959,37228:24960,37229:24961,37230:24962,37231:24963,37232:24964,37233:24965,37234:24966,37235:24967,37236:24968,37237:24969,37238:24970,37239:24972,37240:24973,37241:24975,37242:24976,37243:24977,37244:24978,37245:24979,37246:24981,37248:24982,37249:24983,37250:24984,37251:24985,37252:24986,37253:24987,37254:24988,37255:24990,37256:24991,37257:24992,37258:24993,37259:24994,37260:24995,37261:24996,37262:24997,37263:24998,37264:25002,37265:25003,37266:25005,37267:25006,37268:25007,37269:25008,37270:25009,37271:25010,37272:25011,37273:25012,37274:25013,37275:25014,37276:25016,37277:25017,37278:25018,37279:25019,37280:25020,37281:25021,37282:25023,37283:25024,37284:25025,37285:25027,37286:25028,37287:25029,37288:25030,37289:25031,37290:25033,37291:25036,37292:25037,37293:25038,37294:25039,37295:25040,37296:25043,37297:25045,37298:25046,37299:25047,37300:25048,37301:25049,37302:25050,37303:25051,37304:25052,37305:25053,37306:25054,37307:25055,37308:25056,37309:25057,37310:25058,37311:25059,37312:25060,37313:25061,37314:25063,37315:25064,37316:25065,37317:25066,37318:25067,37319:25068,37320:25069,37321:25070,37322:25071,37323:25072,37324:25073,37325:25074,37326:25075,37327:25076,37328:25078,37329:25079,37330:25080,37331:25081,37332:25082,37333:25083,37334:25084,37335:25085,37336:25086,37337:25088,37338:25089,37339:25090,37340:25091,37341:25092,37342:25093,37343:25095,37344:25097,37345:25107,37346:25108,37347:25113,37348:25116,37349:25117,37350:25118,37351:25120,37352:25123,37353:25126,37354:25127,37355:25128,37356:25129,37357:25131,37358:25133,37359:25135,37360:25136,37361:25137,37362:25138,37363:25141,37364:25142,37365:25144,37366:25145,37367:25146,37368:25147,37369:25148,37370:25154,37371:25156,37372:25157,37373:25158,37374:25162,37440:25167,37441:25168,37442:25173,37443:25174,37444:25175,37445:25177,37446:25178,37447:25180,37448:25181,37449:25182,37450:25183,37451:25184,37452:25185,37453:25186,37454:25188,37455:25189,37456:25192,37457:25201,37458:25202,37459:25204,37460:25205,37461:25207,37462:25208,37463:25210,37464:25211,37465:25213,37466:25217,37467:25218,37468:25219,37469:25221,37470:25222,37471:25223,37472:25224,37473:25227,37474:25228,37475:25229,37476:25230,37477:25231,37478:25232,37479:25236,37480:25241,37481:25244,37482:25245,37483:25246,37484:25251,37485:25254,37486:25255,37487:25257,37488:25258,37489:25261,37490:25262,37491:25263,37492:25264,37493:25266,37494:25267,37495:25268,37496:25270,37497:25271,37498:25272,37499:25274,37500:25278,37501:25280,37502:25281,37504:25283,37505:25291,37506:25295,37507:25297,37508:25301,37509:25309,37510:25310,37511:25312,37512:25313,37513:25316,37514:25322,37515:25323,37516:25328,37517:25330,37518:25333,37519:25336,37520:25337,37521:25338,37522:25339,37523:25344,37524:25347,37525:25348,37526:25349,37527:25350,37528:25354,37529:25355,37530:25356,37531:25357,37532:25359,37533:25360,37534:25362,37535:25363,37536:25364,37537:25365,37538:25367,37539:25368,37540:25369,37541:25372,37542:25382,37543:25383,37544:25385,37545:25388,37546:25389,37547:25390,37548:25392,37549:25393,37550:25395,37551:25396,37552:25397,37553:25398,37554:25399,37555:25400,37556:25403,37557:25404,37558:25406,37559:25407,37560:25408,37561:25409,37562:25412,37563:25415,37564:25416,37565:25418,37566:25425,37567:25426,37568:25427,37569:25428,37570:25430,37571:25431,37572:25432,37573:25433,37574:25434,37575:25435,37576:25436,37577:25437,37578:25440,37579:25444,37580:25445,37581:25446,37582:25448,37583:25450,37584:25451,37585:25452,37586:25455,37587:25456,37588:25458,37589:25459,37590:25460,37591:25461,37592:25464,37593:25465,37594:25468,37595:25469,37596:25470,37597:25471,37598:25473,37599:25475,37600:25476,37601:25477,37602:25478,37603:25483,37604:25485,37605:25489,37606:25491,37607:25492,37608:25493,37609:25495,37610:25497,37611:25498,37612:25499,37613:25500,37614:25501,37615:25502,37616:25503,37617:25505,37618:25508,37619:25510,37620:25515,37621:25519,37622:25521,37623:25522,37624:25525,37625:25526,37626:25529,37627:25531,37628:25533,37629:25535,37630:25536,37696:25537,37697:25538,37698:25539,37699:25541,37700:25543,37701:25544,37702:25546,37703:25547,37704:25548,37705:25553,37706:25555,37707:25556,37708:25557,37709:25559,37710:25560,37711:25561,37712:25562,37713:25563,37714:25564,37715:25565,37716:25567,37717:25570,37718:25572,37719:25573,37720:25574,37721:25575,37722:25576,37723:25579,37724:25580,37725:25582,37726:25583,37727:25584,37728:25585,37729:25587,37730:25589,37731:25591,37732:25593,37733:25594,37734:25595,37735:25596,37736:25598,37737:25603,37738:25604,37739:25606,37740:25607,37741:25608,37742:25609,37743:25610,37744:25613,37745:25614,37746:25617,37747:25618,37748:25621,37749:25622,37750:25623,37751:25624,37752:25625,37753:25626,37754:25629,37755:25631,37756:25634,37757:25635,37758:25636,37760:25637,37761:25639,37762:25640,37763:25641,37764:25643,37765:25646,37766:25647,37767:25648,37768:25649,37769:25650,37770:25651,37771:25653,37772:25654,37773:25655,37774:25656,37775:25657,37776:25659,37777:25660,37778:25662,37779:25664,37780:25666,37781:25667,37782:25673,37783:25675,37784:25676,37785:25677,37786:25678,37787:25679,37788:25680,37789:25681,37790:25683,37791:25685,37792:25686,37793:25687,37794:25689,37795:25690,37796:25691,37797:25692,37798:25693,37799:25695,37800:25696,37801:25697,37802:25698,37803:25699,37804:25700,37805:25701,37806:25702,37807:25704,37808:25706,37809:25707,37810:25708,37811:25710,37812:25711,37813:25712,37814:25713,37815:25714,37816:25715,37817:25716,37818:25717,37819:25718,37820:25719,37821:25723,37822:25724,37823:25725,37824:25726,37825:25727,37826:25728,37827:25729,37828:25731,37829:25734,37830:25736,37831:25737,37832:25738,37833:25739,37834:25740,37835:25741,37836:25742,37837:25743,37838:25744,37839:25747,37840:25748,37841:25751,37842:25752,37843:25754,37844:25755,37845:25756,37846:25757,37847:25759,37848:25760,37849:25761,37850:25762,37851:25763,37852:25765,37853:25766,37854:25767,37855:25768,37856:25770,37857:25771,37858:25775,37859:25777,37860:25778,37861:25779,37862:25780,37863:25782,37864:25785,37865:25787,37866:25789,37867:25790,37868:25791,37869:25793,37870:25795,37871:25796,37872:25798,37873:25799,37874:25800,37875:25801,37876:25802,37877:25803,37878:25804,37879:25807,37880:25809,37881:25811,37882:25812,37883:25813,37884:25814,37885:25817,37886:25818,37952:25819,37953:25820,37954:25821,37955:25823,37956:25824,37957:25825,37958:25827,37959:25829,37960:25831,37961:25832,37962:25833,37963:25834,37964:25835,37965:25836,37966:25837,37967:25838,37968:25839,37969:25840,37970:25841,37971:25842,37972:25843,37973:25844,37974:25845,37975:25846,37976:25847,37977:25848,37978:25849,37979:25850,37980:25851,37981:25852,37982:25853,37983:25854,37984:25855,37985:25857,37986:25858,37987:25859,37988:25860,37989:25861,37990:25862,37991:25863,37992:25864,37993:25866,37994:25867,37995:25868,37996:25869,37997:25870,37998:25871,37999:25872,38000:25873,38001:25875,38002:25876,38003:25877,38004:25878,38005:25879,38006:25881,38007:25882,38008:25883,38009:25884,38010:25885,38011:25886,38012:25887,38013:25888,38014:25889,38016:25890,38017:25891,38018:25892,38019:25894,38020:25895,38021:25896,38022:25897,38023:25898,38024:25900,38025:25901,38026:25904,38027:25905,38028:25906,38029:25907,38030:25911,38031:25914,38032:25916,38033:25917,38034:25920,38035:25921,38036:25922,38037:25923,38038:25924,38039:25926,38040:25927,38041:25930,38042:25931,38043:25933,38044:25934,38045:25936,38046:25938,38047:25939,38048:25940,38049:25943,38050:25944,38051:25946,38052:25948,38053:25951,38054:25952,38055:25953,38056:25956,38057:25957,38058:25959,38059:25960,38060:25961,38061:25962,38062:25965,38063:25966,38064:25967,38065:25969,38066:25971,38067:25973,38068:25974,38069:25976,38070:25977,38071:25978,38072:25979,38073:25980,38074:25981,38075:25982,38076:25983,38077:25984,38078:25985,38079:25986,38080:25987,38081:25988,38082:25989,38083:25990,38084:25992,38085:25993,38086:25994,38087:25997,38088:25998,38089:25999,38090:26002,38091:26004,38092:26005,38093:26006,38094:26008,38095:26010,38096:26013,38097:26014,38098:26016,38099:26018,38100:26019,38101:26022,38102:26024,38103:26026,38104:26028,38105:26030,38106:26033,38107:26034,38108:26035,38109:26036,38110:26037,38111:26038,38112:26039,38113:26040,38114:26042,38115:26043,38116:26046,38117:26047,38118:26048,38119:26050,38120:26055,38121:26056,38122:26057,38123:26058,38124:26061,38125:26064,38126:26065,38127:26067,38128:26068,38129:26069,38130:26072,38131:26073,38132:26074,38133:26075,38134:26076,38135:26077,38136:26078,38137:26079,38138:26081,38139:26083,38140:26084,38141:26090,38142:26091,38208:26098,38209:26099,38210:26100,38211:26101,38212:26104,38213:26105,38214:26107,38215:26108,38216:26109,38217:26110,38218:26111,38219:26113,38220:26116,38221:26117,38222:26119,38223:26120,38224:26121,38225:26123,38226:26125,38227:26128,38228:26129,38229:26130,38230:26134,38231:26135,38232:26136,38233:26138,38234:26139,38235:26140,38236:26142,38237:26145,38238:26146,38239:26147,38240:26148,38241:26150,38242:26153,38243:26154,38244:26155,38245:26156,38246:26158,38247:26160,38248:26162,38249:26163,38250:26167,38251:26168,38252:26169,38253:26170,38254:26171,38255:26173,38256:26175,38257:26176,38258:26178,38259:26180,38260:26181,38261:26182,38262:26183,38263:26184,38264:26185,38265:26186,38266:26189,38267:26190,38268:26192,38269:26193,38270:26200,38272:26201,38273:26203,38274:26204,38275:26205,38276:26206,38277:26208,38278:26210,38279:26211,38280:26213,38281:26215,38282:26217,38283:26218,38284:26219,38285:26220,38286:26221,38287:26225,38288:26226,38289:26227,38290:26229,38291:26232,38292:26233,38293:26235,38294:26236,38295:26237,38296:26239,38297:26240,38298:26241,38299:26243,38300:26245,38301:26246,38302:26248,38303:26249,38304:26250,38305:26251,38306:26253,38307:26254,38308:26255,38309:26256,38310:26258,38311:26259,38312:26260,38313:26261,38314:26264,38315:26265,38316:26266,38317:26267,38318:26268,38319:26270,38320:26271,38321:26272,38322:26273,38323:26274,38324:26275,38325:26276,38326:26277,38327:26278,38328:26281,38329:26282,38330:26283,38331:26284,38332:26285,38333:26287,38334:26288,38335:26289,38336:26290,38337:26291,38338:26293,38339:26294,38340:26295,38341:26296,38342:26298,38343:26299,38344:26300,38345:26301,38346:26303,38347:26304,38348:26305,38349:26306,38350:26307,38351:26308,38352:26309,38353:26310,38354:26311,38355:26312,38356:26313,38357:26314,38358:26315,38359:26316,38360:26317,38361:26318,38362:26319,38363:26320,38364:26321,38365:26322,38366:26323,38367:26324,38368:26325,38369:26326,38370:26327,38371:26328,38372:26330,38373:26334,38374:26335,38375:26336,38376:26337,38377:26338,38378:26339,38379:26340,38380:26341,38381:26343,38382:26344,38383:26346,38384:26347,38385:26348,38386:26349,38387:26350,38388:26351,38389:26353,38390:26357,38391:26358,38392:26360,38393:26362,38394:26363,38395:26365,38396:26369,38397:26370,38398:26371,38464:26372,38465:26373,38466:26374,38467:26375,38468:26380,38469:26382,38470:26383,38471:26385,38472:26386,38473:26387,38474:26390,38475:26392,38476:26393,38477:26394,38478:26396,38479:26398,38480:26400,38481:26401,38482:26402,38483:26403,38484:26404,38485:26405,38486:26407,38487:26409,38488:26414,38489:26416,38490:26418,38491:26419,38492:26422,38493:26423,38494:26424,38495:26425,38496:26427,38497:26428,38498:26430,38499:26431,38500:26433,38501:26436,38502:26437,38503:26439,38504:26442,38505:26443,38506:26445,38507:26450,38508:26452,38509:26453,38510:26455,38511:26456,38512:26457,38513:26458,38514:26459,38515:26461,38516:26466,38517:26467,38518:26468,38519:26470,38520:26471,38521:26475,38522:26476,38523:26478,38524:26481,38525:26484,38526:26486,38528:26488,38529:26489,38530:26490,38531:26491,38532:26493,38533:26496,38534:26498,38535:26499,38536:26501,38537:26502,38538:26504,38539:26506,38540:26508,38541:26509,38542:26510,38543:26511,38544:26513,38545:26514,38546:26515,38547:26516,38548:26518,38549:26521,38550:26523,38551:26527,38552:26528,38553:26529,38554:26532,38555:26534,38556:26537,38557:26540,38558:26542,38559:26545,38560:26546,38561:26548,38562:26553,38563:26554,38564:26555,38565:26556,38566:26557,38567:26558,38568:26559,38569:26560,38570:26562,38571:26565,38572:26566,38573:26567,38574:26568,38575:26569,38576:26570,38577:26571,38578:26572,38579:26573,38580:26574,38581:26581,38582:26582,38583:26583,38584:26587,38585:26591,38586:26593,38587:26595,38588:26596,38589:26598,38590:26599,38591:26600,38592:26602,38593:26603,38594:26605,38595:26606,38596:26610,38597:26613,38598:26614,38599:26615,38600:26616,38601:26617,38602:26618,38603:26619,38604:26620,38605:26622,38606:26625,38607:26626,38608:26627,38609:26628,38610:26630,38611:26637,38612:26640,38613:26642,38614:26644,38615:26645,38616:26648,38617:26649,38618:26650,38619:26651,38620:26652,38621:26654,38622:26655,38623:26656,38624:26658,38625:26659,38626:26660,38627:26661,38628:26662,38629:26663,38630:26664,38631:26667,38632:26668,38633:26669,38634:26670,38635:26671,38636:26672,38637:26673,38638:26676,38639:26677,38640:26678,38641:26682,38642:26683,38643:26687,38644:26695,38645:26699,38646:26701,38647:26703,38648:26706,38649:26710,38650:26711,38651:26712,38652:26713,38653:26714,38654:26715,38720:26716,38721:26717,38722:26718,38723:26719,38724:26730,38725:26732,38726:26733,38727:26734,38728:26735,38729:26736,38730:26737,38731:26738,38732:26739,38733:26741,38734:26744,38735:26745,38736:26746,38737:26747,38738:26748,38739:26749,38740:26750,38741:26751,38742:26752,38743:26754,38744:26756,38745:26759,38746:26760,38747:26761,38748:26762,38749:26763,38750:26764,38751:26765,38752:26766,38753:26768,38754:26769,38755:26770,38756:26772,38757:26773,38758:26774,38759:26776,38760:26777,38761:26778,38762:26779,38763:26780,38764:26781,38765:26782,38766:26783,38767:26784,38768:26785,38769:26787,38770:26788,38771:26789,38772:26793,38773:26794,38774:26795,38775:26796,38776:26798,38777:26801,38778:26802,38779:26804,38780:26806,38781:26807,38782:26808,38784:26809,38785:26810,38786:26811,38787:26812,38788:26813,38789:26814,38790:26815,38791:26817,38792:26819,38793:26820,38794:26821,38795:26822,38796:26823,38797:26824,38798:26826,38799:26828,38800:26830,38801:26831,38802:26832,38803:26833,38804:26835,38805:26836,38806:26838,38807:26839,38808:26841,38809:26843,38810:26844,38811:26845,38812:26846,38813:26847,38814:26849,38815:26850,38816:26852,38817:26853,38818:26854,38819:26855,38820:26856,38821:26857,38822:26858,38823:26859,38824:26860,38825:26861,38826:26863,38827:26866,38828:26867,38829:26868,38830:26870,38831:26871,38832:26872,38833:26875,38834:26877,38835:26878,38836:26879,38837:26880,38838:26882,38839:26883,38840:26884,38841:26886,38842:26887,38843:26888,38844:26889,38845:26890,38846:26892,38847:26895,38848:26897,38849:26899,38850:26900,38851:26901,38852:26902,38853:26903,38854:26904,38855:26905,38856:26906,38857:26907,38858:26908,38859:26909,38860:26910,38861:26913,38862:26914,38863:26915,38864:26917,38865:26918,38866:26919,38867:26920,38868:26921,38869:26922,38870:26923,38871:26924,38872:26926,38873:26927,38874:26929,38875:26930,38876:26931,38877:26933,38878:26934,38879:26935,38880:26936,38881:26938,38882:26939,38883:26940,38884:26942,38885:26944,38886:26945,38887:26947,38888:26948,38889:26949,38890:26950,38891:26951,38892:26952,38893:26953,38894:26954,38895:26955,38896:26956,38897:26957,38898:26958,38899:26959,38900:26960,38901:26961,38902:26962,38903:26963,38904:26965,38905:26966,38906:26968,38907:26969,38908:26971,38909:26972,38910:26975,38976:26977,38977:26978,38978:26980,38979:26981,38980:26983,38981:26984,38982:26985,38983:26986,38984:26988,38985:26989,38986:26991,38987:26992,38988:26994,38989:26995,38990:26996,38991:26997,38992:26998,38993:27002,38994:27003,38995:27005,38996:27006,38997:27007,38998:27009,38999:27011,39000:27013,39001:27018,39002:27019,39003:27020,39004:27022,39005:27023,39006:27024,39007:27025,39008:27026,39009:27027,39010:27030,39011:27031,39012:27033,39013:27034,39014:27037,39015:27038,39016:27039,39017:27040,39018:27041,39019:27042,39020:27043,39021:27044,39022:27045,39023:27046,39024:27049,39025:27050,39026:27052,39027:27054,39028:27055,39029:27056,39030:27058,39031:27059,39032:27061,39033:27062,39034:27064,39035:27065,39036:27066,39037:27068,39038:27069,39040:27070,39041:27071,39042:27072,39043:27074,39044:27075,39045:27076,39046:27077,39047:27078,39048:27079,39049:27080,39050:27081,39051:27083,39052:27085,39053:27087,39054:27089,39055:27090,39056:27091,39057:27093,39058:27094,39059:27095,39060:27096,39061:27097,39062:27098,39063:27100,39064:27101,39065:27102,39066:27105,39067:27106,39068:27107,39069:27108,39070:27109,39071:27110,39072:27111,39073:27112,39074:27113,39075:27114,39076:27115,39077:27116,39078:27118,39079:27119,39080:27120,39081:27121,39082:27123,39083:27124,39084:27125,39085:27126,39086:27127,39087:27128,39088:27129,39089:27130,39090:27131,39091:27132,39092:27134,39093:27136,39094:27137,39095:27138,39096:27139,39097:27140,39098:27141,39099:27142,39100:27143,39101:27144,39102:27145,39103:27147,39104:27148,39105:27149,39106:27150,39107:27151,39108:27152,39109:27153,39110:27154,39111:27155,39112:27156,39113:27157,39114:27158,39115:27161,39116:27162,39117:27163,39118:27164,39119:27165,39120:27166,39121:27168,39122:27170,39123:27171,39124:27172,39125:27173,39126:27174,39127:27175,39128:27177,39129:27179,39130:27180,39131:27181,39132:27182,39133:27184,39134:27186,39135:27187,39136:27188,39137:27190,39138:27191,39139:27192,39140:27193,39141:27194,39142:27195,39143:27196,39144:27199,39145:27200,39146:27201,39147:27202,39148:27203,39149:27205,39150:27206,39151:27208,39152:27209,39153:27210,39154:27211,39155:27212,39156:27213,39157:27214,39158:27215,39159:27217,39160:27218,39161:27219,39162:27220,39163:27221,39164:27222,39165:27223,39166:27226,39232:27228,39233:27229,39234:27230,39235:27231,39236:27232,39237:27234,39238:27235,39239:27236,39240:27238,39241:27239,39242:27240,39243:27241,39244:27242,39245:27243,39246:27244,39247:27245,39248:27246,39249:27247,39250:27248,39251:27250,39252:27251,39253:27252,39254:27253,39255:27254,39256:27255,39257:27256,39258:27258,39259:27259,39260:27261,39261:27262,39262:27263,39263:27265,39264:27266,39265:27267,39266:27269,39267:27270,39268:27271,39269:27272,39270:27273,39271:27274,39272:27275,39273:27276,39274:27277,39275:27279,39276:27282,39277:27283,39278:27284,39279:27285,39280:27286,39281:27288,39282:27289,39283:27290,39284:27291,39285:27292,39286:27293,39287:27294,39288:27295,39289:27297,39290:27298,39291:27299,39292:27300,39293:27301,39294:27302,39296:27303,39297:27304,39298:27306,39299:27309,39300:27310,39301:27311,39302:27312,39303:27313,39304:27314,39305:27315,39306:27316,39307:27317,39308:27318,39309:27319,39310:27320,39311:27321,39312:27322,39313:27323,39314:27324,39315:27325,39316:27326,39317:27327,39318:27328,39319:27329,39320:27330,39321:27331,39322:27332,39323:27333,39324:27334,39325:27335,39326:27336,39327:27337,39328:27338,39329:27339,39330:27340,39331:27341,39332:27342,39333:27343,39334:27344,39335:27345,39336:27346,39337:27347,39338:27348,39339:27349,39340:27350,39341:27351,39342:27352,39343:27353,39344:27354,39345:27355,39346:27356,39347:27357,39348:27358,39349:27359,39350:27360,39351:27361,39352:27362,39353:27363,39354:27364,39355:27365,39356:27366,39357:27367,39358:27368,39359:27369,39360:27370,39361:27371,39362:27372,39363:27373,39364:27374,39365:27375,39366:27376,39367:27377,39368:27378,39369:27379,39370:27380,39371:27381,39372:27382,39373:27383,39374:27384,39375:27385,39376:27386,39377:27387,39378:27388,39379:27389,39380:27390,39381:27391,39382:27392,39383:27393,39384:27394,39385:27395,39386:27396,39387:27397,39388:27398,39389:27399,39390:27400,39391:27401,39392:27402,39393:27403,39394:27404,39395:27405,39396:27406,39397:27407,39398:27408,39399:27409,39400:27410,39401:27411,39402:27412,39403:27413,39404:27414,39405:27415,39406:27416,39407:27417,39408:27418,39409:27419,39410:27420,39411:27421,39412:27422,39413:27423,39414:27429,39415:27430,39416:27432,39417:27433,39418:27434,39419:27435,39420:27436,39421:27437,39422:27438,39488:27439,39489:27440,39490:27441,39491:27443,39492:27444,39493:27445,39494:27446,39495:27448,39496:27451,39497:27452,39498:27453,39499:27455,39500:27456,39501:27457,39502:27458,39503:27460,39504:27461,39505:27464,39506:27466,39507:27467,39508:27469,39509:27470,39510:27471,39511:27472,39512:27473,39513:27474,39514:27475,39515:27476,39516:27477,39517:27478,39518:27479,39519:27480,39520:27482,39521:27483,39522:27484,39523:27485,39524:27486,39525:27487,39526:27488,39527:27489,39528:27496,39529:27497,39530:27499,39531:27500,39532:27501,39533:27502,39534:27503,39535:27504,39536:27505,39537:27506,39538:27507,39539:27508,39540:27509,39541:27510,39542:27511,39543:27512,39544:27514,39545:27517,39546:27518,39547:27519,39548:27520,39549:27525,39550:27528,39552:27532,39553:27534,39554:27535,39555:27536,39556:27537,39557:27540,39558:27541,39559:27543,39560:27544,39561:27545,39562:27548,39563:27549,39564:27550,39565:27551,39566:27552,39567:27554,39568:27555,39569:27556,39570:27557,39571:27558,39572:27559,39573:27560,39574:27561,39575:27563,39576:27564,39577:27565,39578:27566,39579:27567,39580:27568,39581:27569,39582:27570,39583:27574,39584:27576,39585:27577,39586:27578,39587:27579,39588:27580,39589:27581,39590:27582,39591:27584,39592:27587,39593:27588,39594:27590,39595:27591,39596:27592,39597:27593,39598:27594,39599:27596,39600:27598,39601:27600,39602:27601,39603:27608,39604:27610,39605:27612,39606:27613,39607:27614,39608:27615,39609:27616,39610:27618,39611:27619,39612:27620,39613:27621,39614:27622,39615:27623,39616:27624,39617:27625,39618:27628,39619:27629,39620:27630,39621:27632,39622:27633,39623:27634,39624:27636,39625:27638,39626:27639,39627:27640,39628:27642,39629:27643,39630:27644,39631:27646,39632:27647,39633:27648,39634:27649,39635:27650,39636:27651,39637:27652,39638:27656,39639:27657,39640:27658,39641:27659,39642:27660,39643:27662,39644:27666,39645:27671,39646:27676,39647:27677,39648:27678,39649:27680,39650:27683,39651:27685,39652:27691,39653:27692,39654:27693,39655:27697,39656:27699,39657:27702,39658:27703,39659:27705,39660:27706,39661:27707,39662:27708,39663:27710,39664:27711,39665:27715,39666:27716,39667:27717,39668:27720,39669:27723,39670:27724,39671:27725,39672:27726,39673:27727,39674:27729,39675:27730,39676:27731,39677:27734,39678:27736,39744:27737,39745:27738,39746:27746,39747:27747,39748:27749,39749:27750,39750:27751,39751:27755,39752:27756,39753:27757,39754:27758,39755:27759,39756:27761,39757:27763,39758:27765,39759:27767,39760:27768,39761:27770,39762:27771,39763:27772,39764:27775,39765:27776,39766:27780,39767:27783,39768:27786,39769:27787,39770:27789,39771:27790,39772:27793,39773:27794,39774:27797,39775:27798,39776:27799,39777:27800,39778:27802,39779:27804,39780:27805,39781:27806,39782:27808,39783:27810,39784:27816,39785:27820,39786:27823,39787:27824,39788:27828,39789:27829,39790:27830,39791:27831,39792:27834,39793:27840,39794:27841,39795:27842,39796:27843,39797:27846,39798:27847,39799:27848,39800:27851,39801:27853,39802:27854,39803:27855,39804:27857,39805:27858,39806:27864,39808:27865,39809:27866,39810:27868,39811:27869,39812:27871,39813:27876,39814:27878,39815:27879,39816:27881,39817:27884,39818:27885,39819:27890,39820:27892,39821:27897,39822:27903,39823:27904,39824:27906,39825:27907,39826:27909,39827:27910,39828:27912,39829:27913,39830:27914,39831:27917,39832:27919,39833:27920,39834:27921,39835:27923,39836:27924,39837:27925,39838:27926,39839:27928,39840:27932,39841:27933,39842:27935,39843:27936,39844:27937,39845:27938,39846:27939,39847:27940,39848:27942,39849:27944,39850:27945,39851:27948,39852:27949,39853:27951,39854:27952,39855:27956,39856:27958,39857:27959,39858:27960,39859:27962,39860:27967,39861:27968,39862:27970,39863:27972,39864:27977,39865:27980,39866:27984,39867:27989,39868:27990,39869:27991,39870:27992,39871:27995,39872:27997,39873:27999,39874:28001,39875:28002,39876:28004,39877:28005,39878:28007,39879:28008,39880:28011,39881:28012,39882:28013,39883:28016,39884:28017,39885:28018,39886:28019,39887:28021,39888:28022,39889:28025,39890:28026,39891:28027,39892:28029,39893:28030,39894:28031,39895:28032,39896:28033,39897:28035,39898:28036,39899:28038,39900:28039,39901:28042,39902:28043,39903:28045,39904:28047,39905:28048,39906:28050,39907:28054,39908:28055,39909:28056,39910:28057,39911:28058,39912:28060,39913:28066,39914:28069,39915:28076,39916:28077,39917:28080,39918:28081,39919:28083,39920:28084,39921:28086,39922:28087,39923:28089,39924:28090,39925:28091,39926:28092,39927:28093,39928:28094,39929:28097,39930:28098,39931:28099,39932:28104,39933:28105,39934:28106,40000:28109,40001:28110,40002:28111,40003:28112,40004:28114,40005:28115,40006:28116,40007:28117,40008:28119,40009:28122,40010:28123,40011:28124,40012:28127,40013:28130,40014:28131,40015:28133,40016:28135,40017:28136,40018:28137,40019:28138,40020:28141,40021:28143,40022:28144,40023:28146,40024:28148,40025:28149,40026:28150,40027:28152,40028:28154,40029:28157,40030:28158,40031:28159,40032:28160,40033:28161,40034:28162,40035:28163,40036:28164,40037:28166,40038:28167,40039:28168,40040:28169,40041:28171,40042:28175,40043:28178,40044:28179,40045:28181,40046:28184,40047:28185,40048:28187,40049:28188,40050:28190,40051:28191,40052:28194,40053:28198,40054:28199,40055:28200,40056:28202,40057:28204,40058:28206,40059:28208,40060:28209,40061:28211,40062:28213,40064:28214,40065:28215,40066:28217,40067:28219,40068:28220,40069:28221,40070:28222,40071:28223,40072:28224,40073:28225,40074:28226,40075:28229,40076:28230,40077:28231,40078:28232,40079:28233,40080:28234,40081:28235,40082:28236,40083:28239,40084:28240,40085:28241,40086:28242,40087:28245,40088:28247,40089:28249,40090:28250,40091:28252,40092:28253,40093:28254,40094:28256,40095:28257,40096:28258,40097:28259,40098:28260,40099:28261,40100:28262,40101:28263,40102:28264,40103:28265,40104:28266,40105:28268,40106:28269,40107:28271,40108:28272,40109:28273,40110:28274,40111:28275,40112:28276,40113:28277,40114:28278,40115:28279,40116:28280,40117:28281,40118:28282,40119:28283,40120:28284,40121:28285,40122:28288,40123:28289,40124:28290,40125:28292,40126:28295,40127:28296,40128:28298,40129:28299,40130:28300,40131:28301,40132:28302,40133:28305,40134:28306,40135:28307,40136:28308,40137:28309,40138:28310,40139:28311,40140:28313,40141:28314,40142:28315,40143:28317,40144:28318,40145:28320,40146:28321,40147:28323,40148:28324,40149:28326,40150:28328,40151:28329,40152:28331,40153:28332,40154:28333,40155:28334,40156:28336,40157:28339,40158:28341,40159:28344,40160:28345,40161:28348,40162:28350,40163:28351,40164:28352,40165:28355,40166:28356,40167:28357,40168:28358,40169:28360,40170:28361,40171:28362,40172:28364,40173:28365,40174:28366,40175:28368,40176:28370,40177:28374,40178:28376,40179:28377,40180:28379,40181:28380,40182:28381,40183:28387,40184:28391,40185:28394,40186:28395,40187:28396,40188:28397,40189:28398,40190:28399,40256:28400,40257:28401,40258:28402,40259:28403,40260:28405,40261:28406,40262:28407,40263:28408,40264:28410,40265:28411,40266:28412,40267:28413,40268:28414,40269:28415,40270:28416,40271:28417,40272:28419,40273:28420,40274:28421,40275:28423,40276:28424,40277:28426,40278:28427,40279:28428,40280:28429,40281:28430,40282:28432,40283:28433,40284:28434,40285:28438,40286:28439,40287:28440,40288:28441,40289:28442,40290:28443,40291:28444,40292:28445,40293:28446,40294:28447,40295:28449,40296:28450,40297:28451,40298:28453,40299:28454,40300:28455,40301:28456,40302:28460,40303:28462,40304:28464,40305:28466,40306:28468,40307:28469,40308:28471,40309:28472,40310:28473,40311:28474,40312:28475,40313:28476,40314:28477,40315:28479,40316:28480,40317:28481,40318:28482,40320:28483,40321:28484,40322:28485,40323:28488,40324:28489,40325:28490,40326:28492,40327:28494,40328:28495,40329:28496,40330:28497,40331:28498,40332:28499,40333:28500,40334:28501,40335:28502,40336:28503,40337:28505,40338:28506,40339:28507,40340:28509,40341:28511,40342:28512,40343:28513,40344:28515,40345:28516,40346:28517,40347:28519,40348:28520,40349:28521,40350:28522,40351:28523,40352:28524,40353:28527,40354:28528,40355:28529,40356:28531,40357:28533,40358:28534,40359:28535,40360:28537,40361:28539,40362:28541,40363:28542,40364:28543,40365:28544,40366:28545,40367:28546,40368:28547,40369:28549,40370:28550,40371:28551,40372:28554,40373:28555,40374:28559,40375:28560,40376:28561,40377:28562,40378:28563,40379:28564,40380:28565,40381:28566,40382:28567,40383:28568,40384:28569,40385:28570,40386:28571,40387:28573,40388:28574,40389:28575,40390:28576,40391:28578,40392:28579,40393:28580,40394:28581,40395:28582,40396:28584,40397:28585,40398:28586,40399:28587,40400:28588,40401:28589,40402:28590,40403:28591,40404:28592,40405:28593,40406:28594,40407:28596,40408:28597,40409:28599,40410:28600,40411:28602,40412:28603,40413:28604,40414:28605,40415:28606,40416:28607,40417:28609,40418:28611,40419:28612,40420:28613,40421:28614,40422:28615,40423:28616,40424:28618,40425:28619,40426:28620,40427:28621,40428:28622,40429:28623,40430:28624,40431:28627,40432:28628,40433:28629,40434:28630,40435:28631,40436:28632,40437:28633,40438:28634,40439:28635,40440:28636,40441:28637,40442:28639,40443:28642,40444:28643,40445:28644,40446:28645,40512:28646,40513:28647,40514:28648,40515:28649,40516:28650,40517:28651,40518:28652,40519:28653,40520:28656,40521:28657,40522:28658,40523:28659,40524:28660,40525:28661,40526:28662,40527:28663,40528:28664,40529:28665,40530:28666,40531:28667,40532:28668,40533:28669,40534:28670,40535:28671,40536:28672,40537:28673,40538:28674,40539:28675,40540:28676,40541:28677,40542:28678,40543:28679,40544:28680,40545:28681,40546:28682,40547:28683,40548:28684,40549:28685,40550:28686,40551:28687,40552:28688,40553:28690,40554:28691,40555:28692,40556:28693,40557:28694,40558:28695,40559:28696,40560:28697,40561:28700,40562:28701,40563:28702,40564:28703,40565:28704,40566:28705,40567:28706,40568:28708,40569:28709,40570:28710,40571:28711,40572:28712,40573:28713,40574:28714,40576:28715,40577:28716,40578:28717,40579:28718,40580:28719,40581:28720,40582:28721,40583:28722,40584:28723,40585:28724,40586:28726,40587:28727,40588:28728,40589:28730,40590:28731,40591:28732,40592:28733,40593:28734,40594:28735,40595:28736,40596:28737,40597:28738,40598:28739,40599:28740,40600:28741,40601:28742,40602:28743,40603:28744,40604:28745,40605:28746,40606:28747,40607:28749,40608:28750,40609:28752,40610:28753,40611:28754,40612:28755,40613:28756,40614:28757,40615:28758,40616:28759,40617:28760,40618:28761,40619:28762,40620:28763,40621:28764,40622:28765,40623:28767,40624:28768,40625:28769,40626:28770,40627:28771,40628:28772,40629:28773,40630:28774,40631:28775,40632:28776,40633:28777,40634:28778,40635:28782,40636:28785,40637:28786,40638:28787,40639:28788,40640:28791,40641:28793,40642:28794,40643:28795,40644:28797,40645:28801,40646:28802,40647:28803,40648:28804,40649:28806,40650:28807,40651:28808,40652:28811,40653:28812,40654:28813,40655:28815,40656:28816,40657:28817,40658:28819,40659:28823,40660:28824,40661:28826,40662:28827,40663:28830,40664:28831,40665:28832,40666:28833,40667:28834,40668:28835,40669:28836,40670:28837,40671:28838,40672:28839,40673:28840,40674:28841,40675:28842,40676:28848,40677:28850,40678:28852,40679:28853,40680:28854,40681:28858,40682:28862,40683:28863,40684:28868,40685:28869,40686:28870,40687:28871,40688:28873,40689:28875,40690:28876,40691:28877,40692:28878,40693:28879,40694:28880,40695:28881,40696:28882,40697:28883,40698:28884,40699:28885,40700:28886,40701:28887,40702:28890,40768:28892,40769:28893,40770:28894,40771:28896,40772:28897,40773:28898,40774:28899,40775:28901,40776:28906,40777:28910,40778:28912,40779:28913,40780:28914,40781:28915,40782:28916,40783:28917,40784:28918,40785:28920,40786:28922,40787:28923,40788:28924,40789:28926,40790:28927,40791:28928,40792:28929,40793:28930,40794:28931,40795:28932,40796:28933,40797:28934,40798:28935,40799:28936,40800:28939,40801:28940,40802:28941,40803:28942,40804:28943,40805:28945,40806:28946,40807:28948,40808:28951,40809:28955,40810:28956,40811:28957,40812:28958,40813:28959,40814:28960,40815:28961,40816:28962,40817:28963,40818:28964,40819:28965,40820:28967,40821:28968,40822:28969,40823:28970,40824:28971,40825:28972,40826:28973,40827:28974,40828:28978,40829:28979,40830:28980,40832:28981,40833:28983,40834:28984,40835:28985,40836:28986,40837:28987,40838:28988,40839:28989,40840:28990,40841:28991,40842:28992,40843:28993,40844:28994,40845:28995,40846:28996,40847:28998,40848:28999,40849:29000,40850:29001,40851:29003,40852:29005,40853:29007,40854:29008,40855:29009,40856:29010,40857:29011,40858:29012,40859:29013,40860:29014,40861:29015,40862:29016,40863:29017,40864:29018,40865:29019,40866:29021,40867:29023,40868:29024,40869:29025,40870:29026,40871:29027,40872:29029,40873:29033,40874:29034,40875:29035,40876:29036,40877:29037,40878:29039,40879:29040,40880:29041,40881:29044,40882:29045,40883:29046,40884:29047,40885:29049,40886:29051,40887:29052,40888:29054,40889:29055,40890:29056,40891:29057,40892:29058,40893:29059,40894:29061,40895:29062,40896:29063,40897:29064,40898:29065,40899:29067,40900:29068,40901:29069,40902:29070,40903:29072,40904:29073,40905:29074,40906:29075,40907:29077,40908:29078,40909:29079,40910:29082,40911:29083,40912:29084,40913:29085,40914:29086,40915:29089,40916:29090,40917:29091,40918:29092,40919:29093,40920:29094,40921:29095,40922:29097,40923:29098,40924:29099,40925:29101,40926:29102,40927:29103,40928:29104,40929:29105,40930:29106,40931:29108,40932:29110,40933:29111,40934:29112,40935:29114,40936:29115,40937:29116,40938:29117,40939:29118,40940:29119,40941:29120,40942:29121,40943:29122,40944:29124,40945:29125,40946:29126,40947:29127,40948:29128,40949:29129,40950:29130,40951:29131,40952:29132,40953:29133,40954:29135,40955:29136,40956:29137,40957:29138,40958:29139,41024:29142,41025:29143,41026:29144,41027:29145,41028:29146,41029:29147,41030:29148,41031:29149,41032:29150,41033:29151,41034:29153,41035:29154,41036:29155,41037:29156,41038:29158,41039:29160,41040:29161,41041:29162,41042:29163,41043:29164,41044:29165,41045:29167,41046:29168,41047:29169,41048:29170,41049:29171,41050:29172,41051:29173,41052:29174,41053:29175,41054:29176,41055:29178,41056:29179,41057:29180,41058:29181,41059:29182,41060:29183,41061:29184,41062:29185,41063:29186,41064:29187,41065:29188,41066:29189,41067:29191,41068:29192,41069:29193,41070:29194,41071:29195,41072:29196,41073:29197,41074:29198,41075:29199,41076:29200,41077:29201,41078:29202,41079:29203,41080:29204,41081:29205,41082:29206,41083:29207,41084:29208,41085:29209,41086:29210,41088:29211,41089:29212,41090:29214,41091:29215,41092:29216,41093:29217,41094:29218,41095:29219,41096:29220,41097:29221,41098:29222,41099:29223,41100:29225,41101:29227,41102:29229,41103:29230,41104:29231,41105:29234,41106:29235,41107:29236,41108:29242,41109:29244,41110:29246,41111:29248,41112:29249,41113:29250,41114:29251,41115:29252,41116:29253,41117:29254,41118:29257,41119:29258,41120:29259,41121:29262,41122:29263,41123:29264,41124:29265,41125:29267,41126:29268,41127:29269,41128:29271,41129:29272,41130:29274,41131:29276,41132:29278,41133:29280,41134:29283,41135:29284,41136:29285,41137:29288,41138:29290,41139:29291,41140:29292,41141:29293,41142:29296,41143:29297,41144:29299,41145:29300,41146:29302,41147:29303,41148:29304,41149:29307,41150:29308,41151:29309,41152:29314,41153:29315,41154:29317,41155:29318,41156:29319,41157:29320,41158:29321,41159:29324,41160:29326,41161:29328,41162:29329,41163:29331,41164:29332,41165:29333,41166:29334,41167:29335,41168:29336,41169:29337,41170:29338,41171:29339,41172:29340,41173:29341,41174:29342,41175:29344,41176:29345,41177:29346,41178:29347,41179:29348,41180:29349,41181:29350,41182:29351,41183:29352,41184:29353,41185:29354,41186:29355,41187:29358,41188:29361,41189:29362,41190:29363,41191:29365,41192:29370,41193:29371,41194:29372,41195:29373,41196:29374,41197:29375,41198:29376,41199:29381,41200:29382,41201:29383,41202:29385,41203:29386,41204:29387,41205:29388,41206:29391,41207:29393,41208:29395,41209:29396,41210:29397,41211:29398,41212:29400,41213:29402,41214:29403,41280:58566,41281:58567,41282:58568,41283:58569,41284:58570,41285:58571,41286:58572,41287:58573,41288:58574,41289:58575,41290:58576,41291:58577,41292:58578,41293:58579,41294:58580,41295:58581,41296:58582,41297:58583,41298:58584,41299:58585,41300:58586,41301:58587,41302:58588,41303:58589,41304:58590,41305:58591,41306:58592,41307:58593,41308:58594,41309:58595,41310:58596,41311:58597,41312:58598,41313:58599,41314:58600,41315:58601,41316:58602,41317:58603,41318:58604,41319:58605,41320:58606,41321:58607,41322:58608,41323:58609,41324:58610,41325:58611,41326:58612,41327:58613,41328:58614,41329:58615,41330:58616,41331:58617,41332:58618,41333:58619,41334:58620,41335:58621,41336:58622,41337:58623,41338:58624,41339:58625,41340:58626,41341:58627,41342:58628,41344:58629,41345:58630,41346:58631,41347:58632,41348:58633,41349:58634,41350:58635,41351:58636,41352:58637,41353:58638,41354:58639,41355:58640,41356:58641,41357:58642,41358:58643,41359:58644,41360:58645,41361:58646,41362:58647,41363:58648,41364:58649,41365:58650,41366:58651,41367:58652,41368:58653,41369:58654,41370:58655,41371:58656,41372:58657,41373:58658,41374:58659,41375:58660,41376:58661,41377:12288,41378:12289,41379:12290,41380:183,41381:713,41382:711,41383:168,41384:12291,41385:12293,41386:8212,41387:65374,41388:8214,41389:8230,41390:8216,41391:8217,41392:8220,41393:8221,41394:12308,41395:12309,41396:12296,41397:12297,41398:12298,41399:12299,41400:12300,41401:12301,41402:12302,41403:12303,41404:12310,41405:12311,41406:12304,41407:12305,41408:177,41409:215,41410:247,41411:8758,41412:8743,41413:8744,41414:8721,41415:8719,41416:8746,41417:8745,41418:8712,41419:8759,41420:8730,41421:8869,41422:8741,41423:8736,41424:8978,41425:8857,41426:8747,41427:8750,41428:8801,41429:8780,41430:8776,41431:8765,41432:8733,41433:8800,41434:8814,41435:8815,41436:8804,41437:8805,41438:8734,41439:8757,41440:8756,41441:9794,41442:9792,41443:176,41444:8242,41445:8243,41446:8451,41447:65284,41448:164,41449:65504,41450:65505,41451:8240,41452:167,41453:8470,41454:9734,41455:9733,41456:9675,41457:9679,41458:9678,41459:9671,41460:9670,41461:9633,41462:9632,41463:9651,41464:9650,41465:8251,41466:8594,41467:8592,41468:8593,41469:8595,41470:12307,41536:58662,41537:58663,41538:58664,41539:58665,41540:58666,41541:58667,41542:58668,41543:58669,41544:58670,41545:58671,41546:58672,41547:58673,41548:58674,41549:58675,41550:58676,41551:58677,41552:58678,41553:58679,41554:58680,41555:58681,41556:58682,41557:58683,41558:58684,41559:58685,41560:58686,41561:58687,41562:58688,41563:58689,41564:58690,41565:58691,41566:58692,41567:58693,41568:58694,41569:58695,41570:58696,41571:58697,41572:58698,41573:58699,41574:58700,41575:58701,41576:58702,41577:58703,41578:58704,41579:58705,41580:58706,41581:58707,41582:58708,41583:58709,41584:58710,41585:58711,41586:58712,41587:58713,41588:58714,41589:58715,41590:58716,41591:58717,41592:58718,41593:58719,41594:58720,41595:58721,41596:58722,41597:58723,41598:58724,41600:58725,41601:58726,41602:58727,41603:58728,41604:58729,41605:58730,41606:58731,41607:58732,41608:58733,41609:58734,41610:58735,41611:58736,41612:58737,41613:58738,41614:58739,41615:58740,41616:58741,41617:58742,41618:58743,41619:58744,41620:58745,41621:58746,41622:58747,41623:58748,41624:58749,41625:58750,41626:58751,41627:58752,41628:58753,41629:58754,41630:58755,41631:58756,41632:58757,41633:8560,41634:8561,41635:8562,41636:8563,41637:8564,41638:8565,41639:8566,41640:8567,41641:8568,41642:8569,41643:59238,41644:59239,41645:59240,41646:59241,41647:59242,41648:59243,41649:9352,41650:9353,41651:9354,41652:9355,41653:9356,41654:9357,41655:9358,41656:9359,41657:9360,41658:9361,41659:9362,41660:9363,41661:9364,41662:9365,41663:9366,41664:9367,41665:9368,41666:9369,41667:9370,41668:9371,41669:9332,41670:9333,41671:9334,41672:9335,41673:9336,41674:9337,41675:9338,41676:9339,41677:9340,41678:9341,41679:9342,41680:9343,41681:9344,41682:9345,41683:9346,41684:9347,41685:9348,41686:9349,41687:9350,41688:9351,41689:9312,41690:9313,41691:9314,41692:9315,41693:9316,41694:9317,41695:9318,41696:9319,41697:9320,41698:9321,41699:8364,41700:59245,41701:12832,41702:12833,41703:12834,41704:12835,41705:12836,41706:12837,41707:12838,41708:12839,41709:12840,41710:12841,41711:59246,41712:59247,41713:8544,41714:8545,41715:8546,41716:8547,41717:8548,41718:8549,41719:8550,41720:8551,41721:8552,41722:8553,41723:8554,41724:8555,41725:59248,41726:59249,41792:58758,41793:58759,41794:58760,41795:58761,41796:58762,41797:58763,41798:58764,41799:58765,41800:58766,41801:58767,41802:58768,41803:58769,41804:58770,41805:58771,41806:58772,41807:58773,41808:58774,41809:58775,41810:58776,41811:58777,41812:58778,41813:58779,41814:58780,41815:58781,41816:58782,41817:58783,41818:58784,41819:58785,41820:58786,41821:58787,41822:58788,41823:58789,41824:58790,41825:58791,41826:58792,41827:58793,41828:58794,41829:58795,41830:58796,41831:58797,41832:58798,41833:58799,41834:58800,41835:58801,41836:58802,41837:58803,41838:58804,41839:58805,41840:58806,41841:58807,41842:58808,41843:58809,41844:58810,41845:58811,41846:58812,41847:58813,41848:58814,41849:58815,41850:58816,41851:58817,41852:58818,41853:58819,41854:58820,41856:58821,41857:58822,41858:58823,41859:58824,41860:58825,41861:58826,41862:58827,41863:58828,41864:58829,41865:58830,41866:58831,41867:58832,41868:58833,41869:58834,41870:58835,41871:58836,41872:58837,41873:58838,41874:58839,41875:58840,41876:58841,41877:58842,41878:58843,41879:58844,41880:58845,41881:58846,41882:58847,41883:58848,41884:58849,41885:58850,41886:58851,41887:58852,41888:58853,41889:65281,41890:65282,41891:65283,41892:65509,41893:65285,41894:65286,41895:65287,41896:65288,41897:65289,41898:65290,41899:65291,41900:65292,41901:65293,41902:65294,41903:65295,41904:65296,41905:65297,41906:65298,41907:65299,41908:65300,41909:65301,41910:65302,41911:65303,41912:65304,41913:65305,41914:65306,41915:65307,41916:65308,41917:65309,41918:65310,41919:65311,41920:65312,41921:65313,41922:65314,41923:65315,41924:65316,41925:65317,41926:65318,41927:65319,41928:65320,41929:65321,41930:65322,41931:65323,41932:65324,41933:65325,41934:65326,41935:65327,41936:65328,41937:65329,41938:65330,41939:65331,41940:65332,41941:65333,41942:65334,41943:65335,41944:65336,41945:65337,41946:65338,41947:65339,41948:65340,41949:65341,41950:65342,41951:65343,41952:65344,41953:65345,41954:65346,41955:65347,41956:65348,41957:65349,41958:65350,41959:65351,41960:65352,41961:65353,41962:65354,41963:65355,41964:65356,41965:65357,41966:65358,41967:65359,41968:65360,41969:65361,41970:65362,41971:65363,41972:65364,41973:65365,41974:65366,41975:65367,41976:65368,41977:65369,41978:65370,41979:65371,41980:65372,41981:65373,41982:65507,42048:58854,42049:58855,42050:58856,42051:58857,42052:58858,42053:58859,42054:58860,42055:58861,42056:58862,42057:58863,42058:58864,42059:58865,42060:58866,42061:58867,42062:58868,42063:58869,42064:58870,42065:58871,42066:58872,42067:58873,42068:58874,42069:58875,42070:58876,42071:58877,42072:58878,42073:58879,42074:58880,42075:58881,42076:58882,42077:58883,42078:58884,42079:58885,42080:58886,42081:58887,42082:58888,42083:58889,42084:58890,42085:58891,42086:58892,42087:58893,42088:58894,42089:58895,42090:58896,42091:58897,42092:58898,42093:58899,42094:58900,42095:58901,42096:58902,42097:58903,42098:58904,42099:58905,42100:58906,42101:58907,42102:58908,42103:58909,42104:58910,42105:58911,42106:58912,42107:58913,42108:58914,42109:58915,42110:58916,42112:58917,42113:58918,42114:58919,42115:58920,42116:58921,42117:58922,42118:58923,42119:58924,42120:58925,42121:58926,42122:58927,42123:58928,42124:58929,42125:58930,42126:58931,42127:58932,42128:58933,42129:58934,42130:58935,42131:58936,42132:58937,42133:58938,42134:58939,42135:58940,42136:58941,42137:58942,42138:58943,42139:58944,42140:58945,42141:58946,42142:58947,42143:58948,42144:58949,42145:12353,42146:12354,42147:12355,42148:12356,42149:12357,42150:12358,42151:12359,42152:12360,42153:12361,42154:12362,42155:12363,42156:12364,42157:12365,42158:12366,42159:12367,42160:12368,42161:12369,42162:12370,42163:12371,42164:12372,42165:12373,42166:12374,42167:12375,42168:12376,42169:12377,42170:12378,42171:12379,42172:12380,42173:12381,42174:12382,42175:12383,42176:12384,42177:12385,42178:12386,42179:12387,42180:12388,42181:12389,42182:12390,42183:12391,42184:12392,42185:12393,42186:12394,42187:12395,42188:12396,42189:12397,42190:12398,42191:12399,42192:12400,42193:12401,42194:12402,42195:12403,42196:12404,42197:12405,42198:12406,42199:12407,42200:12408,42201:12409,42202:12410,42203:12411,42204:12412,42205:12413,42206:12414,42207:12415,42208:12416,42209:12417,42210:12418,42211:12419,42212:12420,42213:12421,42214:12422,42215:12423,42216:12424,42217:12425,42218:12426,42219:12427,42220:12428,42221:12429,42222:12430,42223:12431,42224:12432,42225:12433,42226:12434,42227:12435,42228:59250,42229:59251,42230:59252,42231:59253,42232:59254,42233:59255,42234:59256,42235:59257,42236:59258,42237:59259,42238:59260,42304:58950,42305:58951,42306:58952,42307:58953,42308:58954,42309:58955,42310:58956,42311:58957,42312:58958,42313:58959,42314:58960,42315:58961,42316:58962,42317:58963,42318:58964,42319:58965,42320:58966,42321:58967,42322:58968,42323:58969,42324:58970,42325:58971,42326:58972,42327:58973,42328:58974,42329:58975,42330:58976,42331:58977,42332:58978,42333:58979,42334:58980,42335:58981,42336:58982,42337:58983,42338:58984,42339:58985,42340:58986,42341:58987,42342:58988,42343:58989,42344:58990,42345:58991,42346:58992,42347:58993,42348:58994,42349:58995,42350:58996,42351:58997,42352:58998,42353:58999,42354:59000,42355:59001,42356:59002,42357:59003,42358:59004,42359:59005,42360:59006,42361:59007,42362:59008,42363:59009,42364:59010,42365:59011,42366:59012,42368:59013,42369:59014,42370:59015,42371:59016,42372:59017,42373:59018,42374:59019,42375:59020,42376:59021,42377:59022,42378:59023,42379:59024,42380:59025,42381:59026,42382:59027,42383:59028,42384:59029,42385:59030,42386:59031,42387:59032,42388:59033,42389:59034,42390:59035,42391:59036,42392:59037,42393:59038,42394:59039,42395:59040,42396:59041,42397:59042,42398:59043,42399:59044,42400:59045,42401:12449,42402:12450,42403:12451,42404:12452,42405:12453,42406:12454,42407:12455,42408:12456,42409:12457,42410:12458,42411:12459,42412:12460,42413:12461,42414:12462,42415:12463,42416:12464,42417:12465,42418:12466,42419:12467,42420:12468,42421:12469,42422:12470,42423:12471,42424:12472,42425:12473,42426:12474,42427:12475,42428:12476,42429:12477,42430:12478,42431:12479,42432:12480,42433:12481,42434:12482,42435:12483,42436:12484,42437:12485,42438:12486,42439:12487,42440:12488,42441:12489,42442:12490,42443:12491,42444:12492,42445:12493,42446:12494,42447:12495,42448:12496,42449:12497,42450:12498,42451:12499,42452:12500,42453:12501,42454:12502,42455:12503,42456:12504,42457:12505,42458:12506,42459:12507,42460:12508,42461:12509,42462:12510,42463:12511,42464:12512,42465:12513,42466:12514,42467:12515,42468:12516,42469:12517,42470:12518,42471:12519,42472:12520,42473:12521,42474:12522,42475:12523,42476:12524,42477:12525,42478:12526,42479:12527,42480:12528,42481:12529,42482:12530,42483:12531,42484:12532,42485:12533,42486:12534,42487:59261,42488:59262,42489:59263,42490:59264,42491:59265,42492:59266,42493:59267,42494:59268,42560:59046,42561:59047,42562:59048,42563:59049,42564:59050,42565:59051,42566:59052,42567:59053,42568:59054,42569:59055,42570:59056,42571:59057,42572:59058,42573:59059,42574:59060,42575:59061,42576:59062,42577:59063,42578:59064,42579:59065,42580:59066,42581:59067,42582:59068,42583:59069,42584:59070,42585:59071,42586:59072,42587:59073,42588:59074,42589:59075,42590:59076,42591:59077,42592:59078,42593:59079,42594:59080,42595:59081,42596:59082,42597:59083,42598:59084,42599:59085,42600:59086,42601:59087,42602:59088,42603:59089,42604:59090,42605:59091,42606:59092,42607:59093,42608:59094,42609:59095,42610:59096,42611:59097,42612:59098,42613:59099,42614:59100,42615:59101,42616:59102,42617:59103,42618:59104,42619:59105,42620:59106,42621:59107,42622:59108,42624:59109,42625:59110,42626:59111,42627:59112,42628:59113,42629:59114,42630:59115,42631:59116,42632:59117,42633:59118,42634:59119,42635:59120,42636:59121,42637:59122,42638:59123,42639:59124,42640:59125,42641:59126,42642:59127,42643:59128,42644:59129,42645:59130,42646:59131,42647:59132,42648:59133,42649:59134,42650:59135,42651:59136,42652:59137,42653:59138,42654:59139,42655:59140,42656:59141,42657:913,42658:914,42659:915,42660:916,42661:917,42662:918,42663:919,42664:920,42665:921,42666:922,42667:923,42668:924,42669:925,42670:926,42671:927,42672:928,42673:929,42674:931,42675:932,42676:933,42677:934,42678:935,42679:936,42680:937,42681:59269,42682:59270,42683:59271,42684:59272,42685:59273,42686:59274,42687:59275,42688:59276,42689:945,42690:946,42691:947,42692:948,42693:949,42694:950,42695:951,42696:952,42697:953,42698:954,42699:955,42700:956,42701:957,42702:958,42703:959,42704:960,42705:961,42706:963,42707:964,42708:965,42709:966,42710:967,42711:968,42712:969,42713:59277,42714:59278,42715:59279,42716:59280,42717:59281,42718:59282,42719:59283,42720:65077,42721:65078,42722:65081,42723:65082,42724:65087,42725:65088,42726:65085,42727:65086,42728:65089,42729:65090,42730:65091,42731:65092,42732:59284,42733:59285,42734:65083,42735:65084,42736:65079,42737:65080,42738:65073,42739:59286,42740:65075,42741:65076,42742:59287,42743:59288,42744:59289,42745:59290,42746:59291,42747:59292,42748:59293,42749:59294,42750:59295,42816:59142,42817:59143,42818:59144,42819:59145,42820:59146,42821:59147,42822:59148,42823:59149,42824:59150,42825:59151,42826:59152,42827:59153,42828:59154,42829:59155,42830:59156,42831:59157,42832:59158,42833:59159,42834:59160,42835:59161,42836:59162,42837:59163,42838:59164,42839:59165,42840:59166,42841:59167,42842:59168,42843:59169,42844:59170,42845:59171,42846:59172,42847:59173,42848:59174,42849:59175,42850:59176,42851:59177,42852:59178,42853:59179,42854:59180,42855:59181,42856:59182,42857:59183,42858:59184,42859:59185,42860:59186,42861:59187,42862:59188,42863:59189,42864:59190,42865:59191,42866:59192,42867:59193,42868:59194,42869:59195,42870:59196,42871:59197,42872:59198,42873:59199,42874:59200,42875:59201,42876:59202,42877:59203,42878:59204,42880:59205,42881:59206,42882:59207,42883:59208,42884:59209,42885:59210,42886:59211,42887:59212,42888:59213,42889:59214,42890:59215,42891:59216,42892:59217,42893:59218,42894:59219,42895:59220,42896:59221,42897:59222,42898:59223,42899:59224,42900:59225,42901:59226,42902:59227,42903:59228,42904:59229,42905:59230,42906:59231,42907:59232,42908:59233,42909:59234,42910:59235,42911:59236,42912:59237,42913:1040,42914:1041,42915:1042,42916:1043,42917:1044,42918:1045,42919:1025,42920:1046,42921:1047,42922:1048,42923:1049,42924:1050,42925:1051,42926:1052,42927:1053,42928:1054,42929:1055,42930:1056,42931:1057,42932:1058,42933:1059,42934:1060,42935:1061,42936:1062,42937:1063,42938:1064,42939:1065,42940:1066,42941:1067,42942:1068,42943:1069,42944:1070,42945:1071,42946:59296,42947:59297,42948:59298,42949:59299,42950:59300,42951:59301,42952:59302,42953:59303,42954:59304,42955:59305,42956:59306,42957:59307,42958:59308,42959:59309,42960:59310,42961:1072,42962:1073,42963:1074,42964:1075,42965:1076,42966:1077,42967:1105,42968:1078,42969:1079,42970:1080,42971:1081,42972:1082,42973:1083,42974:1084,42975:1085,42976:1086,42977:1087,42978:1088,42979:1089,42980:1090,42981:1091,42982:1092,42983:1093,42984:1094,42985:1095,42986:1096,42987:1097,42988:1098,42989:1099,42990:1100,42991:1101,42992:1102,42993:1103,42994:59311,42995:59312,42996:59313,42997:59314,42998:59315,42999:59316,43000:59317,43001:59318,43002:59319,43003:59320,43004:59321,43005:59322,43006:59323,43072:714,43073:715,43074:729,43075:8211,43076:8213,43077:8229,43078:8245,43079:8453,43080:8457,43081:8598,43082:8599,43083:8600,43084:8601,43085:8725,43086:8735,43087:8739,43088:8786,43089:8806,43090:8807,43091:8895,43092:9552,43093:9553,43094:9554,43095:9555,43096:9556,43097:9557,43098:9558,43099:9559,43100:9560,43101:9561,43102:9562,43103:9563,43104:9564,43105:9565,43106:9566,43107:9567,43108:9568,43109:9569,43110:9570,43111:9571,43112:9572,43113:9573,43114:9574,43115:9575,43116:9576,43117:9577,43118:9578,43119:9579,43120:9580,43121:9581,43122:9582,43123:9583,43124:9584,43125:9585,43126:9586,43127:9587,43128:9601,43129:9602,43130:9603,43131:9604,43132:9605,43133:9606,43134:9607,43136:9608,43137:9609,43138:9610,43139:9611,43140:9612,43141:9613,43142:9614,43143:9615,43144:9619,43145:9620,43146:9621,43147:9660,43148:9661,43149:9698,43150:9699,43151:9700,43152:9701,43153:9737,43154:8853,43155:12306,43156:12317,43157:12318,43158:59324,43159:59325,43160:59326,43161:59327,43162:59328,43163:59329,43164:59330,43165:59331,43166:59332,43167:59333,43168:59334,43169:257,43170:225,43171:462,43172:224,43173:275,43174:233,43175:283,43176:232,43177:299,43178:237,43179:464,43180:236,43181:333,43182:243,43183:466,43184:242,43185:363,43186:250,43187:468,43188:249,43189:470,43190:472,43191:474,43192:476,43193:252,43194:234,43195:593,43196:59335,43197:324,43198:328,43199:505,43200:609,43201:59337,43202:59338,43203:59339,43204:59340,43205:12549,43206:12550,43207:12551,43208:12552,43209:12553,43210:12554,43211:12555,43212:12556,43213:12557,43214:12558,43215:12559,43216:12560,43217:12561,43218:12562,43219:12563,43220:12564,43221:12565,43222:12566,43223:12567,43224:12568,43225:12569,43226:12570,43227:12571,43228:12572,43229:12573,43230:12574,43231:12575,43232:12576,43233:12577,43234:12578,43235:12579,43236:12580,43237:12581,43238:12582,43239:12583,43240:12584,43241:12585,43242:59341,43243:59342,43244:59343,43245:59344,43246:59345,43247:59346,43248:59347,43249:59348,43250:59349,43251:59350,43252:59351,43253:59352,43254:59353,43255:59354,43256:59355,43257:59356,43258:59357,43259:59358,43260:59359,43261:59360,43262:59361,43328:12321,43329:12322,43330:12323,43331:12324,43332:12325,43333:12326,43334:12327,43335:12328,43336:12329,43337:12963,43338:13198,43339:13199,43340:13212,43341:13213,43342:13214,43343:13217,43344:13252,43345:13262,43346:13265,43347:13266,43348:13269,43349:65072,43350:65506,43351:65508,43352:59362,43353:8481,43354:12849,43355:59363,43356:8208,43357:59364,43358:59365,43359:59366,43360:12540,43361:12443,43362:12444,43363:12541,43364:12542,43365:12294,43366:12445,43367:12446,43368:65097,43369:65098,43370:65099,43371:65100,43372:65101,43373:65102,43374:65103,43375:65104,43376:65105,43377:65106,43378:65108,43379:65109,43380:65110,43381:65111,43382:65113,43383:65114,43384:65115,43385:65116,43386:65117,43387:65118,43388:65119,43389:65120,43390:65121,43392:65122,43393:65123,43394:65124,43395:65125,43396:65126,43397:65128,43398:65129,43399:65130,43400:65131,43401:12350,43402:12272,43403:12273,43404:12274,43405:12275,43406:12276,43407:12277,43408:12278,43409:12279,43410:12280,43411:12281,43412:12282,43413:12283,43414:12295,43415:59380,43416:59381,43417:59382,43418:59383,43419:59384,43420:59385,43421:59386,43422:59387,43423:59388,43424:59389,43425:59390,43426:59391,43427:59392,43428:9472,43429:9473,43430:9474,43431:9475,43432:9476,43433:9477,43434:9478,43435:9479,43436:9480,43437:9481,43438:9482,43439:9483,43440:9484,43441:9485,43442:9486,43443:9487,43444:9488,43445:9489,43446:9490,43447:9491,43448:9492,43449:9493,43450:9494,43451:9495,43452:9496,43453:9497,43454:9498,43455:9499,43456:9500,43457:9501,43458:9502,43459:9503,43460:9504,43461:9505,43462:9506,43463:9507,43464:9508,43465:9509,43466:9510,43467:9511,43468:9512,43469:9513,43470:9514,43471:9515,43472:9516,43473:9517,43474:9518,43475:9519,43476:9520,43477:9521,43478:9522,43479:9523,43480:9524,43481:9525,43482:9526,43483:9527,43484:9528,43485:9529,43486:9530,43487:9531,43488:9532,43489:9533,43490:9534,43491:9535,43492:9536,43493:9537,43494:9538,43495:9539,43496:9540,43497:9541,43498:9542,43499:9543,43500:9544,43501:9545,43502:9546,43503:9547,43504:59393,43505:59394,43506:59395,43507:59396,43508:59397,43509:59398,43510:59399,43511:59400,43512:59401,43513:59402,43514:59403,43515:59404,43516:59405,43517:59406,43518:59407,43584:29404,43585:29405,43586:29407,43587:29410,43588:29411,43589:29412,43590:29413,43591:29414,43592:29415,43593:29418,43594:29419,43595:29429,43596:29430,43597:29433,43598:29437,43599:29438,43600:29439,43601:29440,43602:29442,43603:29444,43604:29445,43605:29446,43606:29447,43607:29448,43608:29449,43609:29451,43610:29452,43611:29453,43612:29455,43613:29456,43614:29457,43615:29458,43616:29460,43617:29464,43618:29465,43619:29466,43620:29471,43621:29472,43622:29475,43623:29476,43624:29478,43625:29479,43626:29480,43627:29485,43628:29487,43629:29488,43630:29490,43631:29491,43632:29493,43633:29494,43634:29498,43635:29499,43636:29500,43637:29501,43638:29504,43639:29505,43640:29506,43641:29507,43642:29508,43643:29509,43644:29510,43645:29511,43646:29512,43648:29513,43649:29514,43650:29515,43651:29516,43652:29518,43653:29519,43654:29521,43655:29523,43656:29524,43657:29525,43658:29526,43659:29528,43660:29529,43661:29530,43662:29531,43663:29532,43664:29533,43665:29534,43666:29535,43667:29537,43668:29538,43669:29539,43670:29540,43671:29541,43672:29542,43673:29543,43674:29544,43675:29545,43676:29546,43677:29547,43678:29550,43679:29552,43680:29553,43681:57344,43682:57345,43683:57346,43684:57347,43685:57348,43686:57349,43687:57350,43688:57351,43689:57352,43690:57353,43691:57354,43692:57355,43693:57356,43694:57357,43695:57358,43696:57359,43697:57360,43698:57361,43699:57362,43700:57363,43701:57364,43702:57365,43703:57366,43704:57367,43705:57368,43706:57369,43707:57370,43708:57371,43709:57372,43710:57373,43711:57374,43712:57375,43713:57376,43714:57377,43715:57378,43716:57379,43717:57380,43718:57381,43719:57382,43720:57383,43721:57384,43722:57385,43723:57386,43724:57387,43725:57388,43726:57389,43727:57390,43728:57391,43729:57392,43730:57393,43731:57394,43732:57395,43733:57396,43734:57397,43735:57398,43736:57399,43737:57400,43738:57401,43739:57402,43740:57403,43741:57404,43742:57405,43743:57406,43744:57407,43745:57408,43746:57409,43747:57410,43748:57411,43749:57412,43750:57413,43751:57414,43752:57415,43753:57416,43754:57417,43755:57418,43756:57419,43757:57420,43758:57421,43759:57422,43760:57423,43761:57424,43762:57425,43763:57426,43764:57427,43765:57428,43766:57429,43767:57430,43768:57431,43769:57432,43770:57433,43771:57434,43772:57435,43773:57436,43774:57437,43840:29554,43841:29555,43842:29556,43843:29557,43844:29558,43845:29559,43846:29560,43847:29561,43848:29562,43849:29563,43850:29564,43851:29565,43852:29567,43853:29568,43854:29569,43855:29570,43856:29571,43857:29573,43858:29574,43859:29576,43860:29578,43861:29580,43862:29581,43863:29583,43864:29584,43865:29586,43866:29587,43867:29588,43868:29589,43869:29591,43870:29592,43871:29593,43872:29594,43873:29596,43874:29597,43875:29598,43876:29600,43877:29601,43878:29603,43879:29604,43880:29605,43881:29606,43882:29607,43883:29608,43884:29610,43885:29612,43886:29613,43887:29617,43888:29620,43889:29621,43890:29622,43891:29624,43892:29625,43893:29628,43894:29629,43895:29630,43896:29631,43897:29633,43898:29635,43899:29636,43900:29637,43901:29638,43902:29639,43904:29643,43905:29644,43906:29646,43907:29650,43908:29651,43909:29652,43910:29653,43911:29654,43912:29655,43913:29656,43914:29658,43915:29659,43916:29660,43917:29661,43918:29663,43919:29665,43920:29666,43921:29667,43922:29668,43923:29670,43924:29672,43925:29674,43926:29675,43927:29676,43928:29678,43929:29679,43930:29680,43931:29681,43932:29683,43933:29684,43934:29685,43935:29686,43936:29687,43937:57438,43938:57439,43939:57440,43940:57441,43941:57442,43942:57443,43943:57444,43944:57445,43945:57446,43946:57447,43947:57448,43948:57449,43949:57450,43950:57451,43951:57452,43952:57453,43953:57454,43954:57455,43955:57456,43956:57457,43957:57458,43958:57459,43959:57460,43960:57461,43961:57462,43962:57463,43963:57464,43964:57465,43965:57466,43966:57467,43967:57468,43968:57469,43969:57470,43970:57471,43971:57472,43972:57473,43973:57474,43974:57475,43975:57476,43976:57477,43977:57478,43978:57479,43979:57480,43980:57481,43981:57482,43982:57483,43983:57484,43984:57485,43985:57486,43986:57487,43987:57488,43988:57489,43989:57490,43990:57491,43991:57492,43992:57493,43993:57494,43994:57495,43995:57496,43996:57497,43997:57498,43998:57499,43999:57500,44000:57501,44001:57502,44002:57503,44003:57504,44004:57505,44005:57506,44006:57507,44007:57508,44008:57509,44009:57510,44010:57511,44011:57512,44012:57513,44013:57514,44014:57515,44015:57516,44016:57517,44017:57518,44018:57519,44019:57520,44020:57521,44021:57522,44022:57523,44023:57524,44024:57525,44025:57526,44026:57527,44027:57528,44028:57529,44029:57530,44030:57531,44096:29688,44097:29689,44098:29690,44099:29691,44100:29692,44101:29693,44102:29694,44103:29695,44104:29696,44105:29697,44106:29698,44107:29700,44108:29703,44109:29704,44110:29707,44111:29708,44112:29709,44113:29710,44114:29713,44115:29714,44116:29715,44117:29716,44118:29717,44119:29718,44120:29719,44121:29720,44122:29721,44123:29724,44124:29725,44125:29726,44126:29727,44127:29728,44128:29729,44129:29731,44130:29732,44131:29735,44132:29737,44133:29739,44134:29741,44135:29743,44136:29745,44137:29746,44138:29751,44139:29752,44140:29753,44141:29754,44142:29755,44143:29757,44144:29758,44145:29759,44146:29760,44147:29762,44148:29763,44149:29764,44150:29765,44151:29766,44152:29767,44153:29768,44154:29769,44155:29770,44156:29771,44157:29772,44158:29773,44160:29774,44161:29775,44162:29776,44163:29777,44164:29778,44165:29779,44166:29780,44167:29782,44168:29784,44169:29789,44170:29792,44171:29793,44172:29794,44173:29795,44174:29796,44175:29797,44176:29798,44177:29799,44178:29800,44179:29801,44180:29802,44181:29803,44182:29804,44183:29806,44184:29807,44185:29809,44186:29810,44187:29811,44188:29812,44189:29813,44190:29816,44191:29817,44192:29818,44193:57532,44194:57533,44195:57534,44196:57535,44197:57536,44198:57537,44199:57538,44200:57539,44201:57540,44202:57541,44203:57542,44204:57543,44205:57544,44206:57545,44207:57546,44208:57547,44209:57548,44210:57549,44211:57550,44212:57551,44213:57552,44214:57553,44215:57554,44216:57555,44217:57556,44218:57557,44219:57558,44220:57559,44221:57560,44222:57561,44223:57562,44224:57563,44225:57564,44226:57565,44227:57566,44228:57567,44229:57568,44230:57569,44231:57570,44232:57571,44233:57572,44234:57573,44235:57574,44236:57575,44237:57576,44238:57577,44239:57578,44240:57579,44241:57580,44242:57581,44243:57582,44244:57583,44245:57584,44246:57585,44247:57586,44248:57587,44249:57588,44250:57589,44251:57590,44252:57591,44253:57592,44254:57593,44255:57594,44256:57595,44257:57596,44258:57597,44259:57598,44260:57599,44261:57600,44262:57601,44263:57602,44264:57603,44265:57604,44266:57605,44267:57606,44268:57607,44269:57608,44270:57609,44271:57610,44272:57611,44273:57612,44274:57613,44275:57614,44276:57615,44277:57616,44278:57617,44279:57618,44280:57619,44281:57620,44282:57621,44283:57622,44284:57623,44285:57624,44286:57625,44352:29819,44353:29820,44354:29821,44355:29823,44356:29826,44357:29828,44358:29829,44359:29830,44360:29832,44361:29833,44362:29834,44363:29836,44364:29837,44365:29839,44366:29841,44367:29842,44368:29843,44369:29844,44370:29845,44371:29846,44372:29847,44373:29848,44374:29849,44375:29850,44376:29851,44377:29853,44378:29855,44379:29856,44380:29857,44381:29858,44382:29859,44383:29860,44384:29861,44385:29862,44386:29866,44387:29867,44388:29868,44389:29869,44390:29870,44391:29871,44392:29872,44393:29873,44394:29874,44395:29875,44396:29876,44397:29877,44398:29878,44399:29879,44400:29880,44401:29881,44402:29883,44403:29884,44404:29885,44405:29886,44406:29887,44407:29888,44408:29889,44409:29890,44410:29891,44411:29892,44412:29893,44413:29894,44414:29895,44416:29896,44417:29897,44418:29898,44419:29899,44420:29900,44421:29901,44422:29902,44423:29903,44424:29904,44425:29905,44426:29907,44427:29908,44428:29909,44429:29910,44430:29911,44431:29912,44432:29913,44433:29914,44434:29915,44435:29917,44436:29919,44437:29921,44438:29925,44439:29927,44440:29928,44441:29929,44442:29930,44443:29931,44444:29932,44445:29933,44446:29936,44447:29937,44448:29938,44449:57626,44450:57627,44451:57628,44452:57629,44453:57630,44454:57631,44455:57632,44456:57633,44457:57634,44458:57635,44459:57636,44460:57637,44461:57638,44462:57639,44463:57640,44464:57641,44465:57642,44466:57643,44467:57644,44468:57645,44469:57646,44470:57647,44471:57648,44472:57649,44473:57650,44474:57651,44475:57652,44476:57653,44477:57654,44478:57655,44479:57656,44480:57657,44481:57658,44482:57659,44483:57660,44484:57661,44485:57662,44486:57663,44487:57664,44488:57665,44489:57666,44490:57667,44491:57668,44492:57669,44493:57670,44494:57671,44495:57672,44496:57673,44497:57674,44498:57675,44499:57676,44500:57677,44501:57678,44502:57679,44503:57680,44504:57681,44505:57682,44506:57683,44507:57684,44508:57685,44509:57686,44510:57687,44511:57688,44512:57689,44513:57690,44514:57691,44515:57692,44516:57693,44517:57694,44518:57695,44519:57696,44520:57697,44521:57698,44522:57699,44523:57700,44524:57701,44525:57702,44526:57703,44527:57704,44528:57705,44529:57706,44530:57707,44531:57708,44532:57709,44533:57710,44534:57711,44535:57712,44536:57713,44537:57714,44538:57715,44539:57716,44540:57717,44541:57718,44542:57719,44608:29939,44609:29941,44610:29944,44611:29945,44612:29946,44613:29947,44614:29948,44615:29949,44616:29950,44617:29952,44618:29953,44619:29954,44620:29955,44621:29957,44622:29958,44623:29959,44624:29960,44625:29961,44626:29962,44627:29963,44628:29964,44629:29966,44630:29968,44631:29970,44632:29972,44633:29973,44634:29974,44635:29975,44636:29979,44637:29981,44638:29982,44639:29984,44640:29985,44641:29986,44642:29987,44643:29988,44644:29990,44645:29991,44646:29994,44647:29998,44648:30004,44649:30006,44650:30009,44651:30012,44652:30013,44653:30015,44654:30017,44655:30018,44656:30019,44657:30020,44658:30022,44659:30023,44660:30025,44661:30026,44662:30029,44663:30032,44664:30033,44665:30034,44666:30035,44667:30037,44668:30038,44669:30039,44670:30040,44672:30045,44673:30046,44674:30047,44675:30048,44676:30049,44677:30050,44678:30051,44679:30052,44680:30055,44681:30056,44682:30057,44683:30059,44684:30060,44685:30061,44686:30062,44687:30063,44688:30064,44689:30065,44690:30067,44691:30069,44692:30070,44693:30071,44694:30074,44695:30075,44696:30076,44697:30077,44698:30078,44699:30080,44700:30081,44701:30082,44702:30084,44703:30085,44704:30087,44705:57720,44706:57721,44707:57722,44708:57723,44709:57724,44710:57725,44711:57726,44712:57727,44713:57728,44714:57729,44715:57730,44716:57731,44717:57732,44718:57733,44719:57734,44720:57735,44721:57736,44722:57737,44723:57738,44724:57739,44725:57740,44726:57741,44727:57742,44728:57743,44729:57744,44730:57745,44731:57746,44732:57747,44733:57748,44734:57749,44735:57750,44736:57751,44737:57752,44738:57753,44739:57754,44740:57755,44741:57756,44742:57757,44743:57758,44744:57759,44745:57760,44746:57761,44747:57762,44748:57763,44749:57764,44750:57765,44751:57766,44752:57767,44753:57768,44754:57769,44755:57770,44756:57771,44757:57772,44758:57773,44759:57774,44760:57775,44761:57776,44762:57777,44763:57778,44764:57779,44765:57780,44766:57781,44767:57782,44768:57783,44769:57784,44770:57785,44771:57786,44772:57787,44773:57788,44774:57789,44775:57790,44776:57791,44777:57792,44778:57793,44779:57794,44780:57795,44781:57796,44782:57797,44783:57798,44784:57799,44785:57800,44786:57801,44787:57802,44788:57803,44789:57804,44790:57805,44791:57806,44792:57807,44793:57808,44794:57809,44795:57810,44796:57811,44797:57812,44798:57813,44864:30088,44865:30089,44866:30090,44867:30092,44868:30093,44869:30094,44870:30096,44871:30099,44872:30101,44873:30104,44874:30107,44875:30108,44876:30110,44877:30114,44878:30118,44879:30119,44880:30120,44881:30121,44882:30122,44883:30125,44884:30134,44885:30135,44886:30138,44887:30139,44888:30143,44889:30144,44890:30145,44891:30150,44892:30155,44893:30156,44894:30158,44895:30159,44896:30160,44897:30161,44898:30163,44899:30167,44900:30169,44901:30170,44902:30172,44903:30173,44904:30175,44905:30176,44906:30177,44907:30181,44908:30185,44909:30188,44910:30189,44911:30190,44912:30191,44913:30194,44914:30195,44915:30197,44916:30198,44917:30199,44918:30200,44919:30202,44920:30203,44921:30205,44922:30206,44923:30210,44924:30212,44925:30214,44926:30215,44928:30216,44929:30217,44930:30219,44931:30221,44932:30222,44933:30223,44934:30225,44935:30226,44936:30227,44937:30228,44938:30230,44939:30234,44940:30236,44941:30237,44942:30238,44943:30241,44944:30243,44945:30247,44946:30248,44947:30252,44948:30254,44949:30255,44950:30257,44951:30258,44952:30262,44953:30263,44954:30265,44955:30266,44956:30267,44957:30269,44958:30273,44959:30274,44960:30276,44961:57814,44962:57815,44963:57816,44964:57817,44965:57818,44966:57819,44967:57820,44968:57821,44969:57822,44970:57823,44971:57824,44972:57825,44973:57826,44974:57827,44975:57828,44976:57829,44977:57830,44978:57831,44979:57832,44980:57833,44981:57834,44982:57835,44983:57836,44984:57837,44985:57838,44986:57839,44987:57840,44988:57841,44989:57842,44990:57843,44991:57844,44992:57845,44993:57846,44994:57847,44995:57848,44996:57849,44997:57850,44998:57851,44999:57852,45000:57853,45001:57854,45002:57855,45003:57856,45004:57857,45005:57858,45006:57859,45007:57860,45008:57861,45009:57862,45010:57863,45011:57864,45012:57865,45013:57866,45014:57867,45015:57868,45016:57869,45017:57870,45018:57871,45019:57872,45020:57873,45021:57874,45022:57875,45023:57876,45024:57877,45025:57878,45026:57879,45027:57880,45028:57881,45029:57882,45030:57883,45031:57884,45032:57885,45033:57886,45034:57887,45035:57888,45036:57889,45037:57890,45038:57891,45039:57892,45040:57893,45041:57894,45042:57895,45043:57896,45044:57897,45045:57898,45046:57899,45047:57900,45048:57901,45049:57902,45050:57903,45051:57904,45052:57905,45053:57906,45054:57907,45120:30277,45121:30278,45122:30279,45123:30280,45124:30281,45125:30282,45126:30283,45127:30286,45128:30287,45129:30288,45130:30289,45131:30290,45132:30291,45133:30293,45134:30295,45135:30296,45136:30297,45137:30298,45138:30299,45139:30301,45140:30303,45141:30304,45142:30305,45143:30306,45144:30308,45145:30309,45146:30310,45147:30311,45148:30312,45149:30313,45150:30314,45151:30316,45152:30317,45153:30318,45154:30320,45155:30321,45156:30322,45157:30323,45158:30324,45159:30325,45160:30326,45161:30327,45162:30329,45163:30330,45164:30332,45165:30335,45166:30336,45167:30337,45168:30339,45169:30341,45170:30345,45171:30346,45172:30348,45173:30349,45174:30351,45175:30352,45176:30354,45177:30356,45178:30357,45179:30359,45180:30360,45181:30362,45182:30363,45184:30364,45185:30365,45186:30366,45187:30367,45188:30368,45189:30369,45190:30370,45191:30371,45192:30373,45193:30374,45194:30375,45195:30376,45196:30377,45197:30378,45198:30379,45199:30380,45200:30381,45201:30383,45202:30384,45203:30387,45204:30389,45205:30390,45206:30391,45207:30392,45208:30393,45209:30394,45210:30395,45211:30396,45212:30397,45213:30398,45214:30400,45215:30401,45216:30403,45217:21834,45218:38463,45219:22467,45220:25384,45221:21710,45222:21769,45223:21696,45224:30353,45225:30284,45226:34108,45227:30702,45228:33406,45229:30861,45230:29233,45231:38552,45232:38797,45233:27688,45234:23433,45235:20474,45236:25353,45237:26263,45238:23736,45239:33018,45240:26696,45241:32942,45242:26114,45243:30414,45244:20985,45245:25942,45246:29100,45247:32753,45248:34948,45249:20658,45250:22885,45251:25034,45252:28595,45253:33453,45254:25420,45255:25170,45256:21485,45257:21543,45258:31494,45259:20843,45260:30116,45261:24052,45262:25300,45263:36299,45264:38774,45265:25226,45266:32793,45267:22365,45268:38712,45269:32610,45270:29240,45271:30333,45272:26575,45273:30334,45274:25670,45275:20336,45276:36133,45277:25308,45278:31255,45279:26001,45280:29677,45281:25644,45282:25203,45283:33324,45284:39041,45285:26495,45286:29256,45287:25198,45288:25292,45289:20276,45290:29923,45291:21322,45292:21150,45293:32458,45294:37030,45295:24110,45296:26758,45297:27036,45298:33152,45299:32465,45300:26834,45301:30917,45302:34444,45303:38225,45304:20621,45305:35876,45306:33502,45307:32990,45308:21253,45309:35090,45310:21093,45376:30404,45377:30407,45378:30409,45379:30411,45380:30412,45381:30419,45382:30421,45383:30425,45384:30426,45385:30428,45386:30429,45387:30430,45388:30432,45389:30433,45390:30434,45391:30435,45392:30436,45393:30438,45394:30439,45395:30440,45396:30441,45397:30442,45398:30443,45399:30444,45400:30445,45401:30448,45402:30451,45403:30453,45404:30454,45405:30455,45406:30458,45407:30459,45408:30461,45409:30463,45410:30464,45411:30466,45412:30467,45413:30469,45414:30470,45415:30474,45416:30476,45417:30478,45418:30479,45419:30480,45420:30481,45421:30482,45422:30483,45423:30484,45424:30485,45425:30486,45426:30487,45427:30488,45428:30491,45429:30492,45430:30493,45431:30494,45432:30497,45433:30499,45434:30500,45435:30501,45436:30503,45437:30506,45438:30507,45440:30508,45441:30510,45442:30512,45443:30513,45444:30514,45445:30515,45446:30516,45447:30521,45448:30523,45449:30525,45450:30526,45451:30527,45452:30530,45453:30532,45454:30533,45455:30534,45456:30536,45457:30537,45458:30538,45459:30539,45460:30540,45461:30541,45462:30542,45463:30543,45464:30546,45465:30547,45466:30548,45467:30549,45468:30550,45469:30551,45470:30552,45471:30553,45472:30556,45473:34180,45474:38649,45475:20445,45476:22561,45477:39281,45478:23453,45479:25265,45480:25253,45481:26292,45482:35961,45483:40077,45484:29190,45485:26479,45486:30865,45487:24754,45488:21329,45489:21271,45490:36744,45491:32972,45492:36125,45493:38049,45494:20493,45495:29384,45496:22791,45497:24811,45498:28953,45499:34987,45500:22868,45501:33519,45502:26412,45503:31528,45504:23849,45505:32503,45506:29997,45507:27893,45508:36454,45509:36856,45510:36924,45511:40763,45512:27604,45513:37145,45514:31508,45515:24444,45516:30887,45517:34006,45518:34109,45519:27605,45520:27609,45521:27606,45522:24065,45523:24199,45524:30201,45525:38381,45526:25949,45527:24330,45528:24517,45529:36767,45530:22721,45531:33218,45532:36991,45533:38491,45534:38829,45535:36793,45536:32534,45537:36140,45538:25153,45539:20415,45540:21464,45541:21342,45542:36776,45543:36777,45544:36779,45545:36941,45546:26631,45547:24426,45548:33176,45549:34920,45550:40150,45551:24971,45552:21035,45553:30250,45554:24428,45555:25996,45556:28626,45557:28392,45558:23486,45559:25672,45560:20853,45561:20912,45562:26564,45563:19993,45564:31177,45565:39292,45566:28851,45632:30557,45633:30558,45634:30559,45635:30560,45636:30564,45637:30567,45638:30569,45639:30570,45640:30573,45641:30574,45642:30575,45643:30576,45644:30577,45645:30578,45646:30579,45647:30580,45648:30581,45649:30582,45650:30583,45651:30584,45652:30586,45653:30587,45654:30588,45655:30593,45656:30594,45657:30595,45658:30598,45659:30599,45660:30600,45661:30601,45662:30602,45663:30603,45664:30607,45665:30608,45666:30611,45667:30612,45668:30613,45669:30614,45670:30615,45671:30616,45672:30617,45673:30618,45674:30619,45675:30620,45676:30621,45677:30622,45678:30625,45679:30627,45680:30628,45681:30630,45682:30632,45683:30635,45684:30637,45685:30638,45686:30639,45687:30641,45688:30642,45689:30644,45690:30646,45691:30647,45692:30648,45693:30649,45694:30650,45696:30652,45697:30654,45698:30656,45699:30657,45700:30658,45701:30659,45702:30660,45703:30661,45704:30662,45705:30663,45706:30664,45707:30665,45708:30666,45709:30667,45710:30668,45711:30670,45712:30671,45713:30672,45714:30673,45715:30674,45716:30675,45717:30676,45718:30677,45719:30678,45720:30680,45721:30681,45722:30682,45723:30685,45724:30686,45725:30687,45726:30688,45727:30689,45728:30692,45729:30149,45730:24182,45731:29627,45732:33760,45733:25773,45734:25320,45735:38069,45736:27874,45737:21338,45738:21187,45739:25615,45740:38082,45741:31636,45742:20271,45743:24091,45744:33334,45745:33046,45746:33162,45747:28196,45748:27850,45749:39539,45750:25429,45751:21340,45752:21754,45753:34917,45754:22496,45755:19981,45756:24067,45757:27493,45758:31807,45759:37096,45760:24598,45761:25830,45762:29468,45763:35009,45764:26448,45765:25165,45766:36130,45767:30572,45768:36393,45769:37319,45770:24425,45771:33756,45772:34081,45773:39184,45774:21442,45775:34453,45776:27531,45777:24813,45778:24808,45779:28799,45780:33485,45781:33329,45782:20179,45783:27815,45784:34255,45785:25805,45786:31961,45787:27133,45788:26361,45789:33609,45790:21397,45791:31574,45792:20391,45793:20876,45794:27979,45795:23618,45796:36461,45797:25554,45798:21449,45799:33580,45800:33590,45801:26597,45802:30900,45803:25661,45804:23519,45805:23700,45806:24046,45807:35815,45808:25286,45809:26612,45810:35962,45811:25600,45812:25530,45813:34633,45814:39307,45815:35863,45816:32544,45817:38130,45818:20135,45819:38416,45820:39076,45821:26124,45822:29462,45888:30694,45889:30696,45890:30698,45891:30703,45892:30704,45893:30705,45894:30706,45895:30708,45896:30709,45897:30711,45898:30713,45899:30714,45900:30715,45901:30716,45902:30723,45903:30724,45904:30725,45905:30726,45906:30727,45907:30728,45908:30730,45909:30731,45910:30734,45911:30735,45912:30736,45913:30739,45914:30741,45915:30745,45916:30747,45917:30750,45918:30752,45919:30753,45920:30754,45921:30756,45922:30760,45923:30762,45924:30763,45925:30766,45926:30767,45927:30769,45928:30770,45929:30771,45930:30773,45931:30774,45932:30781,45933:30783,45934:30785,45935:30786,45936:30787,45937:30788,45938:30790,45939:30792,45940:30793,45941:30794,45942:30795,45943:30797,45944:30799,45945:30801,45946:30803,45947:30804,45948:30808,45949:30809,45950:30810,45952:30811,45953:30812,45954:30814,45955:30815,45956:30816,45957:30817,45958:30818,45959:30819,45960:30820,45961:30821,45962:30822,45963:30823,45964:30824,45965:30825,45966:30831,45967:30832,45968:30833,45969:30834,45970:30835,45971:30836,45972:30837,45973:30838,45974:30840,45975:30841,45976:30842,45977:30843,45978:30845,45979:30846,45980:30847,45981:30848,45982:30849,45983:30850,45984:30851,45985:22330,45986:23581,45987:24120,45988:38271,45989:20607,45990:32928,45991:21378,45992:25950,45993:30021,45994:21809,45995:20513,45996:36229,45997:25220,45998:38046,45999:26397,46000:22066,46001:28526,46002:24034,46003:21557,46004:28818,46005:36710,46006:25199,46007:25764,46008:25507,46009:24443,46010:28552,46011:37108,46012:33251,46013:36784,46014:23576,46015:26216,46016:24561,46017:27785,46018:38472,46019:36225,46020:34924,46021:25745,46022:31216,46023:22478,46024:27225,46025:25104,46026:21576,46027:20056,46028:31243,46029:24809,46030:28548,46031:35802,46032:25215,46033:36894,46034:39563,46035:31204,46036:21507,46037:30196,46038:25345,46039:21273,46040:27744,46041:36831,46042:24347,46043:39536,46044:32827,46045:40831,46046:20360,46047:23610,46048:36196,46049:32709,46050:26021,46051:28861,46052:20805,46053:20914,46054:34411,46055:23815,46056:23456,46057:25277,46058:37228,46059:30068,46060:36364,46061:31264,46062:24833,46063:31609,46064:20167,46065:32504,46066:30597,46067:19985,46068:33261,46069:21021,46070:20986,46071:27249,46072:21416,46073:36487,46074:38148,46075:38607,46076:28353,46077:38500,46078:26970,46144:30852,46145:30853,46146:30854,46147:30856,46148:30858,46149:30859,46150:30863,46151:30864,46152:30866,46153:30868,46154:30869,46155:30870,46156:30873,46157:30877,46158:30878,46159:30880,46160:30882,46161:30884,46162:30886,46163:30888,46164:30889,46165:30890,46166:30891,46167:30892,46168:30893,46169:30894,46170:30895,46171:30901,46172:30902,46173:30903,46174:30904,46175:30906,46176:30907,46177:30908,46178:30909,46179:30911,46180:30912,46181:30914,46182:30915,46183:30916,46184:30918,46185:30919,46186:30920,46187:30924,46188:30925,46189:30926,46190:30927,46191:30929,46192:30930,46193:30931,46194:30934,46195:30935,46196:30936,46197:30938,46198:30939,46199:30940,46200:30941,46201:30942,46202:30943,46203:30944,46204:30945,46205:30946,46206:30947,46208:30948,46209:30949,46210:30950,46211:30951,46212:30953,46213:30954,46214:30955,46215:30957,46216:30958,46217:30959,46218:30960,46219:30961,46220:30963,46221:30965,46222:30966,46223:30968,46224:30969,46225:30971,46226:30972,46227:30973,46228:30974,46229:30975,46230:30976,46231:30978,46232:30979,46233:30980,46234:30982,46235:30983,46236:30984,46237:30985,46238:30986,46239:30987,46240:30988,46241:30784,46242:20648,46243:30679,46244:25616,46245:35302,46246:22788,46247:25571,46248:24029,46249:31359,46250:26941,46251:20256,46252:33337,46253:21912,46254:20018,46255:30126,46256:31383,46257:24162,46258:24202,46259:38383,46260:21019,46261:21561,46262:28810,46263:25462,46264:38180,46265:22402,46266:26149,46267:26943,46268:37255,46269:21767,46270:28147,46271:32431,46272:34850,46273:25139,46274:32496,46275:30133,46276:33576,46277:30913,46278:38604,46279:36766,46280:24904,46281:29943,46282:35789,46283:27492,46284:21050,46285:36176,46286:27425,46287:32874,46288:33905,46289:22257,46290:21254,46291:20174,46292:19995,46293:20945,46294:31895,46295:37259,46296:31751,46297:20419,46298:36479,46299:31713,46300:31388,46301:25703,46302:23828,46303:20652,46304:33030,46305:30209,46306:31929,46307:28140,46308:32736,46309:26449,46310:23384,46311:23544,46312:30923,46313:25774,46314:25619,46315:25514,46316:25387,46317:38169,46318:25645,46319:36798,46320:31572,46321:30249,46322:25171,46323:22823,46324:21574,46325:27513,46326:20643,46327:25140,46328:24102,46329:27526,46330:20195,46331:36151,46332:34955,46333:24453,46334:36910,46400:30989,46401:30990,46402:30991,46403:30992,46404:30993,46405:30994,46406:30996,46407:30997,46408:30998,46409:30999,46410:31000,46411:31001,46412:31002,46413:31003,46414:31004,46415:31005,46416:31007,46417:31008,46418:31009,46419:31010,46420:31011,46421:31013,46422:31014,46423:31015,46424:31016,46425:31017,46426:31018,46427:31019,46428:31020,46429:31021,46430:31022,46431:31023,46432:31024,46433:31025,46434:31026,46435:31027,46436:31029,46437:31030,46438:31031,46439:31032,46440:31033,46441:31037,46442:31039,46443:31042,46444:31043,46445:31044,46446:31045,46447:31047,46448:31050,46449:31051,46450:31052,46451:31053,46452:31054,46453:31055,46454:31056,46455:31057,46456:31058,46457:31060,46458:31061,46459:31064,46460:31065,46461:31073,46462:31075,46464:31076,46465:31078,46466:31081,46467:31082,46468:31083,46469:31084,46470:31086,46471:31088,46472:31089,46473:31090,46474:31091,46475:31092,46476:31093,46477:31094,46478:31097,46479:31099,46480:31100,46481:31101,46482:31102,46483:31103,46484:31106,46485:31107,46486:31110,46487:31111,46488:31112,46489:31113,46490:31115,46491:31116,46492:31117,46493:31118,46494:31120,46495:31121,46496:31122,46497:24608,46498:32829,46499:25285,46500:20025,46501:21333,46502:37112,46503:25528,46504:32966,46505:26086,46506:27694,46507:20294,46508:24814,46509:28129,46510:35806,46511:24377,46512:34507,46513:24403,46514:25377,46515:20826,46516:33633,46517:26723,46518:20992,46519:25443,46520:36424,46521:20498,46522:23707,46523:31095,46524:23548,46525:21040,46526:31291,46527:24764,46528:36947,46529:30423,46530:24503,46531:24471,46532:30340,46533:36460,46534:28783,46535:30331,46536:31561,46537:30634,46538:20979,46539:37011,46540:22564,46541:20302,46542:28404,46543:36842,46544:25932,46545:31515,46546:29380,46547:28068,46548:32735,46549:23265,46550:25269,46551:24213,46552:22320,46553:33922,46554:31532,46555:24093,46556:24351,46557:36882,46558:32532,46559:39072,46560:25474,46561:28359,46562:30872,46563:28857,46564:20856,46565:38747,46566:22443,46567:30005,46568:20291,46569:30008,46570:24215,46571:24806,46572:22880,46573:28096,46574:27583,46575:30857,46576:21500,46577:38613,46578:20939,46579:20993,46580:25481,46581:21514,46582:38035,46583:35843,46584:36300,46585:29241,46586:30879,46587:34678,46588:36845,46589:35853,46590:21472,46656:31123,46657:31124,46658:31125,46659:31126,46660:31127,46661:31128,46662:31129,46663:31131,46664:31132,46665:31133,46666:31134,46667:31135,46668:31136,46669:31137,46670:31138,46671:31139,46672:31140,46673:31141,46674:31142,46675:31144,46676:31145,46677:31146,46678:31147,46679:31148,46680:31149,46681:31150,46682:31151,46683:31152,46684:31153,46685:31154,46686:31156,46687:31157,46688:31158,46689:31159,46690:31160,46691:31164,46692:31167,46693:31170,46694:31172,46695:31173,46696:31175,46697:31176,46698:31178,46699:31180,46700:31182,46701:31183,46702:31184,46703:31187,46704:31188,46705:31190,46706:31191,46707:31193,46708:31194,46709:31195,46710:31196,46711:31197,46712:31198,46713:31200,46714:31201,46715:31202,46716:31205,46717:31208,46718:31210,46720:31212,46721:31214,46722:31217,46723:31218,46724:31219,46725:31220,46726:31221,46727:31222,46728:31223,46729:31225,46730:31226,46731:31228,46732:31230,46733:31231,46734:31233,46735:31236,46736:31237,46737:31239,46738:31240,46739:31241,46740:31242,46741:31244,46742:31247,46743:31248,46744:31249,46745:31250,46746:31251,46747:31253,46748:31254,46749:31256,46750:31257,46751:31259,46752:31260,46753:19969,46754:30447,46755:21486,46756:38025,46757:39030,46758:40718,46759:38189,46760:23450,46761:35746,46762:20002,46763:19996,46764:20908,46765:33891,46766:25026,46767:21160,46768:26635,46769:20375,46770:24683,46771:20923,46772:27934,46773:20828,46774:25238,46775:26007,46776:38497,46777:35910,46778:36887,46779:30168,46780:37117,46781:30563,46782:27602,46783:29322,46784:29420,46785:35835,46786:22581,46787:30585,46788:36172,46789:26460,46790:38208,46791:32922,46792:24230,46793:28193,46794:22930,46795:31471,46796:30701,46797:38203,46798:27573,46799:26029,46800:32526,46801:22534,46802:20817,46803:38431,46804:23545,46805:22697,46806:21544,46807:36466,46808:25958,46809:39039,46810:22244,46811:38045,46812:30462,46813:36929,46814:25479,46815:21702,46816:22810,46817:22842,46818:22427,46819:36530,46820:26421,46821:36346,46822:33333,46823:21057,46824:24816,46825:22549,46826:34558,46827:23784,46828:40517,46829:20420,46830:39069,46831:35769,46832:23077,46833:24694,46834:21380,46835:25212,46836:36943,46837:37122,46838:39295,46839:24681,46840:32780,46841:20799,46842:32819,46843:23572,46844:39285,46845:27953,46846:20108,46912:31261,46913:31263,46914:31265,46915:31266,46916:31268,46917:31269,46918:31270,46919:31271,46920:31272,46921:31273,46922:31274,46923:31275,46924:31276,46925:31277,46926:31278,46927:31279,46928:31280,46929:31281,46930:31282,46931:31284,46932:31285,46933:31286,46934:31288,46935:31290,46936:31294,46937:31296,46938:31297,46939:31298,46940:31299,46941:31300,46942:31301,46943:31303,46944:31304,46945:31305,46946:31306,46947:31307,46948:31308,46949:31309,46950:31310,46951:31311,46952:31312,46953:31314,46954:31315,46955:31316,46956:31317,46957:31318,46958:31320,46959:31321,46960:31322,46961:31323,46962:31324,46963:31325,46964:31326,46965:31327,46966:31328,46967:31329,46968:31330,46969:31331,46970:31332,46971:31333,46972:31334,46973:31335,46974:31336,46976:31337,46977:31338,46978:31339,46979:31340,46980:31341,46981:31342,46982:31343,46983:31345,46984:31346,46985:31347,46986:31349,46987:31355,46988:31356,46989:31357,46990:31358,46991:31362,46992:31365,46993:31367,46994:31369,46995:31370,46996:31371,46997:31372,46998:31374,46999:31375,47000:31376,47001:31379,47002:31380,47003:31385,47004:31386,47005:31387,47006:31390,47007:31393,47008:31394,47009:36144,47010:21457,47011:32602,47012:31567,47013:20240,47014:20047,47015:38400,47016:27861,47017:29648,47018:34281,47019:24070,47020:30058,47021:32763,47022:27146,47023:30718,47024:38034,47025:32321,47026:20961,47027:28902,47028:21453,47029:36820,47030:33539,47031:36137,47032:29359,47033:39277,47034:27867,47035:22346,47036:33459,47037:26041,47038:32938,47039:25151,47040:38450,47041:22952,47042:20223,47043:35775,47044:32442,47045:25918,47046:33778,47047:38750,47048:21857,47049:39134,47050:32933,47051:21290,47052:35837,47053:21536,47054:32954,47055:24223,47056:27832,47057:36153,47058:33452,47059:37210,47060:21545,47061:27675,47062:20998,47063:32439,47064:22367,47065:28954,47066:27774,47067:31881,47068:22859,47069:20221,47070:24575,47071:24868,47072:31914,47073:20016,47074:23553,47075:26539,47076:34562,47077:23792,47078:38155,47079:39118,47080:30127,47081:28925,47082:36898,47083:20911,47084:32541,47085:35773,47086:22857,47087:20964,47088:20315,47089:21542,47090:22827,47091:25975,47092:32932,47093:23413,47094:25206,47095:25282,47096:36752,47097:24133,47098:27679,47099:31526,47100:20239,47101:20440,47102:26381,47168:31395,47169:31396,47170:31399,47171:31401,47172:31402,47173:31403,47174:31406,47175:31407,47176:31408,47177:31409,47178:31410,47179:31412,47180:31413,47181:31414,47182:31415,47183:31416,47184:31417,47185:31418,47186:31419,47187:31420,47188:31421,47189:31422,47190:31424,47191:31425,47192:31426,47193:31427,47194:31428,47195:31429,47196:31430,47197:31431,47198:31432,47199:31433,47200:31434,47201:31436,47202:31437,47203:31438,47204:31439,47205:31440,47206:31441,47207:31442,47208:31443,47209:31444,47210:31445,47211:31447,47212:31448,47213:31450,47214:31451,47215:31452,47216:31453,47217:31457,47218:31458,47219:31460,47220:31463,47221:31464,47222:31465,47223:31466,47224:31467,47225:31468,47226:31470,47227:31472,47228:31473,47229:31474,47230:31475,47232:31476,47233:31477,47234:31478,47235:31479,47236:31480,47237:31483,47238:31484,47239:31486,47240:31488,47241:31489,47242:31490,47243:31493,47244:31495,47245:31497,47246:31500,47247:31501,47248:31502,47249:31504,47250:31506,47251:31507,47252:31510,47253:31511,47254:31512,47255:31514,47256:31516,47257:31517,47258:31519,47259:31521,47260:31522,47261:31523,47262:31527,47263:31529,47264:31533,47265:28014,47266:28074,47267:31119,47268:34993,47269:24343,47270:29995,47271:25242,47272:36741,47273:20463,47274:37340,47275:26023,47276:33071,47277:33105,47278:24220,47279:33104,47280:36212,47281:21103,47282:35206,47283:36171,47284:22797,47285:20613,47286:20184,47287:38428,47288:29238,47289:33145,47290:36127,47291:23500,47292:35747,47293:38468,47294:22919,47295:32538,47296:21648,47297:22134,47298:22030,47299:35813,47300:25913,47301:27010,47302:38041,47303:30422,47304:28297,47305:24178,47306:29976,47307:26438,47308:26577,47309:31487,47310:32925,47311:36214,47312:24863,47313:31174,47314:25954,47315:36195,47316:20872,47317:21018,47318:38050,47319:32568,47320:32923,47321:32434,47322:23703,47323:28207,47324:26464,47325:31705,47326:30347,47327:39640,47328:33167,47329:32660,47330:31957,47331:25630,47332:38224,47333:31295,47334:21578,47335:21733,47336:27468,47337:25601,47338:25096,47339:40509,47340:33011,47341:30105,47342:21106,47343:38761,47344:33883,47345:26684,47346:34532,47347:38401,47348:38548,47349:38124,47350:20010,47351:21508,47352:32473,47353:26681,47354:36319,47355:32789,47356:26356,47357:24218,47358:32697,47424:31535,47425:31536,47426:31538,47427:31540,47428:31541,47429:31542,47430:31543,47431:31545,47432:31547,47433:31549,47434:31551,47435:31552,47436:31553,47437:31554,47438:31555,47439:31556,47440:31558,47441:31560,47442:31562,47443:31565,47444:31566,47445:31571,47446:31573,47447:31575,47448:31577,47449:31580,47450:31582,47451:31583,47452:31585,47453:31587,47454:31588,47455:31589,47456:31590,47457:31591,47458:31592,47459:31593,47460:31594,47461:31595,47462:31596,47463:31597,47464:31599,47465:31600,47466:31603,47467:31604,47468:31606,47469:31608,47470:31610,47471:31612,47472:31613,47473:31615,47474:31617,47475:31618,47476:31619,47477:31620,47478:31622,47479:31623,47480:31624,47481:31625,47482:31626,47483:31627,47484:31628,47485:31630,47486:31631,47488:31633,47489:31634,47490:31635,47491:31638,47492:31640,47493:31641,47494:31642,47495:31643,47496:31646,47497:31647,47498:31648,47499:31651,47500:31652,47501:31653,47502:31662,47503:31663,47504:31664,47505:31666,47506:31667,47507:31669,47508:31670,47509:31671,47510:31673,47511:31674,47512:31675,47513:31676,47514:31677,47515:31678,47516:31679,47517:31680,47518:31682,47519:31683,47520:31684,47521:22466,47522:32831,47523:26775,47524:24037,47525:25915,47526:21151,47527:24685,47528:40858,47529:20379,47530:36524,47531:20844,47532:23467,47533:24339,47534:24041,47535:27742,47536:25329,47537:36129,47538:20849,47539:38057,47540:21246,47541:27807,47542:33503,47543:29399,47544:22434,47545:26500,47546:36141,47547:22815,47548:36764,47549:33735,47550:21653,47551:31629,47552:20272,47553:27837,47554:23396,47555:22993,47556:40723,47557:21476,47558:34506,47559:39592,47560:35895,47561:32929,47562:25925,47563:39038,47564:22266,47565:38599,47566:21038,47567:29916,47568:21072,47569:23521,47570:25346,47571:35074,47572:20054,47573:25296,47574:24618,47575:26874,47576:20851,47577:23448,47578:20896,47579:35266,47580:31649,47581:39302,47582:32592,47583:24815,47584:28748,47585:36143,47586:20809,47587:24191,47588:36891,47589:29808,47590:35268,47591:22317,47592:30789,47593:24402,47594:40863,47595:38394,47596:36712,47597:39740,47598:35809,47599:30328,47600:26690,47601:26588,47602:36330,47603:36149,47604:21053,47605:36746,47606:28378,47607:26829,47608:38149,47609:37101,47610:22269,47611:26524,47612:35065,47613:36807,47614:21704,47680:31685,47681:31688,47682:31689,47683:31690,47684:31691,47685:31693,47686:31694,47687:31695,47688:31696,47689:31698,47690:31700,47691:31701,47692:31702,47693:31703,47694:31704,47695:31707,47696:31708,47697:31710,47698:31711,47699:31712,47700:31714,47701:31715,47702:31716,47703:31719,47704:31720,47705:31721,47706:31723,47707:31724,47708:31725,47709:31727,47710:31728,47711:31730,47712:31731,47713:31732,47714:31733,47715:31734,47716:31736,47717:31737,47718:31738,47719:31739,47720:31741,47721:31743,47722:31744,47723:31745,47724:31746,47725:31747,47726:31748,47727:31749,47728:31750,47729:31752,47730:31753,47731:31754,47732:31757,47733:31758,47734:31760,47735:31761,47736:31762,47737:31763,47738:31764,47739:31765,47740:31767,47741:31768,47742:31769,47744:31770,47745:31771,47746:31772,47747:31773,47748:31774,47749:31776,47750:31777,47751:31778,47752:31779,47753:31780,47754:31781,47755:31784,47756:31785,47757:31787,47758:31788,47759:31789,47760:31790,47761:31791,47762:31792,47763:31793,47764:31794,47765:31795,47766:31796,47767:31797,47768:31798,47769:31799,47770:31801,47771:31802,47772:31803,47773:31804,47774:31805,47775:31806,47776:31810,47777:39608,47778:23401,47779:28023,47780:27686,47781:20133,47782:23475,47783:39559,47784:37219,47785:25000,47786:37039,47787:38889,47788:21547,47789:28085,47790:23506,47791:20989,47792:21898,47793:32597,47794:32752,47795:25788,47796:25421,47797:26097,47798:25022,47799:24717,47800:28938,47801:27735,47802:27721,47803:22831,47804:26477,47805:33322,47806:22741,47807:22158,47808:35946,47809:27627,47810:37085,47811:22909,47812:32791,47813:21495,47814:28009,47815:21621,47816:21917,47817:33655,47818:33743,47819:26680,47820:31166,47821:21644,47822:20309,47823:21512,47824:30418,47825:35977,47826:38402,47827:27827,47828:28088,47829:36203,47830:35088,47831:40548,47832:36154,47833:22079,47834:40657,47835:30165,47836:24456,47837:29408,47838:24680,47839:21756,47840:20136,47841:27178,47842:34913,47843:24658,47844:36720,47845:21700,47846:28888,47847:34425,47848:40511,47849:27946,47850:23439,47851:24344,47852:32418,47853:21897,47854:20399,47855:29492,47856:21564,47857:21402,47858:20505,47859:21518,47860:21628,47861:20046,47862:24573,47863:29786,47864:22774,47865:33899,47866:32993,47867:34676,47868:29392,47869:31946,47870:28246,47936:31811,47937:31812,47938:31813,47939:31814,47940:31815,47941:31816,47942:31817,47943:31818,47944:31819,47945:31820,47946:31822,47947:31823,47948:31824,47949:31825,47950:31826,47951:31827,47952:31828,47953:31829,47954:31830,47955:31831,47956:31832,47957:31833,47958:31834,47959:31835,47960:31836,47961:31837,47962:31838,47963:31839,47964:31840,47965:31841,47966:31842,47967:31843,47968:31844,47969:31845,47970:31846,47971:31847,47972:31848,47973:31849,47974:31850,47975:31851,47976:31852,47977:31853,47978:31854,47979:31855,47980:31856,47981:31857,47982:31858,47983:31861,47984:31862,47985:31863,47986:31864,47987:31865,47988:31866,47989:31870,47990:31871,47991:31872,47992:31873,47993:31874,47994:31875,47995:31876,47996:31877,47997:31878,47998:31879,48000:31880,48001:31882,48002:31883,48003:31884,48004:31885,48005:31886,48006:31887,48007:31888,48008:31891,48009:31892,48010:31894,48011:31897,48012:31898,48013:31899,48014:31904,48015:31905,48016:31907,48017:31910,48018:31911,48019:31912,48020:31913,48021:31915,48022:31916,48023:31917,48024:31919,48025:31920,48026:31924,48027:31925,48028:31926,48029:31927,48030:31928,48031:31930,48032:31931,48033:24359,48034:34382,48035:21804,48036:25252,48037:20114,48038:27818,48039:25143,48040:33457,48041:21719,48042:21326,48043:29502,48044:28369,48045:30011,48046:21010,48047:21270,48048:35805,48049:27088,48050:24458,48051:24576,48052:28142,48053:22351,48054:27426,48055:29615,48056:26707,48057:36824,48058:32531,48059:25442,48060:24739,48061:21796,48062:30186,48063:35938,48064:28949,48065:28067,48066:23462,48067:24187,48068:33618,48069:24908,48070:40644,48071:30970,48072:34647,48073:31783,48074:30343,48075:20976,48076:24822,48077:29004,48078:26179,48079:24140,48080:24653,48081:35854,48082:28784,48083:25381,48084:36745,48085:24509,48086:24674,48087:34516,48088:22238,48089:27585,48090:24724,48091:24935,48092:21321,48093:24800,48094:26214,48095:36159,48096:31229,48097:20250,48098:28905,48099:27719,48100:35763,48101:35826,48102:32472,48103:33636,48104:26127,48105:23130,48106:39746,48107:27985,48108:28151,48109:35905,48110:27963,48111:20249,48112:28779,48113:33719,48114:25110,48115:24785,48116:38669,48117:36135,48118:31096,48119:20987,48120:22334,48121:22522,48122:26426,48123:30072,48124:31293,48125:31215,48126:31637,48192:31935,48193:31936,48194:31938,48195:31939,48196:31940,48197:31942,48198:31945,48199:31947,48200:31950,48201:31951,48202:31952,48203:31953,48204:31954,48205:31955,48206:31956,48207:31960,48208:31962,48209:31963,48210:31965,48211:31966,48212:31969,48213:31970,48214:31971,48215:31972,48216:31973,48217:31974,48218:31975,48219:31977,48220:31978,48221:31979,48222:31980,48223:31981,48224:31982,48225:31984,48226:31985,48227:31986,48228:31987,48229:31988,48230:31989,48231:31990,48232:31991,48233:31993,48234:31994,48235:31996,48236:31997,48237:31998,48238:31999,48239:32000,48240:32001,48241:32002,48242:32003,48243:32004,48244:32005,48245:32006,48246:32007,48247:32008,48248:32009,48249:32011,48250:32012,48251:32013,48252:32014,48253:32015,48254:32016,48256:32017,48257:32018,48258:32019,48259:32020,48260:32021,48261:32022,48262:32023,48263:32024,48264:32025,48265:32026,48266:32027,48267:32028,48268:32029,48269:32030,48270:32031,48271:32033,48272:32035,48273:32036,48274:32037,48275:32038,48276:32040,48277:32041,48278:32042,48279:32044,48280:32045,48281:32046,48282:32048,48283:32049,48284:32050,48285:32051,48286:32052,48287:32053,48288:32054,48289:32908,48290:39269,48291:36857,48292:28608,48293:35749,48294:40481,48295:23020,48296:32489,48297:32521,48298:21513,48299:26497,48300:26840,48301:36753,48302:31821,48303:38598,48304:21450,48305:24613,48306:30142,48307:27762,48308:21363,48309:23241,48310:32423,48311:25380,48312:20960,48313:33034,48314:24049,48315:34015,48316:25216,48317:20864,48318:23395,48319:20238,48320:31085,48321:21058,48322:24760,48323:27982,48324:23492,48325:23490,48326:35745,48327:35760,48328:26082,48329:24524,48330:38469,48331:22931,48332:32487,48333:32426,48334:22025,48335:26551,48336:22841,48337:20339,48338:23478,48339:21152,48340:33626,48341:39050,48342:36158,48343:30002,48344:38078,48345:20551,48346:31292,48347:20215,48348:26550,48349:39550,48350:23233,48351:27516,48352:30417,48353:22362,48354:23574,48355:31546,48356:38388,48357:29006,48358:20860,48359:32937,48360:33392,48361:22904,48362:32516,48363:33575,48364:26816,48365:26604,48366:30897,48367:30839,48368:25315,48369:25441,48370:31616,48371:20461,48372:21098,48373:20943,48374:33616,48375:27099,48376:37492,48377:36341,48378:36145,48379:35265,48380:38190,48381:31661,48382:20214,48448:32055,48449:32056,48450:32057,48451:32058,48452:32059,48453:32060,48454:32061,48455:32062,48456:32063,48457:32064,48458:32065,48459:32066,48460:32067,48461:32068,48462:32069,48463:32070,48464:32071,48465:32072,48466:32073,48467:32074,48468:32075,48469:32076,48470:32077,48471:32078,48472:32079,48473:32080,48474:32081,48475:32082,48476:32083,48477:32084,48478:32085,48479:32086,48480:32087,48481:32088,48482:32089,48483:32090,48484:32091,48485:32092,48486:32093,48487:32094,48488:32095,48489:32096,48490:32097,48491:32098,48492:32099,48493:32100,48494:32101,48495:32102,48496:32103,48497:32104,48498:32105,48499:32106,48500:32107,48501:32108,48502:32109,48503:32111,48504:32112,48505:32113,48506:32114,48507:32115,48508:32116,48509:32117,48510:32118,48512:32120,48513:32121,48514:32122,48515:32123,48516:32124,48517:32125,48518:32126,48519:32127,48520:32128,48521:32129,48522:32130,48523:32131,48524:32132,48525:32133,48526:32134,48527:32135,48528:32136,48529:32137,48530:32138,48531:32139,48532:32140,48533:32141,48534:32142,48535:32143,48536:32144,48537:32145,48538:32146,48539:32147,48540:32148,48541:32149,48542:32150,48543:32151,48544:32152,48545:20581,48546:33328,48547:21073,48548:39279,48549:28176,48550:28293,48551:28071,48552:24314,48553:20725,48554:23004,48555:23558,48556:27974,48557:27743,48558:30086,48559:33931,48560:26728,48561:22870,48562:35762,48563:21280,48564:37233,48565:38477,48566:34121,48567:26898,48568:30977,48569:28966,48570:33014,48571:20132,48572:37066,48573:27975,48574:39556,48575:23047,48576:22204,48577:25605,48578:38128,48579:30699,48580:20389,48581:33050,48582:29409,48583:35282,48584:39290,48585:32564,48586:32478,48587:21119,48588:25945,48589:37237,48590:36735,48591:36739,48592:21483,48593:31382,48594:25581,48595:25509,48596:30342,48597:31224,48598:34903,48599:38454,48600:25130,48601:21163,48602:33410,48603:26708,48604:26480,48605:25463,48606:30571,48607:31469,48608:27905,48609:32467,48610:35299,48611:22992,48612:25106,48613:34249,48614:33445,48615:30028,48616:20511,48617:20171,48618:30117,48619:35819,48620:23626,48621:24062,48622:31563,48623:26020,48624:37329,48625:20170,48626:27941,48627:35167,48628:32039,48629:38182,48630:20165,48631:35880,48632:36827,48633:38771,48634:26187,48635:31105,48636:36817,48637:28908,48638:28024,48704:32153,48705:32154,48706:32155,48707:32156,48708:32157,48709:32158,48710:32159,48711:32160,48712:32161,48713:32162,48714:32163,48715:32164,48716:32165,48717:32167,48718:32168,48719:32169,48720:32170,48721:32171,48722:32172,48723:32173,48724:32175,48725:32176,48726:32177,48727:32178,48728:32179,48729:32180,48730:32181,48731:32182,48732:32183,48733:32184,48734:32185,48735:32186,48736:32187,48737:32188,48738:32189,48739:32190,48740:32191,48741:32192,48742:32193,48743:32194,48744:32195,48745:32196,48746:32197,48747:32198,48748:32199,48749:32200,48750:32201,48751:32202,48752:32203,48753:32204,48754:32205,48755:32206,48756:32207,48757:32208,48758:32209,48759:32210,48760:32211,48761:32212,48762:32213,48763:32214,48764:32215,48765:32216,48766:32217,48768:32218,48769:32219,48770:32220,48771:32221,48772:32222,48773:32223,48774:32224,48775:32225,48776:32226,48777:32227,48778:32228,48779:32229,48780:32230,48781:32231,48782:32232,48783:32233,48784:32234,48785:32235,48786:32236,48787:32237,48788:32238,48789:32239,48790:32240,48791:32241,48792:32242,48793:32243,48794:32244,48795:32245,48796:32246,48797:32247,48798:32248,48799:32249,48800:32250,48801:23613,48802:21170,48803:33606,48804:20834,48805:33550,48806:30555,48807:26230,48808:40120,48809:20140,48810:24778,48811:31934,48812:31923,48813:32463,48814:20117,48815:35686,48816:26223,48817:39048,48818:38745,48819:22659,48820:25964,48821:38236,48822:24452,48823:30153,48824:38742,48825:31455,48826:31454,48827:20928,48828:28847,48829:31384,48830:25578,48831:31350,48832:32416,48833:29590,48834:38893,48835:20037,48836:28792,48837:20061,48838:37202,48839:21417,48840:25937,48841:26087,48842:33276,48843:33285,48844:21646,48845:23601,48846:30106,48847:38816,48848:25304,48849:29401,48850:30141,48851:23621,48852:39545,48853:33738,48854:23616,48855:21632,48856:30697,48857:20030,48858:27822,48859:32858,48860:25298,48861:25454,48862:24040,48863:20855,48864:36317,48865:36382,48866:38191,48867:20465,48868:21477,48869:24807,48870:28844,48871:21095,48872:25424,48873:40515,48874:23071,48875:20518,48876:30519,48877:21367,48878:32482,48879:25733,48880:25899,48881:25225,48882:25496,48883:20500,48884:29237,48885:35273,48886:20915,48887:35776,48888:32477,48889:22343,48890:33740,48891:38055,48892:20891,48893:21531,48894:23803,48960:32251,48961:32252,48962:32253,48963:32254,48964:32255,48965:32256,48966:32257,48967:32258,48968:32259,48969:32260,48970:32261,48971:32262,48972:32263,48973:32264,48974:32265,48975:32266,48976:32267,48977:32268,48978:32269,48979:32270,48980:32271,48981:32272,48982:32273,48983:32274,48984:32275,48985:32276,48986:32277,48987:32278,48988:32279,48989:32280,48990:32281,48991:32282,48992:32283,48993:32284,48994:32285,48995:32286,48996:32287,48997:32288,48998:32289,48999:32290,49000:32291,49001:32292,49002:32293,49003:32294,49004:32295,49005:32296,49006:32297,49007:32298,49008:32299,49009:32300,49010:32301,49011:32302,49012:32303,49013:32304,49014:32305,49015:32306,49016:32307,49017:32308,49018:32309,49019:32310,49020:32311,49021:32312,49022:32313,49024:32314,49025:32316,49026:32317,49027:32318,49028:32319,49029:32320,49030:32322,49031:32323,49032:32324,49033:32325,49034:32326,49035:32328,49036:32329,49037:32330,49038:32331,49039:32332,49040:32333,49041:32334,49042:32335,49043:32336,49044:32337,49045:32338,49046:32339,49047:32340,49048:32341,49049:32342,49050:32343,49051:32344,49052:32345,49053:32346,49054:32347,49055:32348,49056:32349,49057:20426,49058:31459,49059:27994,49060:37089,49061:39567,49062:21888,49063:21654,49064:21345,49065:21679,49066:24320,49067:25577,49068:26999,49069:20975,49070:24936,49071:21002,49072:22570,49073:21208,49074:22350,49075:30733,49076:30475,49077:24247,49078:24951,49079:31968,49080:25179,49081:25239,49082:20130,49083:28821,49084:32771,49085:25335,49086:28900,49087:38752,49088:22391,49089:33499,49090:26607,49091:26869,49092:30933,49093:39063,49094:31185,49095:22771,49096:21683,49097:21487,49098:28212,49099:20811,49100:21051,49101:23458,49102:35838,49103:32943,49104:21827,49105:22438,49106:24691,49107:22353,49108:21549,49109:31354,49110:24656,49111:23380,49112:25511,49113:25248,49114:21475,49115:25187,49116:23495,49117:26543,49118:21741,49119:31391,49120:33510,49121:37239,49122:24211,49123:35044,49124:22840,49125:22446,49126:25358,49127:36328,49128:33007,49129:22359,49130:31607,49131:20393,49132:24555,49133:23485,49134:27454,49135:21281,49136:31568,49137:29378,49138:26694,49139:30719,49140:30518,49141:26103,49142:20917,49143:20111,49144:30420,49145:23743,49146:31397,49147:33909,49148:22862,49149:39745,49150:20608,49216:32350,49217:32351,49218:32352,49219:32353,49220:32354,49221:32355,49222:32356,49223:32357,49224:32358,49225:32359,49226:32360,49227:32361,49228:32362,49229:32363,49230:32364,49231:32365,49232:32366,49233:32367,49234:32368,49235:32369,49236:32370,49237:32371,49238:32372,49239:32373,49240:32374,49241:32375,49242:32376,49243:32377,49244:32378,49245:32379,49246:32380,49247:32381,49248:32382,49249:32383,49250:32384,49251:32385,49252:32387,49253:32388,49254:32389,49255:32390,49256:32391,49257:32392,49258:32393,49259:32394,49260:32395,49261:32396,49262:32397,49263:32398,49264:32399,49265:32400,49266:32401,49267:32402,49268:32403,49269:32404,49270:32405,49271:32406,49272:32407,49273:32408,49274:32409,49275:32410,49276:32412,49277:32413,49278:32414,49280:32430,49281:32436,49282:32443,49283:32444,49284:32470,49285:32484,49286:32492,49287:32505,49288:32522,49289:32528,49290:32542,49291:32567,49292:32569,49293:32571,49294:32572,49295:32573,49296:32574,49297:32575,49298:32576,49299:32577,49300:32579,49301:32582,49302:32583,49303:32584,49304:32585,49305:32586,49306:32587,49307:32588,49308:32589,49309:32590,49310:32591,49311:32594,49312:32595,49313:39304,49314:24871,49315:28291,49316:22372,49317:26118,49318:25414,49319:22256,49320:25324,49321:25193,49322:24275,49323:38420,49324:22403,49325:25289,49326:21895,49327:34593,49328:33098,49329:36771,49330:21862,49331:33713,49332:26469,49333:36182,49334:34013,49335:23146,49336:26639,49337:25318,49338:31726,49339:38417,49340:20848,49341:28572,49342:35888,49343:25597,49344:35272,49345:25042,49346:32518,49347:28866,49348:28389,49349:29701,49350:27028,49351:29436,49352:24266,49353:37070,49354:26391,49355:28010,49356:25438,49357:21171,49358:29282,49359:32769,49360:20332,49361:23013,49362:37226,49363:28889,49364:28061,49365:21202,49366:20048,49367:38647,49368:38253,49369:34174,49370:30922,49371:32047,49372:20769,49373:22418,49374:25794,49375:32907,49376:31867,49377:27882,49378:26865,49379:26974,49380:20919,49381:21400,49382:26792,49383:29313,49384:40654,49385:31729,49386:29432,49387:31163,49388:28435,49389:29702,49390:26446,49391:37324,49392:40100,49393:31036,49394:33673,49395:33620,49396:21519,49397:26647,49398:20029,49399:21385,49400:21169,49401:30782,49402:21382,49403:21033,49404:20616,49405:20363,49406:20432,49472:32598,49473:32601,49474:32603,49475:32604,49476:32605,49477:32606,49478:32608,49479:32611,49480:32612,49481:32613,49482:32614,49483:32615,49484:32619,49485:32620,49486:32621,49487:32623,49488:32624,49489:32627,49490:32629,49491:32630,49492:32631,49493:32632,49494:32634,49495:32635,49496:32636,49497:32637,49498:32639,49499:32640,49500:32642,49501:32643,49502:32644,49503:32645,49504:32646,49505:32647,49506:32648,49507:32649,49508:32651,49509:32653,49510:32655,49511:32656,49512:32657,49513:32658,49514:32659,49515:32661,49516:32662,49517:32663,49518:32664,49519:32665,49520:32667,49521:32668,49522:32672,49523:32674,49524:32675,49525:32677,49526:32678,49527:32680,49528:32681,49529:32682,49530:32683,49531:32684,49532:32685,49533:32686,49534:32689,49536:32691,49537:32692,49538:32693,49539:32694,49540:32695,49541:32698,49542:32699,49543:32702,49544:32704,49545:32706,49546:32707,49547:32708,49548:32710,49549:32711,49550:32712,49551:32713,49552:32715,49553:32717,49554:32719,49555:32720,49556:32721,49557:32722,49558:32723,49559:32726,49560:32727,49561:32729,49562:32730,49563:32731,49564:32732,49565:32733,49566:32734,49567:32738,49568:32739,49569:30178,49570:31435,49571:31890,49572:27813,49573:38582,49574:21147,49575:29827,49576:21737,49577:20457,49578:32852,49579:33714,49580:36830,49581:38256,49582:24265,49583:24604,49584:28063,49585:24088,49586:25947,49587:33080,49588:38142,49589:24651,49590:28860,49591:32451,49592:31918,49593:20937,49594:26753,49595:31921,49596:33391,49597:20004,49598:36742,49599:37327,49600:26238,49601:20142,49602:35845,49603:25769,49604:32842,49605:20698,49606:30103,49607:29134,49608:23525,49609:36797,49610:28518,49611:20102,49612:25730,49613:38243,49614:24278,49615:26009,49616:21015,49617:35010,49618:28872,49619:21155,49620:29454,49621:29747,49622:26519,49623:30967,49624:38678,49625:20020,49626:37051,49627:40158,49628:28107,49629:20955,49630:36161,49631:21533,49632:25294,49633:29618,49634:33777,49635:38646,49636:40836,49637:38083,49638:20278,49639:32666,49640:20940,49641:28789,49642:38517,49643:23725,49644:39046,49645:21478,49646:20196,49647:28316,49648:29705,49649:27060,49650:30827,49651:39311,49652:30041,49653:21016,49654:30244,49655:27969,49656:26611,49657:20845,49658:40857,49659:32843,49660:21657,49661:31548,49662:31423,49728:32740,49729:32743,49730:32744,49731:32746,49732:32747,49733:32748,49734:32749,49735:32751,49736:32754,49737:32756,49738:32757,49739:32758,49740:32759,49741:32760,49742:32761,49743:32762,49744:32765,49745:32766,49746:32767,49747:32770,49748:32775,49749:32776,49750:32777,49751:32778,49752:32782,49753:32783,49754:32785,49755:32787,49756:32794,49757:32795,49758:32797,49759:32798,49760:32799,49761:32801,49762:32803,49763:32804,49764:32811,49765:32812,49766:32813,49767:32814,49768:32815,49769:32816,49770:32818,49771:32820,49772:32825,49773:32826,49774:32828,49775:32830,49776:32832,49777:32833,49778:32836,49779:32837,49780:32839,49781:32840,49782:32841,49783:32846,49784:32847,49785:32848,49786:32849,49787:32851,49788:32853,49789:32854,49790:32855,49792:32857,49793:32859,49794:32860,49795:32861,49796:32862,49797:32863,49798:32864,49799:32865,49800:32866,49801:32867,49802:32868,49803:32869,49804:32870,49805:32871,49806:32872,49807:32875,49808:32876,49809:32877,49810:32878,49811:32879,49812:32880,49813:32882,49814:32883,49815:32884,49816:32885,49817:32886,49818:32887,49819:32888,49820:32889,49821:32890,49822:32891,49823:32892,49824:32893,49825:38534,49826:22404,49827:25314,49828:38471,49829:27004,49830:23044,49831:25602,49832:31699,49833:28431,49834:38475,49835:33446,49836:21346,49837:39045,49838:24208,49839:28809,49840:25523,49841:21348,49842:34383,49843:40065,49844:40595,49845:30860,49846:38706,49847:36335,49848:36162,49849:40575,49850:28510,49851:31108,49852:24405,49853:38470,49854:25134,49855:39540,49856:21525,49857:38109,49858:20387,49859:26053,49860:23653,49861:23649,49862:32533,49863:34385,49864:27695,49865:24459,49866:29575,49867:28388,49868:32511,49869:23782,49870:25371,49871:23402,49872:28390,49873:21365,49874:20081,49875:25504,49876:30053,49877:25249,49878:36718,49879:20262,49880:20177,49881:27814,49882:32438,49883:35770,49884:33821,49885:34746,49886:32599,49887:36923,49888:38179,49889:31657,49890:39585,49891:35064,49892:33853,49893:27931,49894:39558,49895:32476,49896:22920,49897:40635,49898:29595,49899:30721,49900:34434,49901:39532,49902:39554,49903:22043,49904:21527,49905:22475,49906:20080,49907:40614,49908:21334,49909:36808,49910:33033,49911:30610,49912:39314,49913:34542,49914:28385,49915:34067,49916:26364,49917:24930,49918:28459,49984:32894,49985:32897,49986:32898,49987:32901,49988:32904,49989:32906,49990:32909,49991:32910,49992:32911,49993:32912,49994:32913,49995:32914,49996:32916,49997:32917,49998:32919,49999:32921,50000:32926,50001:32931,50002:32934,50003:32935,50004:32936,50005:32940,50006:32944,50007:32947,50008:32949,50009:32950,50010:32952,50011:32953,50012:32955,50013:32965,50014:32967,50015:32968,50016:32969,50017:32970,50018:32971,50019:32975,50020:32976,50021:32977,50022:32978,50023:32979,50024:32980,50025:32981,50026:32984,50027:32991,50028:32992,50029:32994,50030:32995,50031:32998,50032:33006,50033:33013,50034:33015,50035:33017,50036:33019,50037:33022,50038:33023,50039:33024,50040:33025,50041:33027,50042:33028,50043:33029,50044:33031,50045:33032,50046:33035,50048:33036,50049:33045,50050:33047,50051:33049,50052:33051,50053:33052,50054:33053,50055:33055,50056:33056,50057:33057,50058:33058,50059:33059,50060:33060,50061:33061,50062:33062,50063:33063,50064:33064,50065:33065,50066:33066,50067:33067,50068:33069,50069:33070,50070:33072,50071:33075,50072:33076,50073:33077,50074:33079,50075:33081,50076:33082,50077:33083,50078:33084,50079:33085,50080:33087,50081:35881,50082:33426,50083:33579,50084:30450,50085:27667,50086:24537,50087:33725,50088:29483,50089:33541,50090:38170,50091:27611,50092:30683,50093:38086,50094:21359,50095:33538,50096:20882,50097:24125,50098:35980,50099:36152,50100:20040,50101:29611,50102:26522,50103:26757,50104:37238,50105:38665,50106:29028,50107:27809,50108:30473,50109:23186,50110:38209,50111:27599,50112:32654,50113:26151,50114:23504,50115:22969,50116:23194,50117:38376,50118:38391,50119:20204,50120:33804,50121:33945,50122:27308,50123:30431,50124:38192,50125:29467,50126:26790,50127:23391,50128:30511,50129:37274,50130:38753,50131:31964,50132:36855,50133:35868,50134:24357,50135:31859,50136:31192,50137:35269,50138:27852,50139:34588,50140:23494,50141:24130,50142:26825,50143:30496,50144:32501,50145:20885,50146:20813,50147:21193,50148:23081,50149:32517,50150:38754,50151:33495,50152:25551,50153:30596,50154:34256,50155:31186,50156:28218,50157:24217,50158:22937,50159:34065,50160:28781,50161:27665,50162:25279,50163:30399,50164:25935,50165:24751,50166:38397,50167:26126,50168:34719,50169:40483,50170:38125,50171:21517,50172:21629,50173:35884,50174:25720,50240:33088,50241:33089,50242:33090,50243:33091,50244:33092,50245:33093,50246:33095,50247:33097,50248:33101,50249:33102,50250:33103,50251:33106,50252:33110,50253:33111,50254:33112,50255:33115,50256:33116,50257:33117,50258:33118,50259:33119,50260:33121,50261:33122,50262:33123,50263:33124,50264:33126,50265:33128,50266:33130,50267:33131,50268:33132,50269:33135,50270:33138,50271:33139,50272:33141,50273:33142,50274:33143,50275:33144,50276:33153,50277:33155,50278:33156,50279:33157,50280:33158,50281:33159,50282:33161,50283:33163,50284:33164,50285:33165,50286:33166,50287:33168,50288:33170,50289:33171,50290:33172,50291:33173,50292:33174,50293:33175,50294:33177,50295:33178,50296:33182,50297:33183,50298:33184,50299:33185,50300:33186,50301:33188,50302:33189,50304:33191,50305:33193,50306:33195,50307:33196,50308:33197,50309:33198,50310:33199,50311:33200,50312:33201,50313:33202,50314:33204,50315:33205,50316:33206,50317:33207,50318:33208,50319:33209,50320:33212,50321:33213,50322:33214,50323:33215,50324:33220,50325:33221,50326:33223,50327:33224,50328:33225,50329:33227,50330:33229,50331:33230,50332:33231,50333:33232,50334:33233,50335:33234,50336:33235,50337:25721,50338:34321,50339:27169,50340:33180,50341:30952,50342:25705,50343:39764,50344:25273,50345:26411,50346:33707,50347:22696,50348:40664,50349:27819,50350:28448,50351:23518,50352:38476,50353:35851,50354:29279,50355:26576,50356:25287,50357:29281,50358:20137,50359:22982,50360:27597,50361:22675,50362:26286,50363:24149,50364:21215,50365:24917,50366:26408,50367:30446,50368:30566,50369:29287,50370:31302,50371:25343,50372:21738,50373:21584,50374:38048,50375:37027,50376:23068,50377:32435,50378:27670,50379:20035,50380:22902,50381:32784,50382:22856,50383:21335,50384:30007,50385:38590,50386:22218,50387:25376,50388:33041,50389:24700,50390:38393,50391:28118,50392:21602,50393:39297,50394:20869,50395:23273,50396:33021,50397:22958,50398:38675,50399:20522,50400:27877,50401:23612,50402:25311,50403:20320,50404:21311,50405:33147,50406:36870,50407:28346,50408:34091,50409:25288,50410:24180,50411:30910,50412:25781,50413:25467,50414:24565,50415:23064,50416:37247,50417:40479,50418:23615,50419:25423,50420:32834,50421:23421,50422:21870,50423:38218,50424:38221,50425:28037,50426:24744,50427:26592,50428:29406,50429:20957,50430:23425,50496:33236,50497:33237,50498:33238,50499:33239,50500:33240,50501:33241,50502:33242,50503:33243,50504:33244,50505:33245,50506:33246,50507:33247,50508:33248,50509:33249,50510:33250,50511:33252,50512:33253,50513:33254,50514:33256,50515:33257,50516:33259,50517:33262,50518:33263,50519:33264,50520:33265,50521:33266,50522:33269,50523:33270,50524:33271,50525:33272,50526:33273,50527:33274,50528:33277,50529:33279,50530:33283,50531:33287,50532:33288,50533:33289,50534:33290,50535:33291,50536:33294,50537:33295,50538:33297,50539:33299,50540:33301,50541:33302,50542:33303,50543:33304,50544:33305,50545:33306,50546:33309,50547:33312,50548:33316,50549:33317,50550:33318,50551:33319,50552:33321,50553:33326,50554:33330,50555:33338,50556:33340,50557:33341,50558:33343,50560:33344,50561:33345,50562:33346,50563:33347,50564:33349,50565:33350,50566:33352,50567:33354,50568:33356,50569:33357,50570:33358,50571:33360,50572:33361,50573:33362,50574:33363,50575:33364,50576:33365,50577:33366,50578:33367,50579:33369,50580:33371,50581:33372,50582:33373,50583:33374,50584:33376,50585:33377,50586:33378,50587:33379,50588:33380,50589:33381,50590:33382,50591:33383,50592:33385,50593:25319,50594:27870,50595:29275,50596:25197,50597:38062,50598:32445,50599:33043,50600:27987,50601:20892,50602:24324,50603:22900,50604:21162,50605:24594,50606:22899,50607:26262,50608:34384,50609:30111,50610:25386,50611:25062,50612:31983,50613:35834,50614:21734,50615:27431,50616:40485,50617:27572,50618:34261,50619:21589,50620:20598,50621:27812,50622:21866,50623:36276,50624:29228,50625:24085,50626:24597,50627:29750,50628:25293,50629:25490,50630:29260,50631:24472,50632:28227,50633:27966,50634:25856,50635:28504,50636:30424,50637:30928,50638:30460,50639:30036,50640:21028,50641:21467,50642:20051,50643:24222,50644:26049,50645:32810,50646:32982,50647:25243,50648:21638,50649:21032,50650:28846,50651:34957,50652:36305,50653:27873,50654:21624,50655:32986,50656:22521,50657:35060,50658:36180,50659:38506,50660:37197,50661:20329,50662:27803,50663:21943,50664:30406,50665:30768,50666:25256,50667:28921,50668:28558,50669:24429,50670:34028,50671:26842,50672:30844,50673:31735,50674:33192,50675:26379,50676:40527,50677:25447,50678:30896,50679:22383,50680:30738,50681:38713,50682:25209,50683:25259,50684:21128,50685:29749,50686:27607,50752:33386,50753:33387,50754:33388,50755:33389,50756:33393,50757:33397,50758:33398,50759:33399,50760:33400,50761:33403,50762:33404,50763:33408,50764:33409,50765:33411,50766:33413,50767:33414,50768:33415,50769:33417,50770:33420,50771:33424,50772:33427,50773:33428,50774:33429,50775:33430,50776:33434,50777:33435,50778:33438,50779:33440,50780:33442,50781:33443,50782:33447,50783:33458,50784:33461,50785:33462,50786:33466,50787:33467,50788:33468,50789:33471,50790:33472,50791:33474,50792:33475,50793:33477,50794:33478,50795:33481,50796:33488,50797:33494,50798:33497,50799:33498,50800:33501,50801:33506,50802:33511,50803:33512,50804:33513,50805:33514,50806:33516,50807:33517,50808:33518,50809:33520,50810:33522,50811:33523,50812:33525,50813:33526,50814:33528,50816:33530,50817:33532,50818:33533,50819:33534,50820:33535,50821:33536,50822:33546,50823:33547,50824:33549,50825:33552,50826:33554,50827:33555,50828:33558,50829:33560,50830:33561,50831:33565,50832:33566,50833:33567,50834:33568,50835:33569,50836:33570,50837:33571,50838:33572,50839:33573,50840:33574,50841:33577,50842:33578,50843:33582,50844:33584,50845:33586,50846:33591,50847:33595,50848:33597,50849:21860,50850:33086,50851:30130,50852:30382,50853:21305,50854:30174,50855:20731,50856:23617,50857:35692,50858:31687,50859:20559,50860:29255,50861:39575,50862:39128,50863:28418,50864:29922,50865:31080,50866:25735,50867:30629,50868:25340,50869:39057,50870:36139,50871:21697,50872:32856,50873:20050,50874:22378,50875:33529,50876:33805,50877:24179,50878:20973,50879:29942,50880:35780,50881:23631,50882:22369,50883:27900,50884:39047,50885:23110,50886:30772,50887:39748,50888:36843,50889:31893,50890:21078,50891:25169,50892:38138,50893:20166,50894:33670,50895:33889,50896:33769,50897:33970,50898:22484,50899:26420,50900:22275,50901:26222,50902:28006,50903:35889,50904:26333,50905:28689,50906:26399,50907:27450,50908:26646,50909:25114,50910:22971,50911:19971,50912:20932,50913:28422,50914:26578,50915:27791,50916:20854,50917:26827,50918:22855,50919:27495,50920:30054,50921:23822,50922:33040,50923:40784,50924:26071,50925:31048,50926:31041,50927:39569,50928:36215,50929:23682,50930:20062,50931:20225,50932:21551,50933:22865,50934:30732,50935:22120,50936:27668,50937:36804,50938:24323,50939:27773,50940:27875,50941:35755,50942:25488,51008:33598,51009:33599,51010:33601,51011:33602,51012:33604,51013:33605,51014:33608,51015:33610,51016:33611,51017:33612,51018:33613,51019:33614,51020:33619,51021:33621,51022:33622,51023:33623,51024:33624,51025:33625,51026:33629,51027:33634,51028:33648,51029:33649,51030:33650,51031:33651,51032:33652,51033:33653,51034:33654,51035:33657,51036:33658,51037:33662,51038:33663,51039:33664,51040:33665,51041:33666,51042:33667,51043:33668,51044:33671,51045:33672,51046:33674,51047:33675,51048:33676,51049:33677,51050:33679,51051:33680,51052:33681,51053:33684,51054:33685,51055:33686,51056:33687,51057:33689,51058:33690,51059:33693,51060:33695,51061:33697,51062:33698,51063:33699,51064:33700,51065:33701,51066:33702,51067:33703,51068:33708,51069:33709,51070:33710,51072:33711,51073:33717,51074:33723,51075:33726,51076:33727,51077:33730,51078:33731,51079:33732,51080:33734,51081:33736,51082:33737,51083:33739,51084:33741,51085:33742,51086:33744,51087:33745,51088:33746,51089:33747,51090:33749,51091:33751,51092:33753,51093:33754,51094:33755,51095:33758,51096:33762,51097:33763,51098:33764,51099:33766,51100:33767,51101:33768,51102:33771,51103:33772,51104:33773,51105:24688,51106:27965,51107:29301,51108:25190,51109:38030,51110:38085,51111:21315,51112:36801,51113:31614,51114:20191,51115:35878,51116:20094,51117:40660,51118:38065,51119:38067,51120:21069,51121:28508,51122:36963,51123:27973,51124:35892,51125:22545,51126:23884,51127:27424,51128:27465,51129:26538,51130:21595,51131:33108,51132:32652,51133:22681,51134:34103,51135:24378,51136:25250,51137:27207,51138:38201,51139:25970,51140:24708,51141:26725,51142:30631,51143:20052,51144:20392,51145:24039,51146:38808,51147:25772,51148:32728,51149:23789,51150:20431,51151:31373,51152:20999,51153:33540,51154:19988,51155:24623,51156:31363,51157:38054,51158:20405,51159:20146,51160:31206,51161:29748,51162:21220,51163:33465,51164:25810,51165:31165,51166:23517,51167:27777,51168:38738,51169:36731,51170:27682,51171:20542,51172:21375,51173:28165,51174:25806,51175:26228,51176:27696,51177:24773,51178:39031,51179:35831,51180:24198,51181:29756,51182:31351,51183:31179,51184:19992,51185:37041,51186:29699,51187:27714,51188:22234,51189:37195,51190:27845,51191:36235,51192:21306,51193:34502,51194:26354,51195:36527,51196:23624,51197:39537,51198:28192,51264:33774,51265:33775,51266:33779,51267:33780,51268:33781,51269:33782,51270:33783,51271:33786,51272:33787,51273:33788,51274:33790,51275:33791,51276:33792,51277:33794,51278:33797,51279:33799,51280:33800,51281:33801,51282:33802,51283:33808,51284:33810,51285:33811,51286:33812,51287:33813,51288:33814,51289:33815,51290:33817,51291:33818,51292:33819,51293:33822,51294:33823,51295:33824,51296:33825,51297:33826,51298:33827,51299:33833,51300:33834,51301:33835,51302:33836,51303:33837,51304:33838,51305:33839,51306:33840,51307:33842,51308:33843,51309:33844,51310:33845,51311:33846,51312:33847,51313:33849,51314:33850,51315:33851,51316:33854,51317:33855,51318:33856,51319:33857,51320:33858,51321:33859,51322:33860,51323:33861,51324:33863,51325:33864,51326:33865,51328:33866,51329:33867,51330:33868,51331:33869,51332:33870,51333:33871,51334:33872,51335:33874,51336:33875,51337:33876,51338:33877,51339:33878,51340:33880,51341:33885,51342:33886,51343:33887,51344:33888,51345:33890,51346:33892,51347:33893,51348:33894,51349:33895,51350:33896,51351:33898,51352:33902,51353:33903,51354:33904,51355:33906,51356:33908,51357:33911,51358:33913,51359:33915,51360:33916,51361:21462,51362:23094,51363:40843,51364:36259,51365:21435,51366:22280,51367:39079,51368:26435,51369:37275,51370:27849,51371:20840,51372:30154,51373:25331,51374:29356,51375:21048,51376:21149,51377:32570,51378:28820,51379:30264,51380:21364,51381:40522,51382:27063,51383:30830,51384:38592,51385:35033,51386:32676,51387:28982,51388:29123,51389:20873,51390:26579,51391:29924,51392:22756,51393:25880,51394:22199,51395:35753,51396:39286,51397:25200,51398:32469,51399:24825,51400:28909,51401:22764,51402:20161,51403:20154,51404:24525,51405:38887,51406:20219,51407:35748,51408:20995,51409:22922,51410:32427,51411:25172,51412:20173,51413:26085,51414:25102,51415:33592,51416:33993,51417:33635,51418:34701,51419:29076,51420:28342,51421:23481,51422:32466,51423:20887,51424:25545,51425:26580,51426:32905,51427:33593,51428:34837,51429:20754,51430:23418,51431:22914,51432:36785,51433:20083,51434:27741,51435:20837,51436:35109,51437:36719,51438:38446,51439:34122,51440:29790,51441:38160,51442:38384,51443:28070,51444:33509,51445:24369,51446:25746,51447:27922,51448:33832,51449:33134,51450:40131,51451:22622,51452:36187,51453:19977,51454:21441,51520:33917,51521:33918,51522:33919,51523:33920,51524:33921,51525:33923,51526:33924,51527:33925,51528:33926,51529:33930,51530:33933,51531:33935,51532:33936,51533:33937,51534:33938,51535:33939,51536:33940,51537:33941,51538:33942,51539:33944,51540:33946,51541:33947,51542:33949,51543:33950,51544:33951,51545:33952,51546:33954,51547:33955,51548:33956,51549:33957,51550:33958,51551:33959,51552:33960,51553:33961,51554:33962,51555:33963,51556:33964,51557:33965,51558:33966,51559:33968,51560:33969,51561:33971,51562:33973,51563:33974,51564:33975,51565:33979,51566:33980,51567:33982,51568:33984,51569:33986,51570:33987,51571:33989,51572:33990,51573:33991,51574:33992,51575:33995,51576:33996,51577:33998,51578:33999,51579:34002,51580:34004,51581:34005,51582:34007,51584:34008,51585:34009,51586:34010,51587:34011,51588:34012,51589:34014,51590:34017,51591:34018,51592:34020,51593:34023,51594:34024,51595:34025,51596:34026,51597:34027,51598:34029,51599:34030,51600:34031,51601:34033,51602:34034,51603:34035,51604:34036,51605:34037,51606:34038,51607:34039,51608:34040,51609:34041,51610:34042,51611:34043,51612:34045,51613:34046,51614:34048,51615:34049,51616:34050,51617:20254,51618:25955,51619:26705,51620:21971,51621:20007,51622:25620,51623:39578,51624:25195,51625:23234,51626:29791,51627:33394,51628:28073,51629:26862,51630:20711,51631:33678,51632:30722,51633:26432,51634:21049,51635:27801,51636:32433,51637:20667,51638:21861,51639:29022,51640:31579,51641:26194,51642:29642,51643:33515,51644:26441,51645:23665,51646:21024,51647:29053,51648:34923,51649:38378,51650:38485,51651:25797,51652:36193,51653:33203,51654:21892,51655:27733,51656:25159,51657:32558,51658:22674,51659:20260,51660:21830,51661:36175,51662:26188,51663:19978,51664:23578,51665:35059,51666:26786,51667:25422,51668:31245,51669:28903,51670:33421,51671:21242,51672:38902,51673:23569,51674:21736,51675:37045,51676:32461,51677:22882,51678:36170,51679:34503,51680:33292,51681:33293,51682:36198,51683:25668,51684:23556,51685:24913,51686:28041,51687:31038,51688:35774,51689:30775,51690:30003,51691:21627,51692:20280,51693:36523,51694:28145,51695:23072,51696:32453,51697:31070,51698:27784,51699:23457,51700:23158,51701:29978,51702:32958,51703:24910,51704:28183,51705:22768,51706:29983,51707:29989,51708:29298,51709:21319,51710:32499,51776:34051,51777:34052,51778:34053,51779:34054,51780:34055,51781:34056,51782:34057,51783:34058,51784:34059,51785:34061,51786:34062,51787:34063,51788:34064,51789:34066,51790:34068,51791:34069,51792:34070,51793:34072,51794:34073,51795:34075,51796:34076,51797:34077,51798:34078,51799:34080,51800:34082,51801:34083,51802:34084,51803:34085,51804:34086,51805:34087,51806:34088,51807:34089,51808:34090,51809:34093,51810:34094,51811:34095,51812:34096,51813:34097,51814:34098,51815:34099,51816:34100,51817:34101,51818:34102,51819:34110,51820:34111,51821:34112,51822:34113,51823:34114,51824:34116,51825:34117,51826:34118,51827:34119,51828:34123,51829:34124,51830:34125,51831:34126,51832:34127,51833:34128,51834:34129,51835:34130,51836:34131,51837:34132,51838:34133,51840:34135,51841:34136,51842:34138,51843:34139,51844:34140,51845:34141,51846:34143,51847:34144,51848:34145,51849:34146,51850:34147,51851:34149,51852:34150,51853:34151,51854:34153,51855:34154,51856:34155,51857:34156,51858:34157,51859:34158,51860:34159,51861:34160,51862:34161,51863:34163,51864:34165,51865:34166,51866:34167,51867:34168,51868:34172,51869:34173,51870:34175,51871:34176,51872:34177,51873:30465,51874:30427,51875:21097,51876:32988,51877:22307,51878:24072,51879:22833,51880:29422,51881:26045,51882:28287,51883:35799,51884:23608,51885:34417,51886:21313,51887:30707,51888:25342,51889:26102,51890:20160,51891:39135,51892:34432,51893:23454,51894:35782,51895:21490,51896:30690,51897:20351,51898:23630,51899:39542,51900:22987,51901:24335,51902:31034,51903:22763,51904:19990,51905:26623,51906:20107,51907:25325,51908:35475,51909:36893,51910:21183,51911:26159,51912:21980,51913:22124,51914:36866,51915:20181,51916:20365,51917:37322,51918:39280,51919:27663,51920:24066,51921:24643,51922:23460,51923:35270,51924:35797,51925:25910,51926:25163,51927:39318,51928:23432,51929:23551,51930:25480,51931:21806,51932:21463,51933:30246,51934:20861,51935:34092,51936:26530,51937:26803,51938:27530,51939:25234,51940:36755,51941:21460,51942:33298,51943:28113,51944:30095,51945:20070,51946:36174,51947:23408,51948:29087,51949:34223,51950:26257,51951:26329,51952:32626,51953:34560,51954:40653,51955:40736,51956:23646,51957:26415,51958:36848,51959:26641,51960:26463,51961:25101,51962:31446,51963:22661,51964:24246,51965:25968,51966:28465,52032:34178,52033:34179,52034:34182,52035:34184,52036:34185,52037:34186,52038:34187,52039:34188,52040:34189,52041:34190,52042:34192,52043:34193,52044:34194,52045:34195,52046:34196,52047:34197,52048:34198,52049:34199,52050:34200,52051:34201,52052:34202,52053:34205,52054:34206,52055:34207,52056:34208,52057:34209,52058:34210,52059:34211,52060:34213,52061:34214,52062:34215,52063:34217,52064:34219,52065:34220,52066:34221,52067:34225,52068:34226,52069:34227,52070:34228,52071:34229,52072:34230,52073:34232,52074:34234,52075:34235,52076:34236,52077:34237,52078:34238,52079:34239,52080:34240,52081:34242,52082:34243,52083:34244,52084:34245,52085:34246,52086:34247,52087:34248,52088:34250,52089:34251,52090:34252,52091:34253,52092:34254,52093:34257,52094:34258,52096:34260,52097:34262,52098:34263,52099:34264,52100:34265,52101:34266,52102:34267,52103:34269,52104:34270,52105:34271,52106:34272,52107:34273,52108:34274,52109:34275,52110:34277,52111:34278,52112:34279,52113:34280,52114:34282,52115:34283,52116:34284,52117:34285,52118:34286,52119:34287,52120:34288,52121:34289,52122:34290,52123:34291,52124:34292,52125:34293,52126:34294,52127:34295,52128:34296,52129:24661,52130:21047,52131:32781,52132:25684,52133:34928,52134:29993,52135:24069,52136:26643,52137:25332,52138:38684,52139:21452,52140:29245,52141:35841,52142:27700,52143:30561,52144:31246,52145:21550,52146:30636,52147:39034,52148:33308,52149:35828,52150:30805,52151:26388,52152:28865,52153:26031,52154:25749,52155:22070,52156:24605,52157:31169,52158:21496,52159:19997,52160:27515,52161:32902,52162:23546,52163:21987,52164:22235,52165:20282,52166:20284,52167:39282,52168:24051,52169:26494,52170:32824,52171:24578,52172:39042,52173:36865,52174:23435,52175:35772,52176:35829,52177:25628,52178:33368,52179:25822,52180:22013,52181:33487,52182:37221,52183:20439,52184:32032,52185:36895,52186:31903,52187:20723,52188:22609,52189:28335,52190:23487,52191:35785,52192:32899,52193:37240,52194:33948,52195:31639,52196:34429,52197:38539,52198:38543,52199:32485,52200:39635,52201:30862,52202:23681,52203:31319,52204:36930,52205:38567,52206:31071,52207:23385,52208:25439,52209:31499,52210:34001,52211:26797,52212:21766,52213:32553,52214:29712,52215:32034,52216:38145,52217:25152,52218:22604,52219:20182,52220:23427,52221:22905,52222:22612,52288:34297,52289:34298,52290:34300,52291:34301,52292:34302,52293:34304,52294:34305,52295:34306,52296:34307,52297:34308,52298:34310,52299:34311,52300:34312,52301:34313,52302:34314,52303:34315,52304:34316,52305:34317,52306:34318,52307:34319,52308:34320,52309:34322,52310:34323,52311:34324,52312:34325,52313:34327,52314:34328,52315:34329,52316:34330,52317:34331,52318:34332,52319:34333,52320:34334,52321:34335,52322:34336,52323:34337,52324:34338,52325:34339,52326:34340,52327:34341,52328:34342,52329:34344,52330:34346,52331:34347,52332:34348,52333:34349,52334:34350,52335:34351,52336:34352,52337:34353,52338:34354,52339:34355,52340:34356,52341:34357,52342:34358,52343:34359,52344:34361,52345:34362,52346:34363,52347:34365,52348:34366,52349:34367,52350:34368,52352:34369,52353:34370,52354:34371,52355:34372,52356:34373,52357:34374,52358:34375,52359:34376,52360:34377,52361:34378,52362:34379,52363:34380,52364:34386,52365:34387,52366:34389,52367:34390,52368:34391,52369:34392,52370:34393,52371:34395,52372:34396,52373:34397,52374:34399,52375:34400,52376:34401,52377:34403,52378:34404,52379:34405,52380:34406,52381:34407,52382:34408,52383:34409,52384:34410,52385:29549,52386:25374,52387:36427,52388:36367,52389:32974,52390:33492,52391:25260,52392:21488,52393:27888,52394:37214,52395:22826,52396:24577,52397:27760,52398:22349,52399:25674,52400:36138,52401:30251,52402:28393,52403:22363,52404:27264,52405:30192,52406:28525,52407:35885,52408:35848,52409:22374,52410:27631,52411:34962,52412:30899,52413:25506,52414:21497,52415:28845,52416:27748,52417:22616,52418:25642,52419:22530,52420:26848,52421:33179,52422:21776,52423:31958,52424:20504,52425:36538,52426:28108,52427:36255,52428:28907,52429:25487,52430:28059,52431:28372,52432:32486,52433:33796,52434:26691,52435:36867,52436:28120,52437:38518,52438:35752,52439:22871,52440:29305,52441:34276,52442:33150,52443:30140,52444:35466,52445:26799,52446:21076,52447:36386,52448:38161,52449:25552,52450:39064,52451:36420,52452:21884,52453:20307,52454:26367,52455:22159,52456:24789,52457:28053,52458:21059,52459:23625,52460:22825,52461:28155,52462:22635,52463:30000,52464:29980,52465:24684,52466:33300,52467:33094,52468:25361,52469:26465,52470:36834,52471:30522,52472:36339,52473:36148,52474:38081,52475:24086,52476:21381,52477:21548,52478:28867,52544:34413,52545:34415,52546:34416,52547:34418,52548:34419,52549:34420,52550:34421,52551:34422,52552:34423,52553:34424,52554:34435,52555:34436,52556:34437,52557:34438,52558:34439,52559:34440,52560:34441,52561:34446,52562:34447,52563:34448,52564:34449,52565:34450,52566:34452,52567:34454,52568:34455,52569:34456,52570:34457,52571:34458,52572:34459,52573:34462,52574:34463,52575:34464,52576:34465,52577:34466,52578:34469,52579:34470,52580:34475,52581:34477,52582:34478,52583:34482,52584:34483,52585:34487,52586:34488,52587:34489,52588:34491,52589:34492,52590:34493,52591:34494,52592:34495,52593:34497,52594:34498,52595:34499,52596:34501,52597:34504,52598:34508,52599:34509,52600:34514,52601:34515,52602:34517,52603:34518,52604:34519,52605:34522,52606:34524,52608:34525,52609:34528,52610:34529,52611:34530,52612:34531,52613:34533,52614:34534,52615:34535,52616:34536,52617:34538,52618:34539,52619:34540,52620:34543,52621:34549,52622:34550,52623:34551,52624:34554,52625:34555,52626:34556,52627:34557,52628:34559,52629:34561,52630:34564,52631:34565,52632:34566,52633:34571,52634:34572,52635:34574,52636:34575,52637:34576,52638:34577,52639:34580,52640:34582,52641:27712,52642:24311,52643:20572,52644:20141,52645:24237,52646:25402,52647:33351,52648:36890,52649:26704,52650:37230,52651:30643,52652:21516,52653:38108,52654:24420,52655:31461,52656:26742,52657:25413,52658:31570,52659:32479,52660:30171,52661:20599,52662:25237,52663:22836,52664:36879,52665:20984,52666:31171,52667:31361,52668:22270,52669:24466,52670:36884,52671:28034,52672:23648,52673:22303,52674:21520,52675:20820,52676:28237,52677:22242,52678:25512,52679:39059,52680:33151,52681:34581,52682:35114,52683:36864,52684:21534,52685:23663,52686:33216,52687:25302,52688:25176,52689:33073,52690:40501,52691:38464,52692:39534,52693:39548,52694:26925,52695:22949,52696:25299,52697:21822,52698:25366,52699:21703,52700:34521,52701:27964,52702:23043,52703:29926,52704:34972,52705:27498,52706:22806,52707:35916,52708:24367,52709:28286,52710:29609,52711:39037,52712:20024,52713:28919,52714:23436,52715:30871,52716:25405,52717:26202,52718:30358,52719:24779,52720:23451,52721:23113,52722:19975,52723:33109,52724:27754,52725:29579,52726:20129,52727:26505,52728:32593,52729:24448,52730:26106,52731:26395,52732:24536,52733:22916,52734:23041,52800:34585,52801:34587,52802:34589,52803:34591,52804:34592,52805:34596,52806:34598,52807:34599,52808:34600,52809:34602,52810:34603,52811:34604,52812:34605,52813:34607,52814:34608,52815:34610,52816:34611,52817:34613,52818:34614,52819:34616,52820:34617,52821:34618,52822:34620,52823:34621,52824:34624,52825:34625,52826:34626,52827:34627,52828:34628,52829:34629,52830:34630,52831:34634,52832:34635,52833:34637,52834:34639,52835:34640,52836:34641,52837:34642,52838:34644,52839:34645,52840:34646,52841:34648,52842:34650,52843:34651,52844:34652,52845:34653,52846:34654,52847:34655,52848:34657,52849:34658,52850:34662,52851:34663,52852:34664,52853:34665,52854:34666,52855:34667,52856:34668,52857:34669,52858:34671,52859:34673,52860:34674,52861:34675,52862:34677,52864:34679,52865:34680,52866:34681,52867:34682,52868:34687,52869:34688,52870:34689,52871:34692,52872:34694,52873:34695,52874:34697,52875:34698,52876:34700,52877:34702,52878:34703,52879:34704,52880:34705,52881:34706,52882:34708,52883:34709,52884:34710,52885:34712,52886:34713,52887:34714,52888:34715,52889:34716,52890:34717,52891:34718,52892:34720,52893:34721,52894:34722,52895:34723,52896:34724,52897:24013,52898:24494,52899:21361,52900:38886,52901:36829,52902:26693,52903:22260,52904:21807,52905:24799,52906:20026,52907:28493,52908:32500,52909:33479,52910:33806,52911:22996,52912:20255,52913:20266,52914:23614,52915:32428,52916:26410,52917:34074,52918:21619,52919:30031,52920:32963,52921:21890,52922:39759,52923:20301,52924:28205,52925:35859,52926:23561,52927:24944,52928:21355,52929:30239,52930:28201,52931:34442,52932:25991,52933:38395,52934:32441,52935:21563,52936:31283,52937:32010,52938:38382,52939:21985,52940:32705,52941:29934,52942:25373,52943:34583,52944:28065,52945:31389,52946:25105,52947:26017,52948:21351,52949:25569,52950:27779,52951:24043,52952:21596,52953:38056,52954:20044,52955:27745,52956:35820,52957:23627,52958:26080,52959:33436,52960:26791,52961:21566,52962:21556,52963:27595,52964:27494,52965:20116,52966:25410,52967:21320,52968:33310,52969:20237,52970:20398,52971:22366,52972:25098,52973:38654,52974:26212,52975:29289,52976:21247,52977:21153,52978:24735,52979:35823,52980:26132,52981:29081,52982:26512,52983:35199,52984:30802,52985:30717,52986:26224,52987:22075,52988:21560,52989:38177,52990:29306,53056:34725,53057:34726,53058:34727,53059:34729,53060:34730,53061:34734,53062:34736,53063:34737,53064:34738,53065:34740,53066:34742,53067:34743,53068:34744,53069:34745,53070:34747,53071:34748,53072:34750,53073:34751,53074:34753,53075:34754,53076:34755,53077:34756,53078:34757,53079:34759,53080:34760,53081:34761,53082:34764,53083:34765,53084:34766,53085:34767,53086:34768,53087:34772,53088:34773,53089:34774,53090:34775,53091:34776,53092:34777,53093:34778,53094:34780,53095:34781,53096:34782,53097:34783,53098:34785,53099:34786,53100:34787,53101:34788,53102:34790,53103:34791,53104:34792,53105:34793,53106:34795,53107:34796,53108:34797,53109:34799,53110:34800,53111:34801,53112:34802,53113:34803,53114:34804,53115:34805,53116:34806,53117:34807,53118:34808,53120:34810,53121:34811,53122:34812,53123:34813,53124:34815,53125:34816,53126:34817,53127:34818,53128:34820,53129:34821,53130:34822,53131:34823,53132:34824,53133:34825,53134:34827,53135:34828,53136:34829,53137:34830,53138:34831,53139:34832,53140:34833,53141:34834,53142:34836,53143:34839,53144:34840,53145:34841,53146:34842,53147:34844,53148:34845,53149:34846,53150:34847,53151:34848,53152:34851,53153:31232,53154:24687,53155:24076,53156:24713,53157:33181,53158:22805,53159:24796,53160:29060,53161:28911,53162:28330,53163:27728,53164:29312,53165:27268,53166:34989,53167:24109,53168:20064,53169:23219,53170:21916,53171:38115,53172:27927,53173:31995,53174:38553,53175:25103,53176:32454,53177:30606,53178:34430,53179:21283,53180:38686,53181:36758,53182:26247,53183:23777,53184:20384,53185:29421,53186:19979,53187:21414,53188:22799,53189:21523,53190:25472,53191:38184,53192:20808,53193:20185,53194:40092,53195:32420,53196:21688,53197:36132,53198:34900,53199:33335,53200:38386,53201:28046,53202:24358,53203:23244,53204:26174,53205:38505,53206:29616,53207:29486,53208:21439,53209:33146,53210:39301,53211:32673,53212:23466,53213:38519,53214:38480,53215:32447,53216:30456,53217:21410,53218:38262,53219:39321,53220:31665,53221:35140,53222:28248,53223:20065,53224:32724,53225:31077,53226:35814,53227:24819,53228:21709,53229:20139,53230:39033,53231:24055,53232:27233,53233:20687,53234:21521,53235:35937,53236:33831,53237:30813,53238:38660,53239:21066,53240:21742,53241:22179,53242:38144,53243:28040,53244:23477,53245:28102,53246:26195,53312:34852,53313:34853,53314:34854,53315:34855,53316:34856,53317:34857,53318:34858,53319:34859,53320:34860,53321:34861,53322:34862,53323:34863,53324:34864,53325:34865,53326:34867,53327:34868,53328:34869,53329:34870,53330:34871,53331:34872,53332:34874,53333:34875,53334:34877,53335:34878,53336:34879,53337:34881,53338:34882,53339:34883,53340:34886,53341:34887,53342:34888,53343:34889,53344:34890,53345:34891,53346:34894,53347:34895,53348:34896,53349:34897,53350:34898,53351:34899,53352:34901,53353:34902,53354:34904,53355:34906,53356:34907,53357:34908,53358:34909,53359:34910,53360:34911,53361:34912,53362:34918,53363:34919,53364:34922,53365:34925,53366:34927,53367:34929,53368:34931,53369:34932,53370:34933,53371:34934,53372:34936,53373:34937,53374:34938,53376:34939,53377:34940,53378:34944,53379:34947,53380:34950,53381:34951,53382:34953,53383:34954,53384:34956,53385:34958,53386:34959,53387:34960,53388:34961,53389:34963,53390:34964,53391:34965,53392:34967,53393:34968,53394:34969,53395:34970,53396:34971,53397:34973,53398:34974,53399:34975,53400:34976,53401:34977,53402:34979,53403:34981,53404:34982,53405:34983,53406:34984,53407:34985,53408:34986,53409:23567,53410:23389,53411:26657,53412:32918,53413:21880,53414:31505,53415:25928,53416:26964,53417:20123,53418:27463,53419:34638,53420:38795,53421:21327,53422:25375,53423:25658,53424:37034,53425:26012,53426:32961,53427:35856,53428:20889,53429:26800,53430:21368,53431:34809,53432:25032,53433:27844,53434:27899,53435:35874,53436:23633,53437:34218,53438:33455,53439:38156,53440:27427,53441:36763,53442:26032,53443:24571,53444:24515,53445:20449,53446:34885,53447:26143,53448:33125,53449:29481,53450:24826,53451:20852,53452:21009,53453:22411,53454:24418,53455:37026,53456:34892,53457:37266,53458:24184,53459:26447,53460:24615,53461:22995,53462:20804,53463:20982,53464:33016,53465:21256,53466:27769,53467:38596,53468:29066,53469:20241,53470:20462,53471:32670,53472:26429,53473:21957,53474:38152,53475:31168,53476:34966,53477:32483,53478:22687,53479:25100,53480:38656,53481:34394,53482:22040,53483:39035,53484:24464,53485:35768,53486:33988,53487:37207,53488:21465,53489:26093,53490:24207,53491:30044,53492:24676,53493:32110,53494:23167,53495:32490,53496:32493,53497:36713,53498:21927,53499:23459,53500:24748,53501:26059,53502:29572,53568:34988,53569:34990,53570:34991,53571:34992,53572:34994,53573:34995,53574:34996,53575:34997,53576:34998,53577:35000,53578:35001,53579:35002,53580:35003,53581:35005,53582:35006,53583:35007,53584:35008,53585:35011,53586:35012,53587:35015,53588:35016,53589:35018,53590:35019,53591:35020,53592:35021,53593:35023,53594:35024,53595:35025,53596:35027,53597:35030,53598:35031,53599:35034,53600:35035,53601:35036,53602:35037,53603:35038,53604:35040,53605:35041,53606:35046,53607:35047,53608:35049,53609:35050,53610:35051,53611:35052,53612:35053,53613:35054,53614:35055,53615:35058,53616:35061,53617:35062,53618:35063,53619:35066,53620:35067,53621:35069,53622:35071,53623:35072,53624:35073,53625:35075,53626:35076,53627:35077,53628:35078,53629:35079,53630:35080,53632:35081,53633:35083,53634:35084,53635:35085,53636:35086,53637:35087,53638:35089,53639:35092,53640:35093,53641:35094,53642:35095,53643:35096,53644:35100,53645:35101,53646:35102,53647:35103,53648:35104,53649:35106,53650:35107,53651:35108,53652:35110,53653:35111,53654:35112,53655:35113,53656:35116,53657:35117,53658:35118,53659:35119,53660:35121,53661:35122,53662:35123,53663:35125,53664:35127,53665:36873,53666:30307,53667:30505,53668:32474,53669:38772,53670:34203,53671:23398,53672:31348,53673:38634,53674:34880,53675:21195,53676:29071,53677:24490,53678:26092,53679:35810,53680:23547,53681:39535,53682:24033,53683:27529,53684:27739,53685:35757,53686:35759,53687:36874,53688:36805,53689:21387,53690:25276,53691:40486,53692:40493,53693:21568,53694:20011,53695:33469,53696:29273,53697:34460,53698:23830,53699:34905,53700:28079,53701:38597,53702:21713,53703:20122,53704:35766,53705:28937,53706:21693,53707:38409,53708:28895,53709:28153,53710:30416,53711:20005,53712:30740,53713:34578,53714:23721,53715:24310,53716:35328,53717:39068,53718:38414,53719:28814,53720:27839,53721:22852,53722:25513,53723:30524,53724:34893,53725:28436,53726:33395,53727:22576,53728:29141,53729:21388,53730:30746,53731:38593,53732:21761,53733:24422,53734:28976,53735:23476,53736:35866,53737:39564,53738:27523,53739:22830,53740:40495,53741:31207,53742:26472,53743:25196,53744:20335,53745:30113,53746:32650,53747:27915,53748:38451,53749:27687,53750:20208,53751:30162,53752:20859,53753:26679,53754:28478,53755:36992,53756:33136,53757:22934,53758:29814,53824:35128,53825:35129,53826:35130,53827:35131,53828:35132,53829:35133,53830:35134,53831:35135,53832:35136,53833:35138,53834:35139,53835:35141,53836:35142,53837:35143,53838:35144,53839:35145,53840:35146,53841:35147,53842:35148,53843:35149,53844:35150,53845:35151,53846:35152,53847:35153,53848:35154,53849:35155,53850:35156,53851:35157,53852:35158,53853:35159,53854:35160,53855:35161,53856:35162,53857:35163,53858:35164,53859:35165,53860:35168,53861:35169,53862:35170,53863:35171,53864:35172,53865:35173,53866:35175,53867:35176,53868:35177,53869:35178,53870:35179,53871:35180,53872:35181,53873:35182,53874:35183,53875:35184,53876:35185,53877:35186,53878:35187,53879:35188,53880:35189,53881:35190,53882:35191,53883:35192,53884:35193,53885:35194,53886:35196,53888:35197,53889:35198,53890:35200,53891:35202,53892:35204,53893:35205,53894:35207,53895:35208,53896:35209,53897:35210,53898:35211,53899:35212,53900:35213,53901:35214,53902:35215,53903:35216,53904:35217,53905:35218,53906:35219,53907:35220,53908:35221,53909:35222,53910:35223,53911:35224,53912:35225,53913:35226,53914:35227,53915:35228,53916:35229,53917:35230,53918:35231,53919:35232,53920:35233,53921:25671,53922:23591,53923:36965,53924:31377,53925:35875,53926:23002,53927:21676,53928:33280,53929:33647,53930:35201,53931:32768,53932:26928,53933:22094,53934:32822,53935:29239,53936:37326,53937:20918,53938:20063,53939:39029,53940:25494,53941:19994,53942:21494,53943:26355,53944:33099,53945:22812,53946:28082,53947:19968,53948:22777,53949:21307,53950:25558,53951:38129,53952:20381,53953:20234,53954:34915,53955:39056,53956:22839,53957:36951,53958:31227,53959:20202,53960:33008,53961:30097,53962:27778,53963:23452,53964:23016,53965:24413,53966:26885,53967:34433,53968:20506,53969:24050,53970:20057,53971:30691,53972:20197,53973:33402,53974:25233,53975:26131,53976:37009,53977:23673,53978:20159,53979:24441,53980:33222,53981:36920,53982:32900,53983:30123,53984:20134,53985:35028,53986:24847,53987:27589,53988:24518,53989:20041,53990:30410,53991:28322,53992:35811,53993:35758,53994:35850,53995:35793,53996:24322,53997:32764,53998:32716,53999:32462,54000:33589,54001:33643,54002:22240,54003:27575,54004:38899,54005:38452,54006:23035,54007:21535,54008:38134,54009:28139,54010:23493,54011:39278,54012:23609,54013:24341,54014:38544,54080:35234,54081:35235,54082:35236,54083:35237,54084:35238,54085:35239,54086:35240,54087:35241,54088:35242,54089:35243,54090:35244,54091:35245,54092:35246,54093:35247,54094:35248,54095:35249,54096:35250,54097:35251,54098:35252,54099:35253,54100:35254,54101:35255,54102:35256,54103:35257,54104:35258,54105:35259,54106:35260,54107:35261,54108:35262,54109:35263,54110:35264,54111:35267,54112:35277,54113:35283,54114:35284,54115:35285,54116:35287,54117:35288,54118:35289,54119:35291,54120:35293,54121:35295,54122:35296,54123:35297,54124:35298,54125:35300,54126:35303,54127:35304,54128:35305,54129:35306,54130:35308,54131:35309,54132:35310,54133:35312,54134:35313,54135:35314,54136:35316,54137:35317,54138:35318,54139:35319,54140:35320,54141:35321,54142:35322,54144:35323,54145:35324,54146:35325,54147:35326,54148:35327,54149:35329,54150:35330,54151:35331,54152:35332,54153:35333,54154:35334,54155:35336,54156:35337,54157:35338,54158:35339,54159:35340,54160:35341,54161:35342,54162:35343,54163:35344,54164:35345,54165:35346,54166:35347,54167:35348,54168:35349,54169:35350,54170:35351,54171:35352,54172:35353,54173:35354,54174:35355,54175:35356,54176:35357,54177:21360,54178:33521,54179:27185,54180:23156,54181:40560,54182:24212,54183:32552,54184:33721,54185:33828,54186:33829,54187:33639,54188:34631,54189:36814,54190:36194,54191:30408,54192:24433,54193:39062,54194:30828,54195:26144,54196:21727,54197:25317,54198:20323,54199:33219,54200:30152,54201:24248,54202:38605,54203:36362,54204:34553,54205:21647,54206:27891,54207:28044,54208:27704,54209:24703,54210:21191,54211:29992,54212:24189,54213:20248,54214:24736,54215:24551,54216:23588,54217:30001,54218:37038,54219:38080,54220:29369,54221:27833,54222:28216,54223:37193,54224:26377,54225:21451,54226:21491,54227:20305,54228:37321,54229:35825,54230:21448,54231:24188,54232:36802,54233:28132,54234:20110,54235:30402,54236:27014,54237:34398,54238:24858,54239:33286,54240:20313,54241:20446,54242:36926,54243:40060,54244:24841,54245:28189,54246:28180,54247:38533,54248:20104,54249:23089,54250:38632,54251:19982,54252:23679,54253:31161,54254:23431,54255:35821,54256:32701,54257:29577,54258:22495,54259:33419,54260:37057,54261:21505,54262:36935,54263:21947,54264:23786,54265:24481,54266:24840,54267:27442,54268:29425,54269:32946,54270:35465,54336:35358,54337:35359,54338:35360,54339:35361,54340:35362,54341:35363,54342:35364,54343:35365,54344:35366,54345:35367,54346:35368,54347:35369,54348:35370,54349:35371,54350:35372,54351:35373,54352:35374,54353:35375,54354:35376,54355:35377,54356:35378,54357:35379,54358:35380,54359:35381,54360:35382,54361:35383,54362:35384,54363:35385,54364:35386,54365:35387,54366:35388,54367:35389,54368:35391,54369:35392,54370:35393,54371:35394,54372:35395,54373:35396,54374:35397,54375:35398,54376:35399,54377:35401,54378:35402,54379:35403,54380:35404,54381:35405,54382:35406,54383:35407,54384:35408,54385:35409,54386:35410,54387:35411,54388:35412,54389:35413,54390:35414,54391:35415,54392:35416,54393:35417,54394:35418,54395:35419,54396:35420,54397:35421,54398:35422,54400:35423,54401:35424,54402:35425,54403:35426,54404:35427,54405:35428,54406:35429,54407:35430,54408:35431,54409:35432,54410:35433,54411:35434,54412:35435,54413:35436,54414:35437,54415:35438,54416:35439,54417:35440,54418:35441,54419:35442,54420:35443,54421:35444,54422:35445,54423:35446,54424:35447,54425:35448,54426:35450,54427:35451,54428:35452,54429:35453,54430:35454,54431:35455,54432:35456,54433:28020,54434:23507,54435:35029,54436:39044,54437:35947,54438:39533,54439:40499,54440:28170,54441:20900,54442:20803,54443:22435,54444:34945,54445:21407,54446:25588,54447:36757,54448:22253,54449:21592,54450:22278,54451:29503,54452:28304,54453:32536,54454:36828,54455:33489,54456:24895,54457:24616,54458:38498,54459:26352,54460:32422,54461:36234,54462:36291,54463:38053,54464:23731,54465:31908,54466:26376,54467:24742,54468:38405,54469:32792,54470:20113,54471:37095,54472:21248,54473:38504,54474:20801,54475:36816,54476:34164,54477:37213,54478:26197,54479:38901,54480:23381,54481:21277,54482:30776,54483:26434,54484:26685,54485:21705,54486:28798,54487:23472,54488:36733,54489:20877,54490:22312,54491:21681,54492:25874,54493:26242,54494:36190,54495:36163,54496:33039,54497:33900,54498:36973,54499:31967,54500:20991,54501:34299,54502:26531,54503:26089,54504:28577,54505:34468,54506:36481,54507:22122,54508:36896,54509:30338,54510:28790,54511:29157,54512:36131,54513:25321,54514:21017,54515:27901,54516:36156,54517:24590,54518:22686,54519:24974,54520:26366,54521:36192,54522:25166,54523:21939,54524:28195,54525:26413,54526:36711,54592:35457,54593:35458,54594:35459,54595:35460,54596:35461,54597:35462,54598:35463,54599:35464,54600:35467,54601:35468,54602:35469,54603:35470,54604:35471,54605:35472,54606:35473,54607:35474,54608:35476,54609:35477,54610:35478,54611:35479,54612:35480,54613:35481,54614:35482,54615:35483,54616:35484,54617:35485,54618:35486,54619:35487,54620:35488,54621:35489,54622:35490,54623:35491,54624:35492,54625:35493,54626:35494,54627:35495,54628:35496,54629:35497,54630:35498,54631:35499,54632:35500,54633:35501,54634:35502,54635:35503,54636:35504,54637:35505,54638:35506,54639:35507,54640:35508,54641:35509,54642:35510,54643:35511,54644:35512,54645:35513,54646:35514,54647:35515,54648:35516,54649:35517,54650:35518,54651:35519,54652:35520,54653:35521,54654:35522,54656:35523,54657:35524,54658:35525,54659:35526,54660:35527,54661:35528,54662:35529,54663:35530,54664:35531,54665:35532,54666:35533,54667:35534,54668:35535,54669:35536,54670:35537,54671:35538,54672:35539,54673:35540,54674:35541,54675:35542,54676:35543,54677:35544,54678:35545,54679:35546,54680:35547,54681:35548,54682:35549,54683:35550,54684:35551,54685:35552,54686:35553,54687:35554,54688:35555,54689:38113,54690:38392,54691:30504,54692:26629,54693:27048,54694:21643,54695:20045,54696:28856,54697:35784,54698:25688,54699:25995,54700:23429,54701:31364,54702:20538,54703:23528,54704:30651,54705:27617,54706:35449,54707:31896,54708:27838,54709:30415,54710:26025,54711:36759,54712:23853,54713:23637,54714:34360,54715:26632,54716:21344,54717:25112,54718:31449,54719:28251,54720:32509,54721:27167,54722:31456,54723:24432,54724:28467,54725:24352,54726:25484,54727:28072,54728:26454,54729:19976,54730:24080,54731:36134,54732:20183,54733:32960,54734:30260,54735:38556,54736:25307,54737:26157,54738:25214,54739:27836,54740:36213,54741:29031,54742:32617,54743:20806,54744:32903,54745:21484,54746:36974,54747:25240,54748:21746,54749:34544,54750:36761,54751:32773,54752:38167,54753:34071,54754:36825,54755:27993,54756:29645,54757:26015,54758:30495,54759:29956,54760:30759,54761:33275,54762:36126,54763:38024,54764:20390,54765:26517,54766:30137,54767:35786,54768:38663,54769:25391,54770:38215,54771:38453,54772:33976,54773:25379,54774:30529,54775:24449,54776:29424,54777:20105,54778:24596,54779:25972,54780:25327,54781:27491,54782:25919,54848:35556,54849:35557,54850:35558,54851:35559,54852:35560,54853:35561,54854:35562,54855:35563,54856:35564,54857:35565,54858:35566,54859:35567,54860:35568,54861:35569,54862:35570,54863:35571,54864:35572,54865:35573,54866:35574,54867:35575,54868:35576,54869:35577,54870:35578,54871:35579,54872:35580,54873:35581,54874:35582,54875:35583,54876:35584,54877:35585,54878:35586,54879:35587,54880:35588,54881:35589,54882:35590,54883:35592,54884:35593,54885:35594,54886:35595,54887:35596,54888:35597,54889:35598,54890:35599,54891:35600,54892:35601,54893:35602,54894:35603,54895:35604,54896:35605,54897:35606,54898:35607,54899:35608,54900:35609,54901:35610,54902:35611,54903:35612,54904:35613,54905:35614,54906:35615,54907:35616,54908:35617,54909:35618,54910:35619,54912:35620,54913:35621,54914:35623,54915:35624,54916:35625,54917:35626,54918:35627,54919:35628,54920:35629,54921:35630,54922:35631,54923:35632,54924:35633,54925:35634,54926:35635,54927:35636,54928:35637,54929:35638,54930:35639,54931:35640,54932:35641,54933:35642,54934:35643,54935:35644,54936:35645,54937:35646,54938:35647,54939:35648,54940:35649,54941:35650,54942:35651,54943:35652,54944:35653,54945:24103,54946:30151,54947:37073,54948:35777,54949:33437,54950:26525,54951:25903,54952:21553,54953:34584,54954:30693,54955:32930,54956:33026,54957:27713,54958:20043,54959:32455,54960:32844,54961:30452,54962:26893,54963:27542,54964:25191,54965:20540,54966:20356,54967:22336,54968:25351,54969:27490,54970:36286,54971:21482,54972:26088,54973:32440,54974:24535,54975:25370,54976:25527,54977:33267,54978:33268,54979:32622,54980:24092,54981:23769,54982:21046,54983:26234,54984:31209,54985:31258,54986:36136,54987:28825,54988:30164,54989:28382,54990:27835,54991:31378,54992:20013,54993:30405,54994:24544,54995:38047,54996:34935,54997:32456,54998:31181,54999:32959,55000:37325,55001:20210,55002:20247,55003:33311,55004:21608,55005:24030,55006:27954,55007:35788,55008:31909,55009:36724,55010:32920,55011:24090,55012:21650,55013:30385,55014:23449,55015:26172,55016:39588,55017:29664,55018:26666,55019:34523,55020:26417,55021:29482,55022:35832,55023:35803,55024:36880,55025:31481,55026:28891,55027:29038,55028:25284,55029:30633,55030:22065,55031:20027,55032:33879,55033:26609,55034:21161,55035:34496,55036:36142,55037:38136,55038:31569,55104:35654,55105:35655,55106:35656,55107:35657,55108:35658,55109:35659,55110:35660,55111:35661,55112:35662,55113:35663,55114:35664,55115:35665,55116:35666,55117:35667,55118:35668,55119:35669,55120:35670,55121:35671,55122:35672,55123:35673,55124:35674,55125:35675,55126:35676,55127:35677,55128:35678,55129:35679,55130:35680,55131:35681,55132:35682,55133:35683,55134:35684,55135:35685,55136:35687,55137:35688,55138:35689,55139:35690,55140:35691,55141:35693,55142:35694,55143:35695,55144:35696,55145:35697,55146:35698,55147:35699,55148:35700,55149:35701,55150:35702,55151:35703,55152:35704,55153:35705,55154:35706,55155:35707,55156:35708,55157:35709,55158:35710,55159:35711,55160:35712,55161:35713,55162:35714,55163:35715,55164:35716,55165:35717,55166:35718,55168:35719,55169:35720,55170:35721,55171:35722,55172:35723,55173:35724,55174:35725,55175:35726,55176:35727,55177:35728,55178:35729,55179:35730,55180:35731,55181:35732,55182:35733,55183:35734,55184:35735,55185:35736,55186:35737,55187:35738,55188:35739,55189:35740,55190:35741,55191:35742,55192:35743,55193:35756,55194:35761,55195:35771,55196:35783,55197:35792,55198:35818,55199:35849,55200:35870,55201:20303,55202:27880,55203:31069,55204:39547,55205:25235,55206:29226,55207:25341,55208:19987,55209:30742,55210:36716,55211:25776,55212:36186,55213:31686,55214:26729,55215:24196,55216:35013,55217:22918,55218:25758,55219:22766,55220:29366,55221:26894,55222:38181,55223:36861,55224:36184,55225:22368,55226:32512,55227:35846,55228:20934,55229:25417,55230:25305,55231:21331,55232:26700,55233:29730,55234:33537,55235:37196,55236:21828,55237:30528,55238:28796,55239:27978,55240:20857,55241:21672,55242:36164,55243:23039,55244:28363,55245:28100,55246:23388,55247:32043,55248:20180,55249:31869,55250:28371,55251:23376,55252:33258,55253:28173,55254:23383,55255:39683,55256:26837,55257:36394,55258:23447,55259:32508,55260:24635,55261:32437,55262:37049,55263:36208,55264:22863,55265:25549,55266:31199,55267:36275,55268:21330,55269:26063,55270:31062,55271:35781,55272:38459,55273:32452,55274:38075,55275:32386,55276:22068,55277:37257,55278:26368,55279:32618,55280:23562,55281:36981,55282:26152,55283:24038,55284:20304,55285:26590,55286:20570,55287:20316,55288:22352,55289:24231,55290:59408,55291:59409,55292:59410,55293:59411,55294:59412,55360:35896,55361:35897,55362:35898,55363:35899,55364:35900,55365:35901,55366:35902,55367:35903,55368:35904,55369:35906,55370:35907,55371:35908,55372:35909,55373:35912,55374:35914,55375:35915,55376:35917,55377:35918,55378:35919,55379:35920,55380:35921,55381:35922,55382:35923,55383:35924,55384:35926,55385:35927,55386:35928,55387:35929,55388:35931,55389:35932,55390:35933,55391:35934,55392:35935,55393:35936,55394:35939,55395:35940,55396:35941,55397:35942,55398:35943,55399:35944,55400:35945,55401:35948,55402:35949,55403:35950,55404:35951,55405:35952,55406:35953,55407:35954,55408:35956,55409:35957,55410:35958,55411:35959,55412:35963,55413:35964,55414:35965,55415:35966,55416:35967,55417:35968,55418:35969,55419:35971,55420:35972,55421:35974,55422:35975,55424:35976,55425:35979,55426:35981,55427:35982,55428:35983,55429:35984,55430:35985,55431:35986,55432:35987,55433:35989,55434:35990,55435:35991,55436:35993,55437:35994,55438:35995,55439:35996,55440:35997,55441:35998,55442:35999,55443:36000,55444:36001,55445:36002,55446:36003,55447:36004,55448:36005,55449:36006,55450:36007,55451:36008,55452:36009,55453:36010,55454:36011,55455:36012,55456:36013,55457:20109,55458:19980,55459:20800,55460:19984,55461:24319,55462:21317,55463:19989,55464:20120,55465:19998,55466:39730,55467:23404,55468:22121,55469:20008,55470:31162,55471:20031,55472:21269,55473:20039,55474:22829,55475:29243,55476:21358,55477:27664,55478:22239,55479:32996,55480:39319,55481:27603,55482:30590,55483:40727,55484:20022,55485:20127,55486:40720,55487:20060,55488:20073,55489:20115,55490:33416,55491:23387,55492:21868,55493:22031,55494:20164,55495:21389,55496:21405,55497:21411,55498:21413,55499:21422,55500:38757,55501:36189,55502:21274,55503:21493,55504:21286,55505:21294,55506:21310,55507:36188,55508:21350,55509:21347,55510:20994,55511:21000,55512:21006,55513:21037,55514:21043,55515:21055,55516:21056,55517:21068,55518:21086,55519:21089,55520:21084,55521:33967,55522:21117,55523:21122,55524:21121,55525:21136,55526:21139,55527:20866,55528:32596,55529:20155,55530:20163,55531:20169,55532:20162,55533:20200,55534:20193,55535:20203,55536:20190,55537:20251,55538:20211,55539:20258,55540:20324,55541:20213,55542:20261,55543:20263,55544:20233,55545:20267,55546:20318,55547:20327,55548:25912,55549:20314,55550:20317,55616:36014,55617:36015,55618:36016,55619:36017,55620:36018,55621:36019,55622:36020,55623:36021,55624:36022,55625:36023,55626:36024,55627:36025,55628:36026,55629:36027,55630:36028,55631:36029,55632:36030,55633:36031,55634:36032,55635:36033,55636:36034,55637:36035,55638:36036,55639:36037,55640:36038,55641:36039,55642:36040,55643:36041,55644:36042,55645:36043,55646:36044,55647:36045,55648:36046,55649:36047,55650:36048,55651:36049,55652:36050,55653:36051,55654:36052,55655:36053,55656:36054,55657:36055,55658:36056,55659:36057,55660:36058,55661:36059,55662:36060,55663:36061,55664:36062,55665:36063,55666:36064,55667:36065,55668:36066,55669:36067,55670:36068,55671:36069,55672:36070,55673:36071,55674:36072,55675:36073,55676:36074,55677:36075,55678:36076,55680:36077,55681:36078,55682:36079,55683:36080,55684:36081,55685:36082,55686:36083,55687:36084,55688:36085,55689:36086,55690:36087,55691:36088,55692:36089,55693:36090,55694:36091,55695:36092,55696:36093,55697:36094,55698:36095,55699:36096,55700:36097,55701:36098,55702:36099,55703:36100,55704:36101,55705:36102,55706:36103,55707:36104,55708:36105,55709:36106,55710:36107,55711:36108,55712:36109,55713:20319,55714:20311,55715:20274,55716:20285,55717:20342,55718:20340,55719:20369,55720:20361,55721:20355,55722:20367,55723:20350,55724:20347,55725:20394,55726:20348,55727:20396,55728:20372,55729:20454,55730:20456,55731:20458,55732:20421,55733:20442,55734:20451,55735:20444,55736:20433,55737:20447,55738:20472,55739:20521,55740:20556,55741:20467,55742:20524,55743:20495,55744:20526,55745:20525,55746:20478,55747:20508,55748:20492,55749:20517,55750:20520,55751:20606,55752:20547,55753:20565,55754:20552,55755:20558,55756:20588,55757:20603,55758:20645,55759:20647,55760:20649,55761:20666,55762:20694,55763:20742,55764:20717,55765:20716,55766:20710,55767:20718,55768:20743,55769:20747,55770:20189,55771:27709,55772:20312,55773:20325,55774:20430,55775:40864,55776:27718,55777:31860,55778:20846,55779:24061,55780:40649,55781:39320,55782:20865,55783:22804,55784:21241,55785:21261,55786:35335,55787:21264,55788:20971,55789:22809,55790:20821,55791:20128,55792:20822,55793:20147,55794:34926,55795:34980,55796:20149,55797:33044,55798:35026,55799:31104,55800:23348,55801:34819,55802:32696,55803:20907,55804:20913,55805:20925,55806:20924,55872:36110,55873:36111,55874:36112,55875:36113,55876:36114,55877:36115,55878:36116,55879:36117,55880:36118,55881:36119,55882:36120,55883:36121,55884:36122,55885:36123,55886:36124,55887:36128,55888:36177,55889:36178,55890:36183,55891:36191,55892:36197,55893:36200,55894:36201,55895:36202,55896:36204,55897:36206,55898:36207,55899:36209,55900:36210,55901:36216,55902:36217,55903:36218,55904:36219,55905:36220,55906:36221,55907:36222,55908:36223,55909:36224,55910:36226,55911:36227,55912:36230,55913:36231,55914:36232,55915:36233,55916:36236,55917:36237,55918:36238,55919:36239,55920:36240,55921:36242,55922:36243,55923:36245,55924:36246,55925:36247,55926:36248,55927:36249,55928:36250,55929:36251,55930:36252,55931:36253,55932:36254,55933:36256,55934:36257,55936:36258,55937:36260,55938:36261,55939:36262,55940:36263,55941:36264,55942:36265,55943:36266,55944:36267,55945:36268,55946:36269,55947:36270,55948:36271,55949:36272,55950:36274,55951:36278,55952:36279,55953:36281,55954:36283,55955:36285,55956:36288,55957:36289,55958:36290,55959:36293,55960:36295,55961:36296,55962:36297,55963:36298,55964:36301,55965:36304,55966:36306,55967:36307,55968:36308,55969:20935,55970:20886,55971:20898,55972:20901,55973:35744,55974:35750,55975:35751,55976:35754,55977:35764,55978:35765,55979:35767,55980:35778,55981:35779,55982:35787,55983:35791,55984:35790,55985:35794,55986:35795,55987:35796,55988:35798,55989:35800,55990:35801,55991:35804,55992:35807,55993:35808,55994:35812,55995:35816,55996:35817,55997:35822,55998:35824,55999:35827,56000:35830,56001:35833,56002:35836,56003:35839,56004:35840,56005:35842,56006:35844,56007:35847,56008:35852,56009:35855,56010:35857,56011:35858,56012:35860,56013:35861,56014:35862,56015:35865,56016:35867,56017:35864,56018:35869,56019:35871,56020:35872,56021:35873,56022:35877,56023:35879,56024:35882,56025:35883,56026:35886,56027:35887,56028:35890,56029:35891,56030:35893,56031:35894,56032:21353,56033:21370,56034:38429,56035:38434,56036:38433,56037:38449,56038:38442,56039:38461,56040:38460,56041:38466,56042:38473,56043:38484,56044:38495,56045:38503,56046:38508,56047:38514,56048:38516,56049:38536,56050:38541,56051:38551,56052:38576,56053:37015,56054:37019,56055:37021,56056:37017,56057:37036,56058:37025,56059:37044,56060:37043,56061:37046,56062:37050,56128:36309,56129:36312,56130:36313,56131:36316,56132:36320,56133:36321,56134:36322,56135:36325,56136:36326,56137:36327,56138:36329,56139:36333,56140:36334,56141:36336,56142:36337,56143:36338,56144:36340,56145:36342,56146:36348,56147:36350,56148:36351,56149:36352,56150:36353,56151:36354,56152:36355,56153:36356,56154:36358,56155:36359,56156:36360,56157:36363,56158:36365,56159:36366,56160:36368,56161:36369,56162:36370,56163:36371,56164:36373,56165:36374,56166:36375,56167:36376,56168:36377,56169:36378,56170:36379,56171:36380,56172:36384,56173:36385,56174:36388,56175:36389,56176:36390,56177:36391,56178:36392,56179:36395,56180:36397,56181:36400,56182:36402,56183:36403,56184:36404,56185:36406,56186:36407,56187:36408,56188:36411,56189:36412,56190:36414,56192:36415,56193:36419,56194:36421,56195:36422,56196:36428,56197:36429,56198:36430,56199:36431,56200:36432,56201:36435,56202:36436,56203:36437,56204:36438,56205:36439,56206:36440,56207:36442,56208:36443,56209:36444,56210:36445,56211:36446,56212:36447,56213:36448,56214:36449,56215:36450,56216:36451,56217:36452,56218:36453,56219:36455,56220:36456,56221:36458,56222:36459,56223:36462,56224:36465,56225:37048,56226:37040,56227:37071,56228:37061,56229:37054,56230:37072,56231:37060,56232:37063,56233:37075,56234:37094,56235:37090,56236:37084,56237:37079,56238:37083,56239:37099,56240:37103,56241:37118,56242:37124,56243:37154,56244:37150,56245:37155,56246:37169,56247:37167,56248:37177,56249:37187,56250:37190,56251:21005,56252:22850,56253:21154,56254:21164,56255:21165,56256:21182,56257:21759,56258:21200,56259:21206,56260:21232,56261:21471,56262:29166,56263:30669,56264:24308,56265:20981,56266:20988,56267:39727,56268:21430,56269:24321,56270:30042,56271:24047,56272:22348,56273:22441,56274:22433,56275:22654,56276:22716,56277:22725,56278:22737,56279:22313,56280:22316,56281:22314,56282:22323,56283:22329,56284:22318,56285:22319,56286:22364,56287:22331,56288:22338,56289:22377,56290:22405,56291:22379,56292:22406,56293:22396,56294:22395,56295:22376,56296:22381,56297:22390,56298:22387,56299:22445,56300:22436,56301:22412,56302:22450,56303:22479,56304:22439,56305:22452,56306:22419,56307:22432,56308:22485,56309:22488,56310:22490,56311:22489,56312:22482,56313:22456,56314:22516,56315:22511,56316:22520,56317:22500,56318:22493,56384:36467,56385:36469,56386:36471,56387:36472,56388:36473,56389:36474,56390:36475,56391:36477,56392:36478,56393:36480,56394:36482,56395:36483,56396:36484,56397:36486,56398:36488,56399:36489,56400:36490,56401:36491,56402:36492,56403:36493,56404:36494,56405:36497,56406:36498,56407:36499,56408:36501,56409:36502,56410:36503,56411:36504,56412:36505,56413:36506,56414:36507,56415:36509,56416:36511,56417:36512,56418:36513,56419:36514,56420:36515,56421:36516,56422:36517,56423:36518,56424:36519,56425:36520,56426:36521,56427:36522,56428:36525,56429:36526,56430:36528,56431:36529,56432:36531,56433:36532,56434:36533,56435:36534,56436:36535,56437:36536,56438:36537,56439:36539,56440:36540,56441:36541,56442:36542,56443:36543,56444:36544,56445:36545,56446:36546,56448:36547,56449:36548,56450:36549,56451:36550,56452:36551,56453:36552,56454:36553,56455:36554,56456:36555,56457:36556,56458:36557,56459:36559,56460:36560,56461:36561,56462:36562,56463:36563,56464:36564,56465:36565,56466:36566,56467:36567,56468:36568,56469:36569,56470:36570,56471:36571,56472:36572,56473:36573,56474:36574,56475:36575,56476:36576,56477:36577,56478:36578,56479:36579,56480:36580,56481:22539,56482:22541,56483:22525,56484:22509,56485:22528,56486:22558,56487:22553,56488:22596,56489:22560,56490:22629,56491:22636,56492:22657,56493:22665,56494:22682,56495:22656,56496:39336,56497:40729,56498:25087,56499:33401,56500:33405,56501:33407,56502:33423,56503:33418,56504:33448,56505:33412,56506:33422,56507:33425,56508:33431,56509:33433,56510:33451,56511:33464,56512:33470,56513:33456,56514:33480,56515:33482,56516:33507,56517:33432,56518:33463,56519:33454,56520:33483,56521:33484,56522:33473,56523:33449,56524:33460,56525:33441,56526:33450,56527:33439,56528:33476,56529:33486,56530:33444,56531:33505,56532:33545,56533:33527,56534:33508,56535:33551,56536:33543,56537:33500,56538:33524,56539:33490,56540:33496,56541:33548,56542:33531,56543:33491,56544:33553,56545:33562,56546:33542,56547:33556,56548:33557,56549:33504,56550:33493,56551:33564,56552:33617,56553:33627,56554:33628,56555:33544,56556:33682,56557:33596,56558:33588,56559:33585,56560:33691,56561:33630,56562:33583,56563:33615,56564:33607,56565:33603,56566:33631,56567:33600,56568:33559,56569:33632,56570:33581,56571:33594,56572:33587,56573:33638,56574:33637,56640:36581,56641:36582,56642:36583,56643:36584,56644:36585,56645:36586,56646:36587,56647:36588,56648:36589,56649:36590,56650:36591,56651:36592,56652:36593,56653:36594,56654:36595,56655:36596,56656:36597,56657:36598,56658:36599,56659:36600,56660:36601,56661:36602,56662:36603,56663:36604,56664:36605,56665:36606,56666:36607,56667:36608,56668:36609,56669:36610,56670:36611,56671:36612,56672:36613,56673:36614,56674:36615,56675:36616,56676:36617,56677:36618,56678:36619,56679:36620,56680:36621,56681:36622,56682:36623,56683:36624,56684:36625,56685:36626,56686:36627,56687:36628,56688:36629,56689:36630,56690:36631,56691:36632,56692:36633,56693:36634,56694:36635,56695:36636,56696:36637,56697:36638,56698:36639,56699:36640,56700:36641,56701:36642,56702:36643,56704:36644,56705:36645,56706:36646,56707:36647,56708:36648,56709:36649,56710:36650,56711:36651,56712:36652,56713:36653,56714:36654,56715:36655,56716:36656,56717:36657,56718:36658,56719:36659,56720:36660,56721:36661,56722:36662,56723:36663,56724:36664,56725:36665,56726:36666,56727:36667,56728:36668,56729:36669,56730:36670,56731:36671,56732:36672,56733:36673,56734:36674,56735:36675,56736:36676,56737:33640,56738:33563,56739:33641,56740:33644,56741:33642,56742:33645,56743:33646,56744:33712,56745:33656,56746:33715,56747:33716,56748:33696,56749:33706,56750:33683,56751:33692,56752:33669,56753:33660,56754:33718,56755:33705,56756:33661,56757:33720,56758:33659,56759:33688,56760:33694,56761:33704,56762:33722,56763:33724,56764:33729,56765:33793,56766:33765,56767:33752,56768:22535,56769:33816,56770:33803,56771:33757,56772:33789,56773:33750,56774:33820,56775:33848,56776:33809,56777:33798,56778:33748,56779:33759,56780:33807,56781:33795,56782:33784,56783:33785,56784:33770,56785:33733,56786:33728,56787:33830,56788:33776,56789:33761,56790:33884,56791:33873,56792:33882,56793:33881,56794:33907,56795:33927,56796:33928,56797:33914,56798:33929,56799:33912,56800:33852,56801:33862,56802:33897,56803:33910,56804:33932,56805:33934,56806:33841,56807:33901,56808:33985,56809:33997,56810:34000,56811:34022,56812:33981,56813:34003,56814:33994,56815:33983,56816:33978,56817:34016,56818:33953,56819:33977,56820:33972,56821:33943,56822:34021,56823:34019,56824:34060,56825:29965,56826:34104,56827:34032,56828:34105,56829:34079,56830:34106,56896:36677,56897:36678,56898:36679,56899:36680,56900:36681,56901:36682,56902:36683,56903:36684,56904:36685,56905:36686,56906:36687,56907:36688,56908:36689,56909:36690,56910:36691,56911:36692,56912:36693,56913:36694,56914:36695,56915:36696,56916:36697,56917:36698,56918:36699,56919:36700,56920:36701,56921:36702,56922:36703,56923:36704,56924:36705,56925:36706,56926:36707,56927:36708,56928:36709,56929:36714,56930:36736,56931:36748,56932:36754,56933:36765,56934:36768,56935:36769,56936:36770,56937:36772,56938:36773,56939:36774,56940:36775,56941:36778,56942:36780,56943:36781,56944:36782,56945:36783,56946:36786,56947:36787,56948:36788,56949:36789,56950:36791,56951:36792,56952:36794,56953:36795,56954:36796,56955:36799,56956:36800,56957:36803,56958:36806,56960:36809,56961:36810,56962:36811,56963:36812,56964:36813,56965:36815,56966:36818,56967:36822,56968:36823,56969:36826,56970:36832,56971:36833,56972:36835,56973:36839,56974:36844,56975:36847,56976:36849,56977:36850,56978:36852,56979:36853,56980:36854,56981:36858,56982:36859,56983:36860,56984:36862,56985:36863,56986:36871,56987:36872,56988:36876,56989:36878,56990:36883,56991:36885,56992:36888,56993:34134,56994:34107,56995:34047,56996:34044,56997:34137,56998:34120,56999:34152,57000:34148,57001:34142,57002:34170,57003:30626,57004:34115,57005:34162,57006:34171,57007:34212,57008:34216,57009:34183,57010:34191,57011:34169,57012:34222,57013:34204,57014:34181,57015:34233,57016:34231,57017:34224,57018:34259,57019:34241,57020:34268,57021:34303,57022:34343,57023:34309,57024:34345,57025:34326,57026:34364,57027:24318,57028:24328,57029:22844,57030:22849,57031:32823,57032:22869,57033:22874,57034:22872,57035:21263,57036:23586,57037:23589,57038:23596,57039:23604,57040:25164,57041:25194,57042:25247,57043:25275,57044:25290,57045:25306,57046:25303,57047:25326,57048:25378,57049:25334,57050:25401,57051:25419,57052:25411,57053:25517,57054:25590,57055:25457,57056:25466,57057:25486,57058:25524,57059:25453,57060:25516,57061:25482,57062:25449,57063:25518,57064:25532,57065:25586,57066:25592,57067:25568,57068:25599,57069:25540,57070:25566,57071:25550,57072:25682,57073:25542,57074:25534,57075:25669,57076:25665,57077:25611,57078:25627,57079:25632,57080:25612,57081:25638,57082:25633,57083:25694,57084:25732,57085:25709,57086:25750,57152:36889,57153:36892,57154:36899,57155:36900,57156:36901,57157:36903,57158:36904,57159:36905,57160:36906,57161:36907,57162:36908,57163:36912,57164:36913,57165:36914,57166:36915,57167:36916,57168:36919,57169:36921,57170:36922,57171:36925,57172:36927,57173:36928,57174:36931,57175:36933,57176:36934,57177:36936,57178:36937,57179:36938,57180:36939,57181:36940,57182:36942,57183:36948,57184:36949,57185:36950,57186:36953,57187:36954,57188:36956,57189:36957,57190:36958,57191:36959,57192:36960,57193:36961,57194:36964,57195:36966,57196:36967,57197:36969,57198:36970,57199:36971,57200:36972,57201:36975,57202:36976,57203:36977,57204:36978,57205:36979,57206:36982,57207:36983,57208:36984,57209:36985,57210:36986,57211:36987,57212:36988,57213:36990,57214:36993,57216:36996,57217:36997,57218:36998,57219:36999,57220:37001,57221:37002,57222:37004,57223:37005,57224:37006,57225:37007,57226:37008,57227:37010,57228:37012,57229:37014,57230:37016,57231:37018,57232:37020,57233:37022,57234:37023,57235:37024,57236:37028,57237:37029,57238:37031,57239:37032,57240:37033,57241:37035,57242:37037,57243:37042,57244:37047,57245:37052,57246:37053,57247:37055,57248:37056,57249:25722,57250:25783,57251:25784,57252:25753,57253:25786,57254:25792,57255:25808,57256:25815,57257:25828,57258:25826,57259:25865,57260:25893,57261:25902,57262:24331,57263:24530,57264:29977,57265:24337,57266:21343,57267:21489,57268:21501,57269:21481,57270:21480,57271:21499,57272:21522,57273:21526,57274:21510,57275:21579,57276:21586,57277:21587,57278:21588,57279:21590,57280:21571,57281:21537,57282:21591,57283:21593,57284:21539,57285:21554,57286:21634,57287:21652,57288:21623,57289:21617,57290:21604,57291:21658,57292:21659,57293:21636,57294:21622,57295:21606,57296:21661,57297:21712,57298:21677,57299:21698,57300:21684,57301:21714,57302:21671,57303:21670,57304:21715,57305:21716,57306:21618,57307:21667,57308:21717,57309:21691,57310:21695,57311:21708,57312:21721,57313:21722,57314:21724,57315:21673,57316:21674,57317:21668,57318:21725,57319:21711,57320:21726,57321:21787,57322:21735,57323:21792,57324:21757,57325:21780,57326:21747,57327:21794,57328:21795,57329:21775,57330:21777,57331:21799,57332:21802,57333:21863,57334:21903,57335:21941,57336:21833,57337:21869,57338:21825,57339:21845,57340:21823,57341:21840,57342:21820,57408:37058,57409:37059,57410:37062,57411:37064,57412:37065,57413:37067,57414:37068,57415:37069,57416:37074,57417:37076,57418:37077,57419:37078,57420:37080,57421:37081,57422:37082,57423:37086,57424:37087,57425:37088,57426:37091,57427:37092,57428:37093,57429:37097,57430:37098,57431:37100,57432:37102,57433:37104,57434:37105,57435:37106,57436:37107,57437:37109,57438:37110,57439:37111,57440:37113,57441:37114,57442:37115,57443:37116,57444:37119,57445:37120,57446:37121,57447:37123,57448:37125,57449:37126,57450:37127,57451:37128,57452:37129,57453:37130,57454:37131,57455:37132,57456:37133,57457:37134,57458:37135,57459:37136,57460:37137,57461:37138,57462:37139,57463:37140,57464:37141,57465:37142,57466:37143,57467:37144,57468:37146,57469:37147,57470:37148,57472:37149,57473:37151,57474:37152,57475:37153,57476:37156,57477:37157,57478:37158,57479:37159,57480:37160,57481:37161,57482:37162,57483:37163,57484:37164,57485:37165,57486:37166,57487:37168,57488:37170,57489:37171,57490:37172,57491:37173,57492:37174,57493:37175,57494:37176,57495:37178,57496:37179,57497:37180,57498:37181,57499:37182,57500:37183,57501:37184,57502:37185,57503:37186,57504:37188,57505:21815,57506:21846,57507:21877,57508:21878,57509:21879,57510:21811,57511:21808,57512:21852,57513:21899,57514:21970,57515:21891,57516:21937,57517:21945,57518:21896,57519:21889,57520:21919,57521:21886,57522:21974,57523:21905,57524:21883,57525:21983,57526:21949,57527:21950,57528:21908,57529:21913,57530:21994,57531:22007,57532:21961,57533:22047,57534:21969,57535:21995,57536:21996,57537:21972,57538:21990,57539:21981,57540:21956,57541:21999,57542:21989,57543:22002,57544:22003,57545:21964,57546:21965,57547:21992,57548:22005,57549:21988,57550:36756,57551:22046,57552:22024,57553:22028,57554:22017,57555:22052,57556:22051,57557:22014,57558:22016,57559:22055,57560:22061,57561:22104,57562:22073,57563:22103,57564:22060,57565:22093,57566:22114,57567:22105,57568:22108,57569:22092,57570:22100,57571:22150,57572:22116,57573:22129,57574:22123,57575:22139,57576:22140,57577:22149,57578:22163,57579:22191,57580:22228,57581:22231,57582:22237,57583:22241,57584:22261,57585:22251,57586:22265,57587:22271,57588:22276,57589:22282,57590:22281,57591:22300,57592:24079,57593:24089,57594:24084,57595:24081,57596:24113,57597:24123,57598:24124,57664:37189,57665:37191,57666:37192,57667:37201,57668:37203,57669:37204,57670:37205,57671:37206,57672:37208,57673:37209,57674:37211,57675:37212,57676:37215,57677:37216,57678:37222,57679:37223,57680:37224,57681:37227,57682:37229,57683:37235,57684:37242,57685:37243,57686:37244,57687:37248,57688:37249,57689:37250,57690:37251,57691:37252,57692:37254,57693:37256,57694:37258,57695:37262,57696:37263,57697:37267,57698:37268,57699:37269,57700:37270,57701:37271,57702:37272,57703:37273,57704:37276,57705:37277,57706:37278,57707:37279,57708:37280,57709:37281,57710:37284,57711:37285,57712:37286,57713:37287,57714:37288,57715:37289,57716:37291,57717:37292,57718:37296,57719:37297,57720:37298,57721:37299,57722:37302,57723:37303,57724:37304,57725:37305,57726:37307,57728:37308,57729:37309,57730:37310,57731:37311,57732:37312,57733:37313,57734:37314,57735:37315,57736:37316,57737:37317,57738:37318,57739:37320,57740:37323,57741:37328,57742:37330,57743:37331,57744:37332,57745:37333,57746:37334,57747:37335,57748:37336,57749:37337,57750:37338,57751:37339,57752:37341,57753:37342,57754:37343,57755:37344,57756:37345,57757:37346,57758:37347,57759:37348,57760:37349,57761:24119,57762:24132,57763:24148,57764:24155,57765:24158,57766:24161,57767:23692,57768:23674,57769:23693,57770:23696,57771:23702,57772:23688,57773:23704,57774:23705,57775:23697,57776:23706,57777:23708,57778:23733,57779:23714,57780:23741,57781:23724,57782:23723,57783:23729,57784:23715,57785:23745,57786:23735,57787:23748,57788:23762,57789:23780,57790:23755,57791:23781,57792:23810,57793:23811,57794:23847,57795:23846,57796:23854,57797:23844,57798:23838,57799:23814,57800:23835,57801:23896,57802:23870,57803:23860,57804:23869,57805:23916,57806:23899,57807:23919,57808:23901,57809:23915,57810:23883,57811:23882,57812:23913,57813:23924,57814:23938,57815:23961,57816:23965,57817:35955,57818:23991,57819:24005,57820:24435,57821:24439,57822:24450,57823:24455,57824:24457,57825:24460,57826:24469,57827:24473,57828:24476,57829:24488,57830:24493,57831:24501,57832:24508,57833:34914,57834:24417,57835:29357,57836:29360,57837:29364,57838:29367,57839:29368,57840:29379,57841:29377,57842:29390,57843:29389,57844:29394,57845:29416,57846:29423,57847:29417,57848:29426,57849:29428,57850:29431,57851:29441,57852:29427,57853:29443,57854:29434,57920:37350,57921:37351,57922:37352,57923:37353,57924:37354,57925:37355,57926:37356,57927:37357,57928:37358,57929:37359,57930:37360,57931:37361,57932:37362,57933:37363,57934:37364,57935:37365,57936:37366,57937:37367,57938:37368,57939:37369,57940:37370,57941:37371,57942:37372,57943:37373,57944:37374,57945:37375,57946:37376,57947:37377,57948:37378,57949:37379,57950:37380,57951:37381,57952:37382,57953:37383,57954:37384,57955:37385,57956:37386,57957:37387,57958:37388,57959:37389,57960:37390,57961:37391,57962:37392,57963:37393,57964:37394,57965:37395,57966:37396,57967:37397,57968:37398,57969:37399,57970:37400,57971:37401,57972:37402,57973:37403,57974:37404,57975:37405,57976:37406,57977:37407,57978:37408,57979:37409,57980:37410,57981:37411,57982:37412,57984:37413,57985:37414,57986:37415,57987:37416,57988:37417,57989:37418,57990:37419,57991:37420,57992:37421,57993:37422,57994:37423,57995:37424,57996:37425,57997:37426,57998:37427,57999:37428,58000:37429,58001:37430,58002:37431,58003:37432,58004:37433,58005:37434,58006:37435,58007:37436,58008:37437,58009:37438,58010:37439,58011:37440,58012:37441,58013:37442,58014:37443,58015:37444,58016:37445,58017:29435,58018:29463,58019:29459,58020:29473,58021:29450,58022:29470,58023:29469,58024:29461,58025:29474,58026:29497,58027:29477,58028:29484,58029:29496,58030:29489,58031:29520,58032:29517,58033:29527,58034:29536,58035:29548,58036:29551,58037:29566,58038:33307,58039:22821,58040:39143,58041:22820,58042:22786,58043:39267,58044:39271,58045:39272,58046:39273,58047:39274,58048:39275,58049:39276,58050:39284,58051:39287,58052:39293,58053:39296,58054:39300,58055:39303,58056:39306,58057:39309,58058:39312,58059:39313,58060:39315,58061:39316,58062:39317,58063:24192,58064:24209,58065:24203,58066:24214,58067:24229,58068:24224,58069:24249,58070:24245,58071:24254,58072:24243,58073:36179,58074:24274,58075:24273,58076:24283,58077:24296,58078:24298,58079:33210,58080:24516,58081:24521,58082:24534,58083:24527,58084:24579,58085:24558,58086:24580,58087:24545,58088:24548,58089:24574,58090:24581,58091:24582,58092:24554,58093:24557,58094:24568,58095:24601,58096:24629,58097:24614,58098:24603,58099:24591,58100:24589,58101:24617,58102:24619,58103:24586,58104:24639,58105:24609,58106:24696,58107:24697,58108:24699,58109:24698,58110:24642,58176:37446,58177:37447,58178:37448,58179:37449,58180:37450,58181:37451,58182:37452,58183:37453,58184:37454,58185:37455,58186:37456,58187:37457,58188:37458,58189:37459,58190:37460,58191:37461,58192:37462,58193:37463,58194:37464,58195:37465,58196:37466,58197:37467,58198:37468,58199:37469,58200:37470,58201:37471,58202:37472,58203:37473,58204:37474,58205:37475,58206:37476,58207:37477,58208:37478,58209:37479,58210:37480,58211:37481,58212:37482,58213:37483,58214:37484,58215:37485,58216:37486,58217:37487,58218:37488,58219:37489,58220:37490,58221:37491,58222:37493,58223:37494,58224:37495,58225:37496,58226:37497,58227:37498,58228:37499,58229:37500,58230:37501,58231:37502,58232:37503,58233:37504,58234:37505,58235:37506,58236:37507,58237:37508,58238:37509,58240:37510,58241:37511,58242:37512,58243:37513,58244:37514,58245:37515,58246:37516,58247:37517,58248:37519,58249:37520,58250:37521,58251:37522,58252:37523,58253:37524,58254:37525,58255:37526,58256:37527,58257:37528,58258:37529,58259:37530,58260:37531,58261:37532,58262:37533,58263:37534,58264:37535,58265:37536,58266:37537,58267:37538,58268:37539,58269:37540,58270:37541,58271:37542,58272:37543,58273:24682,58274:24701,58275:24726,58276:24730,58277:24749,58278:24733,58279:24707,58280:24722,58281:24716,58282:24731,58283:24812,58284:24763,58285:24753,58286:24797,58287:24792,58288:24774,58289:24794,58290:24756,58291:24864,58292:24870,58293:24853,58294:24867,58295:24820,58296:24832,58297:24846,58298:24875,58299:24906,58300:24949,58301:25004,58302:24980,58303:24999,58304:25015,58305:25044,58306:25077,58307:24541,58308:38579,58309:38377,58310:38379,58311:38385,58312:38387,58313:38389,58314:38390,58315:38396,58316:38398,58317:38403,58318:38404,58319:38406,58320:38408,58321:38410,58322:38411,58323:38412,58324:38413,58325:38415,58326:38418,58327:38421,58328:38422,58329:38423,58330:38425,58331:38426,58332:20012,58333:29247,58334:25109,58335:27701,58336:27732,58337:27740,58338:27722,58339:27811,58340:27781,58341:27792,58342:27796,58343:27788,58344:27752,58345:27753,58346:27764,58347:27766,58348:27782,58349:27817,58350:27856,58351:27860,58352:27821,58353:27895,58354:27896,58355:27889,58356:27863,58357:27826,58358:27872,58359:27862,58360:27898,58361:27883,58362:27886,58363:27825,58364:27859,58365:27887,58366:27902,58432:37544,58433:37545,58434:37546,58435:37547,58436:37548,58437:37549,58438:37551,58439:37552,58440:37553,58441:37554,58442:37555,58443:37556,58444:37557,58445:37558,58446:37559,58447:37560,58448:37561,58449:37562,58450:37563,58451:37564,58452:37565,58453:37566,58454:37567,58455:37568,58456:37569,58457:37570,58458:37571,58459:37572,58460:37573,58461:37574,58462:37575,58463:37577,58464:37578,58465:37579,58466:37580,58467:37581,58468:37582,58469:37583,58470:37584,58471:37585,58472:37586,58473:37587,58474:37588,58475:37589,58476:37590,58477:37591,58478:37592,58479:37593,58480:37594,58481:37595,58482:37596,58483:37597,58484:37598,58485:37599,58486:37600,58487:37601,58488:37602,58489:37603,58490:37604,58491:37605,58492:37606,58493:37607,58494:37608,58496:37609,58497:37610,58498:37611,58499:37612,58500:37613,58501:37614,58502:37615,58503:37616,58504:37617,58505:37618,58506:37619,58507:37620,58508:37621,58509:37622,58510:37623,58511:37624,58512:37625,58513:37626,58514:37627,58515:37628,58516:37629,58517:37630,58518:37631,58519:37632,58520:37633,58521:37634,58522:37635,58523:37636,58524:37637,58525:37638,58526:37639,58527:37640,58528:37641,58529:27961,58530:27943,58531:27916,58532:27971,58533:27976,58534:27911,58535:27908,58536:27929,58537:27918,58538:27947,58539:27981,58540:27950,58541:27957,58542:27930,58543:27983,58544:27986,58545:27988,58546:27955,58547:28049,58548:28015,58549:28062,58550:28064,58551:27998,58552:28051,58553:28052,58554:27996,58555:28000,58556:28028,58557:28003,58558:28186,58559:28103,58560:28101,58561:28126,58562:28174,58563:28095,58564:28128,58565:28177,58566:28134,58567:28125,58568:28121,58569:28182,58570:28075,58571:28172,58572:28078,58573:28203,58574:28270,58575:28238,58576:28267,58577:28338,58578:28255,58579:28294,58580:28243,58581:28244,58582:28210,58583:28197,58584:28228,58585:28383,58586:28337,58587:28312,58588:28384,58589:28461,58590:28386,58591:28325,58592:28327,58593:28349,58594:28347,58595:28343,58596:28375,58597:28340,58598:28367,58599:28303,58600:28354,58601:28319,58602:28514,58603:28486,58604:28487,58605:28452,58606:28437,58607:28409,58608:28463,58609:28470,58610:28491,58611:28532,58612:28458,58613:28425,58614:28457,58615:28553,58616:28557,58617:28556,58618:28536,58619:28530,58620:28540,58621:28538,58622:28625,58688:37642,58689:37643,58690:37644,58691:37645,58692:37646,58693:37647,58694:37648,58695:37649,58696:37650,58697:37651,58698:37652,58699:37653,58700:37654,58701:37655,58702:37656,58703:37657,58704:37658,58705:37659,58706:37660,58707:37661,58708:37662,58709:37663,58710:37664,58711:37665,58712:37666,58713:37667,58714:37668,58715:37669,58716:37670,58717:37671,58718:37672,58719:37673,58720:37674,58721:37675,58722:37676,58723:37677,58724:37678,58725:37679,58726:37680,58727:37681,58728:37682,58729:37683,58730:37684,58731:37685,58732:37686,58733:37687,58734:37688,58735:37689,58736:37690,58737:37691,58738:37692,58739:37693,58740:37695,58741:37696,58742:37697,58743:37698,58744:37699,58745:37700,58746:37701,58747:37702,58748:37703,58749:37704,58750:37705,58752:37706,58753:37707,58754:37708,58755:37709,58756:37710,58757:37711,58758:37712,58759:37713,58760:37714,58761:37715,58762:37716,58763:37717,58764:37718,58765:37719,58766:37720,58767:37721,58768:37722,58769:37723,58770:37724,58771:37725,58772:37726,58773:37727,58774:37728,58775:37729,58776:37730,58777:37731,58778:37732,58779:37733,58780:37734,58781:37735,58782:37736,58783:37737,58784:37739,58785:28617,58786:28583,58787:28601,58788:28598,58789:28610,58790:28641,58791:28654,58792:28638,58793:28640,58794:28655,58795:28698,58796:28707,58797:28699,58798:28729,58799:28725,58800:28751,58801:28766,58802:23424,58803:23428,58804:23445,58805:23443,58806:23461,58807:23480,58808:29999,58809:39582,58810:25652,58811:23524,58812:23534,58813:35120,58814:23536,58815:36423,58816:35591,58817:36790,58818:36819,58819:36821,58820:36837,58821:36846,58822:36836,58823:36841,58824:36838,58825:36851,58826:36840,58827:36869,58828:36868,58829:36875,58830:36902,58831:36881,58832:36877,58833:36886,58834:36897,58835:36917,58836:36918,58837:36909,58838:36911,58839:36932,58840:36945,58841:36946,58842:36944,58843:36968,58844:36952,58845:36962,58846:36955,58847:26297,58848:36980,58849:36989,58850:36994,58851:37000,58852:36995,58853:37003,58854:24400,58855:24407,58856:24406,58857:24408,58858:23611,58859:21675,58860:23632,58861:23641,58862:23409,58863:23651,58864:23654,58865:32700,58866:24362,58867:24361,58868:24365,58869:33396,58870:24380,58871:39739,58872:23662,58873:22913,58874:22915,58875:22925,58876:22953,58877:22954,58878:22947,58944:37740,58945:37741,58946:37742,58947:37743,58948:37744,58949:37745,58950:37746,58951:37747,58952:37748,58953:37749,58954:37750,58955:37751,58956:37752,58957:37753,58958:37754,58959:37755,58960:37756,58961:37757,58962:37758,58963:37759,58964:37760,58965:37761,58966:37762,58967:37763,58968:37764,58969:37765,58970:37766,58971:37767,58972:37768,58973:37769,58974:37770,58975:37771,58976:37772,58977:37773,58978:37774,58979:37776,58980:37777,58981:37778,58982:37779,58983:37780,58984:37781,58985:37782,58986:37783,58987:37784,58988:37785,58989:37786,58990:37787,58991:37788,58992:37789,58993:37790,58994:37791,58995:37792,58996:37793,58997:37794,58998:37795,58999:37796,59000:37797,59001:37798,59002:37799,59003:37800,59004:37801,59005:37802,59006:37803,59008:37804,59009:37805,59010:37806,59011:37807,59012:37808,59013:37809,59014:37810,59015:37811,59016:37812,59017:37813,59018:37814,59019:37815,59020:37816,59021:37817,59022:37818,59023:37819,59024:37820,59025:37821,59026:37822,59027:37823,59028:37824,59029:37825,59030:37826,59031:37827,59032:37828,59033:37829,59034:37830,59035:37831,59036:37832,59037:37833,59038:37835,59039:37836,59040:37837,59041:22935,59042:22986,59043:22955,59044:22942,59045:22948,59046:22994,59047:22962,59048:22959,59049:22999,59050:22974,59051:23045,59052:23046,59053:23005,59054:23048,59055:23011,59056:23000,59057:23033,59058:23052,59059:23049,59060:23090,59061:23092,59062:23057,59063:23075,59064:23059,59065:23104,59066:23143,59067:23114,59068:23125,59069:23100,59070:23138,59071:23157,59072:33004,59073:23210,59074:23195,59075:23159,59076:23162,59077:23230,59078:23275,59079:23218,59080:23250,59081:23252,59082:23224,59083:23264,59084:23267,59085:23281,59086:23254,59087:23270,59088:23256,59089:23260,59090:23305,59091:23319,59092:23318,59093:23346,59094:23351,59095:23360,59096:23573,59097:23580,59098:23386,59099:23397,59100:23411,59101:23377,59102:23379,59103:23394,59104:39541,59105:39543,59106:39544,59107:39546,59108:39551,59109:39549,59110:39552,59111:39553,59112:39557,59113:39560,59114:39562,59115:39568,59116:39570,59117:39571,59118:39574,59119:39576,59120:39579,59121:39580,59122:39581,59123:39583,59124:39584,59125:39586,59126:39587,59127:39589,59128:39591,59129:32415,59130:32417,59131:32419,59132:32421,59133:32424,59134:32425,59200:37838,59201:37839,59202:37840,59203:37841,59204:37842,59205:37843,59206:37844,59207:37845,59208:37847,59209:37848,59210:37849,59211:37850,59212:37851,59213:37852,59214:37853,59215:37854,59216:37855,59217:37856,59218:37857,59219:37858,59220:37859,59221:37860,59222:37861,59223:37862,59224:37863,59225:37864,59226:37865,59227:37866,59228:37867,59229:37868,59230:37869,59231:37870,59232:37871,59233:37872,59234:37873,59235:37874,59236:37875,59237:37876,59238:37877,59239:37878,59240:37879,59241:37880,59242:37881,59243:37882,59244:37883,59245:37884,59246:37885,59247:37886,59248:37887,59249:37888,59250:37889,59251:37890,59252:37891,59253:37892,59254:37893,59255:37894,59256:37895,59257:37896,59258:37897,59259:37898,59260:37899,59261:37900,59262:37901,59264:37902,59265:37903,59266:37904,59267:37905,59268:37906,59269:37907,59270:37908,59271:37909,59272:37910,59273:37911,59274:37912,59275:37913,59276:37914,59277:37915,59278:37916,59279:37917,59280:37918,59281:37919,59282:37920,59283:37921,59284:37922,59285:37923,59286:37924,59287:37925,59288:37926,59289:37927,59290:37928,59291:37929,59292:37930,59293:37931,59294:37932,59295:37933,59296:37934,59297:32429,59298:32432,59299:32446,59300:32448,59301:32449,59302:32450,59303:32457,59304:32459,59305:32460,59306:32464,59307:32468,59308:32471,59309:32475,59310:32480,59311:32481,59312:32488,59313:32491,59314:32494,59315:32495,59316:32497,59317:32498,59318:32525,59319:32502,59320:32506,59321:32507,59322:32510,59323:32513,59324:32514,59325:32515,59326:32519,59327:32520,59328:32523,59329:32524,59330:32527,59331:32529,59332:32530,59333:32535,59334:32537,59335:32540,59336:32539,59337:32543,59338:32545,59339:32546,59340:32547,59341:32548,59342:32549,59343:32550,59344:32551,59345:32554,59346:32555,59347:32556,59348:32557,59349:32559,59350:32560,59351:32561,59352:32562,59353:32563,59354:32565,59355:24186,59356:30079,59357:24027,59358:30014,59359:37013,59360:29582,59361:29585,59362:29614,59363:29602,59364:29599,59365:29647,59366:29634,59367:29649,59368:29623,59369:29619,59370:29632,59371:29641,59372:29640,59373:29669,59374:29657,59375:39036,59376:29706,59377:29673,59378:29671,59379:29662,59380:29626,59381:29682,59382:29711,59383:29738,59384:29787,59385:29734,59386:29733,59387:29736,59388:29744,59389:29742,59390:29740,59456:37935,59457:37936,59458:37937,59459:37938,59460:37939,59461:37940,59462:37941,59463:37942,59464:37943,59465:37944,59466:37945,59467:37946,59468:37947,59469:37948,59470:37949,59471:37951,59472:37952,59473:37953,59474:37954,59475:37955,59476:37956,59477:37957,59478:37958,59479:37959,59480:37960,59481:37961,59482:37962,59483:37963,59484:37964,59485:37965,59486:37966,59487:37967,59488:37968,59489:37969,59490:37970,59491:37971,59492:37972,59493:37973,59494:37974,59495:37975,59496:37976,59497:37977,59498:37978,59499:37979,59500:37980,59501:37981,59502:37982,59503:37983,59504:37984,59505:37985,59506:37986,59507:37987,59508:37988,59509:37989,59510:37990,59511:37991,59512:37992,59513:37993,59514:37994,59515:37996,59516:37997,59517:37998,59518:37999,59520:38000,59521:38001,59522:38002,59523:38003,59524:38004,59525:38005,59526:38006,59527:38007,59528:38008,59529:38009,59530:38010,59531:38011,59532:38012,59533:38013,59534:38014,59535:38015,59536:38016,59537:38017,59538:38018,59539:38019,59540:38020,59541:38033,59542:38038,59543:38040,59544:38087,59545:38095,59546:38099,59547:38100,59548:38106,59549:38118,59550:38139,59551:38172,59552:38176,59553:29723,59554:29722,59555:29761,59556:29788,59557:29783,59558:29781,59559:29785,59560:29815,59561:29805,59562:29822,59563:29852,59564:29838,59565:29824,59566:29825,59567:29831,59568:29835,59569:29854,59570:29864,59571:29865,59572:29840,59573:29863,59574:29906,59575:29882,59576:38890,59577:38891,59578:38892,59579:26444,59580:26451,59581:26462,59582:26440,59583:26473,59584:26533,59585:26503,59586:26474,59587:26483,59588:26520,59589:26535,59590:26485,59591:26536,59592:26526,59593:26541,59594:26507,59595:26487,59596:26492,59597:26608,59598:26633,59599:26584,59600:26634,59601:26601,59602:26544,59603:26636,59604:26585,59605:26549,59606:26586,59607:26547,59608:26589,59609:26624,59610:26563,59611:26552,59612:26594,59613:26638,59614:26561,59615:26621,59616:26674,59617:26675,59618:26720,59619:26721,59620:26702,59621:26722,59622:26692,59623:26724,59624:26755,59625:26653,59626:26709,59627:26726,59628:26689,59629:26727,59630:26688,59631:26686,59632:26698,59633:26697,59634:26665,59635:26805,59636:26767,59637:26740,59638:26743,59639:26771,59640:26731,59641:26818,59642:26990,59643:26876,59644:26911,59645:26912,59646:26873,59712:38183,59713:38195,59714:38205,59715:38211,59716:38216,59717:38219,59718:38229,59719:38234,59720:38240,59721:38254,59722:38260,59723:38261,59724:38263,59725:38264,59726:38265,59727:38266,59728:38267,59729:38268,59730:38269,59731:38270,59732:38272,59733:38273,59734:38274,59735:38275,59736:38276,59737:38277,59738:38278,59739:38279,59740:38280,59741:38281,59742:38282,59743:38283,59744:38284,59745:38285,59746:38286,59747:38287,59748:38288,59749:38289,59750:38290,59751:38291,59752:38292,59753:38293,59754:38294,59755:38295,59756:38296,59757:38297,59758:38298,59759:38299,59760:38300,59761:38301,59762:38302,59763:38303,59764:38304,59765:38305,59766:38306,59767:38307,59768:38308,59769:38309,59770:38310,59771:38311,59772:38312,59773:38313,59774:38314,59776:38315,59777:38316,59778:38317,59779:38318,59780:38319,59781:38320,59782:38321,59783:38322,59784:38323,59785:38324,59786:38325,59787:38326,59788:38327,59789:38328,59790:38329,59791:38330,59792:38331,59793:38332,59794:38333,59795:38334,59796:38335,59797:38336,59798:38337,59799:38338,59800:38339,59801:38340,59802:38341,59803:38342,59804:38343,59805:38344,59806:38345,59807:38346,59808:38347,59809:26916,59810:26864,59811:26891,59812:26881,59813:26967,59814:26851,59815:26896,59816:26993,59817:26937,59818:26976,59819:26946,59820:26973,59821:27012,59822:26987,59823:27008,59824:27032,59825:27000,59826:26932,59827:27084,59828:27015,59829:27016,59830:27086,59831:27017,59832:26982,59833:26979,59834:27001,59835:27035,59836:27047,59837:27067,59838:27051,59839:27053,59840:27092,59841:27057,59842:27073,59843:27082,59844:27103,59845:27029,59846:27104,59847:27021,59848:27135,59849:27183,59850:27117,59851:27159,59852:27160,59853:27237,59854:27122,59855:27204,59856:27198,59857:27296,59858:27216,59859:27227,59860:27189,59861:27278,59862:27257,59863:27197,59864:27176,59865:27224,59866:27260,59867:27281,59868:27280,59869:27305,59870:27287,59871:27307,59872:29495,59873:29522,59874:27521,59875:27522,59876:27527,59877:27524,59878:27538,59879:27539,59880:27533,59881:27546,59882:27547,59883:27553,59884:27562,59885:36715,59886:36717,59887:36721,59888:36722,59889:36723,59890:36725,59891:36726,59892:36728,59893:36727,59894:36729,59895:36730,59896:36732,59897:36734,59898:36737,59899:36738,59900:36740,59901:36743,59902:36747,59968:38348,59969:38349,59970:38350,59971:38351,59972:38352,59973:38353,59974:38354,59975:38355,59976:38356,59977:38357,59978:38358,59979:38359,59980:38360,59981:38361,59982:38362,59983:38363,59984:38364,59985:38365,59986:38366,59987:38367,59988:38368,59989:38369,59990:38370,59991:38371,59992:38372,59993:38373,59994:38374,59995:38375,59996:38380,59997:38399,59998:38407,59999:38419,60000:38424,60001:38427,60002:38430,60003:38432,60004:38435,60005:38436,60006:38437,60007:38438,60008:38439,60009:38440,60010:38441,60011:38443,60012:38444,60013:38445,60014:38447,60015:38448,60016:38455,60017:38456,60018:38457,60019:38458,60020:38462,60021:38465,60022:38467,60023:38474,60024:38478,60025:38479,60026:38481,60027:38482,60028:38483,60029:38486,60030:38487,60032:38488,60033:38489,60034:38490,60035:38492,60036:38493,60037:38494,60038:38496,60039:38499,60040:38501,60041:38502,60042:38507,60043:38509,60044:38510,60045:38511,60046:38512,60047:38513,60048:38515,60049:38520,60050:38521,60051:38522,60052:38523,60053:38524,60054:38525,60055:38526,60056:38527,60057:38528,60058:38529,60059:38530,60060:38531,60061:38532,60062:38535,60063:38537,60064:38538,60065:36749,60066:36750,60067:36751,60068:36760,60069:36762,60070:36558,60071:25099,60072:25111,60073:25115,60074:25119,60075:25122,60076:25121,60077:25125,60078:25124,60079:25132,60080:33255,60081:29935,60082:29940,60083:29951,60084:29967,60085:29969,60086:29971,60087:25908,60088:26094,60089:26095,60090:26096,60091:26122,60092:26137,60093:26482,60094:26115,60095:26133,60096:26112,60097:28805,60098:26359,60099:26141,60100:26164,60101:26161,60102:26166,60103:26165,60104:32774,60105:26207,60106:26196,60107:26177,60108:26191,60109:26198,60110:26209,60111:26199,60112:26231,60113:26244,60114:26252,60115:26279,60116:26269,60117:26302,60118:26331,60119:26332,60120:26342,60121:26345,60122:36146,60123:36147,60124:36150,60125:36155,60126:36157,60127:36160,60128:36165,60129:36166,60130:36168,60131:36169,60132:36167,60133:36173,60134:36181,60135:36185,60136:35271,60137:35274,60138:35275,60139:35276,60140:35278,60141:35279,60142:35280,60143:35281,60144:29294,60145:29343,60146:29277,60147:29286,60148:29295,60149:29310,60150:29311,60151:29316,60152:29323,60153:29325,60154:29327,60155:29330,60156:25352,60157:25394,60158:25520,60224:38540,60225:38542,60226:38545,60227:38546,60228:38547,60229:38549,60230:38550,60231:38554,60232:38555,60233:38557,60234:38558,60235:38559,60236:38560,60237:38561,60238:38562,60239:38563,60240:38564,60241:38565,60242:38566,60243:38568,60244:38569,60245:38570,60246:38571,60247:38572,60248:38573,60249:38574,60250:38575,60251:38577,60252:38578,60253:38580,60254:38581,60255:38583,60256:38584,60257:38586,60258:38587,60259:38591,60260:38594,60261:38595,60262:38600,60263:38602,60264:38603,60265:38608,60266:38609,60267:38611,60268:38612,60269:38614,60270:38615,60271:38616,60272:38617,60273:38618,60274:38619,60275:38620,60276:38621,60277:38622,60278:38623,60279:38625,60280:38626,60281:38627,60282:38628,60283:38629,60284:38630,60285:38631,60286:38635,60288:38636,60289:38637,60290:38638,60291:38640,60292:38641,60293:38642,60294:38644,60295:38645,60296:38648,60297:38650,60298:38651,60299:38652,60300:38653,60301:38655,60302:38658,60303:38659,60304:38661,60305:38666,60306:38667,60307:38668,60308:38672,60309:38673,60310:38674,60311:38676,60312:38677,60313:38679,60314:38680,60315:38681,60316:38682,60317:38683,60318:38685,60319:38687,60320:38688,60321:25663,60322:25816,60323:32772,60324:27626,60325:27635,60326:27645,60327:27637,60328:27641,60329:27653,60330:27655,60331:27654,60332:27661,60333:27669,60334:27672,60335:27673,60336:27674,60337:27681,60338:27689,60339:27684,60340:27690,60341:27698,60342:25909,60343:25941,60344:25963,60345:29261,60346:29266,60347:29270,60348:29232,60349:34402,60350:21014,60351:32927,60352:32924,60353:32915,60354:32956,60355:26378,60356:32957,60357:32945,60358:32939,60359:32941,60360:32948,60361:32951,60362:32999,60363:33000,60364:33001,60365:33002,60366:32987,60367:32962,60368:32964,60369:32985,60370:32973,60371:32983,60372:26384,60373:32989,60374:33003,60375:33009,60376:33012,60377:33005,60378:33037,60379:33038,60380:33010,60381:33020,60382:26389,60383:33042,60384:35930,60385:33078,60386:33054,60387:33068,60388:33048,60389:33074,60390:33096,60391:33100,60392:33107,60393:33140,60394:33113,60395:33114,60396:33137,60397:33120,60398:33129,60399:33148,60400:33149,60401:33133,60402:33127,60403:22605,60404:23221,60405:33160,60406:33154,60407:33169,60408:28373,60409:33187,60410:33194,60411:33228,60412:26406,60413:33226,60414:33211,60480:38689,60481:38690,60482:38691,60483:38692,60484:38693,60485:38694,60486:38695,60487:38696,60488:38697,60489:38699,60490:38700,60491:38702,60492:38703,60493:38705,60494:38707,60495:38708,60496:38709,60497:38710,60498:38711,60499:38714,60500:38715,60501:38716,60502:38717,60503:38719,60504:38720,60505:38721,60506:38722,60507:38723,60508:38724,60509:38725,60510:38726,60511:38727,60512:38728,60513:38729,60514:38730,60515:38731,60516:38732,60517:38733,60518:38734,60519:38735,60520:38736,60521:38737,60522:38740,60523:38741,60524:38743,60525:38744,60526:38746,60527:38748,60528:38749,60529:38751,60530:38755,60531:38756,60532:38758,60533:38759,60534:38760,60535:38762,60536:38763,60537:38764,60538:38765,60539:38766,60540:38767,60541:38768,60542:38769,60544:38770,60545:38773,60546:38775,60547:38776,60548:38777,60549:38778,60550:38779,60551:38781,60552:38782,60553:38783,60554:38784,60555:38785,60556:38786,60557:38787,60558:38788,60559:38790,60560:38791,60561:38792,60562:38793,60563:38794,60564:38796,60565:38798,60566:38799,60567:38800,60568:38803,60569:38805,60570:38806,60571:38807,60572:38809,60573:38810,60574:38811,60575:38812,60576:38813,60577:33217,60578:33190,60579:27428,60580:27447,60581:27449,60582:27459,60583:27462,60584:27481,60585:39121,60586:39122,60587:39123,60588:39125,60589:39129,60590:39130,60591:27571,60592:24384,60593:27586,60594:35315,60595:26000,60596:40785,60597:26003,60598:26044,60599:26054,60600:26052,60601:26051,60602:26060,60603:26062,60604:26066,60605:26070,60606:28800,60607:28828,60608:28822,60609:28829,60610:28859,60611:28864,60612:28855,60613:28843,60614:28849,60615:28904,60616:28874,60617:28944,60618:28947,60619:28950,60620:28975,60621:28977,60622:29043,60623:29020,60624:29032,60625:28997,60626:29042,60627:29002,60628:29048,60629:29050,60630:29080,60631:29107,60632:29109,60633:29096,60634:29088,60635:29152,60636:29140,60637:29159,60638:29177,60639:29213,60640:29224,60641:28780,60642:28952,60643:29030,60644:29113,60645:25150,60646:25149,60647:25155,60648:25160,60649:25161,60650:31035,60651:31040,60652:31046,60653:31049,60654:31067,60655:31068,60656:31059,60657:31066,60658:31074,60659:31063,60660:31072,60661:31087,60662:31079,60663:31098,60664:31109,60665:31114,60666:31130,60667:31143,60668:31155,60669:24529,60670:24528,60736:38814,60737:38815,60738:38817,60739:38818,60740:38820,60741:38821,60742:38822,60743:38823,60744:38824,60745:38825,60746:38826,60747:38828,60748:38830,60749:38832,60750:38833,60751:38835,60752:38837,60753:38838,60754:38839,60755:38840,60756:38841,60757:38842,60758:38843,60759:38844,60760:38845,60761:38846,60762:38847,60763:38848,60764:38849,60765:38850,60766:38851,60767:38852,60768:38853,60769:38854,60770:38855,60771:38856,60772:38857,60773:38858,60774:38859,60775:38860,60776:38861,60777:38862,60778:38863,60779:38864,60780:38865,60781:38866,60782:38867,60783:38868,60784:38869,60785:38870,60786:38871,60787:38872,60788:38873,60789:38874,60790:38875,60791:38876,60792:38877,60793:38878,60794:38879,60795:38880,60796:38881,60797:38882,60798:38883,60800:38884,60801:38885,60802:38888,60803:38894,60804:38895,60805:38896,60806:38897,60807:38898,60808:38900,60809:38903,60810:38904,60811:38905,60812:38906,60813:38907,60814:38908,60815:38909,60816:38910,60817:38911,60818:38912,60819:38913,60820:38914,60821:38915,60822:38916,60823:38917,60824:38918,60825:38919,60826:38920,60827:38921,60828:38922,60829:38923,60830:38924,60831:38925,60832:38926,60833:24636,60834:24669,60835:24666,60836:24679,60837:24641,60838:24665,60839:24675,60840:24747,60841:24838,60842:24845,60843:24925,60844:25001,60845:24989,60846:25035,60847:25041,60848:25094,60849:32896,60850:32895,60851:27795,60852:27894,60853:28156,60854:30710,60855:30712,60856:30720,60857:30729,60858:30743,60859:30744,60860:30737,60861:26027,60862:30765,60863:30748,60864:30749,60865:30777,60866:30778,60867:30779,60868:30751,60869:30780,60870:30757,60871:30764,60872:30755,60873:30761,60874:30798,60875:30829,60876:30806,60877:30807,60878:30758,60879:30800,60880:30791,60881:30796,60882:30826,60883:30875,60884:30867,60885:30874,60886:30855,60887:30876,60888:30881,60889:30883,60890:30898,60891:30905,60892:30885,60893:30932,60894:30937,60895:30921,60896:30956,60897:30962,60898:30981,60899:30964,60900:30995,60901:31012,60902:31006,60903:31028,60904:40859,60905:40697,60906:40699,60907:40700,60908:30449,60909:30468,60910:30477,60911:30457,60912:30471,60913:30472,60914:30490,60915:30498,60916:30489,60917:30509,60918:30502,60919:30517,60920:30520,60921:30544,60922:30545,60923:30535,60924:30531,60925:30554,60926:30568,60992:38927,60993:38928,60994:38929,60995:38930,60996:38931,60997:38932,60998:38933,60999:38934,61000:38935,61001:38936,61002:38937,61003:38938,61004:38939,61005:38940,61006:38941,61007:38942,61008:38943,61009:38944,61010:38945,61011:38946,61012:38947,61013:38948,61014:38949,61015:38950,61016:38951,61017:38952,61018:38953,61019:38954,61020:38955,61021:38956,61022:38957,61023:38958,61024:38959,61025:38960,61026:38961,61027:38962,61028:38963,61029:38964,61030:38965,61031:38966,61032:38967,61033:38968,61034:38969,61035:38970,61036:38971,61037:38972,61038:38973,61039:38974,61040:38975,61041:38976,61042:38977,61043:38978,61044:38979,61045:38980,61046:38981,61047:38982,61048:38983,61049:38984,61050:38985,61051:38986,61052:38987,61053:38988,61054:38989,61056:38990,61057:38991,61058:38992,61059:38993,61060:38994,61061:38995,61062:38996,61063:38997,61064:38998,61065:38999,61066:39000,61067:39001,61068:39002,61069:39003,61070:39004,61071:39005,61072:39006,61073:39007,61074:39008,61075:39009,61076:39010,61077:39011,61078:39012,61079:39013,61080:39014,61081:39015,61082:39016,61083:39017,61084:39018,61085:39019,61086:39020,61087:39021,61088:39022,61089:30562,61090:30565,61091:30591,61092:30605,61093:30589,61094:30592,61095:30604,61096:30609,61097:30623,61098:30624,61099:30640,61100:30645,61101:30653,61102:30010,61103:30016,61104:30030,61105:30027,61106:30024,61107:30043,61108:30066,61109:30073,61110:30083,61111:32600,61112:32609,61113:32607,61114:35400,61115:32616,61116:32628,61117:32625,61118:32633,61119:32641,61120:32638,61121:30413,61122:30437,61123:34866,61124:38021,61125:38022,61126:38023,61127:38027,61128:38026,61129:38028,61130:38029,61131:38031,61132:38032,61133:38036,61134:38039,61135:38037,61136:38042,61137:38043,61138:38044,61139:38051,61140:38052,61141:38059,61142:38058,61143:38061,61144:38060,61145:38063,61146:38064,61147:38066,61148:38068,61149:38070,61150:38071,61151:38072,61152:38073,61153:38074,61154:38076,61155:38077,61156:38079,61157:38084,61158:38088,61159:38089,61160:38090,61161:38091,61162:38092,61163:38093,61164:38094,61165:38096,61166:38097,61167:38098,61168:38101,61169:38102,61170:38103,61171:38105,61172:38104,61173:38107,61174:38110,61175:38111,61176:38112,61177:38114,61178:38116,61179:38117,61180:38119,61181:38120,61182:38122,61248:39023,61249:39024,61250:39025,61251:39026,61252:39027,61253:39028,61254:39051,61255:39054,61256:39058,61257:39061,61258:39065,61259:39075,61260:39080,61261:39081,61262:39082,61263:39083,61264:39084,61265:39085,61266:39086,61267:39087,61268:39088,61269:39089,61270:39090,61271:39091,61272:39092,61273:39093,61274:39094,61275:39095,61276:39096,61277:39097,61278:39098,61279:39099,61280:39100,61281:39101,61282:39102,61283:39103,61284:39104,61285:39105,61286:39106,61287:39107,61288:39108,61289:39109,61290:39110,61291:39111,61292:39112,61293:39113,61294:39114,61295:39115,61296:39116,61297:39117,61298:39119,61299:39120,61300:39124,61301:39126,61302:39127,61303:39131,61304:39132,61305:39133,61306:39136,61307:39137,61308:39138,61309:39139,61310:39140,61312:39141,61313:39142,61314:39145,61315:39146,61316:39147,61317:39148,61318:39149,61319:39150,61320:39151,61321:39152,61322:39153,61323:39154,61324:39155,61325:39156,61326:39157,61327:39158,61328:39159,61329:39160,61330:39161,61331:39162,61332:39163,61333:39164,61334:39165,61335:39166,61336:39167,61337:39168,61338:39169,61339:39170,61340:39171,61341:39172,61342:39173,61343:39174,61344:39175,61345:38121,61346:38123,61347:38126,61348:38127,61349:38131,61350:38132,61351:38133,61352:38135,61353:38137,61354:38140,61355:38141,61356:38143,61357:38147,61358:38146,61359:38150,61360:38151,61361:38153,61362:38154,61363:38157,61364:38158,61365:38159,61366:38162,61367:38163,61368:38164,61369:38165,61370:38166,61371:38168,61372:38171,61373:38173,61374:38174,61375:38175,61376:38178,61377:38186,61378:38187,61379:38185,61380:38188,61381:38193,61382:38194,61383:38196,61384:38198,61385:38199,61386:38200,61387:38204,61388:38206,61389:38207,61390:38210,61391:38197,61392:38212,61393:38213,61394:38214,61395:38217,61396:38220,61397:38222,61398:38223,61399:38226,61400:38227,61401:38228,61402:38230,61403:38231,61404:38232,61405:38233,61406:38235,61407:38238,61408:38239,61409:38237,61410:38241,61411:38242,61412:38244,61413:38245,61414:38246,61415:38247,61416:38248,61417:38249,61418:38250,61419:38251,61420:38252,61421:38255,61422:38257,61423:38258,61424:38259,61425:38202,61426:30695,61427:30700,61428:38601,61429:31189,61430:31213,61431:31203,61432:31211,61433:31238,61434:23879,61435:31235,61436:31234,61437:31262,61438:31252,61504:39176,61505:39177,61506:39178,61507:39179,61508:39180,61509:39182,61510:39183,61511:39185,61512:39186,61513:39187,61514:39188,61515:39189,61516:39190,61517:39191,61518:39192,61519:39193,61520:39194,61521:39195,61522:39196,61523:39197,61524:39198,61525:39199,61526:39200,61527:39201,61528:39202,61529:39203,61530:39204,61531:39205,61532:39206,61533:39207,61534:39208,61535:39209,61536:39210,61537:39211,61538:39212,61539:39213,61540:39215,61541:39216,61542:39217,61543:39218,61544:39219,61545:39220,61546:39221,61547:39222,61548:39223,61549:39224,61550:39225,61551:39226,61552:39227,61553:39228,61554:39229,61555:39230,61556:39231,61557:39232,61558:39233,61559:39234,61560:39235,61561:39236,61562:39237,61563:39238,61564:39239,61565:39240,61566:39241,61568:39242,61569:39243,61570:39244,61571:39245,61572:39246,61573:39247,61574:39248,61575:39249,61576:39250,61577:39251,61578:39254,61579:39255,61580:39256,61581:39257,61582:39258,61583:39259,61584:39260,61585:39261,61586:39262,61587:39263,61588:39264,61589:39265,61590:39266,61591:39268,61592:39270,61593:39283,61594:39288,61595:39289,61596:39291,61597:39294,61598:39298,61599:39299,61600:39305,61601:31289,61602:31287,61603:31313,61604:40655,61605:39333,61606:31344,61607:30344,61608:30350,61609:30355,61610:30361,61611:30372,61612:29918,61613:29920,61614:29996,61615:40480,61616:40482,61617:40488,61618:40489,61619:40490,61620:40491,61621:40492,61622:40498,61623:40497,61624:40502,61625:40504,61626:40503,61627:40505,61628:40506,61629:40510,61630:40513,61631:40514,61632:40516,61633:40518,61634:40519,61635:40520,61636:40521,61637:40523,61638:40524,61639:40526,61640:40529,61641:40533,61642:40535,61643:40538,61644:40539,61645:40540,61646:40542,61647:40547,61648:40550,61649:40551,61650:40552,61651:40553,61652:40554,61653:40555,61654:40556,61655:40561,61656:40557,61657:40563,61658:30098,61659:30100,61660:30102,61661:30112,61662:30109,61663:30124,61664:30115,61665:30131,61666:30132,61667:30136,61668:30148,61669:30129,61670:30128,61671:30147,61672:30146,61673:30166,61674:30157,61675:30179,61676:30184,61677:30182,61678:30180,61679:30187,61680:30183,61681:30211,61682:30193,61683:30204,61684:30207,61685:30224,61686:30208,61687:30213,61688:30220,61689:30231,61690:30218,61691:30245,61692:30232,61693:30229,61694:30233,61760:39308,61761:39310,61762:39322,61763:39323,61764:39324,61765:39325,61766:39326,61767:39327,61768:39328,61769:39329,61770:39330,61771:39331,61772:39332,61773:39334,61774:39335,61775:39337,61776:39338,61777:39339,61778:39340,61779:39341,61780:39342,61781:39343,61782:39344,61783:39345,61784:39346,61785:39347,61786:39348,61787:39349,61788:39350,61789:39351,61790:39352,61791:39353,61792:39354,61793:39355,61794:39356,61795:39357,61796:39358,61797:39359,61798:39360,61799:39361,61800:39362,61801:39363,61802:39364,61803:39365,61804:39366,61805:39367,61806:39368,61807:39369,61808:39370,61809:39371,61810:39372,61811:39373,61812:39374,61813:39375,61814:39376,61815:39377,61816:39378,61817:39379,61818:39380,61819:39381,61820:39382,61821:39383,61822:39384,61824:39385,61825:39386,61826:39387,61827:39388,61828:39389,61829:39390,61830:39391,61831:39392,61832:39393,61833:39394,61834:39395,61835:39396,61836:39397,61837:39398,61838:39399,61839:39400,61840:39401,61841:39402,61842:39403,61843:39404,61844:39405,61845:39406,61846:39407,61847:39408,61848:39409,61849:39410,61850:39411,61851:39412,61852:39413,61853:39414,61854:39415,61855:39416,61856:39417,61857:30235,61858:30268,61859:30242,61860:30240,61861:30272,61862:30253,61863:30256,61864:30271,61865:30261,61866:30275,61867:30270,61868:30259,61869:30285,61870:30302,61871:30292,61872:30300,61873:30294,61874:30315,61875:30319,61876:32714,61877:31462,61878:31352,61879:31353,61880:31360,61881:31366,61882:31368,61883:31381,61884:31398,61885:31392,61886:31404,61887:31400,61888:31405,61889:31411,61890:34916,61891:34921,61892:34930,61893:34941,61894:34943,61895:34946,61896:34978,61897:35014,61898:34999,61899:35004,61900:35017,61901:35042,61902:35022,61903:35043,61904:35045,61905:35057,61906:35098,61907:35068,61908:35048,61909:35070,61910:35056,61911:35105,61912:35097,61913:35091,61914:35099,61915:35082,61916:35124,61917:35115,61918:35126,61919:35137,61920:35174,61921:35195,61922:30091,61923:32997,61924:30386,61925:30388,61926:30684,61927:32786,61928:32788,61929:32790,61930:32796,61931:32800,61932:32802,61933:32805,61934:32806,61935:32807,61936:32809,61937:32808,61938:32817,61939:32779,61940:32821,61941:32835,61942:32838,61943:32845,61944:32850,61945:32873,61946:32881,61947:35203,61948:39032,61949:39040,61950:39043,62016:39418,62017:39419,62018:39420,62019:39421,62020:39422,62021:39423,62022:39424,62023:39425,62024:39426,62025:39427,62026:39428,62027:39429,62028:39430,62029:39431,62030:39432,62031:39433,62032:39434,62033:39435,62034:39436,62035:39437,62036:39438,62037:39439,62038:39440,62039:39441,62040:39442,62041:39443,62042:39444,62043:39445,62044:39446,62045:39447,62046:39448,62047:39449,62048:39450,62049:39451,62050:39452,62051:39453,62052:39454,62053:39455,62054:39456,62055:39457,62056:39458,62057:39459,62058:39460,62059:39461,62060:39462,62061:39463,62062:39464,62063:39465,62064:39466,62065:39467,62066:39468,62067:39469,62068:39470,62069:39471,62070:39472,62071:39473,62072:39474,62073:39475,62074:39476,62075:39477,62076:39478,62077:39479,62078:39480,62080:39481,62081:39482,62082:39483,62083:39484,62084:39485,62085:39486,62086:39487,62087:39488,62088:39489,62089:39490,62090:39491,62091:39492,62092:39493,62093:39494,62094:39495,62095:39496,62096:39497,62097:39498,62098:39499,62099:39500,62100:39501,62101:39502,62102:39503,62103:39504,62104:39505,62105:39506,62106:39507,62107:39508,62108:39509,62109:39510,62110:39511,62111:39512,62112:39513,62113:39049,62114:39052,62115:39053,62116:39055,62117:39060,62118:39066,62119:39067,62120:39070,62121:39071,62122:39073,62123:39074,62124:39077,62125:39078,62126:34381,62127:34388,62128:34412,62129:34414,62130:34431,62131:34426,62132:34428,62133:34427,62134:34472,62135:34445,62136:34443,62137:34476,62138:34461,62139:34471,62140:34467,62141:34474,62142:34451,62143:34473,62144:34486,62145:34500,62146:34485,62147:34510,62148:34480,62149:34490,62150:34481,62151:34479,62152:34505,62153:34511,62154:34484,62155:34537,62156:34545,62157:34546,62158:34541,62159:34547,62160:34512,62161:34579,62162:34526,62163:34548,62164:34527,62165:34520,62166:34513,62167:34563,62168:34567,62169:34552,62170:34568,62171:34570,62172:34573,62173:34569,62174:34595,62175:34619,62176:34590,62177:34597,62178:34606,62179:34586,62180:34622,62181:34632,62182:34612,62183:34609,62184:34601,62185:34615,62186:34623,62187:34690,62188:34594,62189:34685,62190:34686,62191:34683,62192:34656,62193:34672,62194:34636,62195:34670,62196:34699,62197:34643,62198:34659,62199:34684,62200:34660,62201:34649,62202:34661,62203:34707,62204:34735,62205:34728,62206:34770,62272:39514,62273:39515,62274:39516,62275:39517,62276:39518,62277:39519,62278:39520,62279:39521,62280:39522,62281:39523,62282:39524,62283:39525,62284:39526,62285:39527,62286:39528,62287:39529,62288:39530,62289:39531,62290:39538,62291:39555,62292:39561,62293:39565,62294:39566,62295:39572,62296:39573,62297:39577,62298:39590,62299:39593,62300:39594,62301:39595,62302:39596,62303:39597,62304:39598,62305:39599,62306:39602,62307:39603,62308:39604,62309:39605,62310:39609,62311:39611,62312:39613,62313:39614,62314:39615,62315:39619,62316:39620,62317:39622,62318:39623,62319:39624,62320:39625,62321:39626,62322:39629,62323:39630,62324:39631,62325:39632,62326:39634,62327:39636,62328:39637,62329:39638,62330:39639,62331:39641,62332:39642,62333:39643,62334:39644,62336:39645,62337:39646,62338:39648,62339:39650,62340:39651,62341:39652,62342:39653,62343:39655,62344:39656,62345:39657,62346:39658,62347:39660,62348:39662,62349:39664,62350:39665,62351:39666,62352:39667,62353:39668,62354:39669,62355:39670,62356:39671,62357:39672,62358:39674,62359:39676,62360:39677,62361:39678,62362:39679,62363:39680,62364:39681,62365:39682,62366:39684,62367:39685,62368:39686,62369:34758,62370:34696,62371:34693,62372:34733,62373:34711,62374:34691,62375:34731,62376:34789,62377:34732,62378:34741,62379:34739,62380:34763,62381:34771,62382:34749,62383:34769,62384:34752,62385:34762,62386:34779,62387:34794,62388:34784,62389:34798,62390:34838,62391:34835,62392:34814,62393:34826,62394:34843,62395:34849,62396:34873,62397:34876,62398:32566,62399:32578,62400:32580,62401:32581,62402:33296,62403:31482,62404:31485,62405:31496,62406:31491,62407:31492,62408:31509,62409:31498,62410:31531,62411:31503,62412:31559,62413:31544,62414:31530,62415:31513,62416:31534,62417:31537,62418:31520,62419:31525,62420:31524,62421:31539,62422:31550,62423:31518,62424:31576,62425:31578,62426:31557,62427:31605,62428:31564,62429:31581,62430:31584,62431:31598,62432:31611,62433:31586,62434:31602,62435:31601,62436:31632,62437:31654,62438:31655,62439:31672,62440:31660,62441:31645,62442:31656,62443:31621,62444:31658,62445:31644,62446:31650,62447:31659,62448:31668,62449:31697,62450:31681,62451:31692,62452:31709,62453:31706,62454:31717,62455:31718,62456:31722,62457:31756,62458:31742,62459:31740,62460:31759,62461:31766,62462:31755,62528:39687,62529:39689,62530:39690,62531:39691,62532:39692,62533:39693,62534:39694,62535:39696,62536:39697,62537:39698,62538:39700,62539:39701,62540:39702,62541:39703,62542:39704,62543:39705,62544:39706,62545:39707,62546:39708,62547:39709,62548:39710,62549:39712,62550:39713,62551:39714,62552:39716,62553:39717,62554:39718,62555:39719,62556:39720,62557:39721,62558:39722,62559:39723,62560:39724,62561:39725,62562:39726,62563:39728,62564:39729,62565:39731,62566:39732,62567:39733,62568:39734,62569:39735,62570:39736,62571:39737,62572:39738,62573:39741,62574:39742,62575:39743,62576:39744,62577:39750,62578:39754,62579:39755,62580:39756,62581:39758,62582:39760,62583:39762,62584:39763,62585:39765,62586:39766,62587:39767,62588:39768,62589:39769,62590:39770,62592:39771,62593:39772,62594:39773,62595:39774,62596:39775,62597:39776,62598:39777,62599:39778,62600:39779,62601:39780,62602:39781,62603:39782,62604:39783,62605:39784,62606:39785,62607:39786,62608:39787,62609:39788,62610:39789,62611:39790,62612:39791,62613:39792,62614:39793,62615:39794,62616:39795,62617:39796,62618:39797,62619:39798,62620:39799,62621:39800,62622:39801,62623:39802,62624:39803,62625:31775,62626:31786,62627:31782,62628:31800,62629:31809,62630:31808,62631:33278,62632:33281,62633:33282,62634:33284,62635:33260,62636:34884,62637:33313,62638:33314,62639:33315,62640:33325,62641:33327,62642:33320,62643:33323,62644:33336,62645:33339,62646:33331,62647:33332,62648:33342,62649:33348,62650:33353,62651:33355,62652:33359,62653:33370,62654:33375,62655:33384,62656:34942,62657:34949,62658:34952,62659:35032,62660:35039,62661:35166,62662:32669,62663:32671,62664:32679,62665:32687,62666:32688,62667:32690,62668:31868,62669:25929,62670:31889,62671:31901,62672:31900,62673:31902,62674:31906,62675:31922,62676:31932,62677:31933,62678:31937,62679:31943,62680:31948,62681:31949,62682:31944,62683:31941,62684:31959,62685:31976,62686:33390,62687:26280,62688:32703,62689:32718,62690:32725,62691:32741,62692:32737,62693:32742,62694:32745,62695:32750,62696:32755,62697:31992,62698:32119,62699:32166,62700:32174,62701:32327,62702:32411,62703:40632,62704:40628,62705:36211,62706:36228,62707:36244,62708:36241,62709:36273,62710:36199,62711:36205,62712:35911,62713:35913,62714:37194,62715:37200,62716:37198,62717:37199,62718:37220,62784:39804,62785:39805,62786:39806,62787:39807,62788:39808,62789:39809,62790:39810,62791:39811,62792:39812,62793:39813,62794:39814,62795:39815,62796:39816,62797:39817,62798:39818,62799:39819,62800:39820,62801:39821,62802:39822,62803:39823,62804:39824,62805:39825,62806:39826,62807:39827,62808:39828,62809:39829,62810:39830,62811:39831,62812:39832,62813:39833,62814:39834,62815:39835,62816:39836,62817:39837,62818:39838,62819:39839,62820:39840,62821:39841,62822:39842,62823:39843,62824:39844,62825:39845,62826:39846,62827:39847,62828:39848,62829:39849,62830:39850,62831:39851,62832:39852,62833:39853,62834:39854,62835:39855,62836:39856,62837:39857,62838:39858,62839:39859,62840:39860,62841:39861,62842:39862,62843:39863,62844:39864,62845:39865,62846:39866,62848:39867,62849:39868,62850:39869,62851:39870,62852:39871,62853:39872,62854:39873,62855:39874,62856:39875,62857:39876,62858:39877,62859:39878,62860:39879,62861:39880,62862:39881,62863:39882,62864:39883,62865:39884,62866:39885,62867:39886,62868:39887,62869:39888,62870:39889,62871:39890,62872:39891,62873:39892,62874:39893,62875:39894,62876:39895,62877:39896,62878:39897,62879:39898,62880:39899,62881:37218,62882:37217,62883:37232,62884:37225,62885:37231,62886:37245,62887:37246,62888:37234,62889:37236,62890:37241,62891:37260,62892:37253,62893:37264,62894:37261,62895:37265,62896:37282,62897:37283,62898:37290,62899:37293,62900:37294,62901:37295,62902:37301,62903:37300,62904:37306,62905:35925,62906:40574,62907:36280,62908:36331,62909:36357,62910:36441,62911:36457,62912:36277,62913:36287,62914:36284,62915:36282,62916:36292,62917:36310,62918:36311,62919:36314,62920:36318,62921:36302,62922:36303,62923:36315,62924:36294,62925:36332,62926:36343,62927:36344,62928:36323,62929:36345,62930:36347,62931:36324,62932:36361,62933:36349,62934:36372,62935:36381,62936:36383,62937:36396,62938:36398,62939:36387,62940:36399,62941:36410,62942:36416,62943:36409,62944:36405,62945:36413,62946:36401,62947:36425,62948:36417,62949:36418,62950:36433,62951:36434,62952:36426,62953:36464,62954:36470,62955:36476,62956:36463,62957:36468,62958:36485,62959:36495,62960:36500,62961:36496,62962:36508,62963:36510,62964:35960,62965:35970,62966:35978,62967:35973,62968:35992,62969:35988,62970:26011,62971:35286,62972:35294,62973:35290,62974:35292,63040:39900,63041:39901,63042:39902,63043:39903,63044:39904,63045:39905,63046:39906,63047:39907,63048:39908,63049:39909,63050:39910,63051:39911,63052:39912,63053:39913,63054:39914,63055:39915,63056:39916,63057:39917,63058:39918,63059:39919,63060:39920,63061:39921,63062:39922,63063:39923,63064:39924,63065:39925,63066:39926,63067:39927,63068:39928,63069:39929,63070:39930,63071:39931,63072:39932,63073:39933,63074:39934,63075:39935,63076:39936,63077:39937,63078:39938,63079:39939,63080:39940,63081:39941,63082:39942,63083:39943,63084:39944,63085:39945,63086:39946,63087:39947,63088:39948,63089:39949,63090:39950,63091:39951,63092:39952,63093:39953,63094:39954,63095:39955,63096:39956,63097:39957,63098:39958,63099:39959,63100:39960,63101:39961,63102:39962,63104:39963,63105:39964,63106:39965,63107:39966,63108:39967,63109:39968,63110:39969,63111:39970,63112:39971,63113:39972,63114:39973,63115:39974,63116:39975,63117:39976,63118:39977,63119:39978,63120:39979,63121:39980,63122:39981,63123:39982,63124:39983,63125:39984,63126:39985,63127:39986,63128:39987,63129:39988,63130:39989,63131:39990,63132:39991,63133:39992,63134:39993,63135:39994,63136:39995,63137:35301,63138:35307,63139:35311,63140:35390,63141:35622,63142:38739,63143:38633,63144:38643,63145:38639,63146:38662,63147:38657,63148:38664,63149:38671,63150:38670,63151:38698,63152:38701,63153:38704,63154:38718,63155:40832,63156:40835,63157:40837,63158:40838,63159:40839,63160:40840,63161:40841,63162:40842,63163:40844,63164:40702,63165:40715,63166:40717,63167:38585,63168:38588,63169:38589,63170:38606,63171:38610,63172:30655,63173:38624,63174:37518,63175:37550,63176:37576,63177:37694,63178:37738,63179:37834,63180:37775,63181:37950,63182:37995,63183:40063,63184:40066,63185:40069,63186:40070,63187:40071,63188:40072,63189:31267,63190:40075,63191:40078,63192:40080,63193:40081,63194:40082,63195:40084,63196:40085,63197:40090,63198:40091,63199:40094,63200:40095,63201:40096,63202:40097,63203:40098,63204:40099,63205:40101,63206:40102,63207:40103,63208:40104,63209:40105,63210:40107,63211:40109,63212:40110,63213:40112,63214:40113,63215:40114,63216:40115,63217:40116,63218:40117,63219:40118,63220:40119,63221:40122,63222:40123,63223:40124,63224:40125,63225:40132,63226:40133,63227:40134,63228:40135,63229:40138,63230:40139,63296:39996,63297:39997,63298:39998,63299:39999,63300:40000,63301:40001,63302:40002,63303:40003,63304:40004,63305:40005,63306:40006,63307:40007,63308:40008,63309:40009,63310:40010,63311:40011,63312:40012,63313:40013,63314:40014,63315:40015,63316:40016,63317:40017,63318:40018,63319:40019,63320:40020,63321:40021,63322:40022,63323:40023,63324:40024,63325:40025,63326:40026,63327:40027,63328:40028,63329:40029,63330:40030,63331:40031,63332:40032,63333:40033,63334:40034,63335:40035,63336:40036,63337:40037,63338:40038,63339:40039,63340:40040,63341:40041,63342:40042,63343:40043,63344:40044,63345:40045,63346:40046,63347:40047,63348:40048,63349:40049,63350:40050,63351:40051,63352:40052,63353:40053,63354:40054,63355:40055,63356:40056,63357:40057,63358:40058,63360:40059,63361:40061,63362:40062,63363:40064,63364:40067,63365:40068,63366:40073,63367:40074,63368:40076,63369:40079,63370:40083,63371:40086,63372:40087,63373:40088,63374:40089,63375:40093,63376:40106,63377:40108,63378:40111,63379:40121,63380:40126,63381:40127,63382:40128,63383:40129,63384:40130,63385:40136,63386:40137,63387:40145,63388:40146,63389:40154,63390:40155,63391:40160,63392:40161,63393:40140,63394:40141,63395:40142,63396:40143,63397:40144,63398:40147,63399:40148,63400:40149,63401:40151,63402:40152,63403:40153,63404:40156,63405:40157,63406:40159,63407:40162,63408:38780,63409:38789,63410:38801,63411:38802,63412:38804,63413:38831,63414:38827,63415:38819,63416:38834,63417:38836,63418:39601,63419:39600,63420:39607,63421:40536,63422:39606,63423:39610,63424:39612,63425:39617,63426:39616,63427:39621,63428:39618,63429:39627,63430:39628,63431:39633,63432:39749,63433:39747,63434:39751,63435:39753,63436:39752,63437:39757,63438:39761,63439:39144,63440:39181,63441:39214,63442:39253,63443:39252,63444:39647,63445:39649,63446:39654,63447:39663,63448:39659,63449:39675,63450:39661,63451:39673,63452:39688,63453:39695,63454:39699,63455:39711,63456:39715,63457:40637,63458:40638,63459:32315,63460:40578,63461:40583,63462:40584,63463:40587,63464:40594,63465:37846,63466:40605,63467:40607,63468:40667,63469:40668,63470:40669,63471:40672,63472:40671,63473:40674,63474:40681,63475:40679,63476:40677,63477:40682,63478:40687,63479:40738,63480:40748,63481:40751,63482:40761,63483:40759,63484:40765,63485:40766,63486:40772,63552:40163,63553:40164,63554:40165,63555:40166,63556:40167,63557:40168,63558:40169,63559:40170,63560:40171,63561:40172,63562:40173,63563:40174,63564:40175,63565:40176,63566:40177,63567:40178,63568:40179,63569:40180,63570:40181,63571:40182,63572:40183,63573:40184,63574:40185,63575:40186,63576:40187,63577:40188,63578:40189,63579:40190,63580:40191,63581:40192,63582:40193,63583:40194,63584:40195,63585:40196,63586:40197,63587:40198,63588:40199,63589:40200,63590:40201,63591:40202,63592:40203,63593:40204,63594:40205,63595:40206,63596:40207,63597:40208,63598:40209,63599:40210,63600:40211,63601:40212,63602:40213,63603:40214,63604:40215,63605:40216,63606:40217,63607:40218,63608:40219,63609:40220,63610:40221,63611:40222,63612:40223,63613:40224,63614:40225,63616:40226,63617:40227,63618:40228,63619:40229,63620:40230,63621:40231,63622:40232,63623:40233,63624:40234,63625:40235,63626:40236,63627:40237,63628:40238,63629:40239,63630:40240,63631:40241,63632:40242,63633:40243,63634:40244,63635:40245,63636:40246,63637:40247,63638:40248,63639:40249,63640:40250,63641:40251,63642:40252,63643:40253,63644:40254,63645:40255,63646:40256,63647:40257,63648:40258,63649:57908,63650:57909,63651:57910,63652:57911,63653:57912,63654:57913,63655:57914,63656:57915,63657:57916,63658:57917,63659:57918,63660:57919,63661:57920,63662:57921,63663:57922,63664:57923,63665:57924,63666:57925,63667:57926,63668:57927,63669:57928,63670:57929,63671:57930,63672:57931,63673:57932,63674:57933,63675:57934,63676:57935,63677:57936,63678:57937,63679:57938,63680:57939,63681:57940,63682:57941,63683:57942,63684:57943,63685:57944,63686:57945,63687:57946,63688:57947,63689:57948,63690:57949,63691:57950,63692:57951,63693:57952,63694:57953,63695:57954,63696:57955,63697:57956,63698:57957,63699:57958,63700:57959,63701:57960,63702:57961,63703:57962,63704:57963,63705:57964,63706:57965,63707:57966,63708:57967,63709:57968,63710:57969,63711:57970,63712:57971,63713:57972,63714:57973,63715:57974,63716:57975,63717:57976,63718:57977,63719:57978,63720:57979,63721:57980,63722:57981,63723:57982,63724:57983,63725:57984,63726:57985,63727:57986,63728:57987,63729:57988,63730:57989,63731:57990,63732:57991,63733:57992,63734:57993,63735:57994,63736:57995,63737:57996,63738:57997,63739:57998,63740:57999,63741:58000,63742:58001,63808:40259,63809:40260,63810:40261,63811:40262,63812:40263,63813:40264,63814:40265,63815:40266,63816:40267,63817:40268,63818:40269,63819:40270,63820:40271,63821:40272,63822:40273,63823:40274,63824:40275,63825:40276,63826:40277,63827:40278,63828:40279,63829:40280,63830:40281,63831:40282,63832:40283,63833:40284,63834:40285,63835:40286,63836:40287,63837:40288,63838:40289,63839:40290,63840:40291,63841:40292,63842:40293,63843:40294,63844:40295,63845:40296,63846:40297,63847:40298,63848:40299,63849:40300,63850:40301,63851:40302,63852:40303,63853:40304,63854:40305,63855:40306,63856:40307,63857:40308,63858:40309,63859:40310,63860:40311,63861:40312,63862:40313,63863:40314,63864:40315,63865:40316,63866:40317,63867:40318,63868:40319,63869:40320,63870:40321,63872:40322,63873:40323,63874:40324,63875:40325,63876:40326,63877:40327,63878:40328,63879:40329,63880:40330,63881:40331,63882:40332,63883:40333,63884:40334,63885:40335,63886:40336,63887:40337,63888:40338,63889:40339,63890:40340,63891:40341,63892:40342,63893:40343,63894:40344,63895:40345,63896:40346,63897:40347,63898:40348,63899:40349,63900:40350,63901:40351,63902:40352,63903:40353,63904:40354,63905:58002,63906:58003,63907:58004,63908:58005,63909:58006,63910:58007,63911:58008,63912:58009,63913:58010,63914:58011,63915:58012,63916:58013,63917:58014,63918:58015,63919:58016,63920:58017,63921:58018,63922:58019,63923:58020,63924:58021,63925:58022,63926:58023,63927:58024,63928:58025,63929:58026,63930:58027,63931:58028,63932:58029,63933:58030,63934:58031,63935:58032,63936:58033,63937:58034,63938:58035,63939:58036,63940:58037,63941:58038,63942:58039,63943:58040,63944:58041,63945:58042,63946:58043,63947:58044,63948:58045,63949:58046,63950:58047,63951:58048,63952:58049,63953:58050,63954:58051,63955:58052,63956:58053,63957:58054,63958:58055,63959:58056,63960:58057,63961:58058,63962:58059,63963:58060,63964:58061,63965:58062,63966:58063,63967:58064,63968:58065,63969:58066,63970:58067,63971:58068,63972:58069,63973:58070,63974:58071,63975:58072,63976:58073,63977:58074,63978:58075,63979:58076,63980:58077,63981:58078,63982:58079,63983:58080,63984:58081,63985:58082,63986:58083,63987:58084,63988:58085,63989:58086,63990:58087,63991:58088,63992:58089,63993:58090,63994:58091,63995:58092,63996:58093,63997:58094,63998:58095,64064:40355,64065:40356,64066:40357,64067:40358,64068:40359,64069:40360,64070:40361,64071:40362,64072:40363,64073:40364,64074:40365,64075:40366,64076:40367,64077:40368,64078:40369,64079:40370,64080:40371,64081:40372,64082:40373,64083:40374,64084:40375,64085:40376,64086:40377,64087:40378,64088:40379,64089:40380,64090:40381,64091:40382,64092:40383,64093:40384,64094:40385,64095:40386,64096:40387,64097:40388,64098:40389,64099:40390,64100:40391,64101:40392,64102:40393,64103:40394,64104:40395,64105:40396,64106:40397,64107:40398,64108:40399,64109:40400,64110:40401,64111:40402,64112:40403,64113:40404,64114:40405,64115:40406,64116:40407,64117:40408,64118:40409,64119:40410,64120:40411,64121:40412,64122:40413,64123:40414,64124:40415,64125:40416,64126:40417,64128:40418,64129:40419,64130:40420,64131:40421,64132:40422,64133:40423,64134:40424,64135:40425,64136:40426,64137:40427,64138:40428,64139:40429,64140:40430,64141:40431,64142:40432,64143:40433,64144:40434,64145:40435,64146:40436,64147:40437,64148:40438,64149:40439,64150:40440,64151:40441,64152:40442,64153:40443,64154:40444,64155:40445,64156:40446,64157:40447,64158:40448,64159:40449,64160:40450,64161:58096,64162:58097,64163:58098,64164:58099,64165:58100,64166:58101,64167:58102,64168:58103,64169:58104,64170:58105,64171:58106,64172:58107,64173:58108,64174:58109,64175:58110,64176:58111,64177:58112,64178:58113,64179:58114,64180:58115,64181:58116,64182:58117,64183:58118,64184:58119,64185:58120,64186:58121,64187:58122,64188:58123,64189:58124,64190:58125,64191:58126,64192:58127,64193:58128,64194:58129,64195:58130,64196:58131,64197:58132,64198:58133,64199:58134,64200:58135,64201:58136,64202:58137,64203:58138,64204:58139,64205:58140,64206:58141,64207:58142,64208:58143,64209:58144,64210:58145,64211:58146,64212:58147,64213:58148,64214:58149,64215:58150,64216:58151,64217:58152,64218:58153,64219:58154,64220:58155,64221:58156,64222:58157,64223:58158,64224:58159,64225:58160,64226:58161,64227:58162,64228:58163,64229:58164,64230:58165,64231:58166,64232:58167,64233:58168,64234:58169,64235:58170,64236:58171,64237:58172,64238:58173,64239:58174,64240:58175,64241:58176,64242:58177,64243:58178,64244:58179,64245:58180,64246:58181,64247:58182,64248:58183,64249:58184,64250:58185,64251:58186,64252:58187,64253:58188,64254:58189,64320:40451,64321:40452,64322:40453,64323:40454,64324:40455,64325:40456,64326:40457,64327:40458,64328:40459,64329:40460,64330:40461,64331:40462,64332:40463,64333:40464,64334:40465,64335:40466,64336:40467,64337:40468,64338:40469,64339:40470,64340:40471,64341:40472,64342:40473,64343:40474,64344:40475,64345:40476,64346:40477,64347:40478,64348:40484,64349:40487,64350:40494,64351:40496,64352:40500,64353:40507,64354:40508,64355:40512,64356:40525,64357:40528,64358:40530,64359:40531,64360:40532,64361:40534,64362:40537,64363:40541,64364:40543,64365:40544,64366:40545,64367:40546,64368:40549,64369:40558,64370:40559,64371:40562,64372:40564,64373:40565,64374:40566,64375:40567,64376:40568,64377:40569,64378:40570,64379:40571,64380:40572,64381:40573,64382:40576,64384:40577,64385:40579,64386:40580,64387:40581,64388:40582,64389:40585,64390:40586,64391:40588,64392:40589,64393:40590,64394:40591,64395:40592,64396:40593,64397:40596,64398:40597,64399:40598,64400:40599,64401:40600,64402:40601,64403:40602,64404:40603,64405:40604,64406:40606,64407:40608,64408:40609,64409:40610,64410:40611,64411:40612,64412:40613,64413:40615,64414:40616,64415:40617,64416:40618,64417:58190,64418:58191,64419:58192,64420:58193,64421:58194,64422:58195,64423:58196,64424:58197,64425:58198,64426:58199,64427:58200,64428:58201,64429:58202,64430:58203,64431:58204,64432:58205,64433:58206,64434:58207,64435:58208,64436:58209,64437:58210,64438:58211,64439:58212,64440:58213,64441:58214,64442:58215,64443:58216,64444:58217,64445:58218,64446:58219,64447:58220,64448:58221,64449:58222,64450:58223,64451:58224,64452:58225,64453:58226,64454:58227,64455:58228,64456:58229,64457:58230,64458:58231,64459:58232,64460:58233,64461:58234,64462:58235,64463:58236,64464:58237,64465:58238,64466:58239,64467:58240,64468:58241,64469:58242,64470:58243,64471:58244,64472:58245,64473:58246,64474:58247,64475:58248,64476:58249,64477:58250,64478:58251,64479:58252,64480:58253,64481:58254,64482:58255,64483:58256,64484:58257,64485:58258,64486:58259,64487:58260,64488:58261,64489:58262,64490:58263,64491:58264,64492:58265,64493:58266,64494:58267,64495:58268,64496:58269,64497:58270,64498:58271,64499:58272,64500:58273,64501:58274,64502:58275,64503:58276,64504:58277,64505:58278,64506:58279,64507:58280,64508:58281,64509:58282,64510:58283,64576:40619,64577:40620,64578:40621,64579:40622,64580:40623,64581:40624,64582:40625,64583:40626,64584:40627,64585:40629,64586:40630,64587:40631,64588:40633,64589:40634,64590:40636,64591:40639,64592:40640,64593:40641,64594:40642,64595:40643,64596:40645,64597:40646,64598:40647,64599:40648,64600:40650,64601:40651,64602:40652,64603:40656,64604:40658,64605:40659,64606:40661,64607:40662,64608:40663,64609:40665,64610:40666,64611:40670,64612:40673,64613:40675,64614:40676,64615:40678,64616:40680,64617:40683,64618:40684,64619:40685,64620:40686,64621:40688,64622:40689,64623:40690,64624:40691,64625:40692,64626:40693,64627:40694,64628:40695,64629:40696,64630:40698,64631:40701,64632:40703,64633:40704,64634:40705,64635:40706,64636:40707,64637:40708,64638:40709,64640:40710,64641:40711,64642:40712,64643:40713,64644:40714,64645:40716,64646:40719,64647:40721,64648:40722,64649:40724,64650:40725,64651:40726,64652:40728,64653:40730,64654:40731,64655:40732,64656:40733,64657:40734,64658:40735,64659:40737,64660:40739,64661:40740,64662:40741,64663:40742,64664:40743,64665:40744,64666:40745,64667:40746,64668:40747,64669:40749,64670:40750,64671:40752,64672:40753,64673:58284,64674:58285,64675:58286,64676:58287,64677:58288,64678:58289,64679:58290,64680:58291,64681:58292,64682:58293,64683:58294,64684:58295,64685:58296,64686:58297,64687:58298,64688:58299,64689:58300,64690:58301,64691:58302,64692:58303,64693:58304,64694:58305,64695:58306,64696:58307,64697:58308,64698:58309,64699:58310,64700:58311,64701:58312,64702:58313,64703:58314,64704:58315,64705:58316,64706:58317,64707:58318,64708:58319,64709:58320,64710:58321,64711:58322,64712:58323,64713:58324,64714:58325,64715:58326,64716:58327,64717:58328,64718:58329,64719:58330,64720:58331,64721:58332,64722:58333,64723:58334,64724:58335,64725:58336,64726:58337,64727:58338,64728:58339,64729:58340,64730:58341,64731:58342,64732:58343,64733:58344,64734:58345,64735:58346,64736:58347,64737:58348,64738:58349,64739:58350,64740:58351,64741:58352,64742:58353,64743:58354,64744:58355,64745:58356,64746:58357,64747:58358,64748:58359,64749:58360,64750:58361,64751:58362,64752:58363,64753:58364,64754:58365,64755:58366,64756:58367,64757:58368,64758:58369,64759:58370,64760:58371,64761:58372,64762:58373,64763:58374,64764:58375,64765:58376,64766:58377,64832:40754,64833:40755,64834:40756,64835:40757,64836:40758,64837:40760,64838:40762,64839:40764,64840:40767,64841:40768,64842:40769,64843:40770,64844:40771,64845:40773,64846:40774,64847:40775,64848:40776,64849:40777,64850:40778,64851:40779,64852:40780,64853:40781,64854:40782,64855:40783,64856:40786,64857:40787,64858:40788,64859:40789,64860:40790,64861:40791,64862:40792,64863:40793,64864:40794,64865:40795,64866:40796,64867:40797,64868:40798,64869:40799,64870:40800,64871:40801,64872:40802,64873:40803,64874:40804,64875:40805,64876:40806,64877:40807,64878:40808,64879:40809,64880:40810,64881:40811,64882:40812,64883:40813,64884:40814,64885:40815,64886:40816,64887:40817,64888:40818,64889:40819,64890:40820,64891:40821,64892:40822,64893:40823,64894:40824,64896:40825,64897:40826,64898:40827,64899:40828,64900:40829,64901:40830,64902:40833,64903:40834,64904:40845,64905:40846,64906:40847,64907:40848,64908:40849,64909:40850,64910:40851,64911:40852,64912:40853,64913:40854,64914:40855,64915:40856,64916:40860,64917:40861,64918:40862,64919:40865,64920:40866,64921:40867,64922:40868,64923:40869,64924:63788,64925:63865,64926:63893,64927:63975,64928:63985,64929:58378,64930:58379,64931:58380,64932:58381,64933:58382,64934:58383,64935:58384,64936:58385,64937:58386,64938:58387,64939:58388,64940:58389,64941:58390,64942:58391,64943:58392,64944:58393,64945:58394,64946:58395,64947:58396,64948:58397,64949:58398,64950:58399,64951:58400,64952:58401,64953:58402,64954:58403,64955:58404,64956:58405,64957:58406,64958:58407,64959:58408,64960:58409,64961:58410,64962:58411,64963:58412,64964:58413,64965:58414,64966:58415,64967:58416,64968:58417,64969:58418,64970:58419,64971:58420,64972:58421,64973:58422,64974:58423,64975:58424,64976:58425,64977:58426,64978:58427,64979:58428,64980:58429,64981:58430,64982:58431,64983:58432,64984:58433,64985:58434,64986:58435,64987:58436,64988:58437,64989:58438,64990:58439,64991:58440,64992:58441,64993:58442,64994:58443,64995:58444,64996:58445,64997:58446,64998:58447,64999:58448,65000:58449,65001:58450,65002:58451,65003:58452,65004:58453,65005:58454,65006:58455,65007:58456,65008:58457,65009:58458,65010:58459,65011:58460,65012:58461,65013:58462,65014:58463,65015:58464,65016:58465,65017:58466,65018:58467,65019:58468,65020:58469,65021:58470,65022:58471,65088:64012,65089:64013,65090:64014,65091:64015,65092:64017,65093:64019,65094:64020,65095:64024,65096:64031,65097:64032,65098:64033,65099:64035,65100:64036,65101:64039,65102:64040,65103:64041,65104:11905,65105:59414,65106:59415,65107:59416,65108:11908,65109:13427,65110:13383,65111:11912,65112:11915,65113:59422,65114:13726,65115:13850,65116:13838,65117:11916,65118:11927,65119:14702,65120:14616,65121:59430,65122:14799,65123:14815,65124:14963,65125:14800,65126:59435,65127:59436,65128:15182,65129:15470,65130:15584,65131:11943,65132:59441,65133:59442,65134:11946,65135:16470,65136:16735,65137:11950,65138:17207,65139:11955,65140:11958,65141:11959,65142:59451,65143:17329,65144:17324,65145:11963,65146:17373,65147:17622,65148:18017,65149:17996,65150:59459,65152:18211,65153:18217,65154:18300,65155:18317,65156:11978,65157:18759,65158:18810,65159:18813,65160:18818,65161:18819,65162:18821,65163:18822,65164:18847,65165:18843,65166:18871,65167:18870,65168:59476,65169:59477,65170:19619,65171:19615,65172:19616,65173:19617,65174:19575,65175:19618,65176:19731,65177:19732,65178:19733,65179:19734,65180:19735,65181:19736,65182:19737,65183:19886,65184:59492,65185:58472,65186:58473,65187:58474,65188:58475,65189:58476,65190:58477,65191:58478,65192:58479,65193:58480,65194:58481,65195:58482,65196:58483,65197:58484,65198:58485,65199:58486,65200:58487,65201:58488,65202:58489,65203:58490,65204:58491,65205:58492,65206:58493,65207:58494,65208:58495,65209:58496,65210:58497,65211:58498,65212:58499,65213:58500,65214:58501,65215:58502,65216:58503,65217:58504,65218:58505,65219:58506,65220:58507,65221:58508,65222:58509,65223:58510,65224:58511,65225:58512,65226:58513,65227:58514,65228:58515,65229:58516,65230:58517,65231:58518,65232:58519,65233:58520,65234:58521,65235:58522,65236:58523,65237:58524,65238:58525,65239:58526,65240:58527,65241:58528,65242:58529,65243:58530,65244:58531,65245:58532,65246:58533,65247:58534,65248:58535,65249:58536,65250:58537,65251:58538,65252:58539,65253:58540,65254:58541,65255:58542,65256:58543,65257:58544,65258:58545,65259:58546,65260:58547,65261:58548,65262:58549,65263:58550,65264:58551,65265:58552,65266:58553,65267:58554,65268:58555,65269:58556,65270:58557,65271:58558,65272:58559,65273:58560,65274:58561,65275:58562,65276:58563,65277:58564,65278:58565} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js new file mode 100644 index 0000000..909e433 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js @@ -0,0 +1,25 @@ +var http = require('http'); +var fs = require('fs'); +// BIG5 +var cp950_b2u = {host:'moztw.org',path:'/docs/big5/table/cp950-b2u.txt'}, + cp950_u2b = {host:'moztw.org',path:'/docs/big5/table/cp950-u2b.txt'}, + cp950_moz18_b2u = {host:'moztw.org',path:'/docs/big5/table/moz18-b2u.txt'}; + +http.get(cp950_moz18_b2u, function(res) { + var data = ''; + res.on('data', function(chunk) { + data += chunk; + }); + res.on('end', function() { + var table = {}; + data = data.split('\n').slice(1); + data.forEach(function(line, idx) { + var pair = line.split(' '); + var key = parseInt(pair[0]); + var val = parseInt(pair[1]); + table[key] = val; + }); + fs.createWriteSync('encodings/table/big5.js', + 'module.exports = ' + JSON.stringify(table) + ';'); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js new file mode 100644 index 0000000..2cbebec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js @@ -0,0 +1,142 @@ +var fs = require("fs"); +var Iconv = require("iconv").Iconv; + + +var encodingFamilies = [ + { + // Windows code pages + encodings: [1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258], + convert: function(cp) { + return { + name: "windows-"+cp, + aliases: ["win"+cp, "cp"+cp, ""+cp], + } + } + }, + { + // ISO-8859 code pages + encodings: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16], + convert: function(i) { + return { + name: "iso-8859-"+i, + aliases: ["cp"+(28590+i), (28590+i)], + } + } + }, + { + // IBM/DOS code pages + encodings: [437, 737, 775, 850, 852, 855, 857, 858, 860, 861, 862, 863, 864, 865, 866, 869], + convert: function(cp) { + return { + name: "CP"+cp, + aliases: ["ibm"+cp, ""+cp], + } + } + }, + { + // Macintosh code pages + encodings: ["macCroatian", "macCyrillic", "macGreek", + "macIceland", "macRoman", "macRomania", + "macThai", "macTurkish", "macUkraine"], + }, + { + // KOI8 code pages + encodings: ["KOI8-R", "KOI8-U"], + }, +]; + + +var encodings = { + // Aliases. + "ascii8bit": "ascii", + "usascii": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "cp819": "iso88951", + "arabic": "iso88596", + "arabic8": "iso88596", + "greek" : "iso88597", + "greek8" : "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", + "thai": "iso885911", + "thai8": "iso885911", + "tis620": "iso885911", + "windows874": "iso885911", + "win874": "iso885911", + "cp874": "iso885911", + "874": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + +}; + +// Add all encodings from encodingFamilies. +encodingFamilies.forEach(function(family){ + family.encodings.forEach(function(encoding){ + if (family.convert) + encoding = family.convert(encoding); + + var encodingIconvName = encoding.name ? encoding.name : encoding; + var encodingName = encodingIconvName.replace(/[-_]/g, "").toLowerCase(); + + encodings[encodingName] = { + type: "singlebyte", + chars: generateCharsString(encodingIconvName) + }; + + if (encoding.aliases) + encoding.aliases.forEach(function(alias){ + encodings[alias] = encodingName; + }); + }); +}); + +// Write encodings. +fs.writeFileSync("encodings/singlebyte.js", + "module.exports = " + JSON.stringify(encodings, undefined, " ") + ";"); + + +function generateCharsString(encoding) { + console.log("Generate encoding for " + encoding); + var iconvToUtf8 = new Iconv(encoding, "UTF-8"); + var chars = ""; + + for (var b = 0x80; b < 0x100; b++) { + + try { + var convertedChar = iconvToUtf8.convert(new Buffer([b])).toString(); + + if (convertedChar.length != 1) + throw new Error("Single-byte encoding error: Must return single char."); + } catch (exception) { + if (exception.code === "EILSEQ") { + convertedChar = "\ufffd"; + } else { + throw exception; + } + } + + chars += convertedChar; + } + + return chars; +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js new file mode 100644 index 0000000..a55691b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js @@ -0,0 +1,231 @@ +var RE_SPACEDASH = /[- ]/g; +// Module exports +var iconv = module.exports = { + toEncoding: function(str, encoding) { + return iconv.getCodec(encoding).toEncoding(str); + }, + fromEncoding: function(buf, encoding) { + return iconv.getCodec(encoding).fromEncoding(buf); + }, + encodingExists: function(enc) { + loadEncodings(); + enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); + return (iconv.encodings[enc] !== undefined); + }, + + defaultCharUnicode: '�', + defaultCharSingleByte: '?', + + encodingsLoaded: false, + + // Get correct codec for given encoding. + getCodec: function(encoding) { + loadEncodings(); + var enc = encoding || "utf8"; + var codecOptions = undefined; + while (1) { + if (getType(enc) === "String") + enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); + var codec = iconv.encodings[enc]; + var type = getType(codec); + if (type === "String") { + // Link to other encoding. + codecOptions = {originalEncoding: enc}; + enc = codec; + } + else if (type === "Object" && codec.type != undefined) { + // Options for other encoding. + codecOptions = codec; + enc = codec.type; + } + else if (type === "Function") + // Codec itself. + return codec(codecOptions); + else + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + }, + + // Define basic encodings + encodings: { + internal: function(options) { + return { + toEncoding: toInternalEncoding, + fromEncoding: fromInternalEncoding, + options: options + }; + }, + utf8: "internal", + ucs2: "internal", + binary: "internal", + ascii: "internal", + base64: "internal", + + // Codepage single-byte encodings. + singlebyte: function(options) { + // Prepare chars if needed + if (!options.charsBuf) { + if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256)) + throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (options.chars.length === 128) + options.chars = asciiString + options.chars; + + options.charsBuf = new Buffer(options.chars, 'ucs2'); + } + + if (!options.revCharsBuf) { + options.revCharsBuf = new Buffer(65536); + var defChar = iconv.defaultCharSingleByte.charCodeAt(0); + for (var i = 0; i < options.revCharsBuf.length; i++) + options.revCharsBuf[i] = defChar; + for (var i = 0; i < options.chars.length; i++) + options.revCharsBuf[options.chars.charCodeAt(i)] = i; + } + + return { + toEncoding: toSingleByteEncoding, + fromEncoding: fromSingleByteEncoding, + options: options, + }; + }, + + // Codepage double-byte encodings. + table: function(options) { + if (!options.table) { + throw new Error("Encoding '" + options.type + "' has incorect 'table' option"); + } + if (!options.revCharsTable) { + var revCharsTable = options.revCharsTable = {}; + for (var i = 0; i <= 0xFFFF; i++) { + revCharsTable[i] = 0; + } + + var table = options.table; + for (var key in table) { + revCharsTable[table[key]] = +key; + } + } + + return { + toEncoding: toTableEncoding, + fromEncoding: fromTableEncoding, + options: options, + }; + } + } +}; + +function toInternalEncoding(str) { + return new Buffer(ensureString(str), this.options.originalEncoding); +} + +function fromInternalEncoding(buf) { + return ensureBuffer(buf).toString(this.options.originalEncoding); +} + +function toTableEncoding(str) { + str = ensureString(str); + var strLen = str.length; + var revCharsTable = this.options.revCharsTable; + var newBuf = new Buffer(strLen*2), gbkcode, unicode, + defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)]; + + for (var i = 0, j = 0; i < strLen; i++) { + unicode = str.charCodeAt(i); + if (unicode >> 7) { + gbkcode = revCharsTable[unicode] || defaultChar; + newBuf[j++] = gbkcode >> 8; //high byte; + newBuf[j++] = gbkcode & 0xFF; //low byte + } else {//ascii + newBuf[j++] = unicode; + } + } + return newBuf.slice(0, j); +} + +function fromTableEncoding(buf) { + buf = ensureBuffer(buf); + var bufLen = buf.length; + var table = this.options.table; + var newBuf = new Buffer(bufLen*2), unicode, gbkcode, + defaultChar = iconv.defaultCharUnicode.charCodeAt(0); + + for (var i = 0, j = 0; i < bufLen; i++, j+=2) { + gbkcode = buf[i]; + if (gbkcode & 0x80) { + gbkcode = (gbkcode << 8) + buf[++i]; + unicode = table[gbkcode] || defaultChar; + } else { + unicode = gbkcode; + } + newBuf[j] = unicode & 0xFF; //low byte + newBuf[j+1] = unicode >> 8; //high byte + } + return newBuf.slice(0, j).toString('ucs2'); +} + +function toSingleByteEncoding(str) { + str = ensureString(str); + + var buf = new Buffer(str.length); + var revCharsBuf = this.options.revCharsBuf; + for (var i = 0; i < str.length; i++) + buf[i] = revCharsBuf[str.charCodeAt(i)]; + + return buf; +} + +function fromSingleByteEncoding(buf) { + buf = ensureBuffer(buf); + + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var charsBuf = this.options.charsBuf; + var newBuf = new Buffer(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0, _len = buf.length; i < _len; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = charsBuf[idx1]; + newBuf[idx2+1] = charsBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +// Add aliases to convert functions +iconv.encode = iconv.toEncoding; +iconv.decode = iconv.fromEncoding; + +// Load other encodings manually from files in /encodings dir. +function loadEncodings() { + if (!iconv.encodingsLoaded) { + [ require('./encodings/singlebyte'), + require('./encodings/gbk'), + require('./encodings/big5') + ].forEach(function(encodings) { + for (var key in encodings) + iconv.encodings[key] = encodings[key] + }); + iconv.encodingsLoaded = true; + } +} + + + +// Utilities +var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ + ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'; + +var ensureBuffer = function(buf) { + buf = buf || new Buffer(0); + return (buf instanceof Buffer) ? buf : new Buffer(""+buf, "binary"); +} + +var ensureString = function(str) { + str = str || ""; + return (str instanceof Buffer) ? str.toString('utf8') : (""+str); +} + +var getType = function(obj) { + return Object.prototype.toString.call(obj).slice(8, -1); +} + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json new file mode 100644 index 0000000..e70633d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json @@ -0,0 +1,84 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.2.11", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset" + ], + "author": { + "name": "Alexander Shtuchkin", + "email": "ashtuchkin@gmail.com" + }, + "contributors": [ + { + "name": "Jinwu Zhan", + "url": "https://github.com/jenkinv" + }, + { + "name": "Adamansky Anton", + "url": "https://github.com/adamansky" + }, + { + "name": "George Stagas", + "url": "https://github.com/stagas" + }, + { + "name": "Mike D Pilsbury", + "url": "https://github.com/pekim" + }, + { + "name": "Niggler", + "url": "https://github.com/Niggler" + }, + { + "name": "wychi", + "url": "https://github.com/wychi" + }, + { + "name": "David Kuo", + "url": "https://github.com/david50407" + }, + { + "name": "ChangZhuo Chen", + "url": "https://github.com/czchen" + }, + { + "name": "Lee Treveil", + "url": "https://github.com/leetreveil" + }, + { + "name": "Brian White", + "url": "https://github.com/mscdex" + } + ], + "main": "index.js", + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "vows --spec" + }, + "devDependencies": { + "vows": "", + "iconv": ">=1.1" + }, + "readme": "iconv-lite - pure javascript character encoding conversion\n======================================================================\n\n[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite)\n\n## Features\n\n* Pure javascript. Doesn't need native code compilation.\n* Easy API.\n* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n* Encoding is much faster than node-iconv (see below for performance comparison).\n\n## Usage\n\n var iconv = require('iconv-lite');\n \n // Convert from an encoded buffer to string.\n str = iconv.decode(buf, 'win1251');\n \n // Convert from string to an encoded buffer.\n buf = iconv.encode(\"Sample input string\", 'win1251');\n\n // Check if encoding is supported\n iconv.encodingExists(\"us-ascii\")\n\n\n## Supported encodings\n\n* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'\n* All widespread single byte encodings: Windows 125x family, ISO-8859 family, \n IBM/DOS codepages, Macintosh family, KOI8 family. \n Aliases like 'latin1', 'us-ascii' also supported.\n* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'.\n\nOthers are easy to add, see the source. Please, participate.\nMost encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors!\n\nNot supported yet: EUC family, Shift_JIS.\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). \nNote: your results may vary, so please always check on your hardware.\n\n operation iconv@1.2.4 iconv-lite@0.2.4 \n ----------------------------------------------------------\n encode('win1251') ~115 Mb/s ~230 Mb/s\n decode('win1251') ~95 Mb/s ~130 Mb/s\n\n\n## Notes\n\nWhen decoding, a 'binary'-encoded string can be used as a source buffer. \nUntranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome.\n\n## Testing\n\n git clone git@github.com:ashtuchkin/iconv-lite.git\n cd iconv-lite\n npm install\n npm test\n \n # To view performance:\n node test/performance.js\n\n## TODO\n\n* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')).\n* Add more encodings.\n* Add transliteration (best fit char).\n* Add tests and correct support of variable-byte encodings (currently work is delegated to node).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/ashtuchkin/iconv-lite/issues" + }, + "_id": "iconv-lite@0.2.11", + "dist": { + "shasum": "7bbadeccfb74c781a5084b9f141c03c7c848a8d9" + }, + "_from": "iconv-lite@~0.2.11", + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5-test.js new file mode 100644 index 0000000..f3fe1a8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5-test.js @@ -0,0 +1,36 @@ +var vows = require('vows'), + fs = require('fs'), + assert = require('assert'), + iconv = require(__dirname + '/../'); + +var testString = "中文abc", //unicode contains Big5-code and ascii + testStringBig5Buffer = new Buffer([0xa4,0xa4,0xa4,0xe5,0x61,0x62,0x63]), + testString2 = '測試', + testStringBig5Buffer2 = new Buffer([0xb4, 0xfa, 0xb8, 0xd5]); + +vows.describe("Big5 tests").addBatch({ + "Big5 correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testString, "big5").toString('binary'), testStringBig5Buffer.toString('binary')); + assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "big5"), testString); + assert.strictEqual(iconv.toEncoding(testString2, 'big5').toString('binary'), testStringBig5Buffer2.toString('binary')); + assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer2, 'big5'), testString2); + }, + "cp950 correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testString, "cp950").toString('binary'), testStringBig5Buffer.toString('binary')); + assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "cp950"), testString); + }, + "Big5 file read decoded,compare with iconv result": function() { + var contentBuffer = fs.readFileSync(__dirname+"/big5File.txt"); + var str = iconv.fromEncoding(contentBuffer, "big5"); + var iconvc = new (require('iconv').Iconv)('big5','utf8'); + assert.strictEqual(iconvc.convert(contentBuffer).toString(), str); + }, + "Big5 correctly decodes and encodes characters · and ×": function() { + // https://github.com/ashtuchkin/iconv-lite/issues/13 + // Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + var chars = "·×"; + var big5Chars = new Buffer([0xA1, 0x50, 0xA1, 0xD1]); + assert.strictEqual(iconv.toEncoding(chars, "big5").toString('binary'), big5Chars.toString('binary')); + assert.strictEqual(iconv.fromEncoding(big5Chars, "big5"), chars) + }, +}).export(module) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5File.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5File.txt new file mode 100644 index 0000000..515b251 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/big5File.txt @@ -0,0 +1,13 @@ + + + meta ҪϥΡG + + + + +oO@c餤I
    +(This page uses big5 character set.)
    +charset=big5 + + + \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/cyrillic-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/cyrillic-test.js new file mode 100644 index 0000000..259d283 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/cyrillic-test.js @@ -0,0 +1,86 @@ +var vows = require('vows'), + assert = require('assert'), + iconv = require(__dirname+'/../'); + +var baseStrings = { + empty: "", + hi: "Привет!", + ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ + ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f', + rus: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", + additional1: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬\xAD®Ї°±Ііґµ¶·ё№є»јЅѕї", + additional2: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©", + additional3: " ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏ№ёђѓєѕіїјљњћќ§ўџ", + untranslatable: "£Åçþÿ¿", +}; + +var encodings = [{ + name: "Win-1251", + variations: ['win1251', 'Windows-1251', 'windows1251', 'CP1251', 1251], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\xcf\xf0\xe8\xe2\xe5\xf2!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + rus: new Buffer('\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'), + additional1: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf','binary'), + } +}, { + name: "Koi8-R", + variations: ['koi8r', 'KOI8-R', 'cp20866', 20866], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\xf0\xd2\xc9\xd7\xc5\xd4!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + rus: new Buffer('\xe1\xe2\xf7\xe7\xe4\xe5\xf6\xfa\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf2\xf3\xf4\xf5\xe6\xe8\xe3\xfe\xfb\xfd\xff\xf9\xf8\xfc\xe0\xf1\xc1\xc2\xd7\xc7\xc4\xc5\xd6\xda\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd2\xd3\xd4\xd5\xc6\xc8\xc3\xde\xdb\xdd\xdf\xd9\xd8\xdc\xc0\xd1', 'binary'), + additional2: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf', 'binary'), + } +}, { + name: "ISO 8859-5", + variations: ['iso88595', 'ISO-8859-5', 'ISO 8859-5', 'cp28595', 28595], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\xbf\xe0\xd8\xd2\xd5\xe2!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + rus: new Buffer('\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef', 'binary'), + additional3: new Buffer('\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'), + } +}]; + +var testsBatch = {}; +encodings.forEach(function(encoding) { + var enc = encoding.variations[0]; + var key = "hi"; + var tests = { + "Convert to empty buffer": function() { + assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); + }, + "Convert from empty buffer": function() { + assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); + }, + "Convert from buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), + baseStrings[key]); + }, + "Convert to buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), + encoding.encodedStrings[key].toString('binary')); + }, + "Try different variations of encoding": function() { + encoding.variations.forEach(function(enc) { + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]); + assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); + }); + }, + "Untranslatable chars are converted to defaultCharSingleByte": function() { + var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); + assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. + } + }; + + testsBatch[encoding.name+":"] = tests; +}); + +vows.describe("Test Cyrillic encodings").addBatch(testsBatch).export(module); + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbk-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbk-test.js new file mode 100644 index 0000000..7b2e47b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbk-test.js @@ -0,0 +1,38 @@ +var vows = require('vows'), + fs = require('fs'), + assert = require('assert'), + iconv = require(__dirname+'/../'); + +var testString = "中国abc",//unicode contains GBK-code and ascii + testStringGBKBuffer = new Buffer([0xd6,0xd0,0xb9,0xfa,0x61,0x62,0x63]); + +vows.describe("GBK tests").addBatch({ + "Vows is working": function() {}, + "Return values are of correct types": function() { + assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer); + var s = iconv.fromEncoding(new Buffer(testString), "utf8"); + assert.strictEqual(Object.prototype.toString.call(s), "[object String]"); + }, + "GBK correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testString, "GBK").toString('binary'), testStringGBKBuffer.toString('binary')); + assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GBK"), testString); + }, + "GB2312 correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testString, "GB2312").toString('binary'), testStringGBKBuffer.toString('binary')); + assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GB2312"), testString); + }, + "GBK file read decoded,compare with iconv result": function() { + var contentBuffer = fs.readFileSync(__dirname+"/gbkFile.txt"); + var str = iconv.fromEncoding(contentBuffer, "GBK"); + var iconvc = new (require('iconv').Iconv)('GBK','utf8'); + assert.strictEqual(iconvc.convert(contentBuffer).toString(), str); + }, + "GBK correctly decodes and encodes characters · and ×": function() { + // https://github.com/ashtuchkin/iconv-lite/issues/13 + // Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT + var chars = "·×"; + var gbkChars = new Buffer([0xA1, 0xA4, 0xA1, 0xC1]); + assert.strictEqual(iconv.toEncoding(chars, "GBK").toString('binary'), gbkChars.toString('binary')); + assert.strictEqual(iconv.fromEncoding(gbkChars, "GBK"), chars) + }, +}).export(module) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbkFile.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbkFile.txt new file mode 100644 index 0000000..1154d0a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/gbkFile.txt @@ -0,0 +1,14 @@ +ٶһ£֪ + + +
     | ¼
    + + + + + + + + \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/greek-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/greek-test.js new file mode 100644 index 0000000..0394ee6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/greek-test.js @@ -0,0 +1,79 @@ +var vows = require('vows'), + assert = require('assert'), + iconv = require(__dirname+'/../'); + +var baseStrings = { + empty: "", + hi: "Γειά!", + ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ + ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f', + greek: "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩάέήίόύώΆΈΉΊΌΎΏϊϋΪΫ", + untranslatable: "Åçþÿ¿" +}; + +var encodings = [{ + name: "windows1253", + variations: ['windows-1253', 'win-1253', 'win1253', 'cp1253', 'cp-1253', 1253], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xa2\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'), + } +}, { + name: "iso88597", + variations: ['iso-8859-7', 'greek', 'greek8', 'cp28597', 'cp-28597', 28597], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xb6\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'), + } +}, { + name: "cp737", + variations: ['cp-737', 737], + encodedStrings: { + empty: new Buffer(''), + hi: new Buffer('\x82\x9c\xa0\xe1!', 'binary'), + ascii: new Buffer(baseStrings.ascii, 'binary'), + greek: new Buffer('\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xe0\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\xe1\xe2\xe3\xe5\xe6\xe7\xe9\xea\xeb\xec\xed\xee\xef\xf0\xe4\xe8\xf4\xf5', 'binary'), + } +}]; + +var testsBatch = {}; +encodings.forEach(function(encoding) { + var enc = encoding.variations[0]; + var key = "hi"; + var tests = { + "Convert to empty buffer": function() { + assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); + }, + "Convert from empty buffer": function() { + assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); + }, + "Convert from buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), + baseStrings[key]); + }, + "Convert to buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), + encoding.encodedStrings[key].toString('binary')); + }, + "Try different variations of encoding": function() { + encoding.variations.forEach(function(enc) { + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]); + assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); + }); + }, + "Untranslatable chars are converted to defaultCharSingleByte": function() { + var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); + assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. + } + }; + + testsBatch[encoding.name+":"] = tests; +}); + +vows.describe("Test Greek encodings").addBatch(testsBatch).export(module); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/main-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/main-test.js new file mode 100644 index 0000000..50177f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/main-test.js @@ -0,0 +1,55 @@ +var vows = require('vows'), + assert = require('assert'), + iconv = require(__dirname+'/../'); + +var testString = "Hello123!"; +var testStringLatin1 = "Hello123!£Å÷×çþÿ¿®"; +var testStringBase64 = "SGVsbG8xMjMh"; + +vows.describe("Generic UTF8-UCS2 tests").addBatch({ + "Vows is working": function() {}, + "Return values are of correct types": function() { + assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer); + + var s = iconv.fromEncoding(new Buffer(testString), "utf8"); + assert.strictEqual(Object.prototype.toString.call(s), "[object String]"); + }, + "Internal encodings all correctly encoded/decoded": function() { + ['utf8', "UTF-8", "UCS2", "binary", ""].forEach(function(enc) { + assert.strictEqual(iconv.toEncoding(testStringLatin1, enc).toString(enc), testStringLatin1); + assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, enc), enc), testStringLatin1); + }); + }, + "Base64 correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testStringBase64, "base64").toString("binary"), testString); + assert.strictEqual(iconv.fromEncoding(new Buffer(testString, "binary"), "base64"), testStringBase64); + }, + "Latin1 correctly encoded/decoded": function() { + assert.strictEqual(iconv.toEncoding(testStringLatin1, "latin1").toString("binary"), testStringLatin1); + assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, "binary"), "latin1"), testStringLatin1); + }, + "Convert from string, not buffer (binary encoding used)": function() { + assert.strictEqual(iconv.fromEncoding(testStringLatin1, "binary"), testStringLatin1); + }, + "Convert to string, not buffer (utf8 used)": function() { + var res = iconv.toEncoding(new Buffer(testStringLatin1, "utf8")); + assert.ok(res instanceof Buffer); + assert.strictEqual(res.toString("utf8"), testStringLatin1); + }, + "Throws on unknown encodings": function() { + assert.throws(function() { iconv.toEncoding("a", "xxx"); }); + assert.throws(function() { iconv.fromEncoding("a", "xxx"); }); + }, + "Convert non-strings and non-buffers": function() { + assert.strictEqual(iconv.toEncoding({}, "utf8").toString(), "[object Object]"); + assert.strictEqual(iconv.toEncoding(10, "utf8").toString(), "10"); + assert.strictEqual(iconv.toEncoding(undefined, "utf8").toString(), ""); + assert.strictEqual(iconv.fromEncoding({}, "utf8"), "[object Object]"); + assert.strictEqual(iconv.fromEncoding(10, "utf8"), "10"); + assert.strictEqual(iconv.fromEncoding(undefined, "utf8"), ""); + }, + "Aliases encode and decode work the same as toEncoding and fromEncoding": function() { + assert.strictEqual(iconv.toEncoding(testString, "latin1").toString("binary"), iconv.encode(testString, "latin1").toString("binary")); + assert.strictEqual(iconv.fromEncoding(testStringLatin1, "latin1"), iconv.decode(testStringLatin1, "latin1")); + }, +}).export(module) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/performance.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/performance.js new file mode 100644 index 0000000..835deac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/performance.js @@ -0,0 +1,67 @@ + +var iconv = require('iconv'); +var iconv_lite = require("../index"); + +var encoding = process.argv[2] || "windows-1251"; +var convertTimes = 10000; + +var encodingStrings = { + 'windows-1251': 'This is a test string 32 chars..', + 'gbk': '这是中文字符测试。。!@¥%12', + 'utf8': '这是中文字符测试。。!@¥%12This is a test string 48 chars..', +}; +// Test encoding. +var str = encodingStrings[encoding]; +if (!str) { + throw new Error('Don\'t support ' + encoding + ' performance test.'); +} +for (var i = 0; i < 13; i++) { + str = str + str; +} + +console.log('\n' + encoding + ' charset performance test:'); +console.log("\nEncoding "+str.length+" chars "+convertTimes+" times:"); + +var start = Date.now(); +var converter = new iconv.Iconv("utf8", encoding); +for (var i = 0; i < convertTimes; i++) { + var b = converter.convert(str); +} +var duration = Date.now() - start; +var mbs = convertTimes*b.length/duration/1024; + +console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); + +var start = Date.now(); +for (var i = 0; i < convertTimes; i++) { + var b = iconv_lite.encode(str, encoding); +} +var duration = Date.now() - start; +var mbs = convertTimes*b.length/duration/1024; + +console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); + + +// Test decoding. +var buf = iconv_lite.encode(str, encoding); +console.log("\nDecoding "+buf.length+" bytes "+convertTimes+" times:"); + +var start = Date.now(); +var converter = new iconv.Iconv(encoding, "utf8"); +for (var i = 0; i < convertTimes; i++) { + var s = converter.convert(buf).toString(); +} +var duration = Date.now() - start; +var mbs = convertTimes*buf.length/duration/1024; + +console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); + +var start = Date.now(); +for (var i = 0; i < convertTimes; i++) { + var s = iconv_lite.decode(buf, encoding); +} +var duration = Date.now() - start; +var mbs = convertTimes*buf.length/duration/1024; + +console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/turkish-test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/turkish-test.js new file mode 100644 index 0000000..b2eb68e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/test/turkish-test.js @@ -0,0 +1,90 @@ +var vows = require('vows'), + assert = require('assert'), + iconv = require(__dirname+'/../'); + +var ascii = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ + ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'; + +var encodings = [{ + name: "windows1254", + variations: ['windows-1254', 'win-1254', 'win1254', 'cp1254', 'cp-1254', 1254], + strings: { + empty: "", + ascii: ascii, + turkish: "€‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", + untranslatable: "\x81\x8d\x8e\x8f\x90\x9d\x9e" + }, + encodedStrings: { + empty: new Buffer(''), + ascii: new Buffer(ascii, 'binary'), + turkish: new Buffer( + '\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c' + + '\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9f' + + '\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf' + + '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' + + '\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' + + '\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' + + '\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' + + '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', + 'binary'), + } +}, { + name: "iso88599", + variations: ['iso-8859-9', 'turkish', 'turkish8', 'cp28599', 'cp-28599', 28599], + strings: { + empty: "", + ascii: ascii, + turkish: "\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", + untranslatable: '' + }, + encodedStrings: { + empty: new Buffer(''), + ascii: new Buffer(ascii, 'binary'), + turkish: new Buffer( + '\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' + + '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' + + '\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' + + '\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' + + '\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' + + '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', + 'binary') + } +}]; + +var testsBatch = {}; +encodings.forEach(function(encoding) { + var enc = encoding.variations[0]; + var key = "turkish"; + var tests = { + "Convert to empty buffer": function() { + assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); + }, + "Convert from empty buffer": function() { + assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); + }, + "Convert from buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), + encoding.strings[key]); + }, + "Convert to buffer": function() { + for (var key in encoding.encodedStrings) + assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'), + encoding.encodedStrings[key].toString('binary')); + }, + "Try different variations of encoding": function() { + encoding.variations.forEach(function(enc) { + assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), encoding.strings[key]); + assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); + }); + }, + "Untranslatable chars are converted to defaultCharSingleByte": function() { + var expected = encoding.strings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); + assert.strictEqual(iconv.toEncoding(encoding.strings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. + } + }; + + testsBatch[encoding.name+":"] = tests; +}); + +vows.describe("Test Turkish encodings").addBatch(testsBatch).export(module); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/.npmignore new file mode 100644 index 0000000..7dccd97 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/README.md new file mode 100644 index 0000000..bcedfd7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/README.md @@ -0,0 +1,57 @@ +isBinaryFile +============ + +Detects if a file is binary in Node.js. Similar to [Perl's `-B` switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary), in that: + +* it reads the first few thousand bytes of a file +* checks for a `null` byte; if it's found, it's binary +* flags non-ASCII characters. After a certain number of "weird" characters, the file is flagged as binary + +All the logic is also pretty much ported from [ag](https://github.com/ggreer/the_silver_searcher). + +Note: if the file doesn't exist or it is empty, this function returns `false`. + +## Installation + +``` +npm install isBinaryFile +``` + +## Usage + +If you pass in one argument, this module assumes it's just the file path, and performs the appropriate file read and stat functionality internally: + +```javascript +var isBinaryFile = require("isbinaryfile"); + +if (isBinaryFile(process.argv[2])) + console.log("It is!") +else + console.log("No.") +``` + +Ta da. + + +However, if you've already read and `stat()`-ed a file (for some other reason), you can pass in both the file's raw data and the stat's `size` info to save time: + +```javascript +fs.readFile(process.argv[2], function(err, data) { + fs.lstat(process.argv[2], function(err, stat) { + if (isBinaryFile(data, stat)) + console.log("It is!") + else + console.log("No.") + }); +}); +``` + +## Testing + +Install mocha on your machine: + +``` +npm install mocha -g +``` + +Then go into the _tests_ directory, and type `mocha test.js`. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js new file mode 100644 index 0000000..aa78281 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js @@ -0,0 +1,63 @@ +var fs = require('fs'); + +module.exports = function(bytes, size) { + var max_bytes = 512; + + // Read the file with no encoding for raw buffer access. + if (size === undefined) { + var file = bytes; + if (!fs.existsSync(file)) + return false; + var descriptor = fs.openSync(file, 'r'); + try { + bytes = new Buffer(max_bytes); + size = fs.readSync(descriptor, bytes, 0, bytes.length, 0); + } finally { + fs.closeSync(descriptor); + } + } + + if (size == 0) + return false; + + var suspicious_bytes = 0; + var total_bytes = Math.min(size, max_bytes); + + if (size >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) { + // UTF-8 BOM. This isn't binary. + return false; + } + + for (var i = 0; i < total_bytes; i++) { + if (bytes[i] == 0) { // NULL byte--it's binary! + return true; + } + else if ((bytes[i] < 7 || bytes[i] > 14) && (bytes[i] < 32 || bytes[i] > 127)) { + // UTF-8 detection + if (bytes[i] > 191 && bytes[i] < 224 && i + 1 < total_bytes) { + i++; + if (bytes[i] < 192) { + continue; + } + } + else if (bytes[i] > 223 && bytes[i] < 239 && i + 2 < total_bytes) { + i++; + if (bytes[i] < 192 && bytes[i + 1] < 192) { + i++; + continue; + } + } + suspicious_bytes++; + // Read at least 32 bytes before making a decision + if (i > 32 && (suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + } + } + + if ((suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + + return false; +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json new file mode 100644 index 0000000..1ddf3f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json @@ -0,0 +1,37 @@ +{ + "name": "isbinaryfile", + "version": "0.1.9", + "description": "Detects if a file is binary in Node.js. Similar to Perl's -B.", + "main": "./lib/panino.js", + "engines": { + "node": ">=0.6.0" + }, + "maintainers": [ + { + "name": "Garen J. Torikian", + "email": "gjtorikian@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/gjtorikian/isBinaryFile" + }, + "devDependencies": { + "mocha": "" + }, + "scripts": { + "test": "mocha tests/test.js" + }, + "readme": "isBinaryFile\n============\n\nDetects if a file is binary in Node.js. Similar to [Perl's `-B` switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary), in that:\n\n* it reads the first few thousand bytes of a file\n* checks for a `null` byte; if it's found, it's binary\n* flags non-ASCII characters. After a certain number of \"weird\" characters, the file is flagged as binary\n\nAll the logic is also pretty much ported from [ag](https://github.com/ggreer/the_silver_searcher).\n\nNote: if the file doesn't exist or it is empty, this function returns `false`.\n\n## Installation\n\n```\nnpm install isBinaryFile\n```\n\n## Usage\n\nIf you pass in one argument, this module assumes it's just the file path, and performs the appropriate file read and stat functionality internally:\n\n```javascript\nvar isBinaryFile = require(\"isbinaryfile\");\n\nif (isBinaryFile(process.argv[2]))\n\tconsole.log(\"It is!\")\nelse\n\tconsole.log(\"No.\")\n```\n\nTa da. \n\n\nHowever, if you've already read and `stat()`-ed a file (for some other reason), you can pass in both the file's raw data and the stat's `size` info to save time:\n\n```javascript\nfs.readFile(process.argv[2], function(err, data) {\n\tfs.lstat(process.argv[2], function(err, stat) {\n\t\tif (isBinaryFile(data, stat))\n\t\t\tconsole.log(\"It is!\")\n\t\telse\n\t\t\tconsole.log(\"No.\")\n\t});\n});\n```\n\n## Testing\n\nInstall mocha on your machine:\n\n```\nnpm install mocha -g\n```\n\nThen go into the _tests_ directory, and type `mocha test.js`.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/gjtorikian/isBinaryFile/issues" + }, + "homepage": "https://github.com/gjtorikian/isBinaryFile", + "_id": "isbinaryfile@0.1.9", + "dist": { + "shasum": "b3bf215c625ec67b929fdbf24544377f045469d9" + }, + "_from": "isbinaryfile@~0.1.9", + "_resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-0.1.9.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/01_grep b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/01_grep new file mode 100755 index 0000000..b66cf83 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/01_grep differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/02_perl_script b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/02_perl_script new file mode 100644 index 0000000..e861601 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/02_perl_script @@ -0,0 +1,2 @@ +#!/usr/bin/perl + print "Hello World.\n"; \ No newline at end of file diff --git "a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/03_\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276_\321\215\320\272\321\201\320\277\320\273\321\203\320\260\321\202\320\260\321\206\320\270\320\270.rst" "b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/03_\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276_\321\215\320\272\321\201\320\277\320\273\321\203\320\260\321\202\320\260\321\206\320\270\320\270.rst" new file mode 100644 index 0000000..1e7cce4 --- /dev/null +++ "b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/03_\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276_\321\215\320\272\321\201\320\277\320\273\321\203\320\260\321\202\320\260\321\206\320\270\320\270.rst" @@ -0,0 +1,49 @@ +Общие сведения о программном комплексе +************************************** +test + +Назначение программного комплекса +================================= + +Функции программного комплекса +============================== + +Требования к минимальному составу аппаратных средств +==================================================== +.. Сведения о средствах, обеспечивающих выполнение программы. + +Требования к минимальному составу программных средств +===================================================== +.. Сведения о средствах, обеспечивающих выполнение программы. + +Требования к персоналу (системному программисту) +================================================ + +Структура программного комплекса +******************************** +.. Сведения о структуре программы, ее составных частях, о связях между +.. составными частями и о связях с другими программами. + +Настройка программного комплекса +******************************** + +Настройка на состав технических средств +======================================= +.. Описание действий по настройке программного комплекса на условия конкретного применения. + +Настройка на состав программных средств +======================================= +.. Описание действий по настройке программного комплекса на условия конкретного +.. применения. + +Проверка программного комплекса +******************************* +.. Описание способов проверки, позволяющих дать общее заключение о +.. работоспособности программного комплекса (контрольные примеры, методы прогона, +.. результаты). + +Сообщения системному программисту +********************************* +.. Тексты сообщений, выдаваемых в ходе выполнения настройки, проверки +.. программы, а также в ходе выполнения программы, описание их содержания и +.. действий, которые необходимо предпринять по этим сообщениям. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/04_HelloWorld.pdf b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/04_HelloWorld.pdf new file mode 100644 index 0000000..72942dc Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/04_HelloWorld.pdf differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/05_null_file.gif b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/05_null_file.gif new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/06_trunks.gif b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/06_trunks.gif new file mode 100644 index 0000000..6e14a2a Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/06_trunks.gif differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/test.js new file mode 100644 index 0000000..0c1ad2f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/test.js @@ -0,0 +1,55 @@ +"mocha"; + +var assert = require("assert"); +var fs = require("fs"); +var isBinaryFile = require("../index"); + +describe('isBinaryFile', function() { + it('should fail on a binary program', function() { + assert(isBinaryFile("tests/fixtures/01_grep")); + + var bytes = fs.readFileSync("tests/fixtures/01_grep"); + var stat = fs.lstatSync("tests/fixtures/01_grep"); + assert(isBinaryFile(bytes, stat.size)); + }); + + it('should not fail on an extensionless script', function() { + assert(!isBinaryFile("tests/fixtures/02_perl_script")); + + var bytes = fs.readFileSync("tests/fixtures/02_perl_script"); + var stat = fs.lstatSync("tests/fixtures/02_perl_script"); + assert(!isBinaryFile(bytes, stat.size)); + }); + + it('should not fail on a russian text', function() { + assert(!isBinaryFile("tests/fixtures/03_Руководство_по_эксплуатации.rst")); + + var bytes = fs.readFileSync("tests/fixtures/03_Руководство_по_эксплуатации.rst"); + var stat = fs.lstatSync("tests/fixtures/03_Руководство_по_эксплуатации.rst"); + assert(!isBinaryFile(bytes, stat.size)); + }); + + it('should not fail on a PDF', function() { + assert(isBinaryFile("tests/fixtures/04_HelloWorld.pdf")); + + var bytes = fs.readFileSync("tests/fixtures/04_HelloWorld.pdf"); + var stat = fs.lstatSync("tests/fixtures/04_HelloWorld.pdf"); + assert(isBinaryFile(bytes, stat.size)); + }); + + it('should not fail on a zero-byte file', function() { + assert(!isBinaryFile("tests/fixtures/05_null_file.gif")); + + var bytes = fs.readFileSync("tests/fixtures/05_null_file.gif"); + var stat = fs.lstatSync("tests/fixtures/05_null_file.gif"); + assert(!isBinaryFile(bytes, stat.size)); + }); + + it('should not fail on a gif', function() { + assert(isBinaryFile("tests/fixtures/06_trunks.gif")); + + var bytes = fs.readFileSync("tests/fixtures/06_trunks.gif"); + var stat = fs.lstatSync("tests/fixtures/06_trunks.gif"); + assert(isBinaryFile(bytes, stat.size)); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/README.md new file mode 100644 index 0000000..45f2cd3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/README.md @@ -0,0 +1,142 @@ +# Lo-Dash v2.1.0 +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + +* Modern builds perfect for newer browsers/environments:
    +[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.js) & +[Production](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.min.js) + +* Compatibility builds for older environment support too:
    +[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.compat.js) & +[Production](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.compat.min.js) + +* Underscore builds to use as a drop-in replacement:
    +[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.underscore.js) & +[Production](https://raw.github.com/lodash/lodash/2.1.0/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](http://lodash.com/custom-builds) with only the features needed.
    +Love modules? We’ve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-node](https://npmjs.org/package/lodash-node), and [npm packages](https://npmjs.org/browse/author/jdalton) per method. + +## Dive in + +There’s plenty of [documentation](http://lodash.com/docs), [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).
    +For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
    +The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog). + +## Features *not* in Underscore + + * AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.) + * [_(…)](http://lodash.com/docs#_) supports intuitive chaining + * [_.at](http://lodash.com/docs#at) for cherry-picking collection values + * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods + * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` + * [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins + * [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions + * [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept `options` for more control + * [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys + * [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early + * [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object` + * [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions + * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) + * [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior + * [_.partialRight](http://lodash.com/docs#partialRight) for [partial application](http://lodash.com/docs#partial) from the right + * [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays + * [_.random](http://lodash.com/docs#random) supports returning floating-point numbers + * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking + * [_.support](http://lodash.com/docs#support) for flagging environment features + * [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) + * [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects + * [_.where](http://lodash.com/docs#where) supports deep object comparisons + * [_.zip](http://lodash.com/docs#zip) is capable of unzipping values + * [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), & + [more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks + * [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), & + [more](http://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](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), & + [more](http://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](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), & + [more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight") right-associative methods + +## Resources + + * 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/) + + * 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) + +## Support + +Tested in Chrome 5~29, Firefox 2~24, IE 6-10, Opera 9.25~16, Safari 3-6, Node.js 0.6.8-0.10.18, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5. + +## Installation & usage + +In browsers: + +```html + +``` + +Using [`npm`](http://npmjs.org/): + +```bash +npm i --save lodash + +{sudo} npm i -g lodash +npm ln lodash +``` + +In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/): + +```js +var _ = require('lodash'); +// or as Underscore +var _ = require('lodash/dist/lodash.underscore'); +``` + +**Notes:** + * Don’t 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 link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it + * Node.js 0.10.8-0.10.11 [have](https://github.com/joyent/node/issues/5622) [bugs](https://github.com/joyent/node/issues/5688) preventing minified builds + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader: + +```js +require({ + 'packages': [ + { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' } + ] +}, +['lodash'], function(_) { + console.log(_.VERSION); +}); +``` + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/dist/lodash.compat.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/dist/lodash.compat.js new file mode 100644 index 0000000..a024855 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/lodash/dist/lodash.compat.js @@ -0,0 +1,6694 @@ +/** + * @license + * Lo-Dash 2.1.0 (Custom Build) + * Build: `lodash -o ./dist/lodash.compat.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre ES5 environments */ + var undefined; + + /** Used to pool arrays and objects used internally */ + var arrayPool = [], + objectPool = []; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = {}; + + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ + var keyPrefix = +new Date + ''; + + /** Used as the size when optimizations are enabled for large arrays */ + var largeArraySize = 75; + + /** Used as the max size of the `arrayPool` and `objectPool` */ + var maxPoolSize = 40; + + /** Used to detect and test whitespace */ + var whitespace = ( + // whitespace + ' \t\x0B\f\xA0\ufeff' + + + // line terminators + '\n\r\u2028\u2029' + + + // unicode category "Zs" space separators + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' + ); + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detected named functions */ + var reFuncName = /^function[ \n\r\t]+\w/; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match leading whitespace and zeros to be removed */ + var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to detect functions containing a `this` reference */ + var reThis = /\bthis\b/; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to assign default `context` object properties */ + var contextProps = [ + 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', + 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', + 'parseInt', 'setImmediate', 'setTimeout' + ]; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowedProps = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + errorClass = '[object Error]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports` */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value] ? 0 : -1; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = (cache = cache[type]) && cache[key]; + + return type == 'object' + ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) + : (cache ? 0 : -1); + } + + /** + * Adds a given value to the corresponding cache object. + * + * @private + * @param {*} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + (typeCache[key] || (typeCache[key] = [])).push(value); + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default callback when a given + * collection is a string value. + * + * @private + * @param {string} value The character to inspect. + * @returns {number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` elements, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ac = a.criteria, + bc = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (ac !== bc) { + if (ac > bc || typeof ac == 'undefined') { + return 1; + } + if (ac < bc || typeof bc == 'undefined') { + return -1; + } + } + // The JS engine embedded in Adobe applications like InDesign has a buggy + // `Array#sort` implementation that causes it, under certain circumstances, + // to return the same value for `a` and `b`. + // See https://github.com/jashkenas/underscore/pull/1247 + return a.index - b.index; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length, + first = array[0], + mid = array[(length / 2) | 0], + last = array[length - 1]; + + if (first && typeof first == 'object' && + mid && typeof mid == 'object' && last && typeof last == 'object') { + return false; + } + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Gets an array from the array pool or creates a new one if the pool is empty. + * + * @private + * @returns {Array} The array from the pool. + */ + function getArray() { + return arrayPool.pop() || []; + } + + /** + * Gets an object from the object pool or creates a new one if the pool is empty. + * + * @private + * @returns {Object} The object from the pool. + */ + function getObject() { + return objectPool.pop() || { + 'args': '', + 'array': null, + 'bottom': '', + 'cache': null, + 'configurable': false, + 'criteria': null, + 'enumerable': false, + 'false': false, + 'firstArg': '', + 'index': 0, + 'init': '', + 'keys': null, + 'leading': false, + 'loop': '', + 'maxWait': 0, + 'null': false, + 'number': null, + 'object': null, + 'push': null, + 'shadowedProps': null, + 'string': null, + 'top': '', + 'trailing': false, + 'true': false, + 'undefined': false, + 'useHas': false, + 'value': null, + 'writable': false + }; + } + + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /** + * Releases the given array back to the array pool. + * + * @private + * @param {Array} [array] The array to release. + */ + function releaseArray(array) { + array.length = 0; + if (arrayPool.length < maxPoolSize) { + arrayPool.push(array); + } + } + + /** + * Releases the given object back to the object pool. + * + * @private + * @param {Object} [object] The object to release. + */ + function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } + object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; + if (objectPool.length < maxPoolSize) { + objectPool.push(object); + } + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used instead of `Array#slice` to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|string} collection The collection to slice. + * @param {number} start The start index. + * @param {number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new `lodash` function using the given context object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} [context=root] The context object. + * @returns {Function} Returns the `lodash` function. + */ + function runInContext(context) { + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See http://es5.github.io/#x11.1.5. + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; + + /** Native constructor references */ + var Array = context.Array, + Boolean = context.Boolean, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Number = context.Number, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** + * Used for `Array` method references. + * + * Normally `Array.prototype` would suffice, however, using an array literal + * avoids issues in Narwhal. + */ + var arrayRef = []; + + /** Used for native method references */ + var errorProto = Error.prototype, + objectProto = Object.prototype, + stringProto = String.prototype; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = context._; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + String(objectProto.valueOf) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/valueOf|for [^\]]+/g, '.+?') + '$' + ); + + /** Native method shortcuts */ + var ceil = Math.ceil, + clearTimeout = context.clearTimeout, + floor = Math.floor, + fnToString = Function.prototype.toString, + getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectProto.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + setImmediate = context.setImmediate, + setTimeout = context.setTimeout, + splice = arrayRef.splice, + toString = objectProto.toString, + unshift = arrayRef.unshift; + + var defineProperty = (function() { + try { + var o = {}, + func = reNative.test(func = Object.defineProperty) && func, + result = func(o, o, o) && func; + } catch(e) { } + return result; + }()); + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind, + nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate, + nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = context.isFinite, + nativeIsNaN = context.isNaN, + nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeSlice = arrayRef.slice; + + /** Detect various environments */ + var isIeOpera = reNative.test(context.attachEvent), + isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera); + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[funcClass] = Function; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /** Used to avoid iterating non-enumerable properties in IE < 9 */ + var nonEnumProps = {}; + nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; + nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; + nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; + nonEnumProps[objectClass] = { 'constructor': true }; + + (function() { + var length = shadowedProps.length; + while (length--) { + var prop = shadowedProps[length]; + for (var className in nonEnumProps) { + if (hasOwnProperty.call(nonEnumProps, className) && !hasOwnProperty.call(nonEnumProps[className], prop)) { + nonEnumProps[className][prop] = false; + } + } + } + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps the given value to enable method + * chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * Chaining is supported in custom builds as long as the `value` method is + * implicitly or explicitly included in the build. + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, + * `compose`, `concat`, `countBy`, `createCallback`, `curry`, `debounce`, + * `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, + * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, + * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, + * `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, + * `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, `range`, `reject`, + * `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, + * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, + * `unzip`, `values`, `where`, `without`, `wrap`, and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, + * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, + * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, + * `template`, `unescape`, `uniqueId`, and `value` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * provided, otherwise they return unwrapped values. + * + * @name _ + * @constructor + * @category Chaining + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(num) { + * return num * num; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor + return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) + ? value + : new lodashWrapper(value); + } + + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap in a `lodash` instance. + * @param {boolean} chainAll A flag to enable chaining for all methods + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value, chainAll) { + this.__chain__ = !!chainAll; + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + + /** + * An object used to flag environments features. + * + * @static + * @memberOf _ + * @type Object + */ + var support = lodash.support = {}; + + (function() { + var ctor = function() { this.x = 1; }, + object = { '0': 1, 'length': 1 }, + props = []; + + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + for (prop in arguments) { } + + /** + * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.argsClass = toString.call(arguments) == argsClass; + + /** + * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5). + * + * @memberOf _.support + * @type boolean + */ + support.argsObject = arguments.constructor == Object && !(arguments instanceof Array); + + /** + * Detect if `name` or `message` properties of `Error.prototype` are + * enumerable by default. (IE < 9, Safari < 5.1) + * + * @memberOf _.support + * @type boolean + */ + support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); + + /** + * Detect if `prototype` properties are enumerable by default. + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly sets a function's `prototype` property [[Enumerable]] + * value to `true`. + * + * @memberOf _.support + * @type boolean + */ + support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); + + /** + * Detect if `Function#bind` exists and is inferred to be fast (all but V8). + * + * @memberOf _.support + * @type boolean + */ + support.fastBind = nativeBind && !isV8; + + /** + * Detect if functions can be decompiled by `Function#toString` + * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). + * + * @memberOf _.support + * @type boolean + */ + support.funcDecomp = !reNative.test(context.WinRTError) && reThis.test(runInContext); + + /** + * Detect if `Function#name` is supported (all but IE). + * + * @memberOf _.support + * @type boolean + */ + support.funcNames = typeof Function.name == 'string'; + + /** + * Detect if `arguments` object indexes are non-enumerable + * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumArgs = prop != 0; + + /** + * Detect if properties shadowing those on `Object.prototype` are non-enumerable. + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well (a.k.a the JScript [[DontEnum]] bug). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumShadows = !/valueOf/.test(props); + + /** + * Detect if own properties are iterated after inherited properties (all but IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.ownLast = props[0] != 'x'; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + * + * @memberOf _.support + * @type boolean + */ + support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]); + + /** + * Detect lack of support for accessing string characters by index. + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + * + * @memberOf _.support + * @type boolean + */ + support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a DOM node's [[Class]] is resolvable (all but IE < 9) + * and that the JS engine errors when attempting to coerce an object to + * a string without a `toString` function. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); + } catch(e) { + support.nodeClass = true; + } + }(1)); + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Object} data The data object used to populate the text. + * @returns {string} Returns the interpolated text. + */ + var iteratorTemplate = function(obj) { + + var __p = 'var index, iterable = ' + + (obj.firstArg) + + ', result = ' + + (obj.init) + + ';\nif (!iterable) return result;\n' + + (obj.top) + + ';'; + if (obj.array) { + __p += '\nvar length = iterable.length; index = -1;\nif (' + + (obj.array) + + ') { '; + if (support.unindexedChars) { + __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; + } + __p += '\n while (++index < length) {\n ' + + (obj.loop) + + ';\n }\n}\nelse { '; + } else if (support.nonEnumArgs) { + __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + + (obj.loop) + + ';\n }\n } else { '; + } + + if (support.enumPrototypes) { + __p += '\n var skipProto = typeof iterable == \'function\';\n '; + } + + if (support.enumErrorProps) { + __p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n '; + } + + var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); } + + if (obj.useHas && obj.keys) { + __p += '\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'; + if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + } else { + __p += '\n for (index in iterable) {\n'; + if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); } if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + if (support.nonEnumShadows) { + __p += '\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 '; + for (k = 0; k < 7; k++) { + __p += '\n index = \'' + + (obj.shadowedProps[k]) + + '\';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))'; + if (!obj.useHas) { + __p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])'; + } + __p += ') {\n ' + + (obj.loop) + + ';\n } '; + } + __p += '\n } '; + } + + } + + if (obj.array || support.nonEnumArgs) { + __p += '\n}'; + } + __p += + (obj.bottom) + + ';\nreturn result'; + + return __p + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.clone` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [deep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned `value`. + */ + function baseClone(value, deep, callback, stackA, stackB) { + var result = value; + + if (callback) { + result = callback(result); + if (typeof result != 'undefined') { + return result; + } + result = value; + } + // inspect [[Class]] + var isObj = isObject(result); + if (isObj) { + var className = toString.call(result); + if (!cloneableClasses[className] || (!support.nodeClass && isNode(result))) { + return result; + } + var isArr = isArray(result); + } + // shallow clone + if (!isObj || !deep) { + return isObj + ? (isArr ? slice(result) : assign({}, result)) + : result; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+result); + + case numberClass: + case stringClass: + return new ctor(result); + + case regexpClass: + return ctor(result.source, reFlags.exec(result)); + } + // check for circular references and return corresponding clone + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // init cloned object + result = isArr ? ctor(result.length) : {}; + + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? baseEach : forOwn)(value, function(objValue, key) { + result[key] = baseClone(objValue, deep, callback, stackA, stackB); + }); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.createCallback` without support for creating + * "_.pluck" or "_.where" style callbacks. + * + * @private + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function baseCreateCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + // exit early if there is no `thisArg` + if (typeof thisArg == 'undefined') { + return func; + } + var bindData = func.__bindData__ || (support.funcNames && !func.name); + if (typeof bindData == 'undefined') { + var source = reThis && fnToString.call(func); + if (!support.funcNames && source && !reFuncName.test(source)) { + bindData = true; + } + if (support.funcNames || !bindData) { + // checks if `func` references the `this` keyword and stores the result + bindData = !support.funcDecomp || reThis.test(source); + setBindData(func, bindData); + } + } + // exit early if there are no `this` references or `func` is bound + if (bindData !== true && (bindData && bindData[1] & 1)) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 2: return function(a, b) { + return func.call(thisArg, a, b); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + } + return bind(func, thisArg); + } + + /** + * The base implementation of `_.flatten` without support for callback + * shorthands or `thisArg` binding. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {boolean} [isArgArrays=false] A flag to restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns a new flattened array. + */ + function baseFlatten(array, isShallow, isArgArrays, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value && typeof value == 'object' && typeof value.length == 'number' + && (isArray(value) || isArguments(value))) { + // recursively flatten arrays (susceptible to call stack limits) + if (!isShallow) { + value = baseFlatten(value, isShallow, isArgArrays); + } + var valIndex = -1, + valLength = value.length, + resIndex = result.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[resIndex++] = value[valIndex]; + } + } else if (!isArgArrays) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.isEqual`, without support for `thisArg` binding, + * that allows partial "_.where" style comparisons. + * + * @private + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `a` objects. + * @param {Array} [stackB=[]] Tracks traversed `b` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + if (callback) { + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + !(a && objectTypes[type]) && + !(b && objectTypes[otherType])) { + return false; + } + // exit early for `null` and `undefined` avoiding ES3's Function#call behavior + // http://es5.github.io/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (a != +a) + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == String(b); + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + if (hasOwnProperty.call(a, '__wrapped__ ') || hasOwnProperty.call(b, '__wrapped__')) { + return baseIsEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, isWhere, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, + ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && !( + isFunction(ctorA) && ctorA instanceof ctorA && + isFunction(ctorB) && ctorB instanceof ctorB + )) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + length = a.length; + size = b.length; + + // compare lengths to determine if a deep comparison is necessary + result = size == a.length; + if (!result && !isWhere) { + return result; + } + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (isWhere) { + while (index--) { + if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + break; + } + } + return result; + } + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + } + }); + + if (result && !isWhere) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.merge` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} [callback] The function to customize merging properties. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + */ + function baseMerge(object, source, callback, stackA, stackB) { + (isArray(source) ? forEach : forOwn)(source, function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + var isShallow; + if (callback) { + result = callback(value, source); + if ((isShallow = typeof result != 'undefined')) { + value = result; + } + } + if (!isShallow) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!isShallow) { + baseMerge(value, source, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * or `thisArg` binding. + * + * @private + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function} [callback] The function called per iteration. + * @returns {Array} Returns a duplicate-value-free array. + */ + function baseUniq(array, isSorted, callback) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + seen = callback ? seen : (releaseArray(seen), result); + } + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + if (isLarge) { + releaseArray(seen.array); + releaseObject(seen); + } else if (callback) { + releaseArray(seen); + } + return result; + } + + /** + * Creates a function that aggregates a collection, creating an object composed + * of keys generated from the results of running each element of the collection + * through a callback. The given `setter` function sets the keys and values + * of the composed object. + * + * @private + * @param {Function} setter The setter function. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter) { + return function(collection, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + setter(result, value, callback(value, index, collection), collection); + } + } else { + baseEach(collection, function(value, key, collection) { + setter(result, value, callback(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a function that, when called, either curries or invokes `func` + * with an optional `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of method flags to compose. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` + * 8 - `_.curry` (bound) + * 16 - `_.partial` + * 32 - `_.partialRight` + * @param {Array} [partialArgs] An array of arguments to prepend to those + * provided to the new function. + * @param {Array} [partialRightArgs] An array of arguments to append to those + * provided to the new function. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new bound function. + */ + function createBound(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + isPartial = bitmask & 16, + isPartialRight = bitmask & 32, + key = func; + + if (!isBindKey && !isFunction(func)) { + throw new TypeError; + } + if (isPartial && !partialArgs.length) { + bitmask &= ~16; + isPartial = partialArgs = false; + } + if (isPartialRight && !partialRightArgs.length) { + bitmask &= ~32; + isPartialRight = partialRightArgs = false; + } + var bindData = func && func.__bindData__; + if (bindData) { + if (isBind && !(bindData[1] & 1)) { + bindData[4] = thisArg; + } + if (!isBind && bindData[1] & 1) { + bitmask |= 8; + } + if (isCurry && !(bindData[1] & 4)) { + bindData[5] = arity; + } + if (isPartial) { + push.apply(bindData[2] || (bindData[2] = []), partialArgs); + } + if (isPartialRight) { + push.apply(bindData[3] || (bindData[3] = []), partialRightArgs); + } + bindData[1] |= bitmask; + return createBound.apply(null, bindData); + } + // use `Function#bind` if it exists and is fast + // (in V8 `Function#bind` is slower except when partially applied) + if (isBind && !(isBindKey || isCurry || isPartialRight) && + (support.fastBind || (nativeBind && isPartial))) { + if (isPartial) { + var args = [thisArg]; + push.apply(args, partialArgs); + } + var bound = isPartial + ? nativeBind.apply(func, args) + : nativeBind.call(func, thisArg); + } + else { + bound = function() { + // `Function#bind` spec + // http://es5.github.io/#x15.3.4.5 + var args = arguments, + thisBinding = isBind ? thisArg : this; + + if (isCurry || isPartial || isPartialRight) { + args = nativeSlice.call(args); + if (isPartial) { + unshift.apply(args, partialArgs); + } + if (isPartialRight) { + push.apply(args, partialRightArgs); + } + if (isCurry && args.length < arity) { + bitmask |= 16 & ~32; + return createBound(func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity); + } + } + if (isBindKey) { + func = thisBinding[key]; + } + if (this instanceof bound) { + // ensure `new bound` is an instance of `func` + thisBinding = createObject(func.prototype); + + // mimic the constructor's `return` behavior + // http://es5.github.io/#x13.2.2 + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + }; + } + setBindData(bound, nativeSlice.call(arguments)); + return bound; + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {...Object} [options] The compile options object(s). + * @param {string} [options.array] Code to determine if the iterable is an array or array-like. + * @param {boolean} [options.useHas] Specify using `hasOwnProperty` checks in the object loop. + * @param {Function} [options.keys] A reference to `_.keys` for use in own property iteration. + * @param {string} [options.args] A comma separated string of iteration function arguments. + * @param {string} [options.top] Code to execute before the iteration branches. + * @param {string} [options.loop] Code to execute in the object loop. + * @param {string} [options.bottom] Code to execute after the iteration branches. + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + var data = getObject(); + + // data properties + data.shadowedProps = shadowedProps; + + // iterator options + data.array = data.bottom = data.loop = data.top = ''; + data.init = 'iterable'; + data.useHas = true; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + data[key] = object[key]; + } + } + var args = data.args; + data.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'baseCreateCallback, errorClass, errorProto, hasOwnProperty, ' + + 'indicatorObject, isArguments, isArray, isString, keys, objectProto, ' + + 'objectTypes, nonEnumProps, stringClass, stringProto, toString', + 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' + ); + + releaseObject(data); + + // return the compiled function + return factory( + baseCreateCallback, errorClass, errorProto, hasOwnProperty, + indicatorObject, isArguments, isArray, isString, data.keys, objectProto, + objectTypes, nonEnumProps, stringClass, stringProto, toString + ); + } + + /** + * Creates a new object with the specified `prototype`. + * + * @private + * @param {Object} prototype The prototype object. + * @returns {Object} Returns the new object. + */ + function createObject(prototype) { + return isObject(prototype) ? nativeCreate(prototype) : {}; + } + // fallback for browsers without `Object.create` + if (!nativeCreate) { + createObject = function(prototype) { + if (isObject(prototype)) { + noop.prototype = prototype; + var result = new noop; + noop.prototype = null; + } + return result || {}; + }; + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized, this method returns the custom method, otherwise it returns + * the `baseIndexOf` function. + * + * @private + * @returns {Function} Returns the "indexOf" function. + */ + function getIndexOf() { + var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; + return result; + } + + /** + * Sets `this` binding data on a given function. + * + * @private + * @param {Function} func The function to set data on. + * @param {*} value The value to set. + */ + var setBindData = !defineProperty ? noop : function(func, value) { + var descriptor = getObject(); + descriptor.value = value; + defineProperty(func, '__bindData__', descriptor); + releaseObject(descriptor); + }; + + /** + * A fallback implementation of `isPlainObject` which checks if a given value + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + var ctor, + result; + + // avoid non Object objects, `arguments` objects, and DOM elements + if (!(value && toString.call(value) == objectClass) || + (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor)) || + (!support.argsClass && isArguments(value)) || + (!support.nodeClass && isNode(value))) { + return false; + } + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (support.ownLast) { + forIn(value, function(value, key, object) { + result = hasOwnProperty.call(object, key); + return false; + }); + return result !== false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return typeof result == 'undefined' || hasOwnProperty.call(value, result); + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {string} match The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass || false; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (!support.argsClass) { + isArguments = function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') || false; + }; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass || false; + }; + + /** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ + var shimKeys = createIterator({ + 'args': 'object', + 'init': '[]', + 'top': 'if (!(objectTypes[typeof object])) return result', + 'loop': 'result.push(index)' + }); + + /** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + if ((support.enumPrototypes && typeof object == 'function') || + (support.nonEnumArgs && object.length && isArguments(object))) { + return shimKeys(object); + } + return nativeKeys(object); + }; + + /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ + var eachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)", + 'array': "typeof length == 'number'", + 'keys': keys, + 'loop': 'if (callback(iterable[index], index, collection) === false) return result' + }; + + /** Reusable iterator options for `assign` and `defaults` */ + var defaultsIteratorOptions = { + 'args': 'object, source, guard', + 'top': + 'var args = arguments,\n' + + ' argsIndex = 0,\n' + + " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + + 'while (++argsIndex < argsLength) {\n' + + ' iterable = args[argsIndex];\n' + + ' if (iterable && objectTypes[typeof iterable]) {', + 'keys': keys, + 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", + 'bottom': ' }\n}' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'array': false + }; + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), + reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); + + /** + * A function compiled to iterate `arguments` objects, arrays, objects, and + * strings consistenly across environments, executing the callback for each + * element in the collection. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index|key, collection). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @private + * @type Function + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + */ + var baseEach = createIterator(eachIteratorOptions); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite property assignments of previous + * sources. If a callback is provided it will be executed to produce the + * assigned values. The callback is bound to `thisArg` and invoked with two + * arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'moe' }, { 'age': 40 }); + * // => { 'name': 'moe', 'age': 40 } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var food = { 'name': 'apple' }; + * defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var assign = createIterator(defaultsIteratorOptions, { + 'top': + defaultsIteratorOptions.top.replace(';', + ';\n' + + "if (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]' + }); + + /** + * Creates a clone of `value`. If `deep` is `true` nested objects will also + * be cloned, otherwise they will be assigned by reference. If a callback + * is provided it will be executed to produce the cloned values. If the + * callback returns `undefined` cloning will be handled by the method instead. + * The callback is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to clone. + * @param {boolean} [deep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var shallow = _.clone(stooges); + * shallow[0] === stooges[0]; + * // => true + * + * var deep = _.clone(stooges, true); + * deep[0] === stooges[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, deep, callback, thisArg) { + // allows working with "Collections" methods without using their `index` + // and `collection` arguments for `deep` and `callback` + if (typeof deep != 'boolean' && deep != null) { + thisArg = callback; + callback = deep; + deep = false; + } + return baseClone(value, deep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates a deep clone of `value`. If a callback is provided it will be + * executed to produce the cloned values. If the callback returns `undefined` + * cloning will be handled by the method instead. The callback is bound to + * `thisArg` and invoked with one argument; (value). + * + * Note: This method is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the deep cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var deep = _.cloneDeep(stooges); + * deep[0] === stooges[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : undefined; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var food = { 'name': 'apple' }; + * _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var defaults = createIterator(defaultsIteratorOptions); + + /** + * This method is like `_.findIndex` except that it returns the key of the + * first element that passes the callback check, instead of the element itself. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { + * return num % 2 == 0; + * }); + * // => 'b' (property order is not guaranteed across environments) + */ + function findKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwn(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * This method is like `_.findKey` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * _.findLastKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { + * return num % 2 == 1; + * }); + * // => returns `c`, assuming `_.findKey` returns `a` + */ + function findLastKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwnRight(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * Iterates over own and inherited enumerable properties of an object, + * executing the callback for each property. The callback is bound to `thisArg` + * and invoked with three arguments; (value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * console.log('Woof, woof!'); + * }; + * + * _.forIn(new Dog('Dagny'), function(value, key) { + * console.log(key); + * }); + * // => logs 'bark' and 'name' (property order is not guaranteed across environments) + */ + var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * This method is like `_.forIn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * console.log('Woof, woof!'); + * }; + * + * _.forInRight(new Dog('Dagny'), function(value, key) { + * console.log(key); + * }); + * // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name' + */ + function forInRight(object, callback, thisArg) { + var pairs = []; + + forIn(object, function(value, key) { + pairs.push(key, value); + }); + + var length = pairs.length; + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + if (callback(pairs[length--], pairs[length], object) === false) { + break; + } + } + return object; + } + + /** + * Iterates over own enumerable properties of an object, executing the callback + * for each property. The callback is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) + */ + var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + + /** + * This method is like `_.forOwn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' + */ + function forOwnRight(object, callback, thisArg) { + var props = keys(object), + length = props.length; + + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + var key = props[length]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } + + /** + * Creates a sorted array of property names of all enumerable properties, + * own and inherited, of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified object `property` exists and is a direct property, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to check. + * @param {string} property The property to check for. + * @returns {boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, property) { + return object ? hasOwnProperty.call(object, property) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'moe', 'second': 'larry' }); + * // => { 'moe': 'first', 'larry': 'second' } + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || toString.call(value) == boolClass; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value ? value.nodeType === 1 : false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + (support.argsClass ? className == argsClass : isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If a callback is provided it will be executed + * to compare values. If the callback returns `undefined` comparisons will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var moe = { 'name': 'moe', 'age': 40 }; + * var copy = { 'name': 'moe', 'age': 40 }; + * + * moe == copy; + * // => false + * + * _.isEqual(moe, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg) { + return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2)); + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite` which will return true for + * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN` which will return `true` for + * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || toString.call(value) == numberClass; + } + + /** + * Checks if `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Stooge(name, age) { + * this.name = name; + * this.age = age; + * } + * + * _.isPlainObject(new Stooge('moe', 40)); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'name': 'moe', 'age': 40 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { + return false; + } + var valueOf = value.valueOf, + objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/moe/); + * // => true + */ + function isRegExp(value) { + return (value && objectTypes[typeof value]) ? toString.call(value) == regexpClass : false; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('moe'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || toString.call(value) == stringClass; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * will overwrite property assignments of previous sources. If a callback is + * provided it will be executed to produce the merged values of the destination + * and source properties. If the callback returns `undefined` merging will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'stooges': [ + * { 'name': 'moe' }, + * { 'name': 'larry' } + * ] + * }; + * + * var ages = { + * 'stooges': [ + * { 'age': 40 }, + * { 'age': 50 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object) { + var args = arguments, + length = 2; + + if (!isObject(object)) { + return object; + } + // allows working with `_.reduce` and `_.reduceRight` without using + // their `index` and `collection` arguments + if (typeof args[2] != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + var callback = baseCreateCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + var sources = nativeSlice.call(arguments, 1, length), + index = -1, + stackA = getArray(), + stackB = getArray(); + + while (++index < length) { + baseMerge(object, sources[index], callback, stackA, stackB); + } + releaseArray(stackA); + releaseArray(stackB); + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` omitting the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The properties to omit or the + * function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'moe', 'age': 40 }, 'age'); + * // => { 'name': 'moe' } + * + * _.omit({ 'name': 'moe', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'moe' } + */ + function omit(object, callback, thisArg) { + var indexOf = getIndexOf(), + isFunc = typeof callback == 'function', + result = {}; + + if (isFunc) { + callback = lodash.createCallback(callback, thisArg, 3); + } else { + var props = baseFlatten(arguments, true, false, 1); + } + forIn(object, function(value, key, object) { + if (isFunc + ? !callback(value, key, object) + : indexOf(props, key) < 0 + ) { + result[key] = value; + } + }); + return result; + } + + /** + * Creates a two dimensional array of an object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'moe': 30, 'larry': 40 }); + * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` picking the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The function called per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); + * // => { 'name': 'moe' } + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'moe' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = -1, + props = baseFlatten(arguments, true, false, 1), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * An alternative to `_.reduce` this method transforms `object` to a new + * `accumulator` object which is the result of running each of its elements + * through a callback, with each callback execution potentially mutating + * the `accumulator` object. The callback is bound to `thisArg` and invoked + * with four arguments; (accumulator, value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { + * num *= num; + * if (num % 2) { + * return result.push(num) < 3; + * } + * }); + * // => [1, 9, 25] + * + * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function transform(object, callback, accumulator, thisArg) { + var isArr = isArray(object); + callback = baseCreateCallback(callback, thisArg, 4); + + if (accumulator == null) { + if (isArr) { + accumulator = []; + } else { + var ctor = object && object.constructor, + proto = ctor && ctor.prototype; + + accumulator = createObject(proto); + } + } + (isArr ? baseEach : forOwn)(object, function(value, index, object) { + return callback(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] (property order is not guaranteed across environments) + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [index] The indexes of `collection` + * to retrieve, specified as individual indexes or arrays of indexes. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['moe', 'larry', 'curly'], 0, 2); + * // => ['moe', 'curly'] + */ + function at(collection) { + var args = arguments, + index = -1, + props = baseFlatten(args, true, false, 1), + length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length, + result = Array(length); + + if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given value is present in a collection using strict equality + * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the + * offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {*} target The value to check for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); + * // => true + * + * _.contains('curly', 'ur'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + indexOf = getIndexOf(), + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (isArray(collection)) { + result = indexOf(collection, target, fromIndex) > -1; + } else if (typeof length == 'number') { + result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1; + } else { + baseEach(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through the callback. The corresponding value + * of each key is the number of times the key was returned by the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + + /** + * Checks if the given callback returns truey value for **all** elements of + * a collection. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if all elements passed the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(stooges, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(stooges, { 'age': 50 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning an array of all elements + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + * + * // using "_.where" callback shorthand + * _.filter(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning the first element that + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect, findWhere + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * _.find([1, 2, 3, 4], function(num) { + * return num % 2 == 0; + * }); + * // => 2 + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'banana', 'organic': true, 'type': 'fruit' }, + * { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.find(food, { 'type': 'vegetable' }); + * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + * + * // using "_.pluck" callback shorthand + * _.find(food, 'organic'); + * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' } + */ + function find(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + return value; + } + } + } else { + var result; + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + } + + /** + * This method is like `_.find` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(num) { + * return num % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forEachRight(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over elements of a collection, executing the callback for each + * element. The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); + * // => logs each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + * // => logs each number and returns the object (property order is not guaranteed across environments) + */ + function forEach(collection, callback, thisArg) { + if (callback && typeof thisArg == 'undefined' && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + baseEach(collection, callback, thisArg); + } + return collection; + } + + /** + * This method is like `_.forEach` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); + * // => logs each number from right to left and returns '3,2,1' + */ + function forEachRight(collection, callback, thisArg) { + var iterable = collection, + length = collection ? collection.length : 0; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (length--) { + if (callback(collection[length], length, collection) === false) { + break; + } + } + } else { + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (support.unindexedChars && isString(collection)) { + iterable = collection.split(''); + } + baseEach(collection, function(value, key, collection) { + key = props ? props[--length] : --length; + return callback(iterable[key], key, collection); + }); + } + return collection; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of a collection through the callback. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of the collection through the given callback. The corresponding + * value of each key is the last element responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keys = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keys, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method named by `methodName` on each element in the `collection` + * returning an array of the results of each invoked method. Additional arguments + * will be provided to each invoked method. If `methodName` is a function it + * will be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|string} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {...*} [arg] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = nativeSlice.call(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the collection + * through the callback. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (property order is not guaranteed across environments) + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(stooges, 'name'); + * // => ['moe', 'larry'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = lodash.createCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of a collection. If the collection is empty or + * falsey `-Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.max(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'larry', 'age': 50 }; + * + * // using "_.pluck" callback shorthand + * _.max(stooges, 'age'); + * // => { 'name': 'larry', 'age': 50 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = (!callback && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of a collection. If the collection is empty or + * falsey `Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.min(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'moe', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.min(stooges, 'age'); + * // => { 'name': 'moe', 'age': 40 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = (!callback && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the `collection`. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {string} property The property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.pluck(stooges, 'name'); + * // => ['moe', 'larry'] + */ + var pluck = map; + + /** + * Reduces a collection to a value which is the accumulated result of running + * each element in the collection through the callback, where each successive + * callback execution consumes the return value of the previous execution. If + * `accumulator` is not provided the first element of the collection will be + * used as the initial `accumulator` value. The callback is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = baseCreateCallback(callback, thisArg, 4); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + baseEach(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is like `_.reduce` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = baseCreateCallback(callback, thisArg, 4); + forEachRight(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter` this method returns the elements of a + * collection that the callback does **not** return truey for. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that failed the callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(food, 'organic'); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + * + * // using "_.where" callback shorthand + * _.reject(food, { 'type': 'fruit' }); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + */ + function reject(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Retrieves a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Allows working with functions, like `_.map`, + * without using their `key` and `object` arguments as sources. + * @returns {Array} Returns the random sample(s) of `collection`. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + var length = collection ? collection.length : 0; + if (typeof length != 'number') { + collection = values(collection); + } else if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + if (n == null || guard) { + return collection ? collection[random(length - 1)] : undefined; + } + var result = shuffle(collection); + result.length = nativeMin(nativeMax(0, n), result.length); + return result; + } + + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates + * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = random(++index); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('curly'); + * // => 5 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the callback returns a truey value for **any** element of a + * collection. The function returns as soon as it finds a passing value and + * does not iterate over the entire collection. The callback is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if any element passed the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(food, 'organic'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(food, { 'type': 'meat' }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through the callback. This method + * performs a stable sort, that is, it will preserve the original sort order + * of equal elements. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * // using "_.pluck" callback shorthand + * _.sortBy(['banana', 'strawberry', 'apple'], 'length'); + * // => ['apple', 'banana', 'strawberry'] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = lodash.createCallback(callback, thisArg, 3); + forEach(collection, function(value, key, collection) { + var object = result[++index] = getObject(); + object.criteria = callback(value, key, collection); + object.index = index; + object.value = value; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + var object = result[length]; + result[length] = object.value; + releaseObject(object); + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return (support.unindexedChars && isString(collection)) + ? collection.split('') + : slice(collection); + } + return values(collection); + } + + /** + * Performs a deep comparison of each element in a `collection` to the given + * `properties` object, returning an array of all elements that have equivalent + * property values. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given properties. + * @example + * + * var stooges = [ + * { 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }, + * { 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] } + * ]; + * + * _.where(stooges, { 'age': 40 }); + * // => [{ 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }] + * + * _.where(stooges, { 'quotes': ['Poifect!'] }); + * // => [{ 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array excluding all values of the provided arrays using strict + * equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {...Array} [array] The arrays of values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + seen = baseFlatten(arguments, true, true, 1), + result = []; + + var isLarge = length >= largeArraySize && indexOf === baseIndexOf; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + } + } + while (++index < length) { + var value = array[index]; + if (indexOf(seen, value) < 0) { + result.push(value); + } + } + if (isLarge) { + releaseObject(seen); + } + return result; + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element that passes the callback check, instead of the element itself. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * _.findIndex(['apple', 'banana', 'beet'], function(food) { + * return /^b/.test(food); + * }); + * // => 1 + */ + function findIndex(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + if (callback(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * _.findLastIndex(['apple', 'banana', 'beet'], function(food) { + * return /^b/.test(food); + * }); + * // => 2 + */ + function findLastIndex(array, callback, thisArg) { + var length = array ? array.length : 0; + callback = lodash.createCallback(callback, thisArg, 3); + while (length--) { + if (callback(array[length], length, array)) { + return length; + } + } + return -1; + } + + /** + * Gets the first element or first `n` elements of an array. If a callback + * is provided elements at the beginning of the array are returned as long + * as the callback returns truey. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(food, 'organic'); + * // => [{ 'name': 'banana', 'organic': true }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.first(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] + */ + function first(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[0] : undefined; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `isShallow` + * is truey, the array will only be flattened a single level. If a callback + * is provided each element of the array is passed through the callback before + * flattening. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + * + * var stooges = [ + * { 'name': 'curly', 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }, + * { 'name': 'moe', 'quotes': ['Spread out!', 'You knucklehead!'] } + * ]; + * + * // using "_.pluck" callback shorthand + * _.flatten(stooges, 'quotes'); + * // => ['Oh, a wise guy, eh?', 'Poifect!', 'Spread out!', 'You knucklehead!'] + */ + function flatten(array, isShallow, callback, thisArg) { + // juggle arguments + if (typeof isShallow != 'boolean' && isShallow != null) { + thisArg = callback; + callback = !(thisArg && thisArg[isShallow] === array) ? isShallow : null; + isShallow = false; + } + if (callback != null) { + array = map(array, callback, thisArg); + } + return baseFlatten(array, isShallow); + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the array is already sorted + * providing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + if (typeof fromIndex == 'number') { + var length = array ? array.length : 0; + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); + } else if (fromIndex) { + var index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element or last `n` elements of an array. If a + * callback is provided elements at the end of the array are excluded from + * the result as long as the callback returns truey. The callback is bound + * to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.initial(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'banana', 'type': 'fruit' }] + */ + function initial(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Creates an array of unique values present in all provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of composite values. + * @example + * + * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2] + */ + function intersection(array) { + var args = arguments, + argsLength = args.length, + argsIndex = -1, + caches = getArray(), + index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = [], + seen = getArray(); + + while (++argsIndex < argsLength) { + var value = args[argsIndex]; + caches[argsIndex] = indexOf === baseIndexOf && + (value ? value.length : 0) >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen); + } + outer: + while (++index < length) { + var cache = caches[0]; + value = array[index]; + + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); + while (--argsIndex) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { + continue outer; + } + } + result.push(value); + } + } + while (argsLength--) { + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } + } + releaseArray(caches); + releaseArray(seen); + return result; + } + + /** + * Gets the last element or last `n` elements of an array. If a callback is + * provided elements at the end of the array are returned as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.last(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.last(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] + */ + function last(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[length - 1] : undefined; + } + } + return slice(array, nativeMax(0, length - n)); + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all provided values from the given array using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {...*} [value] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + function pull(array) { + var args = arguments, + argsIndex = 0, + argsLength = args.length, + length = array ? array.length : 0; + + while (++argsIndex < argsLength) { + var index = -1, + value = args[argsIndex]; + while (++index < length) { + if (array[index] === value) { + splice.call(array, index--, 1); + length--; + } + } + } + return array; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. If `start` is less than `stop` a + * zero-length range is created unless a negative `step` is specified. + * + * @static + * @memberOf _ + * @category Arrays + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(10); + * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + * + * _.range(1, 11); + * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * _.range(0, 30, 5); + * // => [0, 5, 10, 15, 20, 25] + * + * _.range(0, -10, -1); + * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = typeof step == 'number' ? step : (+step || 1); + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so engines, like Chakra and V8, avoid slower modes + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / (step || 1))), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * Removes all elements from an array that the callback returns truey for + * and returns an array of removed elements. The callback is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4, 5, 6]; + * var evens = _.remove(array, function(num) { return num % 2 == 0; }); + * + * console.log(array); + * // => [1, 3, 5] + * + * console.log(evens); + * // => [2, 4, 6] + */ + function remove(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = []; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + var value = array[index]; + if (callback(value, index, array)) { + result.push(value); + splice.call(array, index--, 1); + length--; + } + } + return result; + } + + /** + * The opposite of `_.initial` this method gets all but the first element or + * first `n` elements of an array. If a callback function is provided elements + * at the beginning of the array are excluded from the result as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.rest(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.rest(food, { 'type': 'fruit' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which a value + * should be inserted into a given sorted array in order to maintain the sort + * order of the array. If a callback is provided it will be executed for + * `value` and each element of `array` to compute their sort ranking. The + * callback is bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + (callback(array[mid]) < value) + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Creates an array of unique values, in order, of the provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of composite values. + * @example + * + * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2, 3, 101, 10] + */ + function union(array) { + return baseUniq(baseFlatten(arguments, true, true)); + } + + /** + * Creates a duplicate-value-free version of an array using strict equality + * for comparisons, i.e. `===`. If the array is sorted, providing + * `true` for `isSorted` will use a faster algorithm. If a callback is provided + * each element of `array` is passed through the callback before uniqueness + * is computed. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); + * // => ['A', 'b', 'C'] + * + * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2.5, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + // juggle arguments + if (typeof isSorted != 'boolean' && isSorted != null) { + thisArg = callback; + callback = !(thisArg && thisArg[isSorted] === array) ? isSorted : null; + isSorted = false; + } + if (callback != null) { + callback = lodash.createCallback(callback, thisArg, 3); + } + return baseUniq(array, isSorted, callback); + } + + /** + * Creates an array excluding all provided values using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {...*} [value] The values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + return difference(array, nativeSlice.call(arguments, 1)); + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second + * elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @alias unzip + * @category Arrays + * @param {...Array} [array] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['moe', 'larry'], [30, 40], [true, false]); + * // => [['moe', 30, true], ['larry', 40, false]] + */ + function zip() { + var array = arguments.length > 1 ? arguments : arguments[0], + index = -1, + length = array ? max(pluck(array, 'length')) : 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = pluck(array, index); + } + return result; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Provide + * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` + * or two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @alias object + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.zipObject(['moe', 'larry'], [30, 40]); + * // => { 'moe': 30, 'larry': 40 } + */ + function zipObject(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that executes `func`, with the `this` binding and + * arguments of the created function, only after being called `n` times. + * + * @static + * @memberOf _ + * @category Functions + * @param {number} n The number of times the function must be called before + * `func` is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('Done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'Done saving!', after all saves have completed + */ + function after(n, func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * provided to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'moe' }, 'hi'); + * func(); + * // => 'hi moe' + */ + function bind(func, thisArg) { + return arguments.length > 2 + ? createBound(func, 17, nativeSlice.call(arguments, 2), null, thisArg) + : createBound(func, 1, null, null, thisArg); + } + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all the function properties + * of `object` will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...string} [methodName] The object method names to + * bind, specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { console.log('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), + index = -1, + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = createBound(object[key], 1, null, null, object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those provided to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {string} key The key of the method. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'moe', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi moe' + * + * object.greet = function(greeting) { + * return greeting + ', ' + this.name + '!'; + * }; + * + * func(); + * // => 'hi, moe!' + */ + function bindKey(object, key) { + return arguments.length > 2 + ? createBound(key, 19, nativeSlice.call(arguments, 2), null, object) + : createBound(key, 3, null, null, object); + } + + /** + * Creates a function that is the composition of the provided functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {...Function} [func] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var realNameMap = { + * 'curly': 'jerome' + * }; + * + * var format = function(name) { + * name = realNameMap[name.toLowerCase()] || name; + * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); + * }; + * + * var greet = function(formatted) { + * return 'Hiya ' + formatted + '!'; + * }; + * + * var welcome = _.compose(greet, format); + * welcome('curly'); + * // => 'Hiya Jerome!' + */ + function compose() { + var funcs = arguments, + length = funcs.length; + + while (length--) { + if (!isFunction(funcs[length])) { + throw new TypeError; + } + } + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name the created callback will return the property value for a given element. + * If `func` is an object the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // wrap to create custom callback shorthands + * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { + * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); + * return !match ? func(callback, thisArg) : function(object) { + * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * }; + * }); + * + * _.filter(stooges, 'age__gt45'); + * // => [{ 'name': 'larry', 'age': 50 }] + */ + function createCallback(func, thisArg, argCount) { + var type = typeof func; + if (func == null || type == 'function') { + return baseCreateCallback(func, thisArg, argCount); + } + // handle "_.pluck" style callback shorthands + if (type != 'object') { + return function(object) { + return object[func]; + }; + } + var props = keys(func), + key = props[0], + a = func[key]; + + // handle "_.where" style callback shorthands + if (props.length == 1 && a === a && !isObject(a)) { + // fast path the common case of providing an object with a single + // property containing a primitive value + return function(object) { + var b = object[key]; + return a === b && (a !== 0 || (1 / a == 1 / b)); + }; + } + return function(object) { + var length = props.length, + result = false; + + while (length--) { + if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) { + break; + } + } + return result; + }; + } + + /** + * Creates a function which accepts one or more arguments of `func` that when + * invoked either executes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` can be specified + * if `func.length` is not sufficient. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @returns {Function} Returns the new curried function. + * @example + * + * var curried = _.curry(function(a, b, c) { + * console.log(a + b + c); + * }); + * + * curried(1)(2)(3); + * // => 6 + * + * curried(1, 2)(3); + * // => 6 + * + * curried(1, 2, 3); + * // => 6 + */ + function curry(func, arity) { + arity = typeof arity == 'number' ? arity : (+arity || func.length); + return createBound(func, 4, null, null, null, arity); + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. + * Provide an options object to indicate that `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. Subsequent calls + * to the debounced function will return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {number} wait The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * var lazyLayout = _.debounce(calculateLayout, 150); + * jQuery(window).on('resize', lazyLayout); + * + * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * }); + * + * // ensure `batchLog` is executed once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * source.addEventListener('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * }, false); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + wait = nativeMax(0, wait) || 0; + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = options.leading; + maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); + trailing = 'trailing' in options ? options.trailing : trailing; + } + var delayed = function() { + var remaining = wait - (new Date - stamp); + if (remaining <= 0) { + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + var isCalled = trailingCall; + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = +new Date; + result = func.apply(thisArg, args); + } + } else { + timeoutId = setTimeout(delayed, remaining); + } + }; + + var maxDelayed = function() { + if (timeoutId) { + clearTimeout(timeoutId); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (trailing || (maxWait !== wait)) { + lastCalled = +new Date; + result = func.apply(thisArg, args); + } + }; + + return function() { + args = arguments; + stamp = +new Date; + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled); + if (remaining <= 0) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + result = func.apply(thisArg, args); + } + return result; + }; + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function() { console.log('deferred'); }); + * // returns from the function before 'deferred' is logged + */ + function defer(func) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = nativeSlice.call(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + // use `setImmediate` if available in Node.js + if (isV8 && moduleExports && typeof setImmediate == 'function') { + defer = function(func) { + if (!isFunction(func)) { + throw new TypeError; + } + return setImmediate.apply(context, arguments); + }; + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay execution. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * var log = _.bind(console.log, console); + * _.delay(log, 1000, 'logged later'); + * // => 'logged later' (Appears after one second.) + */ + function delay(func, wait) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = nativeSlice.call(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it will be used to determine the cache key for storing the result + * based on the arguments provided to the memoized function. By default, the + * first argument provided to the memoized function is used as the cache key. + * The `func` is executed with the `this` binding of the memoized function. + * The result cache is exposed as the `cache` property on the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + * + * var data = { + * 'moe': { 'name': 'moe', 'age': 40 }, + * 'curly': { 'name': 'curly', 'age': 60 } + * }; + * + * // modifying the result cache + * var stooge = _.memoize(function(name) { return data[name]; }, _.identity); + * stooge('curly'); + * // => { 'name': 'curly', 'age': 60 } + * + * stooge.cache.curly.name = 'jerome'; + * stooge('curly'); + * // => { 'name': 'jerome', 'age': 60 } + */ + function memoize(func, resolver) { + if (!isFunction(func)) { + throw new TypeError; + } + var memoized = function() { + var cache = memoized.cache, + key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + } + memoized.cache = {}; + return memoized; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those provided to the new function. This + * method is similar to `_.bind` except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('moe'); + * // => 'hi moe' + */ + function partial(func) { + return createBound(func, 16, nativeSlice.call(arguments, 1)); + } + + /** + * This method is like `_.partial` except that `partial` arguments are + * appended to those provided to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createBound(func, 32, null, nativeSlice.call(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` function + * at most once per every `wait` milliseconds. Provide an options object to + * indicate that `func` should be invoked on the leading and/or trailing edge + * of the `wait` timeout. Subsequent calls to the throttled function will + * return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {number} wait The number of milliseconds to throttle executions to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + * + * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? options.leading : leading; + trailing = 'trailing' in options ? options.trailing : trailing; + } + options = getObject(); + options.leading = leading; + options.maxWait = wait; + options.trailing = trailing; + + var result = debounce(func, wait, options); + releaseObject(options); + return result; + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Additional arguments provided to the function are appended + * to those provided to the wrapper function. The wrapper is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var hello = function(name) { return 'hello ' + name; }; + * hello = _.wrap(hello, function(func) { + * return 'before, ' + func('moe') + ', after'; + * }); + * hello(); + * // => 'before, hello moe, after' + */ + function wrap(value, wrapper) { + if (!isFunction(wrapper)) { + throw new TypeError; + } + return function() { + var args = [value]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Moe, Larry & Curly'); + * // => 'Moe, Larry & Curly' + */ + function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var moe = { 'name': 'moe' }; + * moe === _.identity(moe); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds function properties of a source object to the `lodash` function and + * chainable wrapper. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object of function properties to add to `lodash`. + * @param {Object} object The object of function properties to add to `lodash`. + * @example + * + * _.mixin({ + * 'capitalize': function(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * }); + * + * _.capitalize('moe'); + * // => 'Moe' + * + * _('moe').capitalize(); + * // => 'Moe' + */ + function mixin(object, source) { + var ctor = object, + isFunc = !source || isFunction(ctor); + + if (!source) { + ctor = lodashWrapper; + source = object; + object = lodash; + } + forEach(functions(source), function(methodName) { + var func = object[methodName] = source[methodName]; + if (isFunc) { + ctor.prototype[methodName] = function() { + var value = this.__wrapped__, + args = [value]; + + push.apply(args, arguments); + var result = func.apply(object, args); + return (value && typeof value == 'object' && value === result) + ? this + : new ctor(result); + }; + } + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + context._ = oldDash; + return this; + } + + /** + * Converts the given value into an integer of the specified radix. + * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the + * `value` is a hexadecimal, in which case a `radix` of `16` is used. + * + * Note: This method avoids differences in native ES3 and ES5 `parseInt` + * implementations. See http://es5.github.io/#E. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} value The value to parse. + * @param {number} [radix] The radix used to interpret the value to parse. + * @returns {number} Returns the new integer value. + * @example + * + * _.parseInt('08'); + * // => 8 + */ + var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) { + // Firefox and Opera still follow the ES3 specified implementation of `parseInt` + return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0); + }; + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number will be + * returned. If `floating` is truey or either `min` or `max` are floats a + * floating-point number will be returned instead of an integer. + * + * @static + * @memberOf _ + * @category Utilities + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating=false] Specify returning a floating-point number. + * @returns {number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max, floating) { + var noMin = min == null, + noMax = max == null; + + if (floating == null) { + if (typeof min == 'boolean' && noMax) { + floating = min; + min = 1; + } + else if (!noMax && typeof max == 'boolean') { + floating = max; + noMax = true; + } + } + if (noMin && noMax) { + max = 1; + } + min = +min || 0; + if (noMax) { + max = min; + min = 0; + } else { + max = +max || 0; + } + var rand = nativeRandom(); + return (floating || min % 1 || max % 1) + ? min + nativeMin(rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1))), max) + : min + floor(rand * (max - min + 1)); + } + + /** + * Resolves the value of `property` on `object`. If `property` is a function + * it will be invoked with the `this` binding of `object` and its result returned, + * else the property value is returned. If `object` is falsey then `undefined` + * is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {string} property The property to get the value of. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, property) { + if (object) { + var value = object[property]; + return isFunction(value) ? object[property]() : value; + } + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/#custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'moe' }); + * // => 'hello moe' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm i --save lodash\n\n{sudo} npm i -g lodash\nnpm ln lodash\n```\n\nIn [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n// or as Underscore\nvar _ = require('lodash/dist/lodash.underscore');\n```\n\n**Notes:**\n * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL\n * 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 project’s root directory *before* requiring it\n * Node.js 0.10.8-0.10.11 [have](https://github.com/joyent/node/issues/5622) [bugs](https://github.com/joyent/node/issues/5688) preventing minified builds\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader:\n\n```js\nrequire({\n 'packages': [\n { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }\n ]\n},\n['lodash'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash@2.1.0", + "dist": { + "shasum": "0637eaaa36a8a1cfc865c3adfb942189bfb0998d" + }, + "_from": "lodash@~2.1.0", + "_resolved": "https://registry.npmjs.org/lodash/-/lodash-2.1.0.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/README.md new file mode 100644 index 0000000..978268e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/README.md @@ -0,0 +1,218 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +Eventually, it will replace the C binding in node-glob. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself. When set, an empty list is returned if there are +no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..c633f89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js @@ -0,0 +1,1055 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + var splitFile = path.basename(f.join("/")).split("/") + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = splitFile + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/.npmignore new file mode 100644 index 0000000..07e6e47 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS new file mode 100644 index 0000000..4a0bc50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS @@ -0,0 +1,14 @@ +# Authors, sorted by whether or not they are me +Isaac Z. Schlueter +Brian Cottingham +Carlos Brito Lage +Jesse Dailey +Kevin O'Hara +Marco Rogers +Mark Cavage +Marko Mikulicic +Nathan Rajlich +Satheesh Natesan +Trent Mick +ashleybrener +n4kz diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/README.md new file mode 100644 index 0000000..03ee0f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/README.md @@ -0,0 +1,97 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `n` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 0000000..d1d1381 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,252 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0; + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +// Provided for debugging/dev purposes only. No promises whatsoever that +// this API stays stable. +LRUCache.prototype.dump = function () { + return this._cache +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value) { + if (hOP(this._cache, key)) { + // dispose of the old one before overwriting + if (this._dispose) this._dispose(key, this._cache[key].value) + if (this._maxAge) this._cache[key].now = Date.now() + this._cache[key].value = value + this.get(key) + return true + } + + var len = this._lengthCalculator(value) + var age = this._maxAge ? Date.now() : 0 + var hit = new Entry(key, value, this._mru++, len, age) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + del(this, this._cache[key]) +} + +function get (self, key, doUse) { + var hit = self._cache[key] + if (hit) { + if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now +} + +})() diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/package.json new file mode 100644 index 0000000..4472725 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,33 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.5.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "", + "weak": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" + }, + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache", + "_id": "lru-cache@2.5.0", + "_from": "lru-cache@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/basic.js new file mode 100644 index 0000000..f72697c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/basic.js @@ -0,0 +1,369 @@ +var test = require("tap").test + , LRU = require("../") + +test("basic", function (t) { + var cache = new LRU({max: 10}) + cache.set("key", "value") + t.equal(cache.get("key"), "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.length, 1) + t.equal(cache.max, 10) + t.end() +}) + +test("least recently set", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.get("a") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), "A") + t.end() +}) + +test("del", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.del("a") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("max", function (t) { + var cache = new LRU(3) + + // test changing the max, verify that the LRU items get dropped. + cache.max = 100 + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + + // now remove the max restriction, and try again. + cache.max = "hello" + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + // should trigger an immediate resize + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + t.end() +}) + +test("reset", function (t) { + var cache = new LRU(10) + cache.set("a", "A") + cache.set("b", "B") + cache.reset() + t.equal(cache.length, 0) + t.equal(cache.max, 10) + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.end() +}) + + +// Note: `.dump()` is a debugging tool only. No guarantees are made +// about the format/layout of the response. +test("dump", function (t) { + var cache = new LRU(10) + var d = cache.dump(); + t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") + cache.set("a", "A") + var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } + t.ok(d.a) + t.equal(d.a.key, "a") + t.equal(d.a.value, "A") + t.equal(d.a.lu, 0) + + cache.set("b", "B") + cache.get("b") + d = cache.dump() + t.ok(d.b) + t.equal(d.b.key, "b") + t.equal(d.b.value, "B") + t.equal(d.b.lu, 2) + + t.end() +}) + + +test("basic with weighed length", function (t) { + var cache = new LRU({ + max: 100, + length: function (item) { return item.size } + }) + cache.set("key", {val: "value", size: 50}) + t.equal(cache.get("key").val, "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.lengthCalculator(cache.get("key")), 50) + t.equal(cache.length, 50) + t.equal(cache.max, 100) + t.end() +}) + + +test("weighed length item too large", function (t) { + var cache = new LRU({ + max: 10, + length: function (item) { return item.size } + }) + t.equal(cache.max, 10) + + // should fall out immediately + cache.set("key", {val: "value", size: 50}) + + t.equal(cache.length, 0) + t.equal(cache.get("key"), undefined) + t.end() +}) + +test("least recently set with weighed length", function (t) { + var cache = new LRU({ + max:8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.set("d", "DDDD") + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("c"), "CCC") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.get("a") + cache.get("b") + cache.set("d", "DDDD") + t.equal(cache.get("c"), undefined) + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("b"), "BB") + t.equal(cache.get("a"), "A") + t.end() +}) + +test("set returns proper booleans", function(t) { + var cache = new LRU({ + max: 5, + length: function (item) { return item.length } + }) + + t.equal(cache.set("a", "A"), true) + + // should return false for max exceeded + t.equal(cache.set("b", "donuts"), false) + + t.equal(cache.set("b", "B"), true) + t.equal(cache.set("c", "CCCC"), true) + t.end() +}) + +test("drop the old items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A") + + setTimeout(function () { + cache.set("b", "b") + t.equal(cache.get("a"), "A") + }, 25) + + setTimeout(function () { + cache.set("c", "C") + // timed out + t.notOk(cache.get("a")) + }, 60) + + setTimeout(function () { + t.notOk(cache.get("b")) + t.equal(cache.get("c"), "C") + }, 90) + + setTimeout(function () { + t.notOk(cache.get("c")) + t.end() + }, 155) +}) + +test("disposal function", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + dispose: function (k, n) { + disposed = n + } + }) + + cache.set(1, 1) + cache.set(2, 2) + t.equal(disposed, 1) + cache.set(3, 3) + t.equal(disposed, 2) + cache.reset() + t.equal(disposed, 3) + t.end() +}) + +test("disposal function on too big of item", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + length: function (k) { + return k.length + }, + dispose: function (k, n) { + disposed = n + } + }) + var obj = [ 1, 2 ] + + t.equal(disposed, false) + cache.set("obj", obj) + t.equal(disposed, obj) + t.end() +}) + +test("has()", function(t) { + var cache = new LRU({ + max: 1, + maxAge: 10 + }) + + cache.set('foo', 'bar') + t.equal(cache.has('foo'), true) + cache.set('blu', 'baz') + t.equal(cache.has('foo'), false) + t.equal(cache.has('blu'), true) + setTimeout(function() { + t.equal(cache.has('blu'), false) + t.end() + }, 15) +}) + +test("stale", function(t) { + var cache = new LRU({ + maxAge: 10, + stale: true + }) + + cache.set('foo', 'bar') + t.equal(cache.get('foo'), 'bar') + t.equal(cache.has('foo'), true) + setTimeout(function() { + t.equal(cache.has('foo'), false) + t.equal(cache.get('foo'), 'bar') + t.equal(cache.get('foo'), undefined) + t.end() + }, 15) +}) + +test("lru update via set", function(t) { + var cache = LRU({ max: 2 }); + + cache.set('foo', 1); + cache.set('bar', 2); + cache.del('bar'); + cache.set('baz', 3); + cache.set('qux', 4); + + t.equal(cache.get('foo'), undefined) + t.equal(cache.get('bar'), undefined) + t.equal(cache.get('baz'), 3) + t.equal(cache.get('qux'), 4) + t.end() +}) + +test("least recently set w/ peek", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + t.equal(cache.peek("a"), "A") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("pop the least used item", function (t) { + var cache = new LRU(3) + , last + + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + + t.equal(cache.length, 3) + t.equal(cache.max, 3) + + // Ensure we pop a, c, b + cache.get("b", "B") + + last = cache.pop() + t.equal(last.key, "a") + t.equal(last.value, "A") + t.equal(cache.length, 2) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "c") + t.equal(last.value, "C") + t.equal(cache.length, 1) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "b") + t.equal(last.value, "B") + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last, null) + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/foreach.js new file mode 100644 index 0000000..eefb80d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/foreach.js @@ -0,0 +1,52 @@ +var test = require('tap').test +var LRU = require('../') + +test('forEach', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 9 + l.forEach(function (val, key, cache) { + t.equal(cache, l) + t.equal(key, i.toString()) + t.equal(val, i.toString(2)) + i -= 1 + }) + + // get in order of most recently used + l.get(6) + l.get(8) + + var order = [ 8, 6, 9, 7, 5 ] + var i = 0 + + l.forEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + + t.end() +}) + +test('keys() and values()', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + t.similar(l.keys(), ['9', '8', '7', '6', '5']) + t.similar(l.values(), ['1001', '1000', '111', '110', '101']) + + // get in order of most recently used + l.get(6) + l.get(8) + + t.similar(l.keys(), ['8', '6', '9', '7', '5']) + t.similar(l.values(), ['1000', '110', '1001', '111', '101']) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js new file mode 100644 index 0000000..7af45b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node --expose_gc + +var weak = require('weak'); +var test = require('tap').test +var LRU = require('../') +var l = new LRU({ max: 10 }) +var refs = 0 +function X() { + refs ++ + weak(this, deref) +} + +function deref() { + refs -- +} + +test('no leaks', function (t) { + // fill up the cache + for (var i = 0; i < 100; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var start = process.memoryUsage() + + // capture the memory + var startRefs = refs + + // do it again, but more + for (var i = 0; i < 10000; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var end = process.memoryUsage() + t.equal(refs, startRefs, 'no leaky refs') + + console.error('start: %j\n' + + 'end: %j', start, end); + t.pass(); + t.end(); +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/README.md new file mode 100644 index 0000000..7e36512 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/README.md @@ -0,0 +1,53 @@ +# sigmund + +Quick and dirty signatures for Objects. + +This is like a much faster `deepEquals` comparison, which returns a +string key suitable for caches and the like. + +## Usage + +```javascript +function doSomething (someObj) { + var key = sigmund(someObj, maxDepth) // max depth defaults to 10 + var cached = cache.get(key) + if (cached) return cached) + + var result = expensiveCalculation(someObj) + cache.set(key, result) + return result +} +``` + +The resulting key will be as unique and reproducible as calling +`JSON.stringify` or `util.inspect` on the object, but is much faster. +In order to achieve this speed, some differences are glossed over. +For example, the object `{0:'foo'}` will be treated identically to the +array `['foo']`. + +Also, just as there is no way to summon the soul from the scribblings +of a cocain-addled psychoanalyst, there is no way to revive the object +from the signature string that sigmund gives you. In fact, it's +barely even readable. + +As with `sys.inspect` and `JSON.stringify`, larger objects will +produce larger signature strings. + +Because sigmund is a bit less strict than the more thorough +alternatives, the strings will be shorter, and also there is a +slightly higher chance for collisions. For example, these objects +have the same signature: + + var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} + var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +Like a good Freudian, sigmund is most effective when you already have +some understanding of what you're looking for. It can help you help +yourself, but you must be willing to do some work as well. + +Cycles are handled, and cyclical objects are silently omitted (though +the key is included in the signature output.) + +The second argument is the maximum depth, which defaults to 10, +because that is the maximum object traversal depth covered by most +insurance carriers. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/bench.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/bench.js new file mode 100644 index 0000000..5acfd6d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/bench.js @@ -0,0 +1,283 @@ +// different ways to id objects +// use a req/res pair, since it's crazy deep and cyclical + +// sparseFE10 and sigmund are usually pretty close, which is to be expected, +// since they are essentially the same algorithm, except that sigmund handles +// regular expression objects properly. + + +var http = require('http') +var util = require('util') +var sigmund = require('./sigmund.js') +var sreq, sres, creq, cres, test + +http.createServer(function (q, s) { + sreq = q + sres = s + sres.end('ok') + this.close(function () { setTimeout(function () { + start() + }, 200) }) +}).listen(1337, function () { + creq = http.get({ port: 1337 }) + creq.on('response', function (s) { cres = s }) +}) + +function start () { + test = [sreq, sres, creq, cres] + // test = sreq + // sreq.sres = sres + // sreq.creq = creq + // sreq.cres = cres + + for (var i in exports.compare) { + console.log(i) + var hash = exports.compare[i]() + console.log(hash) + console.log(hash.length) + console.log('') + } + + require('bench').runMain() +} + +function customWs (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return customWs(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + customWs(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function custom (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return '' + obj + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return custom(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + custom(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function sparseFE2 (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ':' + ch(v[k], depth + 1) + }) + soFar += '}' + } + ch(obj, 0) + return soFar +} + +function sparseFE (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ch(v[k], depth + 1) + }) + } + ch(obj, 0) + return soFar +} + +function sparse (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ch(v[k], depth + 1) + } + } + ch(obj, 0) + return soFar +} + +function noCommas (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + + +function flatten (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + soFar += ',' + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + +exports.compare = +{ + // 'custom 2': function () { + // return custom(test, 2, 0) + // }, + // 'customWs 2': function () { + // return customWs(test, 2, 0) + // }, + 'JSON.stringify (guarded)': function () { + var seen = [] + return JSON.stringify(test, function (k, v) { + if (typeof v !== 'object' || !v) return v + if (seen.indexOf(v) !== -1) return undefined + seen.push(v) + return v + }) + }, + + 'flatten 10': function () { + return flatten(test, 10) + }, + + // 'flattenFE 10': function () { + // return flattenFE(test, 10) + // }, + + 'noCommas 10': function () { + return noCommas(test, 10) + }, + + 'sparse 10': function () { + return sparse(test, 10) + }, + + 'sparseFE 10': function () { + return sparseFE(test, 10) + }, + + 'sparseFE2 10': function () { + return sparseFE2(test, 10) + }, + + sigmund: function() { + return sigmund(test, 10) + }, + + + // 'util.inspect 1': function () { + // return util.inspect(test, false, 1, false) + // }, + // 'util.inspect undefined': function () { + // util.inspect(test) + // }, + // 'util.inspect 2': function () { + // util.inspect(test, false, 2, false) + // }, + // 'util.inspect 3': function () { + // util.inspect(test, false, 3, false) + // }, + // 'util.inspect 4': function () { + // util.inspect(test, false, 4, false) + // }, + // 'util.inspect Infinity': function () { + // util.inspect(test, false, Infinity, false) + // } +} + +/** results +**/ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/package.json new file mode 100644 index 0000000..cb7e2bd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/package.json @@ -0,0 +1,42 @@ +{ + "name": "sigmund", + "version": "1.0.0", + "description": "Quick and dirty signatures for Objects.", + "main": "sigmund.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.3.0" + }, + "scripts": { + "test": "tap test/*.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/sigmund" + }, + "keywords": [ + "object", + "signature", + "key", + "data", + "psychoanalysis" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/sigmund/issues" + }, + "homepage": "https://github.com/isaacs/sigmund", + "_id": "sigmund@1.0.0", + "_from": "sigmund@~1.0.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/sigmund.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/sigmund.js new file mode 100644 index 0000000..82c7ab8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/sigmund.js @@ -0,0 +1,39 @@ +module.exports = sigmund +function sigmund (subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ''; + var RE = RegExp; + + function psychoAnalyze (subject, session) { + if (session > maxSessions) return; + + if (typeof subject === 'function' || + typeof subject === 'undefined') { + return; + } + + if (typeof subject !== 'object' || !subject || + (subject instanceof RE)) { + analysis += subject; + return; + } + + if (notes.indexOf(subject) !== -1 || session === maxSessions) return; + + notes.push(subject); + analysis += '{'; + Object.keys(subject).forEach(function (issue, _, __) { + // pseudo-private values. skip those. + if (issue.charAt(0) === '_') return; + var to = typeof subject[issue]; + if (to === 'function' || to === 'undefined') return; + analysis += issue; + psychoAnalyze(subject[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; +} + +// vim: set softtabstop=4 shiftwidth=4: diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/test/basic.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/test/basic.js new file mode 100644 index 0000000..50c53a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -0,0 +1,24 @@ +var test = require('tap').test +var sigmund = require('../sigmund.js') + + +// occasionally there are duplicates +// that's an acceptable edge-case. JSON.stringify and util.inspect +// have some collision potential as well, though less, and collision +// detection is expensive. +var hash = '{abc/def/g{0h1i2{jkl' +var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} +var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +var obj3 = JSON.parse(JSON.stringify(obj1)) +obj3.c = /def/ +obj3.g[2].cycle = obj3 +var cycleHash = '{abc/def/g{0h1i2{jklcycle' + +test('basic', function (t) { + t.equal(sigmund(obj1), hash) + t.equal(sigmund(obj2), hash) + t.equal(sigmund(obj3), cycleHash) + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json new file mode 100644 index 0000000..f8f545a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.2.14", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@0.2.14", + "_from": "minimatch@~0.2.11" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/basic.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/basic.js new file mode 100644 index 0000000..ae7ac73 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/basic.js @@ -0,0 +1,399 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + + +var patterns = + [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + // https://github.com/isaacs/minimatch/issues/5 + , function () { + files = [ 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' + , 'a/b/.x' + , 'a/b/.x/' + , 'a/.x/b' + , '.x' + , '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b/.x/c' + , '.x/.x' ] + } + , ["**/.x/**", [ '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b' + , 'a/b/.x/' + , 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' ] ] + + ] + +var regexps = + [ '/^(?:(?=.)a[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:\\*)$/', + '/^(?:(?=.)\\*[^/]*?)$/', + '/^(?:\\*\\*)$/', + '/^(?:(?=.)b[^/]*?\\/)$/', + '/^(?:(?=.)c[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', + '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', + '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', + '/^(?:(?=.)a[^/]*?[^c])$/', + '/^(?:(?=.)a[X-]b)$/', + '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', + '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[^/]c)$/', + '/^(?:a\\*c)$/', + 'false', + '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', + '/^(?:man\\/man1\\/bash\\.1)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[-abc])$/', + '/^(?:(?!\\.)(?=.)[abc-])$/', + '/^(?:\\\\)$/', + '/^(?:(?!\\.)(?=.)[\\\\])$/', + '/^(?:(?!\\.)(?=.)[\\[])$/', + '/^(?:\\[)$/', + '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[\\]])$/', + '/^(?:(?!\\.)(?=.)[\\]-])$/', + '/^(?:(?!\\.)(?=.)[a-z])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:\\[\\])$/', + '/^(?:\\[abc)$/', + '/^(?:(?=.)XYZ)$/i', + '/^(?:(?=.)ab[^/]*?)$/i', + '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', + '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', + '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', + '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', + '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', + '/^(?:(?=.)a[^/]b)$/', + '/^(?:(?=.)#[^/]*?)$/', + '/^(?!^(?:(?=.)a[^/]*?)$).*$/', + '/^(?:(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)a[^/]*?)$/', + '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] +var re = 0; + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + patterns.forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var m = new mm.Minimatch(pattern, options) + var r = m.makeRe() + var expectRe = regexps[re++] + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + + t.equal(tapOpts.re, expectRe, tapOpts) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/brace-expand.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/brace-expand.js new file mode 100644 index 0000000..7ee278a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/brace-expand.js @@ -0,0 +1,33 @@ +var tap = require("tap") + , minimatch = require("../") + +tap.test("brace expansion", function (t) { + // [ pattern, [expanded] ] + ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" + , [ "abxy" + , "abxz" + , "acdxy" + , "acdxz" + , "acexy" + , "acexz" + , "afhxy" + , "afhxz" + , "aghxy" + , "aghxz" ] ] + , [ "a{1..5}b" + , [ "a1b" + , "a2b" + , "a3b" + , "a4b" + , "a5b" ] ] + , [ "a{b}c", ["a{b}c"] ] + ].forEach(function (tc) { + var p = tc[0] + , expect = tc[1] + t.equivalent(minimatch.braceExpand(p), expect, p) + }) + console.error("ending") + t.end() +}) + + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/caching.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/caching.js new file mode 100644 index 0000000..0fec4b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/caching.js @@ -0,0 +1,14 @@ +var Minimatch = require("../minimatch.js").Minimatch +var tap = require("tap") +tap.test("cache test", function (t) { + var mm1 = new Minimatch("a?b") + var mm2 = new Minimatch("a?b") + t.equal(mm1, mm2, "should get the same object") + // the lru should drop it after 100 entries + for (var i = 0; i < 100; i ++) { + new Minimatch("a"+i) + } + mm2 = new Minimatch("a?b") + t.notEqual(mm1, mm2, "cache should have dropped") + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/defaults.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/defaults.js new file mode 100644 index 0000000..25f1f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/defaults.js @@ -0,0 +1,274 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + ; [ "http://www.bashcookbook.com/bashinfo" + + "/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + ].forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var Class = mm.defaults(options).Minimatch + var m = new Class(pattern, {}) + var r = m.makeRe() + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/extglob-ending-with-state-char.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/extglob-ending-with-state-char.js new file mode 100644 index 0000000..6676e26 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/test/extglob-ending-with-state-char.js @@ -0,0 +1,8 @@ +var test = require('tap').test +var minimatch = require('../') + +test('extglob ending with statechar', function(t) { + t.notOk(minimatch('ax', 'a?(b*)')) + t.ok(minimatch('ax', '?(a*|b)')) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/AUTHORS b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/AUTHORS new file mode 100644 index 0000000..247b754 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/AUTHORS @@ -0,0 +1,6 @@ +# Authors sorted by whether or not they're me. +Isaac Z. Schlueter (http://blog.izs.me) +Wayne Larsen (http://github.com/wvl) +ritch +Marcel Laverdet +Yosef Dinerstein diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/README.md new file mode 100644 index 0000000..cd123b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/README.md @@ -0,0 +1,30 @@ +`rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, callback)` + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf ` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js new file mode 100755 index 0000000..29bfa8a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf ') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else { + args.forEach(function(arg) { + rimraf.sync(arg) + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json new file mode 100644 index 0000000..749964b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json @@ -0,0 +1,60 @@ +{ + "name": "rimraf", + "version": "2.2.6", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "cd test && bash run.sh" + }, + "bin": { + "rimraf": "./bin.js" + }, + "contributors": [ + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + { + "name": "Wayne Larsen", + "email": "wayne@larsen.st", + "url": "http://github.com/wvl" + }, + { + "name": "ritch", + "email": "skawful@gmail.com" + }, + { + "name": "Marcel Laverdet" + }, + { + "name": "Yosef Dinerstein", + "email": "yosefd@microsoft.com" + } + ], + "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "homepage": "https://github.com/isaacs/rimraf", + "_id": "rimraf@2.2.6", + "dist": { + "shasum": "7ada6a6d39b2301af3c8fe7b936c2e46e7c4463d" + }, + "_from": "rimraf@~2.2.2", + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000..ce62051 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js @@ -0,0 +1,178 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var path = require("path") +var fs = require("fs") + +// for EMFILE handling +var timeout = 0 +exports.EMFILE_MAX = 1000 +exports.BUSYTRIES_MAX = 3 + +var isWindows = (process.platform === "win32") + +function rimraf (p, cb) { + if (!cb) throw new Error("No callback passed to rimraf()") + + var busyTries = 0 + rimraf_(p, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + busyTries < exports.BUSYTRIES_MAX) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { + return setTimeout(function () { + rimraf_(p, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, cb) { + fs.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) + if (er.code === "EISDIR") + return rmdir(p, er, cb) + } + return cb(er) + }) +} + +function fixWinEPERM (p, er, cb) { + fs.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + fs.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, er, cb) + else + fs.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, er, cb) { + try { + fs.chmodSync(p, 666) + } catch (er2) { + if (er2.code !== "ENOENT") + throw er + } + + try { + var stats = fs.statSync(p) + } catch (er3) { + if (er3 !== "ENOENT") + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, er) + else + fs.unlinkSync(p) +} + +function rmdir (p, originalEr, cb) { + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + fs.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, cb) { + fs.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return fs.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + fs.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p) { + try { + fs.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, er) + } +} + +function rmdirSync (p, originalEr) { + try { + fs.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p) + } +} + +function rmkidsSync (p) { + fs.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f)) + }) + fs.rmdirSync(p) +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/run.sh b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/run.sh new file mode 100644 index 0000000..598f016 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +for i in test-*.js; do + echo -n $i ... + bash setup.sh + node $i + ! [ -d target ] + echo "pass" +done +rm -rf target diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/setup.sh b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/setup.sh new file mode 100644 index 0000000..2602e63 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/setup.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -e + +files=10 +folders=2 +depth=4 +target="$PWD/target" + +rm -rf target + +fill () { + local depth=$1 + local files=$2 + local folders=$3 + local target=$4 + + if ! [ -d $target ]; then + mkdir -p $target + fi + + local f + + f=$files + while [ $f -gt 0 ]; do + touch "$target/f-$depth-$f" + let f-- + done + + let depth-- + + if [ $depth -le 0 ]; then + return 0 + fi + + f=$folders + while [ $f -gt 0 ]; do + mkdir "$target/folder-$depth-$f" + fill $depth $files $folders "$target/d-$depth-$f" + let f-- + done +} + +fill $depth $files $folders $target + +# sanity assert +[ -d $target ] diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-async.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-async.js new file mode 100644 index 0000000..9c2e0b7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-async.js @@ -0,0 +1,5 @@ +var rimraf = require("../rimraf") + , path = require("path") +rimraf(path.join(__dirname, "target"), function (er) { + if (er) throw er +}) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-sync.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-sync.js new file mode 100644 index 0000000..eb71f10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/test/test-sync.js @@ -0,0 +1,3 @@ +var rimraf = require("../rimraf") + , path = require("path") +rimraf.sync(path.join(__dirname, "target")) diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/package.json new file mode 100644 index 0000000..91bd99e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/package.json @@ -0,0 +1,55 @@ +{ + "name": "file-utils", + "version": "0.1.5", + "description": "Sync file utility for Node.js command line tools", + "main": "index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "grunt test" + }, + "license": "MIT", + "dependencies": { + "lodash": "~2.1.0", + "iconv-lite": "~0.2.11", + "rimraf": "~2.2.2", + "glob": "~3.2.6", + "minimatch": "~0.2.12", + "findup-sync": "~0.1.2", + "isbinaryfile": "~0.1.9" + }, + "devDependencies": { + "temporary": "~0.0.4", + "grunt-contrib-jshint": "~0.6.4", + "grunt-contrib-nodeunit": "~0.2.0", + "grunt-contrib-watch": "~0.5.3", + "grunt-release": "~0.3.3" + }, + "repository": { + "type": "git", + "url": "git://github.com/SBoudrias/file-utils.git" + }, + "keywords": [ + "file", + "utils", + "scaffold", + "tool", + "cli" + ], + "author": { + "name": "Simon Boudrias" + }, + "bugs": { + "url": "https://github.com/SBoudrias/file-utils/issues" + }, + "readme": "file-utils [![](https://travis-ci.org/SBoudrias/file-utils.png)](https://travis-ci.org/SBoudrias/file-utils)\r\n==========\r\n\r\nThis is a Grunt.file forks to allow the creation of scoped file utilities and the ability to add write filters.\r\n\r\nSame as Grunt.file, this is a set of _synchronous_ utility. As so, it should **never** be used on a Node.js server. This is meant for users/command line utilities.\r\n\r\n\r\nFile API\r\n=========\r\n\r\nUpcoming. Meanwhile, check [Grunt.file documentation](http://gruntjs.com/api/grunt.file) as the same methods are available.\r\n\r\n#### Setting options - `file.option( name, [ value ])`\r\n\r\n```\r\n// Set option\r\nfile.option('write', false);\r\n\r\n// Get option\r\nfile.option('write');\r\n```\r\n\r\n**Available Options**\r\n- `write` (Boolean): If write is set to `false`, then no file will be written or deleted. Useful for test run without side effets.\r\n- `logger` (Logger object): Used internally to log information to the console. **API still work in progress**\r\n- `encoding` (String): Defaults `utf8`. Set the default encoding used for reading/writing. Note most methods allow you to overwridde it for a single run.\r\n- `force` (Boolean): `force: true` Force the deletion of folders and file outside the utility scope (or CWD if no scope).\r\n\r\n\r\nENV scope and filters\r\n=========\r\n\r\n### Creating an Env - file#createEnv([ options ]);\r\n\r\n```javascript\r\nvar file = require('file-utils');\r\n\r\nvar env = file.createEnv({\r\n base: 'my/scoped/path',\r\n dest: 'destination/path' // optionnal\r\n});\r\n```\r\n\r\nThe `base` directory will prefix any paths passed to `mkdir`, `recurse`, `read`, `readJSON`, `write`, `delete` methods.\r\n\r\nThe `dest` directory will prefix the `destination` path provided in the `copy` method. Note that this option is optionnal and will default to the current working directory.\r\n\r\nIf [options (`logger`, `write`, etc)](#setting-options---fileoption-name--value-) are not passed, each `Env` instance inherit those of its parent.\r\n\r\nWrite Filters\r\n---------\r\n\r\nWrite filters are applied on `env.write` and `env.copy`.\r\n\r\nThey're used to modifiy the content or the filepath of a file.\r\n\r\n#### Add a write filter - `env.registerWriteFilter( name, filter )`\r\n\r\n**options**\r\n- `name` (String): The name under which registering the filter\r\n- `filter` (Function): The filter function\r\n\r\nThe filter function take a file object as parameter. This file object is a hash containing a `path` and a `contents` property. You can modify these two property as you like and returning the modified object.\r\n\r\n```javascript\r\nenv.registerWriteFilter( 'coffee', function( file ) {\r\n if (!path.extname(file) !== '.js') return file;\r\n\r\n file.path = file.path.replace(/(\\.js)$/, '.coffee');\r\n file.content = convertJsToCoffee( file.contents );\r\n\r\n return file;\r\n});\r\n```\r\n\r\n#### Remove a write filter - `env.removeWriteFilter( name )`\r\n\r\n```javascript\r\nenv.removeWriteFilter('coffee');\r\n```\r\n\r\n#### Async filter\r\n\r\nThe filter can also be asynchronous. This is done by calling `this.async()` and passing the return value to the callback provided.\r\n\r\n```javascript\r\nenv.registerWriteFilter( 'coffee', function( file ) {\r\n var done = this.async();\r\n\r\n // some process\r\n setTimeout(function() {\r\n done({ path: '/newfile', contents: 'filtered content' });\r\n }, 1000);\r\n});\r\n```\r\n\r\n**Caution:** Using an asynchronous filter will change the way write and copy method are called to. This will make both of those method to run asynchronously too.\r\n\r\nValidation Filters\r\n----------\r\n\r\nValidation filters are applied on `env.write` and `env.copy`.\r\n\r\nThey're used to allow or disallow the write action.\r\n\r\n#### Add a validation filter - `env.registerValidationFilter( name, filter )`\r\n\r\n**options**\r\n- `name` (String): The name under which registering the filter\r\n- `filter` (Function): The filter function\r\n\r\nThe filter function take a file object as parameter. This file object is a hash containing a `path` (String) and a `contents` (String if text file, Buffer otherwise) property.\r\n\r\nReturn `true` to allow the file to be written. Return `false` or an error message `String` to disallow the write action.\r\n\r\n```javascript\r\nenv.registerValidationFilter( 'checkConflicts', function( toOutput ) {\r\n if ( file.exists(toOutput.path) ) {\r\n return 'file is already present';\r\n }\r\n return true;\r\n});\r\n```\r\n\r\nJust like the write filters, [this filter can be asynchronous](#async-filter).\r\n\r\n#### Remove a validation filter - `env.removeValidationFilter( name )`\r\n\r\n```javascript\r\nenv.removeValidationFilter('checkConflicts');\r\n```\r\n\r\n\r\nTodos\r\n=========\r\n\r\n- Real Logging system\r\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/SBoudrias/file-utils", + "_id": "file-utils@0.1.5", + "dist": { + "shasum": "699523e282d1786e3db071a236bd7411fd81027c" + }, + "_from": "file-utils@~0.1.5", + "_resolved": "https://registry.npmjs.org/file-utils/-/file-utils-0.1.5.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/env.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/env.js new file mode 100644 index 0000000..de9015d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/env.js @@ -0,0 +1,276 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); +var file = require('..'); +var _ = require('lodash'); +var helpers = require('./helpers/helpers'); +var defLogger = require('../lib/logger'); + +var Tempdir = require('temporary/lib/dir'); +var tmpdir = new Tempdir(); + +exports['Env()'] = { + 'setUp': function(done) { + this.fixtures = file.createEnv({ base: path.join(__dirname, 'fixtures') }); + this.env = file.createEnv({ base: path.join(tmpdir.path, '/env/scope') }); + done(); + }, + 'inherits from global file config': function(test) { + test.expect(3); + var logger = { bar: 'foo' }; + file.option('logger', logger); + file.option('write', false); + var env = file.createEnv(); + test.deepEqual(env.option('logger'), logger, 'logger should be inherited'); + test.deepEqual(env.log, file.log, 'logger should be inherited'); + test.equal(env.option('write'), false, 'write state should be inherited'); + file.option('write', true); + file.option('logger', defLogger); + test.done(); + }, + 'read': function(test) { + test.expect(1); + helpers.assertTextEqual(this.fixtures.read('utf8.txt'), 'Ação é isso aí\n', test, 'file should be read from base path.'); + test.done(); + }, + 'readJSON': function(test) { + test.expect(1); + var obj = {foo: 'Ação é isso aí', bar: ['ømg', 'pønies']}; + var fileContent = this.fixtures.readJSON('utf8.json'); + test.deepEqual(fileContent, obj, 'file should be read from base path and parsed correctly.'); + test.done(); + }, + 'write': function(test) { + test.expect(1); + var str = 'foo bar'; + this.env.write('write.txt', str); + test.strictEqual(fs.readFileSync(path.join(tmpdir.path, '/env/scope', 'write.txt'), 'utf8'), str, 'file should be written in the root dir.'); + test.done(); + }, + 'copy': function(test) { + test.expect(1); + var root = 'utf8.txt'; + var dest = path.join( tmpdir.path, 'copy.txt'); + this.fixtures.copy(root, dest); + + var initial = this.fixtures.read(root); + var copied = fs.readFileSync(dest, 'utf8'); + + test.strictEqual(initial, copied, 'File should be copied from the root dir'); + + test.done(); + }, + 'copy with dest': function(test) { + test.expect(1); + var dest = path.join(tmpdir.path, '/copy'); + var env = file.createEnv({ + base: path.join(__dirname, 'fixtures'), + dest: dest + }); + + env.copy('utf8.txt', 'utf-8.txt'); + + var initial = this.fixtures.read('utf8.txt'); + var copied = fs.readFileSync(dest + '/utf-8.txt', 'utf8'); + test.strictEqual(initial, copied, 'File should be copied from the root dir to the dest dir'); + test.done(); + }, + 'delete': function(test) { + test.expect(3); + this.env.write('delete.txt', 'foo'); + test.ok(file.exists(path.join(tmpdir.path, '/env/scope', 'delete.txt')), 'file should exist'); + test.ok(this.env.delete('delete.txt'), 'return true if it delete the file'); + test.ok(!file.exists(path.join(tmpdir.path, '/env/scope', 'delete.txt')), 'file should\'ve been deleted'); + test.done(); + }, + 'mkdir': function(test) { + test.expect(2); + + test.doesNotThrow(function() { + this.env.mkdir('aa/bb/cc'); + }.bind(this), 'Should also not explode'); + test.ok(file.isDir(this.env.fromBase('aa/bb/cc')), 'path should have been created.'); + + this.env.delete('aa/bb/cc'); + + test.done(); + }, + 'recurse': function(test) { + test.expect(1); + var rootdir = this.fixtures.fromBase('expand').replace(/\\/g, '/'); + var expected = {}; + expected[rootdir + '/css/baz.css'] = [rootdir, 'css', 'baz.css']; + expected[rootdir + '/css/qux.css'] = [rootdir, 'css', 'qux.css']; + expected[rootdir + '/deep/deep.txt'] = [rootdir, 'deep', 'deep.txt']; + expected[rootdir + '/deep/deeper/deeper.txt'] = [rootdir, 'deep/deeper', 'deeper.txt']; + expected[rootdir + '/deep/deeper/deepest/deepest.txt'] = [rootdir, 'deep/deeper/deepest', 'deepest.txt']; + expected[rootdir + '/js/bar.js'] = [rootdir, 'js', 'bar.js']; + expected[rootdir + '/js/foo.js'] = [rootdir, 'js', 'foo.js']; + expected[rootdir + '/README.md'] = [rootdir, undefined, 'README.md']; + + var actual = {}; + this.fixtures.recurse('expand', function(abspath, rootdir, subdir, filename) { + actual[abspath] = [rootdir.replace(/\\/g, '/'), subdir, filename]; + }); + + test.deepEqual(actual, expected, 'paths and arguments should match.'); + test.done(); + }, + 'setBase': function(test) { + this.env.setBase('foo'); + test.equal(this.env.fromBase('bar').replace(/\\/g, '/'), 'foo/bar'); + test.done(); + }, + 'setDestBase': function(test) { + this.env.setDestBase('foo'); + test.equal(this.env.fromDestBase('bar').replace(/\\/g, '/'), 'foo/bar'); + test.done(); + } +}; + +exports['Env() filters'] = { + 'setUp': function(done) { + this.env = file.createEnv({ base: tmpdir.path }); + done(); + }, + '.registerWriteFilter() synchronous and apply output': function(test) { + test.expect(3); + this.env.registerWriteFilter('tmp', function(file) { + test.equal(file.path, 'foo'); + test.equal(file.contents, 'bar'); + return { path: 'simple-filter', contents: 'test' }; + }); + this.env.write('foo', 'bar'); + var written = this.env.read('simple-filter'); + test.equal(written, 'test', 'should have written the filtered file and path'); + test.done(); + }, + 'pipe all filters': function(test) { + test.expect(4); + this.env.registerWriteFilter('1', function(file) { + test.equal(file.path, 'foo'); + test.equal(file.contents, 'bar'); + return { path: 'piped-filter', contents: 'test' }; + }); + this.env.registerWriteFilter('2', function(file) { + test.equal(file.path, 'piped-filter'); + test.equal(file.contents, 'test'); + return file; + }); + this.env.write('foo', 'bar'); + test.done(); + }, + '.removeWriteFilter()': function(test) { + test.expect(1); + this.env.registerWriteFilter('broke', function(file) { + test.ok(false); + return { path: 'broke', contents: 'broke' }; + }); + this.env.removeWriteFilter('broke'); + this.env.write('no-filter', 'bar'); + var written = this.env.read('no-filter'); + test.equal(written, 'bar', 'should have removed the filter'); + test.done(); + }, + 'Async write filter': function(test) { + test.expect(2); + this.env._actualWrite = function(filepath, contents) { + test.equal(filepath, 'async-write'); + test.equal(contents, 'puts async'); + test.done(); + }; + + this.env.registerWriteFilter('async', function() { + var done = this.async(); + setTimeout(function() { + done({ path: 'async-write', contents: 'puts async' }); + }, 10); + }); + + this.env.write('foo', 'bar'); + }, + '.registerValidationFilter': { + 'setUp': function(done) { + var self = this; + this.env.option('logger', _.extend({}, require('../lib/logger'), { + write: function(msg) { + self.errMsg = msg; + } + })); + done(); + }, + 'passing validation': function(test) { + test.expect(3); + this.env.registerValidationFilter('tmp', function(file) { + test.equal(file.path, 'foo'); + test.equal(file.contents, 'bar'); + return true; + }); + this.env.write('foo', 'bar'); + var written = this.env.read('simple-filter'); + test.equal(written, 'test', 'should have written the filtered file and path'); + test.done(); + }, + 'failing validation': function(test) { + test.expect(2); + this.env.registerValidationFilter('tmp', function(file) { return false; }); + this.env.write('failing-filter', 'bar'); + test.ok(!file.exists(this.env.fromBase('failing-filter')), 'should have written the filtered file and path'); + test.equal(this.errMsg, 'Not actually writing to failing-filter haven\'t pass validation', 'default error message is log'); + test.done(); + }, + 'validation with text file': function(test) { + test.expect(1); + this.env.registerValidationFilter('tmp', function(file) { + test.ok(typeof file.contents === 'string'); + test.done(); + return 'abort'; + }); + var textPath = path.join(__dirname, 'fixtures/utf8.txt'); + this.env.copy(textPath, textPath); + }, + 'validation with binary file': function(test) { + test.expect(1); + this.env.registerValidationFilter('tmp', function(file) { + test.ok(file.contents instanceof Buffer); + test.done(); + return 'abort'; + }); + var binaryPath = path.join(__dirname, 'fixtures/octocat.png'); + this.env.copy(binaryPath, binaryPath); + }, + 'failing validation and custom error message': function(test) { + test.expect(2); + this.env.registerValidationFilter('tmp', function(file) { return 'a bad error'; }); + this.env.write('failing-filter', 'bar'); + test.ok(!file.exists(this.env.fromBase('failing-filter')), 'should not have written'); + test.equal(this.errMsg, 'a bad error', 'custom error message is log'); + test.done(); + }, + 'async validator': function(test) { + var self = this; + test.expect(1); + this.env._actualWrite = function() { test.ok(false, 'should not be call') }; + this.env.registerValidationFilter('tmp', function(file) { + var done = this.async(); + setTimeout(function() { + done('a bad error'); + test.equal(self.errMsg, 'a bad error', 'custom error message is log'); + test.done(); + }, 10); + }); + this.env.write('async-failing-filter', 'bar'); + } + }, + '.removeValidationFilter': function(test) { + test.expect(1); + this.env.registerValidationFilter('no-run', function() { + test.ok(false, 'shouldn\'t run the filter'); + }); + this.env.removeValidationFilter('no-run'); + this.env.write('removed-validation', 'bar'); + test.ok(true); + test.done(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/file_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/file_test.js new file mode 100644 index 0000000..e59d13c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/file_test.js @@ -0,0 +1,665 @@ +'use strict'; + +var file = require('..'); + +var fs = require('fs'); +var path = require('path'); +var helpers = require('./helpers/helpers'); + +var Tempfile = require('temporary/lib/file'); +var Tempdir = require('temporary/lib/dir'); + +var tmpdir = new Tempdir(); +fs.symlinkSync(path.resolve('tests/fixtures/octocat.png'), path.join(tmpdir.path, 'octocat.png'), 'file'); +fs.symlinkSync(path.resolve('tests/fixtures/expand'), path.join(tmpdir.path, 'expand'), 'dir'); + +exports['file.match'] = { + 'empty set': function(test) { + test.expect(12); + // Should return empty set if a required argument is missing or an empty set. + test.deepEqual(file.match(null, null), [], 'should return empty set.'); + test.deepEqual(file.match({}, null, null), [], 'should return empty set.'); + test.deepEqual(file.match(null, 'foo.js'), [], 'should return empty set.'); + test.deepEqual(file.match('*.js', null), [], 'should return empty set.'); + test.deepEqual(file.match({}, null, 'foo.js'), [], 'should return empty set.'); + test.deepEqual(file.match({}, '*.js', null), [], 'should return empty set.'); + test.deepEqual(file.match({}, [], 'foo.js'), [], 'should return empty set.'); + test.deepEqual(file.match({}, '*.js', []), [], 'should return empty set.'); + test.deepEqual(file.match(null, ['foo.js']), [], 'should return empty set.'); + test.deepEqual(file.match(['*.js'], null), [], 'should return empty set.'); + test.deepEqual(file.match({}, null, ['foo.js']), [], 'should return empty set.'); + test.deepEqual(file.match({}, ['*.js'], null), [], 'should return empty set.'); + test.done(); + }, + 'basic matching': function(test) { + test.expect(6); + test.deepEqual(file.match('*.js', 'foo.js'), ['foo.js'], 'should match correctly.'); + test.deepEqual(file.match('*.js', ['foo.js']), ['foo.js'], 'should match correctly.'); + test.deepEqual(file.match('*.js', ['foo.js', 'bar.css']), ['foo.js'], 'should match correctly.'); + test.deepEqual(file.match(['*.js', '*.css'], 'foo.js'), ['foo.js'], 'should match correctly.'); + test.deepEqual(file.match(['*.js', '*.css'], ['foo.js']), ['foo.js'], 'should match correctly.'); + test.deepEqual(file.match(['*.js', '*.css'], ['foo.js', 'bar.css']), ['foo.js', 'bar.css'], 'should match correctly.'); + test.done(); + }, + 'no matches': function(test) { + test.expect(2); + test.deepEqual(file.match('*.js', 'foo.css'), [], 'should fail to match.'); + test.deepEqual(file.match('*.js', ['foo.css', 'bar.css']), [], 'should fail to match.'); + test.done(); + }, + 'unique': function(test) { + test.expect(2); + test.deepEqual(file.match('*.js', ['foo.js', 'foo.js']), ['foo.js'], 'should return a uniqued set.'); + test.deepEqual(file.match(['*.js', '*.*'], ['foo.js', 'foo.js']), ['foo.js'], 'should return a uniqued set.'); + test.done(); + }, + 'flatten': function(test) { + test.expect(1); + test.deepEqual(file.match([['*.js', '*.css'], ['*.*', '*.js']], ['foo.js', 'bar.css']), ['foo.js', 'bar.css'], 'should process nested pattern arrays correctly.'); + test.done(); + }, + 'exclusion': function(test) { + test.expect(5); + test.deepEqual(file.match(['!*.js'], ['foo.js', 'bar.js']), [], 'solitary exclusion should match nothing'); + test.deepEqual(file.match(['*.js', '!*.js'], ['foo.js', 'bar.js']), [], 'exclusion should cancel match'); + test.deepEqual(file.match(['*.js', '!f*.js'], ['foo.js', 'bar.js', 'baz.js']), ['bar.js', 'baz.js'], 'partial exclusion should partially cancel match'); + test.deepEqual(file.match(['*.js', '!*.js', 'b*.js'], ['foo.js', 'bar.js', 'baz.js']), ['bar.js', 'baz.js'], 'inclusion / exclusion order matters'); + test.deepEqual(file.match(['*.js', '!f*.js', '*.js'], ['foo.js', 'bar.js', 'baz.js']), ['bar.js', 'baz.js', 'foo.js'], 'inclusion / exclusion order matters'); + test.done(); + }, + 'options.matchBase': function(test) { + test.expect(2); + test.deepEqual(file.match({matchBase: true}, '*.js', ['foo.js', 'bar', 'baz/xyz.js']), ['foo.js', 'baz/xyz.js'], 'should matchBase (minimatch) when specified.'); + test.deepEqual(file.match('*.js', ['foo.js', 'bar', 'baz/xyz.js']), ['foo.js'], 'should not matchBase (minimatch) by default.'); + test.done(); + } +}; + +exports['file.isMatch'] = { + 'basic matching': function(test) { + test.expect(6); + test.ok(file.isMatch('*.js', 'foo.js'), 'should match correctly.'); + test.ok(file.isMatch('*.js', ['foo.js']), 'should match correctly.'); + test.ok(file.isMatch('*.js', ['foo.js', 'bar.css']), 'should match correctly.'); + test.ok(file.isMatch(['*.js', '*.css'], 'foo.js'), 'should match correctly.'); + test.ok(file.isMatch(['*.js', '*.css'], ['foo.js']), 'should match correctly.'); + test.ok(file.isMatch(['*.js', '*.css'], ['foo.js', 'bar.css']), 'should match correctly.'); + test.done(); + }, + 'no matches': function(test) { + test.expect(6); + test.equal(file.isMatch('*.js', 'foo.css'), false, 'should fail to match.'); + test.equal(file.isMatch('*.js', ['foo.css', 'bar.css']), false, 'should fail to match.'); + test.equal(file.isMatch(null, 'foo.css'), false, 'should fail to match.'); + test.equal(file.isMatch('*.js', null), false, 'should fail to match.'); + test.equal(file.isMatch([], 'foo.css'), false, 'should fail to match.'); + test.equal(file.isMatch('*.js', []), false, 'should fail to match.'); + test.done(); + }, + 'options.matchBase': function(test) { + test.expect(2); + test.ok(file.isMatch({matchBase: true}, '*.js', ['baz/xyz.js']), 'should matchBase (minimatch) when specified.'); + test.equal(file.isMatch('*.js', ['baz/xyz.js']), false, 'should not matchBase (minimatch) by default.'); + test.done(); + } +}; + +exports['file.expand*'] = { + setUp: function(done) { + this.cwd = process.cwd(); + process.chdir('tests/fixtures/expand'); + done(); + }, + tearDown: function(done) { + process.chdir(this.cwd); + done(); + }, + 'basic matching': function(test) { + test.expect(8); + test.deepEqual(file.expand('**/*.js'), ['js/bar.js', 'js/foo.js'], 'should match.'); + test.deepEqual(file.expand('**/*.js', '**/*.css'), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'should match.'); + test.deepEqual(file.expand(['**/*.js', '**/*.css']), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'should match.'); + test.deepEqual(file.expand('**d*/**'), [ + 'deep', + 'deep/deep.txt', + 'deep/deeper', + 'deep/deeper/deeper.txt', + 'deep/deeper/deepest', + 'deep/deeper/deepest/deepest.txt'], 'should match files and directories.'); + test.deepEqual(file.expand({mark: true}, '**d*/**'), [ + 'deep/', + 'deep/deep.txt', + 'deep/deeper/', + 'deep/deeper/deeper.txt', + 'deep/deeper/deepest/', + 'deep/deeper/deepest/deepest.txt'], 'the minimatch "mark" option ensures directories end in /.'); + test.deepEqual(file.expand('**d*/**/'), [ + 'deep/', + 'deep/deeper/', + 'deep/deeper/deepest/'], 'should match directories, arbitrary / at the end appears in matches.'); + test.deepEqual(file.expand({mark: true}, '**d*/**/'), [ + 'deep/', + 'deep/deeper/', + 'deep/deeper/deepest/'], 'should match directories, arbitrary / at the end appears in matches.'); + test.deepEqual(file.expand('*.xyz'), [], 'should fail to match.'); + test.done(); + }, + 'filter': function(test) { + test.expect(5); + test.deepEqual(file.expand({filter: 'isFile'}, '**d*/**'), [ + 'deep/deep.txt', + 'deep/deeper/deeper.txt', + 'deep/deeper/deepest/deepest.txt' + ], 'should match files only.'); + test.deepEqual(file.expand({filter: 'isDirectory'}, '**d*/**'), [ + 'deep', + 'deep/deeper', + 'deep/deeper/deepest' + ], 'should match directories only.'); + test.deepEqual(file.expand({filter: function(filepath) { return (/deepest/).test(filepath); }}, '**'), [ + 'deep/deeper/deepest', + 'deep/deeper/deepest/deepest.txt', + ], 'should filter arbitrarily.'); + test.deepEqual(file.expand({filter: 'isFile'}, 'js', 'css'), [], 'should fail to match.'); + test.deepEqual(file.expand({filter: 'isDirectory'}, '**/*.js'), [], 'should fail to match.'); + test.done(); + }, + 'unique': function(test) { + test.expect(4); + test.deepEqual(file.expand('**/*.js', 'js/*.js'), ['js/bar.js', 'js/foo.js'], 'file list should be uniqed.'); + test.deepEqual(file.expand('**/*.js', '**/*.css', 'js/*.js'), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'file list should be uniqed.'); + test.deepEqual(file.expand('js', 'js/'), ['js', 'js/'], 'mixed non-ending-/ and ending-/ dirs will not be uniqed by default.'); + test.deepEqual(file.expand({mark: true}, 'js', 'js/'), ['js/'], 'mixed non-ending-/ and ending-/ dirs will be uniqed when "mark" is specified.'); + test.done(); + }, + 'file order': function(test) { + test.expect(4); + var actual = file.expand('**/*.{js,css}'); + var expected = ['css/baz.css', 'css/qux.css', 'js/bar.js', 'js/foo.js']; + test.deepEqual(actual, expected, 'should select 4 files in this order, by default.'); + + actual = file.expand('js/foo.js', 'js/bar.js', '**/*.{js,css}'); + expected = ['js/foo.js', 'js/bar.js', 'css/baz.css', 'css/qux.css']; + test.deepEqual(actual, expected, 'specifically-specified-up-front file order should be maintained.'); + + actual = file.expand('js/bar.js', 'js/foo.js', '**/*.{js,css}'); + expected = ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css']; + test.deepEqual(actual, expected, 'specifically-specified-up-front file order should be maintained.'); + + actual = file.expand('js/foo.js', '**/*.{js,css}', '!js/bar.js', 'js/bar.js'); + expected = ['js/foo.js', 'css/baz.css', 'css/qux.css', 'js/bar.js']; + test.deepEqual(actual, expected, 'if a file is excluded and then re-added, it should be added at the end.'); + test.done(); + }, + 'flatten': function(test) { + test.expect(1); + test.deepEqual(file.expand([['**/*.js'], ['**/*.css', 'js/*.js']]), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'should match.'); + test.done(); + }, + 'exclusion': function(test) { + test.expect(8); + test.deepEqual(file.expand(['!js/*.js']), [], 'solitary exclusion should match nothing'); + test.deepEqual(file.expand(['js/bar.js','!js/bar.js']), [], 'exclusion should cancel match'); + test.deepEqual(file.expand(['**/*.js', '!js/foo.js']), ['js/bar.js'], 'should omit single file from matched set'); + test.deepEqual(file.expand(['!js/foo.js', '**/*.js']), ['js/bar.js', 'js/foo.js'], 'inclusion / exclusion order matters'); + test.deepEqual(file.expand(['**/*.js', '**/*.css', '!js/bar.js', '!css/baz.css']), ['js/foo.js','css/qux.css'], 'multiple exclusions should be removed from the set'); + test.deepEqual(file.expand(['**/*.js', '**/*.css', '!**/*.css']), ['js/bar.js', 'js/foo.js'], 'excluded wildcards should be removed from the matched set'); + test.deepEqual(file.expand(['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css', '!**/b*.*']), ['js/foo.js', 'css/qux.css'], 'different pattern for exclusion should still work'); + test.deepEqual(file.expand(['js/bar.js', '!**/b*.*', 'js/foo.js', 'css/baz.css', 'css/qux.css']), ['js/foo.js', 'css/baz.css', 'css/qux.css'], 'inclusion / exclusion order matters'); + test.done(); + }, + 'options.matchBase': function(test) { + test.expect(4); + var opts = {matchBase: true}; + test.deepEqual(file.expand('*.js'), [], 'should not matchBase (minimatch) by default.'); + test.deepEqual(file.expand(opts, '*.js'), ['js/bar.js', 'js/foo.js'], 'options should be passed through to minimatch.'); + test.deepEqual(file.expand(opts, '*.js', '*.css'), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'should match.'); + test.deepEqual(file.expand(opts, ['*.js', '*.css']), ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], 'should match.'); + test.done(); + }, + 'options.cwd': function(test) { + test.expect(4); + var cwd = path.resolve(process.cwd(), '..'); + test.deepEqual(file.expand({cwd: cwd}, ['expand/js', 'expand/js/*']), ['expand/js', 'expand/js/bar.js', 'expand/js/foo.js'], 'should match.'); + test.deepEqual(file.expand({cwd: cwd, filter: 'isFile'}, ['expand/js', 'expand/js/*']), ['expand/js/bar.js', 'expand/js/foo.js'], 'should match.'); + test.deepEqual(file.expand({cwd: cwd, filter: 'isDirectory'}, ['expand/js', 'expand/js/*']), ['expand/js'], 'should match.'); + test.deepEqual(file.expand({cwd: cwd, filter: 'isFile'}, ['expand/js', 'expand/js/*', '!**/b*.js']), ['expand/js/foo.js'], 'should negate properly.'); + test.done(); + }, + 'options.nonull': function(test) { + test.expect(2); + var opts = {nonull: true}; + test.deepEqual(file.expand(opts, ['js/a*', 'js/b*', 'js/c*']), ['js/a*', 'js/bar.js', 'js/c*'], 'non-matching patterns should be returned in result set.'); + test.deepEqual(file.expand(opts, ['js/foo.js', 'js/bar.js', 'js/baz.js']), ['js/foo.js', 'js/bar.js', 'js/baz.js'], 'non-matching filenames should be returned in result set.'); + test.done(); + }, +}; + +exports['file.expandMapping'] = { + setUp: function(done) { + this.cwd = process.cwd(); + process.chdir('tests/fixtures'); + done(); + }, + tearDown: function(done) { + process.chdir(this.cwd); + done(); + }, + 'basic matching': function(test) { + test.expect(2); + + var actual = file.expandMapping(['expand/**/*.txt'], 'dest'); + var expected = [ + {dest: 'dest/expand/deep/deep.txt', src: ['expand/deep/deep.txt']}, + {dest: 'dest/expand/deep/deeper/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, + {dest: 'dest/expand/deep/deeper/deepest/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, + ]; + test.deepEqual(actual, expected, 'basic src-dest options'); + + actual = file.expandMapping(['expand/**/*.txt'], 'dest/'); + test.deepEqual(actual, expected, 'destBase should behave the same both with or without trailing slash'); + + test.done(); + }, + 'flatten': function(test) { + test.expect(1); + var actual = file.expandMapping(['expand/**/*.txt'], 'dest', {flatten: true}); + var expected = [ + {dest: 'dest/deep.txt', src: ['expand/deep/deep.txt']}, + {dest: 'dest/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, + {dest: 'dest/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, + ]; + test.deepEqual(actual, expected, 'dest paths should be flattened pre-destBase+destPath join'); + test.done(); + }, + 'ext': function(test) { + test.expect(2); + var actual, expected; + actual = file.expandMapping(['expand/**/*.txt'], 'dest', {ext: '.foo'}); + expected = [ + {dest: 'dest/expand/deep/deep.foo', src: ['expand/deep/deep.txt']}, + {dest: 'dest/expand/deep/deeper/deeper.foo', src: ['expand/deep/deeper/deeper.txt']}, + {dest: 'dest/expand/deep/deeper/deepest/deepest.foo', src: ['expand/deep/deeper/deepest/deepest.txt']}, + ]; + test.deepEqual(actual, expected, 'specified extension should be added'); + actual = file.expandMapping(['expand-mapping-ext/**/file*'], 'dest', {ext: '.foo'}); + expected = [ + {dest: 'dest/expand-mapping-ext/dir.ectory/file-no-extension.foo', src: ['expand-mapping-ext/dir.ectory/file-no-extension']}, + {dest: 'dest/expand-mapping-ext/dir.ectory/sub.dir.ectory/file.foo', src: ['expand-mapping-ext/dir.ectory/sub.dir.ectory/file.ext.ension']}, + {dest: 'dest/expand-mapping-ext/file.foo', src: ['expand-mapping-ext/file.ext.ension']}, + ]; + test.deepEqual(actual, expected, 'specified extension should be added'); + test.done(); + }, + 'cwd': function(test) { + test.expect(1); + var actual = file.expandMapping(['**/*.txt'], 'dest', {cwd: 'expand'}); + var expected = [ + {dest: 'dest/deep/deep.txt', src: ['expand/deep/deep.txt']}, + {dest: 'dest/deep/deeper/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, + {dest: 'dest/deep/deeper/deepest/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, + ]; + test.deepEqual(actual, expected, 'cwd should be stripped from front of destPath, pre-destBase+destPath join'); + test.done(); + }, + 'rename': function(test) { + test.expect(1); + var actual = file.expandMapping(['**/*.txt'], 'dest', { + cwd: 'expand', + flatten: true, + rename: function(destBase, destPath, options) { + return path.join(destBase, options.cwd, 'o-m-g', destPath); + } + }); + var expected = [ + {dest: 'dest/expand/o-m-g/deep.txt', src: ['expand/deep/deep.txt']}, + {dest: 'dest/expand/o-m-g/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, + {dest: 'dest/expand/o-m-g/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, + ]; + test.deepEqual(actual, expected, 'custom rename function should be used to build dest, post-flatten'); + test.done(); + }, + 'rename to same dest': function(test) { + test.expect(1); + var actual = file.expandMapping(['**/*'], 'dest', { + filter: 'isFile', + cwd: 'expand', + flatten: true, + rename: function(destBase, destPath) { + return path.join(destBase, 'all' + path.extname(destPath)); + } + }); + var expected = [ + {dest: 'dest/all.md', src: ['expand/README.md']}, + {dest: 'dest/all.css', src: ['expand/css/baz.css', 'expand/css/qux.css']}, + {dest: 'dest/all.txt', src: ['expand/deep/deep.txt', 'expand/deep/deeper/deeper.txt', 'expand/deep/deeper/deepest/deepest.txt']}, + {dest: 'dest/all.js', src: ['expand/js/bar.js', 'expand/js/foo.js']}, + ]; + test.deepEqual(actual, expected, 'if dest is same for multiple src, create an array of src'); + test.done(); + }, +}; + + +// Compare two buffers. Returns true if they are equivalent. +var compareBuffers = function(buf1, buf2) { + if (!Buffer.isBuffer(buf1) || !Buffer.isBuffer(buf2)) { return false; } + if (buf1.length !== buf2.length) { return false; } + for (var i = 0; i < buf2.length; i++) { + if (buf1[i] !== buf2[i]) { return false; } + } + return true; +}; + +// Compare two files. Returns true if they are equivalent. +var compareFiles = function(filepath1, filepath2) { + return compareBuffers(fs.readFileSync(filepath1), fs.readFileSync(filepath2)); +}; + +exports['file'] = { + setUp: function(done) { + this.defaultEncoding = file.option('encoding'); + file.option('encoding', 'utf8'); + this.string = 'Ação é isso aí\n'; + this.object = {foo: 'Ação é isso aí', bar: ['ømg', 'pønies']}; + this.writeOption = file.option('write'); + done(); + }, + tearDown: function(done) { + file.option('encoding', this.defaultEncoding); + file.option('write', this.writeOption); + done(); + }, + 'read': function(test) { + test.expect(5); + helpers.assertTextEqual(file.read('tests/fixtures/utf8.txt'), this.string, test, 'file should be read as utf8 by default.'); + helpers.assertTextEqual(file.read('tests/fixtures/iso-8859-1.txt', {encoding: 'iso-8859-1'}), this.string,test, 'file should be read using the specified encoding.'); + test.ok(compareBuffers(file.read('tests/fixtures/octocat.png', {encoding: null}), fs.readFileSync('tests/fixtures/octocat.png')), 'file should be read as a buffer if encoding is specified as null.'); + test.strictEqual(file.read('tests/fixtures/BOM.txt'), 'foo', 'file should have BOM stripped.'); + + file.option('encoding', 'iso-8859-1'); + helpers.assertTextEqual(file.read('tests/fixtures/iso-8859-1.txt'), this.string, test, 'changing the default encoding should work.'); + test.done(); + }, + 'readJSON': function(test) { + test.expect(3); + var obj; + obj = file.readJSON('tests/fixtures/utf8.json'); + test.deepEqual(obj, this.object, 'file should be read as utf8 by default and parsed correctly.'); + + obj = file.readJSON('tests/fixtures/iso-8859-1.json', {encoding: 'iso-8859-1'}); + test.deepEqual(obj, this.object, 'file should be read using the specified encoding.'); + + file.option('encoding', 'iso-8859-1'); + obj = file.readJSON('tests/fixtures/iso-8859-1.json'); + test.deepEqual(obj, this.object, 'changing the default encoding should work.'); + test.done(); + }, + 'write': function(test) { + test.expect(5); + var tmpfile; + tmpfile = new Tempfile(); + file.write(tmpfile.path, this.string); + test.strictEqual(fs.readFileSync(tmpfile.path, 'utf8'), this.string, 'file should be written as utf8 by default.'); + tmpfile.unlinkSync(); + + tmpfile = new Tempfile(); + file.write(tmpfile.path, this.string, {encoding: 'iso-8859-1'}); + test.strictEqual(file.read(tmpfile.path, {encoding: 'iso-8859-1'}), this.string, 'file should be written using the specified encoding.'); + tmpfile.unlinkSync(); + + file.option('encoding', 'iso-8859-1'); + tmpfile = new Tempfile(); + file.write(tmpfile.path, this.string); + file.option('encoding', 'utf8'); + test.strictEqual(file.read(tmpfile.path, {encoding: 'iso-8859-1'}), this.string, 'changing the default encoding should work.'); + tmpfile.unlinkSync(); + + tmpfile = new Tempfile(); + var octocat = fs.readFileSync('tests/fixtures/octocat.png'); + file.write(tmpfile.path, octocat); + test.ok(compareBuffers(fs.readFileSync(tmpfile.path), octocat), 'buffers should always be written as-specified, with no attempt at re-encoding.'); + tmpfile.unlinkSync(); + + file.option('write', false); + var filepath = path.join(tmpdir.path, 'should-not-exist.txt'); + file.write(filepath, 'test'); + test.equal(file.exists(filepath), false, 'file should NOT be created if `write: false` was specified.'); + test.done(); + }, + 'copy': function(test) { + test.expect(4); + var tmpfile; + tmpfile = new Tempfile(); + file.copy('tests/fixtures/utf8.txt', tmpfile.path); + test.ok(compareFiles(tmpfile.path, 'tests/fixtures/utf8.txt'), 'text files should just be copied as default encoding.'); + tmpfile.unlinkSync(); + + tmpfile = new Tempfile(); + file.option('encoding', 'iso-8859-1'); + file.copy('tests/fixtures/iso-8859-1.txt', tmpfile.path); + test.ok(compareFiles(tmpfile.path, 'tests/fixtures/iso-8859-1.txt'), 'text files should just be copied as default encoding.'); + tmpfile.unlinkSync(); + file.option('encoding', 'utf8'); + + tmpfile = new Tempfile(); + file.copy('tests/fixtures/octocat.png', tmpfile.path); + test.ok(compareFiles(tmpfile.path, 'tests/fixtures/octocat.png'), 'Binary files should be copied as encoding-agnostic by default.'); + tmpfile.unlinkSync(); + + file.option('write', false); + var filepath = path.join(tmpdir.path, 'should-not-exist.txt'); + file.copy('tests/fixtures/utf8.txt', filepath); + test.equal(file.exists(filepath), false, 'file should NOT be created if `write: false` was specified.'); + + test.done(); + }, + 'copy and process': function(test) { + test.expect(13); + var tmpfile; + tmpfile = new Tempfile(); + file.copy('tests/fixtures/utf8.txt', tmpfile.path, { + process: function(src, filepath) { + test.equal(filepath.replace(/\\/g, '/'), 'tests/fixtures/utf8.txt', 'filepath should be passed in, as-specified.'); + test.equal(Buffer.isBuffer(src), false, 'when no encoding is specified, use default encoding and process src as a string'); + test.equal(typeof src, 'string', 'when no encoding is specified, use default encoding and process src as a string'); + return 'føø' + src + 'bår'; + } + }); + helpers.assertTextEqual(file.read(tmpfile.path), 'føø' + this.string + 'bår', test, 'file should be saved as properly encoded processed string.'); + tmpfile.unlinkSync(); + + tmpfile = new Tempfile(); + file.copy('tests/fixtures/iso-8859-1.txt', tmpfile.path, { + encoding: 'iso-8859-1', + process: function(src) { + test.equal(Buffer.isBuffer(src), false, 'use specified encoding and process src as a string'); + test.equal(typeof src, 'string', 'use specified encoding and process src as a string'); + return 'føø' + src + 'bår'; + } + }); + helpers.assertTextEqual(file.read(tmpfile.path, {encoding: 'iso-8859-1'}), 'føø' + this.string + 'bår', test, 'file should be saved as properly encoded processed string.'); + tmpfile.unlinkSync(); + + tmpfile = new Tempfile(); + file.copy('tests/fixtures/utf8.txt', tmpfile.path, { + encoding: null, + process: function(src) { + test.ok(Buffer.isBuffer(src), 'when encoding is specified as null, process src as a buffer'); + return new Buffer('føø' + src.toString() + 'bår'); + } + }); + helpers.assertTextEqual(file.read(tmpfile.path), 'føø' + this.string + 'bår', test, 'file should be saved as the buffer returned by process.'); + tmpfile.unlinkSync(); + + file.option('encoding', 'iso-8859-1'); + tmpfile = new Tempfile(); + file.copy('tests/fixtures/iso-8859-1.txt', tmpfile.path, { + process: function(src) { + test.equal(Buffer.isBuffer(src), false, 'use non-utf8 default encoding and process src as a string'); + test.equal(typeof src, 'string', 'use non-utf8 default encoding and process src as a string'); + return 'føø' + src + 'bår'; + } + }); + helpers.assertTextEqual(file.read(tmpfile.path), 'føø' + this.string + 'bår', test, 'file should be saved as properly encoded processed string'); + tmpfile.unlinkSync(); + + var filepath = path.join(tmpdir.path, 'should-not-exist.txt'); + file.copy('tests/fixtures/iso-8859-1.txt', filepath, { + process: function() { + return false; + } + }); + test.equal(file.exists(filepath), false, 'file should NOT be created if process returns false.'); + test.done(); + }, + 'copy and process, noprocess': function(test) { + test.expect(4); + var tmpfile; + tmpfile = new Tempfile(); + file.copy('tests/fixtures/utf8.txt', tmpfile.path, { + noProcess: true, + process: function(src) { + return 'føø' + src + 'bår'; + } + }); + helpers.assertTextEqual(file.read(tmpfile.path), this.string, test, 'file should not have been processed.'); + tmpfile.unlinkSync(); + + ['process', 'noprocess', 'othernoprocess'].forEach(function(filename) { + var filepath = path.join(tmpdir.path, filename); + file.copy('tests/fixtures/utf8.txt', filepath); + var tmpfile = new Tempfile(); + file.copy(filepath, tmpfile.path, { + noProcess: ['**/*no*'], + process: function(src) { + return 'føø' + src + 'bår'; + } + }); + if (filename === 'process') { + helpers.assertTextEqual(file.read(tmpfile.path), 'føø' + this.string + 'bår', test, 'file should have been processed.'); + } else { + helpers.assertTextEqual(file.read(tmpfile.path), this.string, test, 'file should not have been processed.'); + } + tmpfile.unlinkSync(); + }, this); + + test.done(); + }, + 'delete': function(test) { + test.expect(2); + var oldBase = process.cwd(); + var cwd = path.resolve(tmpdir.path, 'delete', 'folder'); + file.mkdir(cwd); + process.chdir(tmpdir.path); + + file.write(path.join(cwd, 'test.js'), 'var test;'); + test.ok(file.delete(cwd), 'should return true after deleting file.'); + test.equal(file.exists(cwd), false, 'file should have been deleted.'); + process.chdir(oldBase); + test.done(); + }, + 'delete nonexistent file': function(test) { + test.expect(1); + var oldWarn = file.log.warn; + file.log.warn = function() {}; + test.ok(!file.delete('nonexistent'), 'should return false if file does not exist.'); + file.log.warn = oldWarn; + test.done(); + }, + 'delete outside working directory': function(test) { + test.expect(3); + var oldBase = process.cwd(); + var oldWarn = file.log.warn; + file.log.warn = function() {}; + + var cwd = path.resolve(tmpdir.path, 'delete', 'folder'); + var outsidecwd = path.resolve(tmpdir.path, 'delete', 'outsidecwd'); + file.mkdir(cwd); + file.mkdir(outsidecwd); + process.chdir(cwd); + + file.write(path.join(outsidecwd, 'test.js'), 'var test;'); + test.equal(file.delete(path.join(outsidecwd, 'test.js')), false, 'should not delete anything outside the cwd.'); + + test.ok(file.delete(path.join(outsidecwd), {force:true}), 'should delete outside cwd when using the --force.'); + test.equal(file.exists(outsidecwd), false, 'file outside cwd should have been deleted when using the --force.'); + + process.chdir(oldBase); + file.log.warn = oldWarn; + test.done(); + }, + 'dont delete current working directory': function(test) { + test.expect(2); + var oldBase = process.cwd(); + var oldWarn = file.log.warn; + file.log.warn = function() {}; + + var cwd = path.resolve(tmpdir.path, 'dontdelete', 'folder'); + file.mkdir(cwd); + process.chdir(cwd); + + test.equal(file.delete(cwd), false, 'should not delete the cwd.'); + test.ok(file.exists(cwd), 'the cwd should exist.'); + + process.chdir(oldBase); + file.log.warn = oldWarn; + test.done(); + }, + 'dont actually delete with no-write option on': function(test) { + test.expect(2); + file.option('write', false); + + var oldBase = process.cwd(); + var cwd = path.resolve(tmpdir.path, 'dontdelete', 'folder'); + file.mkdir(cwd); + process.chdir(tmpdir.path); + + file.write(path.join(cwd, 'test.js'), 'var test;'); + test.ok(file.delete(cwd), 'should return true after not actually deleting file.'); + test.equal(file.exists(cwd), true, 'file should NOT be deleted if `write: false` was specified.'); + process.chdir(oldBase); + + test.done(); + }, + 'mkdir': function(test) { + test.expect(5); + test.doesNotThrow(function() { + file.mkdir(tmpdir.path); + }, 'Should not explode if the directory already exists.'); + test.ok(fs.existsSync(tmpdir.path), 'path should still exist.'); + + test.doesNotThrow(function() { + file.mkdir(path.join(tmpdir.path, 'aa/bb/cc')); + }, 'Should also not explode, otherwise.'); + test.ok(path.join(tmpdir.path, 'aa/bb/cc'), 'path should have been created.'); + + fs.writeFileSync(path.join(tmpdir.path, 'aa/bb/xx'), 'test'); + test.throws(function() { + file.mkdir(path.join(tmpdir.path, 'aa/bb/xx/yy')); + }, 'Should throw if a path cannot be created (ENOTDIR).'); + + test.done(); + }, + 'recurse': function(test) { + test.expect(1); + var rootdir = 'tests/fixtures/expand'; + var expected = {}; + expected[rootdir + '/css/baz.css'] = [rootdir, 'css', 'baz.css']; + expected[rootdir + '/css/qux.css'] = [rootdir, 'css', 'qux.css']; + expected[rootdir + '/deep/deep.txt'] = [rootdir, 'deep', 'deep.txt']; + expected[rootdir + '/deep/deeper/deeper.txt'] = [rootdir, 'deep/deeper', 'deeper.txt']; + expected[rootdir + '/deep/deeper/deepest/deepest.txt'] = [rootdir, 'deep/deeper/deepest', 'deepest.txt']; + expected[rootdir + '/js/bar.js'] = [rootdir, 'js', 'bar.js']; + expected[rootdir + '/js/foo.js'] = [rootdir, 'js', 'foo.js']; + expected[rootdir + '/README.md'] = [rootdir, undefined, 'README.md']; + + var actual = {}; + file.recurse(rootdir, function(abspath, rootdir, subdir, filename) { + actual[abspath] = [rootdir, subdir, filename]; + }); + + test.deepEqual(actual, expected, 'paths and arguments should match.'); + test.done(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/BOM.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/BOM.txt new file mode 100644 index 0000000..e1fde78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/BOM.txt @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/Gruntfile-print-text.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/Gruntfile-print-text.js new file mode 100644 index 0000000..910197d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/Gruntfile-print-text.js @@ -0,0 +1,8 @@ +module.exports = function(grunt) { + + grunt.registerTask('print', 'Print the specified text.', function(text) { + console.log('OUTPUT: ' + text); + // console.log(process.cwd()); + }); + +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/a.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/a.js new file mode 100644 index 0000000..f688910 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/a.js @@ -0,0 +1 @@ +var a = 1; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/b.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/b.js new file mode 100644 index 0000000..a2f3122 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/b.js @@ -0,0 +1 @@ +var b = 2; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner.js new file mode 100644 index 0000000..61cf35d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner.js @@ -0,0 +1,11 @@ + +/* THIS + * IS + * A + * SAMPLE + * BANNER! + */ + +// Comment + +/* Comment */ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner2.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner2.js new file mode 100644 index 0000000..f8ff08c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner2.js @@ -0,0 +1,7 @@ + +/*! SAMPLE + * BANNER */ + +// Comment + +/* Comment */ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner3.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner3.js new file mode 100644 index 0000000..ef55520 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/banner3.js @@ -0,0 +1,10 @@ + +// This is +// A sample +// Banner + +// But this is not + +/* And neither + * is this + */ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.cmd b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.cmd new file mode 100644 index 0000000..6e4a52b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.cmd @@ -0,0 +1 @@ +@echo done diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.sh b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.sh new file mode 100644 index 0000000..8890799 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/exec.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "done" diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/dir.ectory/file-no-extension b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/dir.ectory/file-no-extension new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/dir.ectory/sub.dir.ectory/file.ext.ension b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/dir.ectory/sub.dir.ectory/file.ext.ension new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/file.ext.ension b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand-mapping-ext/file.ext.ension new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/css/baz.css b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/css/baz.css new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/css/qux.css b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/css/qux.css new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deep.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deep.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deeper/deeper.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deeper/deeper.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deeper/deepest/deepest.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/deep/deeper/deepest/deepest.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/js/bar.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/js/bar.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/js/foo.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/expand/js/foo.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-123-a.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-123-a.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-123-b.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-123-b.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-a.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-a.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-b.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built-b.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/dist/built.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file1-123.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file1-123.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file1.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file1.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file2-123.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file2-123.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file2.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/files/src/file2.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.json new file mode 100644 index 0000000..31e1dc3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.json @@ -0,0 +1,4 @@ +{ + "foo": "Ao isso a", + "bar": ["mg", "pnies"] +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.txt new file mode 100644 index 0000000..c4a1684 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.txt @@ -0,0 +1 @@ +Ao isso a diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.yaml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.yaml new file mode 100644 index 0000000..b869cc1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/iso-8859-1.yaml @@ -0,0 +1,4 @@ +foo: Ao isso a +bar: + - mg + - pnies diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/lint.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/lint.txt new file mode 100644 index 0000000..62b1156 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/lint.txt differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/no_BOM.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/no_BOM.txt new file mode 100644 index 0000000..1910281 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/no_BOM.txt @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/octocat.png b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/octocat.png new file mode 100644 index 0000000..8f794e0 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/octocat.png differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn-multibyte.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn-multibyte.js new file mode 100644 index 0000000..8277711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn-multibyte.js @@ -0,0 +1,17 @@ +// This is a test fixture for a case where spawn receives incomplete +// multibyte strings in separate data events. + +// A multibyte buffer containing all our output. We will slice it later. +// In this case we are using a Japanese word for hello / good day, where each +// character takes three bytes. +var fullOutput = new Buffer('こんにちは'); + +// Output one full character and one third of a character +process.stdout.write(fullOutput.slice(0, 4)); + +// Output the rest of the string +process.stdout.write(fullOutput.slice(4)); + +// Do the same for stderr +process.stderr.write(fullOutput.slice(0, 4)); +process.stderr.write(fullOutput.slice(4)); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn.js new file mode 100644 index 0000000..eb65657 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/spawn.js @@ -0,0 +1,9 @@ + +var code = Number(process.argv[2]); + +process.stdout.write('stdout\n'); +process.stderr.write('stderr\n'); + +// Use instead of process.exit to ensure stdout/stderr are flushed +// before exiting in Windows (Tested in Node.js v0.8.7) +require('../../lib/util/exit').exit(code); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/template.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/template.txt new file mode 100644 index 0000000..99342d6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/template.txt @@ -0,0 +1 @@ +Version: <%= grunt.version %>, today: <%= grunt.template.today("yyyy-mm-dd") %>. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/test.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/test.json new file mode 100644 index 0000000..098e7b8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/test.json @@ -0,0 +1,4 @@ +{ + "foo": "bar", + "baz": [1, 2, 3] +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.json new file mode 100644 index 0000000..d10e975 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.json @@ -0,0 +1,4 @@ +{ + "foo": "Ação é isso aí", + "bar": ["ømg", "pønies"] +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.txt new file mode 100644 index 0000000..eadbdb4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.txt @@ -0,0 +1 @@ +Ação é isso aí diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.yaml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.yaml new file mode 100644 index 0000000..7eb7321 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/fixtures/utf8.yaml @@ -0,0 +1,4 @@ +foo: Ação é isso aí +bar: + - ømg + - pønies diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/helpers/helpers.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/helpers/helpers.js new file mode 100644 index 0000000..1555cb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/helpers/helpers.js @@ -0,0 +1,7 @@ +exports.assertTextEqual = function (value, expected, test, msg) { + function eol(str) { + return str.replace(/\r\n/g, '\n'); + } + + test.strictEqual(eol(value), eol(expected), msg); +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/module.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/module.js new file mode 100644 index 0000000..b62107c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/module.js @@ -0,0 +1,26 @@ +'use strict'; + +var file = require('..'); +var File = require('../lib/file'); +var _ = require('lodash'); + +exports['file module'] = { + 'createEnv': function(test) { + test.expect(6); + var logger = { bar: 'foo' }; + var src = file.createEnv({ + write: false, + encoding: 'usc2', + logger: logger, + base: 'src/' + }); + + test.equal(src.option('write'), false); + test.equal(src.option('encoding'), 'usc2'); + test.equal(src.option('logger'), logger); + test.equal(src.option('base'), 'src/'); + test.notEqual(src, file); + test.ok(src instanceof File); + test.done(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/query.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/query.js new file mode 100644 index 0000000..f2b2e9f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/tests/query.js @@ -0,0 +1,113 @@ +'use strict'; + +var fquery = require('..'); + +var fs = require('fs'); +var path = require('path'); + +var Tempfile = require('temporary/lib/file'); +var Tempdir = require('temporary/lib/dir'); + +var tmpdir = new Tempdir(); +fs.symlinkSync(path.resolve('tests/fixtures/octocat.png'), path.join(tmpdir.path, 'octocat.png'), 'file'); +fs.symlinkSync(path.resolve('tests/fixtures/expand'), path.join(tmpdir.path, 'expand'), 'dir'); + +exports['fquery'] = { + setUp: function(done) { + // Assign the query interface, allow running these tests on other interface + this.fquery = fquery; + done(); + }, + 'exists': function(test) { + test.expect(6); + test.ok(this.fquery.exists('tests/fixtures/octocat.png'), 'files exist.'); + test.ok(this.fquery.exists('tests', 'fixtures', 'octocat.png'), 'should work for paths in parts.'); + test.ok(this.fquery.exists('tests/fixtures'), 'directories exist.'); + test.ok(this.fquery.exists(path.join(tmpdir.path, 'octocat.png')), 'file links exist.'); + test.ok(this.fquery.exists(path.join(tmpdir.path, 'expand')), 'directory links exist.'); + test.equal(this.fquery.exists('tests/fixtures/does/not/exist'), false, 'nonexistent files do not exist.'); + test.done(); + }, + 'isLink': function(test) { + test.expect(6); + test.equals(this.fquery.isLink('tests/fixtures/octocat.png'), false, 'files are not links.'); + test.equals(this.fquery.isLink('tests/fixtures'), false, 'directories are not links.'); + test.ok(this.fquery.isLink(path.join(tmpdir.path, 'octocat.png')), 'file links are links.'); + test.ok(this.fquery.isLink(path.join(tmpdir.path, 'expand')), 'directory links are links.'); + test.ok(this.fquery.isLink(tmpdir.path, 'octocat.png'), 'should work for paths in parts.'); + test.equals(this.fquery.isLink('tests/fixtures/does/not/exist'), false, 'nonexistent files are not links.'); + test.done(); + }, + 'isDir': function(test) { + test.expect(6); + test.equals(this.fquery.isDir('tests/fixtures/octocat.png'), false, 'files are not directories.'); + test.ok(this.fquery.isDir('tests/fixtures'), 'directories are directories.'); + test.ok(this.fquery.isDir('tests', 'fixtures'), 'should work for paths in parts.'); + test.equals(this.fquery.isDir(path.join(tmpdir.path, 'octocat.png')), false, 'file links are not directories.'); + test.ok(this.fquery.isDir(path.join(tmpdir.path, 'expand')), 'directory links are directories.'); + test.equals(this.fquery.isDir('tests/fixtures/does/not/exist'), false, 'nonexistent files are not directories.'); + test.done(); + }, + 'isFile': function(test) { + test.expect(6); + test.ok(this.fquery.isFile('tests/fixtures/octocat.png'), 'files are files.'); + test.ok(this.fquery.isFile('tests', 'fixtures', 'octocat.png'), 'should work for paths in parts.'); + test.equals(this.fquery.isFile('tests/fixtures'), false, 'directories are not files.'); + test.ok(this.fquery.isFile(path.join(tmpdir.path, 'octocat.png')), 'file links are files.'); + test.equals(this.fquery.isFile(path.join(tmpdir.path, 'expand')), false, 'directory links are not files.'); + test.equals(this.fquery.isFile('tests/fixtures/does/not/exist'), false, 'nonexistent files are not files.'); + test.done(); + }, + 'isPathAbsolute': function(test) { + test.expect(5); + test.ok(this.fquery.isPathAbsolute(path.resolve('/foo')), 'should return true'); + test.ok(this.fquery.isPathAbsolute(path.resolve('/foo') + path.sep), 'should return true'); + test.equal(this.fquery.isPathAbsolute('foo'), false, 'should return false'); + test.ok(this.fquery.isPathAbsolute(path.resolve('tests/fixtures/a.js')), 'should return true'); + test.equal(this.fquery.isPathAbsolute('tests/fixtures/a.js'), false, 'should return false'); + test.done(); + }, + 'arePathsEquivalent': function(test) { + test.expect(5); + test.ok(this.fquery.arePathsEquivalent('/foo'), 'should return true'); + test.ok(this.fquery.arePathsEquivalent('/foo', '/foo/', '/foo/../foo/'), 'should return true'); + test.ok(this.fquery.arePathsEquivalent(process.cwd(), '.', './', 'tests/..'), 'should return true'); + test.equal(this.fquery.arePathsEquivalent(process.cwd(), '..'), false, 'should return false'); + test.equal(this.fquery.arePathsEquivalent('.', '..'), false, 'should return false'); + test.done(); + }, + 'doesPathContain': function(test) { + test.expect(6); + test.ok(this.fquery.doesPathContain('/foo', '/foo/bar'), 'should return true'); + test.ok(this.fquery.doesPathContain('/foo/', '/foo/bar/baz', '/foo/bar', '/foo/whatever'), 'should return true'); + test.equal(this.fquery.doesPathContain('/foo', '/foo'), false, 'should return false'); + test.equal(this.fquery.doesPathContain('/foo/xyz', '/foo/xyz/123', '/foo/bar/baz'), false, 'should return false'); + test.equal(this.fquery.doesPathContain('/foo/xyz', '/foo'), false, 'should return false'); + test.ok(this.fquery.doesPathContain(process.cwd(), 'test', 'tests/fixtures', 'lib'), 'should return true'); + test.done(); + }, + 'isPathCwd': function(test) { + test.expect(8); + test.ok(this.fquery.isPathCwd(process.cwd()), 'cwd is cwd'); + test.ok(this.fquery.isPathCwd('.'), 'cwd is cwd'); + test.equal(this.fquery.isPathCwd('tests'), false, 'subdirectory is not cwd'); + test.equal(this.fquery.isPathCwd(path.resolve('test')), false, 'subdirectory is not cwd'); + test.equal(this.fquery.isPathCwd('..'), false, 'parent is not cwd'); + test.equal(this.fquery.isPathCwd(path.resolve('..')), false, 'parent is not cwd'); + test.equal(this.fquery.isPathCwd('/'), false, 'root is not cwd (I hope)'); + test.equal(this.fquery.isPathCwd('nonexistent'), false, 'nonexistent path is not cwd'); + test.done(); + }, + 'isPathInCwd': function(test) { + test.expect(8); + test.equal(this.fquery.isPathInCwd(process.cwd()), false, 'cwd is not IN cwd'); + test.equal(this.fquery.isPathInCwd('.'), false, 'cwd is not IN cwd'); + test.ok(this.fquery.isPathInCwd('tests'), 'subdirectory is in cwd'); + test.ok(this.fquery.isPathInCwd(path.resolve('tests')), 'subdirectory is in cwd'); + test.equal(this.fquery.isPathInCwd('..'), false, 'parent is not in cwd'); + test.equal(this.fquery.isPathInCwd(path.resolve('..')), false, 'parent is not in cwd'); + test.equal(this.fquery.isPathInCwd('/'), false, 'root is not in cwd (I hope)'); + test.equal(this.fquery.isPathInCwd('nonexistent'), false, 'nonexistent path is not in cwd'); + test.done(); + }, +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/write.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/write.txt new file mode 100644 index 0000000..96c9067 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/file-utils/write.txt @@ -0,0 +1 @@ +foo bar \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.npmignore new file mode 100644 index 0000000..8030a49 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.npmignore @@ -0,0 +1,3 @@ +npm-debug.log +node_modules/ +test/tmp/ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.travis.yml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.travis.yml new file mode 100644 index 0000000..5c11909 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.8" +# - "0.6" diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/LICENSE-MIT b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/LICENSE-MIT new file mode 100644 index 0000000..982db13 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/LICENSE-MIT @@ -0,0 +1,23 @@ +Copyright (c) 2013 J. Pommerening, contributors. + +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. + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/README.md new file mode 100644 index 0000000..3af9caf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/README.md @@ -0,0 +1,100 @@ +# Lazy Streams + +> *Create streams lazily when they are read from or written to.* +> `lazystream: 0.0.2` [![Build Status](https://travis-ci.org/jpommerening/node-lazystream.png?branch=master)](https://travis-ci.org/jpommerening/node-lazystream) + +## Why? + +Sometimes you feel the itch to open *all the files* at once. You want to pass a bunch of streams around, so the consumer does not need to worry where the data comes from. +From a software design point-of-view this sounds entirely reasonable. Then there is that neat little function `fs.createReadStream()` that opens a file and gives you a nice `fs.ReadStream` to pass around, so you use what the mighty creator deities of node bestowed upon you. + +> `Error: EMFILE, too many open files` +> ─ *node* + +This package provides two classes based on the node's new streams API (or `readable-stream` if you are using node a node version earlier than 0.10): + +## Class: lazystream.Readable + +A wrapper for readable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough). + +### new lazystream.Readable(fn [, options]) + +* `fn` *{Function}* + The function that the lazy stream will call to obtain the stream to actually read from. +* `options` *{Object}* + Options for the underlying `PassThrough` stream, accessible by `fn`. + +Creates a new readable stream. Once the stream is accessed (for example when you call its `read()` method, or attach a `data`-event listener) the `fn` function is called with the outer `lazystream.Readable` instance bound to `this`. + +If you pass an `options` object to the constuctor, you can access it in your `fn` function. + +```javascript +new lazystream.Readable(function (options) { + return fs.createReadStream('/dev/urandom'); +}); +``` + +## Class: lazystream.Writable + +A wrapper for writable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough). + +### new lazystream.Writable(fn [, options]) + +* `fn` *{Function}* + The function that the lazy stream will call to obtain the stream to actually write to. +* `options` *{Object}* + Options for the underlying `PassThrough` stream, accessible by `fn`. + +Creates a new writable stream. Just like the one above but for writable streams. + +```javascript +new lazystream.Writable(function () { + return fs.createWriteStream('/dev/null'); +}); +``` + +## Install + +```console +$ npm install lazystream --save +npm http GET https://registry.npmjs.org/readable-stream +npm http 200 https://registry.npmjs.org/readable-stream +npm http GET https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz +npm http 200 https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz +lazystream@0.0.2 node_modules/lazystream +└── readable-stream@1.0.2 +``` + +## Contributing + +Fork it, branch it, send me a pull request. We'll work out the rest together. + +## Credits + +[Chris Talkington](https://github.com/ctalkington) and his [node-archiver](https://github.com/ctalkington/node-archiver) for providing a use-case. + +## [License](LICENSE-MIT) + +Copyright (c) 2013 J. Pommerening, contributors. + +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. + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/lib/lazystream.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/lib/lazystream.js new file mode 100644 index 0000000..c6fbb39 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/lib/lazystream.js @@ -0,0 +1,52 @@ + +var util = require('util'); +var PassThrough = require('stream').PassThrough || require('readable-stream/passthrough'); + +module.exports = { + Readable: Readable, + Writable: Writable +}; + +util.inherits(Readable, PassThrough); +util.inherits(Writable, PassThrough); + +// Patch the given method of instance so that the callback +// is executed once, before the actual method is called the +// first time. +function beforeFirstCall(instance, method, callback) { + instance[method] = function() { + delete instance[method]; + callback.apply(this, arguments); + return this[method].apply(this, arguments); + }; +} + +function Readable(fn, options) { + if (!(this instanceof Readable)) + return new Readable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_read', function() { + var source = fn.call(this, options); + var that = this; + source.pipe(this); + }); + + this.emit('readable'); +} + +function Writable(fn, options) { + if (!(this instanceof Writable)) + return new Writable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_write', function() { + var destination = fn.call(this, options); + this.pipe(destination); + }); + + this.emit('writable'); +} + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/package.json new file mode 100644 index 0000000..969bba3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/package.json @@ -0,0 +1,47 @@ +{ + "name": "lazystream", + "version": "0.1.0", + "description": "Open Node Streams on demand.", + "homepage": "https://github.com/jpommerening/node-lazystream", + "author": { + "name": "J. Pommerening" + }, + "repository": { + "type": "git", + "url": "https://github.com/jpommerening/node-lazystream.git" + }, + "bugs": { + "url": "https://github.com/jpommerening/node-lazystream/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jpommerening/node-lazystream/blob/master/LICENSE-MIT" + } + ], + "main": "lib/lazystream.js", + "engines": { + "node": ">= 0.6.3" + }, + "scripts": { + "test": "nodeunit test/readable_test.js test/writable_test.js test/pipe_test.js test/fs_test.js" + }, + "dependencies": { + "readable-stream": "~1.0.2" + }, + "devDependencies": { + "nodeunit": "~0.7.4" + }, + "keywords": [ + "streams", + "stream" + ], + "readme": "# Lazy Streams\n\n> *Create streams lazily when they are read from or written to.* \n> `lazystream: 0.0.2` [![Build Status](https://travis-ci.org/jpommerening/node-lazystream.png?branch=master)](https://travis-ci.org/jpommerening/node-lazystream) \n\n## Why?\n\nSometimes you feel the itch to open *all the files* at once. You want to pass a bunch of streams around, so the consumer does not need to worry where the data comes from.\nFrom a software design point-of-view this sounds entirely reasonable. Then there is that neat little function `fs.createReadStream()` that opens a file and gives you a nice `fs.ReadStream` to pass around, so you use what the mighty creator deities of node bestowed upon you.\n\n> `Error: EMFILE, too many open files` \n> ─ *node*\n\nThis package provides two classes based on the node's new streams API (or `readable-stream` if you are using node a node version earlier than 0.10):\n\n## Class: lazystream.Readable\n\nA wrapper for readable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough).\n\n### new lazystream.Readable(fn [, options])\n\n* `fn` *{Function}* \n The function that the lazy stream will call to obtain the stream to actually read from.\n* `options` *{Object}* \n Options for the underlying `PassThrough` stream, accessible by `fn`.\n\nCreates a new readable stream. Once the stream is accessed (for example when you call its `read()` method, or attach a `data`-event listener) the `fn` function is called with the outer `lazystream.Readable` instance bound to `this`.\n\nIf you pass an `options` object to the constuctor, you can access it in your `fn` function.\n\n```javascript\nnew lazystream.Readable(function (options) {\n return fs.createReadStream('/dev/urandom');\n});\n```\n\n## Class: lazystream.Writable\n\nA wrapper for writable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough).\n\n### new lazystream.Writable(fn [, options])\n\n* `fn` *{Function}* \n The function that the lazy stream will call to obtain the stream to actually write to.\n* `options` *{Object}* \n Options for the underlying `PassThrough` stream, accessible by `fn`.\n\nCreates a new writable stream. Just like the one above but for writable streams.\n\n```javascript\nnew lazystream.Writable(function () {\n return fs.createWriteStream('/dev/null');\n});\n```\n\n## Install\n\n```console\n$ npm install lazystream --save\nnpm http GET https://registry.npmjs.org/readable-stream\nnpm http 200 https://registry.npmjs.org/readable-stream\nnpm http GET https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz\nnpm http 200 https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz\nlazystream@0.0.2 node_modules/lazystream\n└── readable-stream@1.0.2\n```\n\n## Contributing\n\nFork it, branch it, send me a pull request. We'll work out the rest together.\n\n## Credits\n\n[Chris Talkington](https://github.com/ctalkington) and his [node-archiver](https://github.com/ctalkington/node-archiver) for providing a use-case.\n\n## [License](LICENSE-MIT)\n\nCopyright (c) 2013 J. Pommerening, contributors.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n", + "readmeFilename": "README.md", + "_id": "lazystream@0.1.0", + "dist": { + "shasum": "84f9f6c9294d67dea865dec9c6861e00264c58ec" + }, + "_from": "lazystream@~0.1.0", + "_resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/data.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/data.md new file mode 100644 index 0000000..fc48222 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/data.md @@ -0,0 +1,13 @@ +> Never mind, hey, this is really exciting, so much to find out about, so much to +> look forward to, I'm quite dizzy with anticipation . . . Or is it the wind? +> +> There really is a lot of that now, isn't there? And wow! Hey! What's this thing +> suddenly coming toward me very fast? Very, very fast. So big and flat and round, +> it needs a big wide-sounding name like . . . ow . . . ound . . . round . . . +> ground! That's it! That's a good name- ground! +> +> I wonder if it will be friends with me? +> +> Hello Ground! + +And the rest, after a sudden wet thud, was silence. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/fs_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/fs_test.js new file mode 100644 index 0000000..149b1c4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/fs_test.js @@ -0,0 +1,69 @@ + +var stream = require('../lib/lazystream'); +var fs = require('fs'); +var tmpDir = 'test/tmp/'; +var readFile = 'test/data.md'; +var writeFile = tmpDir + 'data.md'; + +exports.fs = { + readwrite: function(test) { + var readfd, writefd; + + var readable = new stream.Readable(function() { + return fs.createReadStream(readFile) + .on('open', function(fd) { + readfd = fd; + }) + .on('close', function() { + readfd = undefined; + step(); + }); + }); + + var writable = new stream.Writable(function() { + return fs.createWriteStream(writeFile) + .on('open', function(fd) { + writefd = fd; + }) + .on('close', function() { + writefd = undefined; + step(); + }); + }); + + test.expect(3); + + test.equal(readfd, undefined, 'Input file should not be opened until read'); + test.equal(writefd, undefined, 'Output file should not be opened until write'); + + if (!fs.existsSync(tmpDir)) { + fs.mkdirSync(tmpDir); + } + if (fs.existsSync(writeFile)) { + fs.unlinkSync(writeFile); + } + + readable.on('end', function() { step(); }); + writable.on('end', function() { step(); }); + + var steps = 0; + function step() { + steps += 1; + if (steps == 4) { + var input = fs.readFileSync(readFile); + var output = fs.readFileSync(writeFile); + + test.ok(input >= output && input <= output, 'Should be equal'); + + fs.unlinkSync(writeFile); + fs.rmdirSync(tmpDir); + + test.done(); + } + }; + + readable.pipe(writable); + } +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/helper.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/helper.js new file mode 100644 index 0000000..9d41191 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/helper.js @@ -0,0 +1,39 @@ + +var _Readable = require('readable-stream/readable'); +var _Writable = require('readable-stream/writable'); +var util = require('util'); + +module.exports = { + DummyReadable: DummyReadable, + DummyWritable: DummyWritable +}; + +function DummyReadable(strings) { + _Readable.call(this); + this.strings = strings; + this.emit('readable'); +} + +util.inherits(DummyReadable, _Readable); + +DummyReadable.prototype._read = function _read(n) { + if (this.strings.length) { + this.push(new Buffer(this.strings.shift())); + } else { + this.push(null); + } +}; + +function DummyWritable(strings) { + _Writable.call(this); + this.strings = strings; + this.emit('writable'); +} + +util.inherits(DummyWritable, _Writable); + +DummyWritable.prototype._write = function _write(chunk, encoding, callback) { + this.strings.push(chunk.toString()); + if (callback) callback(); +}; + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/pipe_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/pipe_test.js new file mode 100644 index 0000000..7129e35 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/pipe_test.js @@ -0,0 +1,36 @@ + +var stream = require('../lib/lazystream'); +var helper = require('./helper'); + +exports.pipe = { + readwrite: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + var readableInstantiated = false; + var writableInstantiated = false; + + test.expect(3); + + var readable = new stream.Readable(function() { + readableInstantiated = true; + return new helper.DummyReadable([].concat(expected)); + }); + + var writable = new stream.Writable(function() { + writableInstantiated = true; + return new helper.DummyWritable(actual); + }); + + test.equal(readableInstantiated, false, 'DummyReadable should only be instantiated when it is needed'); + test.equal(writableInstantiated, false, 'DummyWritable should only be instantiated when it is needed'); + + writable.on('end', function() { + test.equal(actual.join(''), expected.join(''), 'Piping on demand streams should keep data intact'); + test.done(); + }); + + readable.pipe(writable); + } +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/readable_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/readable_test.js new file mode 100644 index 0000000..12eb05a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/readable_test.js @@ -0,0 +1,88 @@ + +var Readable = require('../lib/lazystream').Readable; +var DummyReadable = require('./helper').DummyReadable; + +exports.readable = { + dummy: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + + test.expect(1); + + new DummyReadable([].concat(expected)) + .on('data', function(chunk) { + actual.push(chunk.toString()); + }) + .on('end', function() { + test.equal(actual.join(''), expected.join(''), 'DummyReadable should produce the data it was created with'); + test.done(); + }); + }, + options: function(test) { + test.expect(3); + + var readable = new Readable(function(options) { + test.ok(this instanceof Readable, "Readable should bind itself to callback's this"); + test.equal(options.encoding, "utf-8", "Readable should make options accessible to callback"); + this.ok = true; + return new DummyReadable(["test"]); + }, {encoding: "utf-8"}); + + readable.read(4); + + test.ok(readable.ok); + + test.done(); + }, + streams2: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + var instantiated = false; + + test.expect(2); + + var readable = new Readable(function() { + instantiated = true; + return new DummyReadable([].concat(expected)); + }); + + test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed'); + + readable.on('readable', function() { + var chunk = readable.read(); + actual.push(chunk.toString()); + }); + readable.on('end', function() { + test.equal(actual.join(''), expected.join(''), 'Readable should not change the data of the underlying stream'); + test.done(); + }); + + readable.read(0); + }, + resume: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + var instantiated = false; + + test.expect(2); + + var readable = new Readable(function() { + instantiated = true; + return new DummyReadable([].concat(expected)); + }); + + readable.pause(); + + readable.on('data', function(chunk) { + actual.push(chunk.toString()); + }); + readable.on('end', function() { + test.equal(actual.join(''), expected.join(''), 'Readable should not change the data of the underlying stream'); + test.done(); + }); + + test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed'); + + readable.resume(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/writable_test.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/writable_test.js new file mode 100644 index 0000000..a663845 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lazystream/test/writable_test.js @@ -0,0 +1,59 @@ + +var Writable = require('../lib/lazystream').Writable; +var DummyWritable = require('./helper').DummyWritable; + +exports.writable = { + options: function(test) { + test.expect(3); + + var writable = new Writable(function(options) { + test.ok(this instanceof Writable, "Writable should bind itself to callback's this"); + test.equal(options.encoding, "utf-8", "Writable should make options accessible to callback"); + this.ok = true; + return new DummyWritable([]); + }, {encoding: "utf-8"}); + + writable.write("test"); + + test.ok(writable.ok); + + test.done(); + }, + dummy: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + + test.expect(0); + + var dummy = new DummyWritable(actual); + + expected.forEach(function(item) { + dummy.write(new Buffer(item)); + }); + test.done(); + }, + streams2: function(test) { + var expected = [ 'line1\n', 'line2\n' ]; + var actual = []; + var instantiated = false; + + test.expect(2); + + var writable = new Writable(function() { + instantiated = true; + return new DummyWritable(actual); + }); + + test.equal(instantiated, false, 'DummyWritable should only be instantiated when it is needed'); + + writable.on('end', function() { + test.equal(actual.join(''), expected.join(''), 'Writable should not change the data of the underlying stream'); + test.done(); + }); + + expected.forEach(function(item) { + writable.write(new Buffer(item)); + }); + writable.end(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/README.md new file mode 100644 index 0000000..6f9598e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/README.md @@ -0,0 +1,163 @@ +# Lo-Dash v2.4.1 +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + +Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds. + +* Modern builds perfect for newer browsers/environments:
    +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js) + +* Compatibility builds for older environment support too:
    +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.min.js) + +* Underscore builds to use as a drop-in replacement:
    +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/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](http://lodash.com/custom-builds) with only the features needed. + +Love modules? We’ve 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 + +There’s plenty of **[documentation](http://lodash.com/docs)**, [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).
    +Check out DevDocs as a fast, organized, & searchable interface for our documentation. + +The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).
    +A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). + +## Features *not* in Underscore + + * AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.) + * [_(…)](http://lodash.com/docs#_) supports intuitive chaining + * [_.at](http://lodash.com/docs#at) for cherry-picking collection values + * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods + * [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects + * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects + * [_.constant](http://lodash.com/docs#constant) & [_.property](http://lodash.com/docs#property) function generators for composing functions + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` + * [_.create](http://lodash.com/docs#create) for easier object inheritance + * [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins + * [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions + * [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control + * [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys + * [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early + * [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object` + * [_.mapValues](http://lodash.com/docs#mapValues) for [mapping](http://lodash.com/docs#map) values to an object + * [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions + * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) + * [_.noop](http://lodash.com/docs#noop) for function placeholders + * [_.now](http://lodash.com/docs#now) as a cross-browser `Date.now` alternative + * [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior + * [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays + * [_.random](http://lodash.com/docs#random) supports returning floating-point numbers + * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking + * [_.sortBy](http://lodash.com/docs#sortBy) supports sorting by multiple properties + * [_.support](http://lodash.com/docs#support) for flagging environment features + * [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals) + * [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects + * [_.where](http://lodash.com/docs#where) supports deep object comparisons + * [_.xor](http://lodash.com/docs#xor) as a companion to [_.difference](http://lodash.com/docs#difference), [_.intersection](http://lodash.com/docs#intersection), & [_.union](http://lodash.com/docs#union) + * [_.zip](http://lodash.com/docs#zip) is capable of unzipping values + * [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), & + [more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks + * [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), & + [more](http://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](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), & + [more](http://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](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), & + [more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods + +## Resources + + * Podcasts + - [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/) + + * 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/) + + * 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) + + A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources). + +## Support + +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.
    +Automated browser test results [are available](https://saucelabs.com/u/lodash) as well as [Travis CI](https://travis-ci.org/) builds for [lodash](https://travis-ci.org/lodash/lodash/), [lodash-cli](https://travis-ci.org/lodash/lodash-cli/), [lodash-amd](https://travis-ci.org/lodash/lodash-amd/), [lodash-node](https://travis-ci.org/lodash/lodash-node/), & [grunt-lodash](https://travis-ci.org/lodash/grunt-lodash). + +Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
    +[![Sauce Labs](http://lodash.com/_img/sauce.png)](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More") + +## Installation & usage + +In browsers: + +```html + +``` + +Using [`npm`](http://npmjs.org/): + +```bash +npm i --save lodash + +{sudo} npm i -g lodash +npm ln lodash +``` + +In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/): + +```js +var _ = require('lodash'); +// or as Underscore +var _ = require('lodash/dist/lodash.underscore'); +``` + +**Notes:** + * Don’t 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 project’s root directory *before* requiring it + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader: + +```js +require({ + 'packages': [ + { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' } + ] +}, +['lodash'], function(_) { + console.log(_.VERSION); +}); +``` + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/dist/lodash.compat.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/dist/lodash.compat.js new file mode 100644 index 0000000..23798ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/lodash/dist/lodash.compat.js @@ -0,0 +1,7157 @@ +/** + * @license + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash -o ./dist/lodash.compat.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre ES5 environments */ + var undefined; + + /** Used to pool arrays and objects used internally */ + var arrayPool = [], + objectPool = []; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = {}; + + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ + var keyPrefix = +new Date + ''; + + /** Used as the size when optimizations are enabled for large arrays */ + var largeArraySize = 75; + + /** Used as the max size of the `arrayPool` and `objectPool` */ + var maxPoolSize = 40; + + /** Used to detect and test whitespace */ + var whitespace = ( + // whitespace + ' \t\x0B\f\xA0\ufeff' + + + // line terminators + '\n\r\u2028\u2029' + + + // unicode category "Zs" space separators + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' + ); + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detected named functions */ + var reFuncName = /^\s*function[ \n\r\t]+\w/; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match leading whitespace and zeros to be removed */ + var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to detect functions containing a `this` reference */ + var reThis = /\bthis\b/; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to assign default `context` object properties */ + var contextProps = [ + 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', + 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', + 'parseInt', 'setTimeout' + ]; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowedProps = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + errorClass = '[object Error]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used as an internal `_.debounce` options object */ + var debounceOptions = { + 'leading': false, + 'maxWait': 0, + 'trailing': false + }; + + /** Used as the property descriptor for `__bindData__` */ + var descriptor = { + 'configurable': false, + 'enumerable': false, + 'value': null, + 'writable': false + }; + + /** Used as the data object for `iteratorTemplate` */ + var iteratorData = { + 'args': '', + 'array': null, + 'bottom': '', + 'firstArg': '', + 'init': '', + 'keys': null, + 'loop': '', + 'shadowedProps': null, + 'support': null, + 'top': '', + 'useHas': false + }; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports` */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value] ? 0 : -1; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = (cache = cache[type]) && cache[key]; + + return type == 'object' + ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) + : (cache ? 0 : -1); + } + + /** + * Adds a given value to the corresponding cache object. + * + * @private + * @param {*} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + (typeCache[key] || (typeCache[key] = [])).push(value); + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default callback when a given + * collection is a string value. + * + * @private + * @param {string} value The character to inspect. + * @returns {number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` elements, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ac = a.criteria, + bc = b.criteria, + index = -1, + length = ac.length; + + while (++index < length) { + var value = ac[index], + other = bc[index]; + + if (value !== other) { + if (value > other || typeof value == 'undefined') { + return 1; + } + if (value < other || typeof other == 'undefined') { + return -1; + } + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to return the same value for + // `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 + // + // This also ensures a stable sort in V8 and other engines. + // See http://code.google.com/p/v8/issues/detail?id=90 + return a.index - b.index; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length, + first = array[0], + mid = array[(length / 2) | 0], + last = array[length - 1]; + + if (first && typeof first == 'object' && + mid && typeof mid == 'object' && last && typeof last == 'object') { + return false; + } + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Gets an array from the array pool or creates a new one if the pool is empty. + * + * @private + * @returns {Array} The array from the pool. + */ + function getArray() { + return arrayPool.pop() || []; + } + + /** + * Gets an object from the object pool or creates a new one if the pool is empty. + * + * @private + * @returns {Object} The object from the pool. + */ + function getObject() { + return objectPool.pop() || { + 'array': null, + 'cache': null, + 'criteria': null, + 'false': false, + 'index': 0, + 'null': false, + 'number': null, + 'object': null, + 'push': null, + 'string': null, + 'true': false, + 'undefined': false, + 'value': null + }; + } + + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * Releases the given array back to the array pool. + * + * @private + * @param {Array} [array] The array to release. + */ + function releaseArray(array) { + array.length = 0; + if (arrayPool.length < maxPoolSize) { + arrayPool.push(array); + } + } + + /** + * Releases the given object back to the object pool. + * + * @private + * @param {Object} [object] The object to release. + */ + function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } + object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; + if (objectPool.length < maxPoolSize) { + objectPool.push(object); + } + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used instead of `Array#slice` to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|string} collection The collection to slice. + * @param {number} start The start index. + * @param {number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new `lodash` function using the given context object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} [context=root] The context object. + * @returns {Function} Returns the `lodash` function. + */ + function runInContext(context) { + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See http://es5.github.io/#x11.1.5. + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; + + /** Native constructor references */ + var Array = context.Array, + Boolean = context.Boolean, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Number = context.Number, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** + * Used for `Array` method references. + * + * Normally `Array.prototype` would suffice, however, using an array literal + * avoids issues in Narwhal. + */ + var arrayRef = []; + + /** Used for native method references */ + var errorProto = Error.prototype, + objectProto = Object.prototype, + stringProto = String.prototype; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = context._; + + /** Used to resolve the internal [[Class]] of values */ + var toString = objectProto.toString; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + String(toString) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/toString| for [^\]]+/g, '.*?') + '$' + ); + + /** Native method shortcuts */ + var ceil = Math.ceil, + clearTimeout = context.clearTimeout, + floor = Math.floor, + fnToString = Function.prototype.toString, + getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectProto.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + setTimeout = context.setTimeout, + splice = arrayRef.splice, + unshift = arrayRef.unshift; + + /** Used to set meta data on functions */ + var defineProperty = (function() { + // IE 8 only accepts DOM elements + try { + var o = {}, + func = isNative(func = Object.defineProperty) && func, + result = func(o, o, o) && func; + } catch(e) { } + return result; + }()); + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, + nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = context.isFinite, + nativeIsNaN = context.isNaN, + nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random; + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[funcClass] = Function; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /** Used to avoid iterating non-enumerable properties in IE < 9 */ + var nonEnumProps = {}; + nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; + nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; + nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; + nonEnumProps[objectClass] = { 'constructor': true }; + + (function() { + var length = shadowedProps.length; + while (length--) { + var key = shadowedProps[length]; + for (var className in nonEnumProps) { + if (hasOwnProperty.call(nonEnumProps, className) && !hasOwnProperty.call(nonEnumProps[className], key)) { + nonEnumProps[className][key] = false; + } + } + } + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps the given value to enable intuitive + * method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * Chaining is supported in custom builds as long as the `value` method is + * implicitly or explicitly included in the build. + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, + * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, + * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, + * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, + * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, + * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, + * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, + * and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, + * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, + * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, + * `template`, `unescape`, `uniqueId`, and `value` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * provided, otherwise they return unwrapped values. + * + * Explicit chaining can be enabled by using the `_.chain` method. + * + * @name _ + * @constructor + * @category Chaining + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(num) { + * return num * num; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor + return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) + ? value + : new lodashWrapper(value); + } + + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap in a `lodash` instance. + * @param {boolean} chainAll A flag to enable chaining for all methods + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value, chainAll) { + this.__chain__ = !!chainAll; + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + + /** + * An object used to flag environments features. + * + * @static + * @memberOf _ + * @type Object + */ + var support = lodash.support = {}; + + (function() { + var ctor = function() { this.x = 1; }, + object = { '0': 1, 'length': 1 }, + props = []; + + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var key in new ctor) { props.push(key); } + for (key in arguments) { } + + /** + * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.argsClass = toString.call(arguments) == argsClass; + + /** + * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5). + * + * @memberOf _.support + * @type boolean + */ + support.argsObject = arguments.constructor == Object && !(arguments instanceof Array); + + /** + * Detect if `name` or `message` properties of `Error.prototype` are + * enumerable by default. (IE < 9, Safari < 5.1) + * + * @memberOf _.support + * @type boolean + */ + support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); + + /** + * Detect if `prototype` properties are enumerable by default. + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly sets a function's `prototype` property [[Enumerable]] + * value to `true`. + * + * @memberOf _.support + * @type boolean + */ + support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); + + /** + * Detect if functions can be decompiled by `Function#toString` + * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). + * + * @memberOf _.support + * @type boolean + */ + support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); + + /** + * Detect if `Function#name` is supported (all but IE). + * + * @memberOf _.support + * @type boolean + */ + support.funcNames = typeof Function.name == 'string'; + + /** + * Detect if `arguments` object indexes are non-enumerable + * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumArgs = key != 0; + + /** + * Detect if properties shadowing those on `Object.prototype` are non-enumerable. + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well (a.k.a the JScript [[DontEnum]] bug). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumShadows = !/valueOf/.test(props); + + /** + * Detect if own properties are iterated after inherited properties (all but IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.ownLast = props[0] != 'x'; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + * + * @memberOf _.support + * @type boolean + */ + support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]); + + /** + * Detect lack of support for accessing string characters by index. + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + * + * @memberOf _.support + * @type boolean + */ + support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a DOM node's [[Class]] is resolvable (all but IE < 9) + * and that the JS engine errors when attempting to coerce an object to + * a string without a `toString` function. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); + } catch(e) { + support.nodeClass = true; + } + }(1)); + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Object} data The data object used to populate the text. + * @returns {string} Returns the interpolated text. + */ + var iteratorTemplate = function(obj) { + + var __p = 'var index, iterable = ' + + (obj.firstArg) + + ', result = ' + + (obj.init) + + ';\nif (!iterable) return result;\n' + + (obj.top) + + ';'; + if (obj.array) { + __p += '\nvar length = iterable.length; index = -1;\nif (' + + (obj.array) + + ') { '; + if (support.unindexedChars) { + __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; + } + __p += '\n while (++index < length) {\n ' + + (obj.loop) + + ';\n }\n}\nelse { '; + } else if (support.nonEnumArgs) { + __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + + (obj.loop) + + ';\n }\n } else { '; + } + + if (support.enumPrototypes) { + __p += '\n var skipProto = typeof iterable == \'function\';\n '; + } + + if (support.enumErrorProps) { + __p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n '; + } + + var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); } + + if (obj.useHas && obj.keys) { + __p += '\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'; + if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + } else { + __p += '\n for (index in iterable) {\n'; + if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); } if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + if (support.nonEnumShadows) { + __p += '\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 '; + for (k = 0; k < 7; k++) { + __p += '\n index = \'' + + (obj.shadowedProps[k]) + + '\';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))'; + if (!obj.useHas) { + __p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])'; + } + __p += ') {\n ' + + (obj.loop) + + ';\n } '; + } + __p += '\n } '; + } + + } + + if (obj.array || support.nonEnumArgs) { + __p += '\n}'; + } + __p += + (obj.bottom) + + ';\nreturn result'; + + return __p + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.bind` that creates the bound function and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new bound function. + */ + function baseBind(bindData) { + var func = bindData[0], + partialArgs = bindData[2], + thisArg = bindData[4]; + + function bound() { + // `Function#bind` spec + // http://es5.github.io/#x15.3.4.5 + if (partialArgs) { + // avoid `arguments` object deoptimizations by using `slice` instead + // of `Array.prototype.slice.call` and not assigning `arguments` to a + // variable as a ternary expression + var args = slice(partialArgs); + push.apply(args, arguments); + } + // mimic the constructor's `return` behavior + // http://es5.github.io/#x13.2.2 + if (this instanceof bound) { + // ensure `new bound` is an instance of `func` + var thisBinding = baseCreate(func.prototype), + result = func.apply(thisBinding, args || arguments); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisArg, args || arguments); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.clone` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, callback, stackA, stackB) { + if (callback) { + var result = callback(value); + if (typeof result != 'undefined') { + return result; + } + } + // inspect [[Class]] + var isObj = isObject(value); + if (isObj) { + var className = toString.call(value); + if (!cloneableClasses[className] || (!support.nodeClass && isNode(value))) { + return value; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+value); + + case numberClass: + case stringClass: + return new ctor(value); + + case regexpClass: + result = ctor(value.source, reFlags.exec(value)); + result.lastIndex = value.lastIndex; + return result; + } + } else { + return value; + } + var isArr = isArray(value); + if (isDeep) { + // check for circular references and return corresponding clone + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + result = isArr ? ctor(value.length) : {}; + } + else { + result = isArr ? slice(value) : assign({}, value); + } + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + // exit for shallow clone + if (!isDeep) { + return result; + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? baseEach : forOwn)(value, function(objValue, key) { + result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); + }); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(prototype, properties) { + return isObject(prototype) ? nativeCreate(prototype) : {}; + } + // fallback for browsers without `Object.create` + if (!nativeCreate) { + baseCreate = (function() { + function Object() {} + return function(prototype) { + if (isObject(prototype)) { + Object.prototype = prototype; + var result = new Object; + Object.prototype = null; + } + return result || context.Object(); + }; + }()); + } + + /** + * The base implementation of `_.createCallback` without support for creating + * "_.pluck" or "_.where" style callbacks. + * + * @private + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function baseCreateCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + // exit early for no `thisArg` or already bound by `Function#bind` + if (typeof thisArg == 'undefined' || !('prototype' in func)) { + return func; + } + var bindData = func.__bindData__; + if (typeof bindData == 'undefined') { + if (support.funcNames) { + bindData = !func.name; + } + bindData = bindData || !support.funcDecomp; + if (!bindData) { + var source = fnToString.call(func); + if (!support.funcNames) { + bindData = !reFuncName.test(source); + } + if (!bindData) { + // checks if `func` references the `this` keyword and stores the result + bindData = reThis.test(source); + setBindData(func, bindData); + } + } + } + // exit early if there are no `this` references or `func` is bound + if (bindData === false || (bindData !== true && bindData[1] & 1)) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 2: return function(a, b) { + return func.call(thisArg, a, b); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + } + return bind(func, thisArg); + } + + /** + * The base implementation of `createWrapper` that creates the wrapper and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new function. + */ + function baseCreateWrapper(bindData) { + var func = bindData[0], + bitmask = bindData[1], + partialArgs = bindData[2], + partialRightArgs = bindData[3], + thisArg = bindData[4], + arity = bindData[5]; + + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + key = func; + + function bound() { + var thisBinding = isBind ? thisArg : this; + if (partialArgs) { + var args = slice(partialArgs); + push.apply(args, arguments); + } + if (partialRightArgs || isCurry) { + args || (args = slice(arguments)); + if (partialRightArgs) { + push.apply(args, partialRightArgs); + } + if (isCurry && args.length < arity) { + bitmask |= 16 & ~32; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + } + } + args || (args = arguments); + if (isBindKey) { + func = thisBinding[key]; + } + if (this instanceof bound) { + thisBinding = baseCreate(func.prototype); + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.difference` that accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to process. + * @param {Array} [values] The array of values to exclude. + * @returns {Array} Returns a new array of filtered values. + */ + function baseDifference(array, values) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + isLarge = length >= largeArraySize && indexOf === baseIndexOf, + result = []; + + if (isLarge) { + var cache = createCache(values); + if (cache) { + indexOf = cacheIndexOf; + values = cache; + } else { + isLarge = false; + } + } + while (++index < length) { + var value = array[index]; + if (indexOf(values, value) < 0) { + result.push(value); + } + } + if (isLarge) { + releaseObject(values); + } + return result; + } + + /** + * The base implementation of `_.flatten` without support for callback + * shorthands or `thisArg` binding. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns a new flattened array. + */ + function baseFlatten(array, isShallow, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value && typeof value == 'object' && typeof value.length == 'number' + && (isArray(value) || isArguments(value))) { + // recursively flatten arrays (susceptible to call stack limits) + if (!isShallow) { + value = baseFlatten(value, isShallow, isStrict); + } + var valIndex = -1, + valLength = value.length, + resIndex = result.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[resIndex++] = value[valIndex]; + } + } else if (!isStrict) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.isEqual`, without support for `thisArg` binding, + * that allows partial "_.where" style comparisons. + * + * @private + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `a` objects. + * @param {Array} [stackB=[]] Tracks traversed `b` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + if (callback) { + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + !(a && objectTypes[type]) && + !(b && objectTypes[otherType])) { + return false; + } + // exit early for `null` and `undefined` avoiding ES3's Function#call behavior + // http://es5.github.io/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (a != +a) + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == String(b); + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + var aWrapped = hasOwnProperty.call(a, '__wrapped__'), + bWrapped = hasOwnProperty.call(b, '__wrapped__'); + + if (aWrapped || bWrapped) { + return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, + ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && + !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && + ('constructor' in a && 'constructor' in b) + ) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + // compare lengths to determine if a deep comparison is necessary + length = a.length; + size = b.length; + result = size == length; + + if (result || isWhere) { + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (isWhere) { + while (index--) { + if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } + } + else { + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + } + }); + + if (result && !isWhere) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + } + stackA.pop(); + stackB.pop(); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.merge` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} [callback] The function to customize merging properties. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + */ + function baseMerge(object, source, callback, stackA, stackB) { + (isArray(source) ? forEach : forOwn)(source, function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + var isShallow; + if (callback) { + result = callback(value, source); + if ((isShallow = typeof result != 'undefined')) { + value = result; + } + } + if (!isShallow) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!isShallow) { + baseMerge(value, source, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + + /** + * The base implementation of `_.random` without argument juggling or support + * for returning floating-point numbers. + * + * @private + * @param {number} min The minimum possible value. + * @param {number} max The maximum possible value. + * @returns {number} Returns a random number. + */ + function baseRandom(min, max) { + return min + floor(nativeRandom() * (max - min + 1)); + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * or `thisArg` binding. + * + * @private + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function} [callback] The function called per iteration. + * @returns {Array} Returns a duplicate-value-free array. + */ + function baseUniq(array, isSorted, callback) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + indexOf = cacheIndexOf; + seen = cache; + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + if (isLarge) { + releaseArray(seen.array); + releaseObject(seen); + } else if (callback) { + releaseArray(seen); + } + return result; + } + + /** + * Creates a function that aggregates a collection, creating an object composed + * of keys generated from the results of running each element of the collection + * through a callback. The given `setter` function sets the keys and values + * of the composed object. + * + * @private + * @param {Function} setter The setter function. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter) { + return function(collection, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + setter(result, value, callback(value, index, collection), collection); + } + } else { + baseEach(collection, function(value, key, collection) { + setter(result, value, callback(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a function that, when called, either curries or invokes `func` + * with an optional `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of method flags to compose. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` + * 8 - `_.curry` (bound) + * 16 - `_.partial` + * 32 - `_.partialRight` + * @param {Array} [partialArgs] An array of arguments to prepend to those + * provided to the new function. + * @param {Array} [partialRightArgs] An array of arguments to append to those + * provided to the new function. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new function. + */ + function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + isPartial = bitmask & 16, + isPartialRight = bitmask & 32; + + if (!isBindKey && !isFunction(func)) { + throw new TypeError; + } + if (isPartial && !partialArgs.length) { + bitmask &= ~16; + isPartial = partialArgs = false; + } + if (isPartialRight && !partialRightArgs.length) { + bitmask &= ~32; + isPartialRight = partialRightArgs = false; + } + var bindData = func && func.__bindData__; + if (bindData && bindData !== true) { + // clone `bindData` + bindData = slice(bindData); + if (bindData[2]) { + bindData[2] = slice(bindData[2]); + } + if (bindData[3]) { + bindData[3] = slice(bindData[3]); + } + // set `thisBinding` is not previously bound + if (isBind && !(bindData[1] & 1)) { + bindData[4] = thisArg; + } + // set if previously bound but not currently (subsequent curried functions) + if (!isBind && bindData[1] & 1) { + bitmask |= 8; + } + // set curried arity if not yet set + if (isCurry && !(bindData[1] & 4)) { + bindData[5] = arity; + } + // append partial left arguments + if (isPartial) { + push.apply(bindData[2] || (bindData[2] = []), partialArgs); + } + // append partial right arguments + if (isPartialRight) { + unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs); + } + // merge flags + bindData[1] |= bitmask; + return createWrapper.apply(null, bindData); + } + // fast path for `_.bind` + var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {...Object} [options] The compile options object(s). + * @param {string} [options.array] Code to determine if the iterable is an array or array-like. + * @param {boolean} [options.useHas] Specify using `hasOwnProperty` checks in the object loop. + * @param {Function} [options.keys] A reference to `_.keys` for use in own property iteration. + * @param {string} [options.args] A comma separated string of iteration function arguments. + * @param {string} [options.top] Code to execute before the iteration branches. + * @param {string} [options.loop] Code to execute in the object loop. + * @param {string} [options.bottom] Code to execute after the iteration branches. + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + // data properties + iteratorData.shadowedProps = shadowedProps; + + // iterator options + iteratorData.array = iteratorData.bottom = iteratorData.loop = iteratorData.top = ''; + iteratorData.init = 'iterable'; + iteratorData.useHas = true; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + iteratorData[key] = object[key]; + } + } + var args = iteratorData.args; + iteratorData.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'baseCreateCallback, errorClass, errorProto, hasOwnProperty, ' + + 'indicatorObject, isArguments, isArray, isString, keys, objectProto, ' + + 'objectTypes, nonEnumProps, stringClass, stringProto, toString', + 'return function(' + args + ') {\n' + iteratorTemplate(iteratorData) + '\n}' + ); + + // return the compiled function + return factory( + baseCreateCallback, errorClass, errorProto, hasOwnProperty, + indicatorObject, isArguments, isArray, isString, iteratorData.keys, objectProto, + objectTypes, nonEnumProps, stringClass, stringProto, toString + ); + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized, this method returns the custom method, otherwise it returns + * the `baseIndexOf` function. + * + * @private + * @returns {Function} Returns the "indexOf" function. + */ + function getIndexOf() { + var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; + return result; + } + + /** + * Checks if `value` is a native function. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. + */ + function isNative(value) { + return typeof value == 'function' && reNative.test(value); + } + + /** + * Sets `this` binding data on a given function. + * + * @private + * @param {Function} func The function to set data on. + * @param {Array} value The data array to set. + */ + var setBindData = !defineProperty ? noop : function(func, value) { + descriptor.value = value; + defineProperty(func, '__bindData__', descriptor); + }; + + /** + * A fallback implementation of `isPlainObject` which checks if a given value + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + var ctor, + result; + + // avoid non Object objects, `arguments` objects, and DOM elements + if (!(value && toString.call(value) == objectClass) || + (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor)) || + (!support.argsClass && isArguments(value)) || + (!support.nodeClass && isNode(value))) { + return false; + } + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (support.ownLast) { + forIn(value, function(value, key, object) { + result = hasOwnProperty.call(object, key); + return false; + }); + return result !== false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return typeof result == 'undefined' || hasOwnProperty.call(value, result); + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {string} match The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass || false; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (!support.argsClass) { + isArguments = function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; + }; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass || false; + }; + + /** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ + var shimKeys = createIterator({ + 'args': 'object', + 'init': '[]', + 'top': 'if (!(objectTypes[typeof object])) return result', + 'loop': 'result.push(index)' + }); + + /** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + if ((support.enumPrototypes && typeof object == 'function') || + (support.nonEnumArgs && object.length && isArguments(object))) { + return shimKeys(object); + } + return nativeKeys(object); + }; + + /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ + var eachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)", + 'array': "typeof length == 'number'", + 'keys': keys, + 'loop': 'if (callback(iterable[index], index, collection) === false) return result' + }; + + /** Reusable iterator options for `assign` and `defaults` */ + var defaultsIteratorOptions = { + 'args': 'object, source, guard', + 'top': + 'var args = arguments,\n' + + ' argsIndex = 0,\n' + + " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + + 'while (++argsIndex < argsLength) {\n' + + ' iterable = args[argsIndex];\n' + + ' if (iterable && objectTypes[typeof iterable]) {', + 'keys': keys, + 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", + 'bottom': ' }\n}' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'array': false + }; + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), + reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); + + /** + * A function compiled to iterate `arguments` objects, arrays, objects, and + * strings consistenly across environments, executing the callback for each + * element in the collection. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index|key, collection). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @private + * @type Function + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + */ + var baseEach = createIterator(eachIteratorOptions); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite property assignments of previous + * sources. If a callback is provided it will be executed to produce the + * assigned values. The callback is bound to `thisArg` and invoked with two + * arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var object = { 'name': 'barney' }; + * defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var assign = createIterator(defaultsIteratorOptions, { + 'top': + defaultsIteratorOptions.top.replace(';', + ';\n' + + "if (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]' + }); + + /** + * Creates a clone of `value`. If `isDeep` is `true` nested objects will also + * be cloned, otherwise they will be assigned by reference. If a callback + * is provided it will be executed to produce the cloned values. If the + * callback returns `undefined` cloning will be handled by the method instead. + * The callback is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var shallow = _.clone(characters); + * shallow[0] === characters[0]; + * // => true + * + * var deep = _.clone(characters, true); + * deep[0] === characters[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, isDeep, callback, thisArg) { + // allows working with "Collections" methods without using their `index` + // and `collection` arguments for `isDeep` and `callback` + if (typeof isDeep != 'boolean' && isDeep != null) { + thisArg = callback; + callback = isDeep; + isDeep = false; + } + return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates a deep clone of `value`. If a callback is provided it will be + * executed to produce the cloned values. If the callback returns `undefined` + * cloning will be handled by the method instead. The callback is bound to + * `thisArg` and invoked with one argument; (value). + * + * Note: This method is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var deep = _.cloneDeep(characters); + * deep[0] === characters[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : undefined; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? assign(result, properties) : result; + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var object = { 'name': 'barney' }; + * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var defaults = createIterator(defaultsIteratorOptions); + + /** + * This method is like `_.findIndex` except that it returns the key of the + * first element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': false }, + * 'fred': { 'age': 40, 'blocked': true }, + * 'pebbles': { 'age': 1, 'blocked': false } + * }; + * + * _.findKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => 'barney' (property order is not guaranteed across environments) + * + * // using "_.where" callback shorthand + * _.findKey(characters, { 'age': 1 }); + * // => 'pebbles' + * + * // using "_.pluck" callback shorthand + * _.findKey(characters, 'blocked'); + * // => 'fred' + */ + function findKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwn(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * This method is like `_.findKey` except that it iterates over elements + * of a `collection` in the opposite order. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': true }, + * 'fred': { 'age': 40, 'blocked': false }, + * 'pebbles': { 'age': 1, 'blocked': true } + * }; + * + * _.findLastKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => returns `pebbles`, assuming `_.findKey` returns `barney` + * + * // using "_.where" callback shorthand + * _.findLastKey(characters, { 'age': 40 }); + * // => 'fred' + * + * // using "_.pluck" callback shorthand + * _.findLastKey(characters, 'blocked'); + * // => 'pebbles' + */ + function findLastKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwnRight(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * Iterates over own and inherited enumerable properties of an object, + * executing the callback for each property. The callback is bound to `thisArg` + * and invoked with three arguments; (value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forIn(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) + */ + var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * This method is like `_.forIn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forInRight(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move' + */ + function forInRight(object, callback, thisArg) { + var pairs = []; + + forIn(object, function(value, key) { + pairs.push(key, value); + }); + + var length = pairs.length; + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + if (callback(pairs[length--], pairs[length], object) === false) { + break; + } + } + return object; + } + + /** + * Iterates over own enumerable properties of an object, executing the callback + * for each property. The callback is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) + */ + var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + + /** + * This method is like `_.forOwn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' + */ + function forOwnRight(object, callback, thisArg) { + var props = keys(object), + length = props.length; + + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + var key = props[length]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } + + /** + * Creates a sorted array of property names of all enumerable properties, + * own and inherited, of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified property name exists as a direct property of `object`, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to check. + * @returns {boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, key) { + return object ? hasOwnProperty.call(object, key) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'fred', 'second': 'barney' }); + * // => { 'fred': 'first', 'barney': 'second' } + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass || false; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value && typeof value == 'object' && toString.call(value) == dateClass || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value && value.nodeType === 1 || false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + (support.argsClass ? className == argsClass : isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If a callback is provided it will be executed + * to compare values. If the callback returns `undefined` comparisons will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var copy = { 'name': 'fred' }; + * + * object == copy; + * // => false + * + * _.isEqual(object, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg) { + return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2)); + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite` which will return true for + * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN` which will return `true` for + * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || + value && typeof value == 'object' && toString.call(value) == numberClass || false; + } + + /** + * Checks if `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * _.isPlainObject(new Shape); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { + return false; + } + var valueOf = value.valueOf, + objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/fred/); + * // => true + */ + function isRegExp(value) { + return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('fred'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || + value && typeof value == 'object' && toString.call(value) == stringClass || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new object with values of the results of each `callback` execution. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + * + * var characters = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // using "_.pluck" callback shorthand + * _.mapValues(characters, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } + */ + function mapValues(object, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + forOwn(object, function(value, key, object) { + result[key] = callback(value, key, object); + }); + return result; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * will overwrite property assignments of previous sources. If a callback is + * provided it will be executed to produce the merged values of the destination + * and source properties. If the callback returns `undefined` merging will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'characters': [ + * { 'name': 'barney' }, + * { 'name': 'fred' } + * ] + * }; + * + * var ages = { + * 'characters': [ + * { 'age': 36 }, + * { 'age': 40 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object) { + var args = arguments, + length = 2; + + if (!isObject(object)) { + return object; + } + // allows working with `_.reduce` and `_.reduceRight` without using + // their `index` and `collection` arguments + if (typeof args[2] != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + var callback = baseCreateCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + var sources = slice(arguments, 1, length), + index = -1, + stackA = getArray(), + stackB = getArray(); + + while (++index < length) { + baseMerge(object, sources[index], callback, stackA, stackB); + } + releaseArray(stackA); + releaseArray(stackB); + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` omitting the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The properties to omit or the + * function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'fred', 'age': 40 }, 'age'); + * // => { 'name': 'fred' } + * + * _.omit({ 'name': 'fred', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'fred' } + */ + function omit(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var props = []; + forIn(object, function(value, key) { + props.push(key); + }); + props = baseDifference(props, baseFlatten(arguments, true, false, 1)); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + result[key] = object[key]; + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (!callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates a two dimensional array of an object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` picking the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The function called per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name'); + * // => { 'name': 'fred' } + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'fred' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = -1, + props = baseFlatten(arguments, true, false, 1), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * An alternative to `_.reduce` this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable properties through a callback, with each callback execution + * potentially mutating the `accumulator` object. The callback is bound to + * `thisArg` and invoked with four arguments; (accumulator, value, key, object). + * Callbacks may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { + * num *= num; + * if (num % 2) { + * return result.push(num) < 3; + * } + * }); + * // => [1, 9, 25] + * + * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function transform(object, callback, accumulator, thisArg) { + var isArr = isArray(object); + if (accumulator == null) { + if (isArr) { + accumulator = []; + } else { + var ctor = object && object.constructor, + proto = ctor && ctor.prototype; + + accumulator = baseCreate(proto); + } + } + if (callback) { + callback = lodash.createCallback(callback, thisArg, 4); + (isArr ? baseEach : forOwn)(object, function(value, index, object) { + return callback(accumulator, value, index, object); + }); + } + return accumulator; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] (property order is not guaranteed across environments) + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [index] The indexes of `collection` + * to retrieve, specified as individual indexes or arrays of indexes. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['fred', 'barney', 'pebbles'], 0, 2); + * // => ['fred', 'pebbles'] + */ + function at(collection) { + var args = arguments, + index = -1, + props = baseFlatten(args, true, false, 1), + length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length, + result = Array(length); + + if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given value is present in a collection using strict equality + * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the + * offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {*} target The value to check for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.contains('pebbles', 'eb'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + indexOf = getIndexOf(), + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (isArray(collection)) { + result = indexOf(collection, target, fromIndex) > -1; + } else if (typeof length == 'number') { + result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1; + } else { + baseEach(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through the callback. The corresponding value + * of each key is the number of times the key was returned by the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + + /** + * Checks if the given callback returns truey value for **all** elements of + * a collection. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if all elements passed the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes']); + * // => false + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(characters, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(characters, { 'age': 36 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning an array of all elements + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(characters, 'blocked'); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + * + * // using "_.where" callback shorthand + * _.filter(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning the first element that + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect, findWhere + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.find(characters, function(chr) { + * return chr.age < 40; + * }); + * // => { 'name': 'barney', 'age': 36, 'blocked': false } + * + * // using "_.where" callback shorthand + * _.find(characters, { 'age': 1 }); + * // => { 'name': 'pebbles', 'age': 1, 'blocked': false } + * + * // using "_.pluck" callback shorthand + * _.find(characters, 'blocked'); + * // => { 'name': 'fred', 'age': 40, 'blocked': true } + */ + function find(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + return value; + } + } + } else { + var result; + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + } + + /** + * This method is like `_.find` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(num) { + * return num % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forEachRight(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over elements of a collection, executing the callback for each + * element. The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * Note: As with other "Collections" methods, objects with a `length` property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); + * // => logs each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + * // => logs each number and returns the object (property order is not guaranteed across environments) + */ + function forEach(collection, callback, thisArg) { + if (callback && typeof thisArg == 'undefined' && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + baseEach(collection, callback, thisArg); + } + return collection; + } + + /** + * This method is like `_.forEach` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); + * // => logs each number from right to left and returns '3,2,1' + */ + function forEachRight(collection, callback, thisArg) { + var iterable = collection, + length = collection ? collection.length : 0; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (length--) { + if (callback(collection[length], length, collection) === false) { + break; + } + } + } else { + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (support.unindexedChars && isString(collection)) { + iterable = collection.split(''); + } + baseEach(collection, function(value, key, collection) { + key = props ? props[--length] : --length; + return callback(iterable[key], key, collection); + }); + } + return collection; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of a collection through the callback. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of the collection through the given callback. The corresponding + * value of each key is the last element responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keys = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keys, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method named by `methodName` on each element in the `collection` + * returning an array of the results of each invoked method. Additional arguments + * will be provided to each invoked method. If `methodName` is a function it + * will be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|string} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {...*} [arg] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the collection + * through the callback. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (property order is not guaranteed across environments) + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(characters, 'name'); + * // => ['barney', 'fred'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = lodash.createCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of a collection. If the collection is empty or + * falsey `-Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.max(characters, function(chr) { return chr.age; }); + * // => { 'name': 'fred', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.max(characters, 'age'); + * // => { 'name': 'fred', 'age': 40 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of a collection. If the collection is empty or + * falsey `Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.min(characters, function(chr) { return chr.age; }); + * // => { 'name': 'barney', 'age': 36 }; + * + * // using "_.pluck" callback shorthand + * _.min(characters, 'age'); + * // => { 'name': 'barney', 'age': 36 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the collection. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {string} property The name of the property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.pluck(characters, 'name'); + * // => ['barney', 'fred'] + */ + var pluck = map; + + /** + * Reduces a collection to a value which is the accumulated result of running + * each element in the collection through the callback, where each successive + * callback execution consumes the return value of the previous execution. If + * `accumulator` is not provided the first element of the collection will be + * used as the initial `accumulator` value. The callback is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + baseEach(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is like `_.reduce` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + forEachRight(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter` this method returns the elements of a + * collection that the callback does **not** return truey for. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that failed the callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(characters, 'blocked'); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + * + * // using "_.where" callback shorthand + * _.reject(characters, { 'age': 36 }); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + */ + function reject(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Retrieves a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Allows working with functions like `_.map` + * without using their `index` arguments as `n`. + * @returns {Array} Returns the random sample(s) of `collection`. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + if (collection && typeof collection.length != 'number') { + collection = values(collection); + } else if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + if (n == null || guard) { + return collection ? collection[baseRandom(0, collection.length - 1)] : undefined; + } + var result = shuffle(collection); + result.length = nativeMin(nativeMax(0, n), result.length); + return result; + } + + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates + * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = baseRandom(0, ++index); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the callback returns a truey value for **any** element of a + * collection. The function returns as soon as it finds a passing value and + * does not iterate over the entire collection. The callback is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if any element passed the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(characters, 'blocked'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(characters, { 'age': 1 }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through the callback. This method + * performs a stable sort, that is, it will preserve the original sort order + * of equal elements. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an array of property names is provided for `callback` the collection + * will be sorted by each property value. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 26 }, + * { 'name': 'fred', 'age': 30 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(_.sortBy(characters, 'age'), _.values); + * // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]] + * + * // sorting by multiple properties + * _.map(_.sortBy(characters, ['name', 'age']), _.values); + * // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + isArr = isArray(callback), + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + if (!isArr) { + callback = lodash.createCallback(callback, thisArg, 3); + } + forEach(collection, function(value, key, collection) { + var object = result[++index] = getObject(); + if (isArr) { + object.criteria = map(callback, function(key) { return value[key]; }); + } else { + (object.criteria = getArray())[0] = callback(value, key, collection); + } + object.index = index; + object.value = value; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + var object = result[length]; + result[length] = object.value; + if (!isArr) { + releaseArray(object.criteria); + } + releaseObject(object); + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return (support.unindexedChars && isString(collection)) + ? collection.split('') + : slice(collection); + } + return values(collection); + } + + /** + * Performs a deep comparison of each element in a `collection` to the given + * `properties` object, returning an array of all elements that have equivalent + * property values. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} props The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given properties. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.where(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }] + * + * _.where(characters, { 'pets': ['dino'] }); + * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array excluding all values of the provided arrays using strict + * equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {...Array} [values] The arrays of values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + return baseDifference(array, baseFlatten(arguments, true, true, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.findIndex(characters, function(chr) { + * return chr.age < 20; + * }); + * // => 2 + * + * // using "_.where" callback shorthand + * _.findIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findIndex(characters, 'blocked'); + * // => 1 + */ + function findIndex(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + if (callback(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of a `collection` from right to left. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': true }, + * { 'name': 'fred', 'age': 40, 'blocked': false }, + * { 'name': 'pebbles', 'age': 1, 'blocked': true } + * ]; + * + * _.findLastIndex(characters, function(chr) { + * return chr.age > 30; + * }); + * // => 1 + * + * // using "_.where" callback shorthand + * _.findLastIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findLastIndex(characters, 'blocked'); + * // => 2 + */ + function findLastIndex(array, callback, thisArg) { + var length = array ? array.length : 0; + callback = lodash.createCallback(callback, thisArg, 3); + while (length--) { + if (callback(array[length], length, array)) { + return length; + } + } + return -1; + } + + /** + * Gets the first element or first `n` elements of an array. If a callback + * is provided elements at the beginning of the array are returned as long + * as the callback returns truey. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); + * // => ['barney', 'fred'] + */ + function first(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[0] : undefined; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `isShallow` + * is truey, the array will only be flattened a single level. If a callback + * is provided each element of the array is passed through the callback before + * flattening. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + * + * var characters = [ + * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * // using "_.pluck" callback shorthand + * _.flatten(characters, 'pets'); + * // => ['hoppy', 'baby puss', 'dino'] + */ + function flatten(array, isShallow, callback, thisArg) { + // juggle arguments + if (typeof isShallow != 'boolean' && isShallow != null) { + thisArg = callback; + callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow; + isShallow = false; + } + if (callback != null) { + array = map(array, callback, thisArg); + } + return baseFlatten(array, isShallow); + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the array is already sorted + * providing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + if (typeof fromIndex == 'number') { + var length = array ? array.length : 0; + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); + } else if (fromIndex) { + var index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element or last `n` elements of an array. If a + * callback is provided elements at the end of the array are excluded from + * the result as long as the callback returns truey. The callback is bound + * to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); + * // => ['barney', 'fred'] + */ + function initial(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Creates an array of unique values present in all provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of shared values. + * @example + * + * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2] + */ + function intersection() { + var args = [], + argsIndex = -1, + argsLength = arguments.length, + caches = getArray(), + indexOf = getIndexOf(), + trustIndexOf = indexOf === baseIndexOf, + seen = getArray(); + + while (++argsIndex < argsLength) { + var value = arguments[argsIndex]; + if (isArray(value) || isArguments(value)) { + args.push(value); + caches.push(trustIndexOf && value.length >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen)); + } + } + var array = args[0], + index = -1, + length = array ? array.length : 0, + result = []; + + outer: + while (++index < length) { + var cache = caches[0]; + value = array[index]; + + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); + while (--argsIndex) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { + continue outer; + } + } + result.push(value); + } + } + while (argsLength--) { + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } + } + releaseArray(caches); + releaseArray(seen); + return result; + } + + /** + * Gets the last element or last `n` elements of an array. If a callback is + * provided elements at the end of the array are returned as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.last(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.last(characters, { 'employer': 'na' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function last(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[length - 1] : undefined; + } + } + return slice(array, nativeMax(0, length - n)); + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all provided values from the given array using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {...*} [value] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + function pull(array) { + var args = arguments, + argsIndex = 0, + argsLength = args.length, + length = array ? array.length : 0; + + while (++argsIndex < argsLength) { + var index = -1, + value = args[argsIndex]; + while (++index < length) { + if (array[index] === value) { + splice.call(array, index--, 1); + length--; + } + } + } + return array; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. If `start` is less than `stop` a + * zero-length range is created unless a negative `step` is specified. + * + * @static + * @memberOf _ + * @category Arrays + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = typeof step == 'number' ? step : (+step || 1); + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so engines like Chakra and V8 avoid slower modes + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / (step || 1))), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * Removes all elements from an array that the callback returns truey for + * and returns an array of removed elements. The callback is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4, 5, 6]; + * var evens = _.remove(array, function(num) { return num % 2 == 0; }); + * + * console.log(array); + * // => [1, 3, 5] + * + * console.log(evens); + * // => [2, 4, 6] + */ + function remove(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = []; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + var value = array[index]; + if (callback(value, index, array)) { + result.push(value); + splice.call(array, index--, 1); + length--; + } + } + return result; + } + + /** + * The opposite of `_.initial` this method gets all but the first element or + * first `n` elements of an array. If a callback function is provided elements + * at the beginning of the array are excluded from the result as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.rest(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.rest(characters, { 'employer': 'slate' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which a value + * should be inserted into a given sorted array in order to maintain the sort + * order of the array. If a callback is provided it will be executed for + * `value` and each element of `array` to compute their sort ranking. The + * callback is bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + (callback(array[mid]) < value) + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Creates an array of unique values, in order, of the provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of combined values. + * @example + * + * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2, 3, 5, 4] + */ + function union() { + return baseUniq(baseFlatten(arguments, true, true)); + } + + /** + * Creates a duplicate-value-free version of an array using strict equality + * for comparisons, i.e. `===`. If the array is sorted, providing + * `true` for `isSorted` will use a faster algorithm. If a callback is provided + * each element of `array` is passed through the callback before uniqueness + * is computed. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); + * // => ['A', 'b', 'C'] + * + * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2.5, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + // juggle arguments + if (typeof isSorted != 'boolean' && isSorted != null) { + thisArg = callback; + callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted; + isSorted = false; + } + if (callback != null) { + callback = lodash.createCallback(callback, thisArg, 3); + } + return baseUniq(array, isSorted, callback); + } + + /** + * Creates an array excluding all provided values using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {...*} [value] The values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + return baseDifference(array, slice(arguments, 1)); + } + + /** + * Creates an array that is the symmetric difference of the provided arrays. + * See http://en.wikipedia.org/wiki/Symmetric_difference. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of values. + * @example + * + * _.xor([1, 2, 3], [5, 2, 1, 4]); + * // => [3, 5, 4] + * + * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); + * // => [1, 4, 5] + */ + function xor() { + var index = -1, + length = arguments.length; + + while (++index < length) { + var array = arguments[index]; + if (isArray(array) || isArguments(array)) { + var result = result + ? baseUniq(baseDifference(result, array).concat(baseDifference(array, result))) + : array; + } + } + return result || []; + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second + * elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @alias unzip + * @category Arrays + * @param {...Array} [array] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + function zip() { + var array = arguments.length > 1 ? arguments : arguments[0], + index = -1, + length = array ? max(pluck(array, 'length')) : 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = pluck(array, index); + } + return result; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Provide + * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` + * or two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @alias object + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */ + function zipObject(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + if (!values && length && !isArray(keys[0])) { + values = []; + } + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that executes `func`, with the `this` binding and + * arguments of the created function, only after being called `n` times. + * + * @static + * @memberOf _ + * @category Functions + * @param {number} n The number of times the function must be called before + * `func` is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('Done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'Done saving!', after all saves have completed + */ + function after(n, func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * provided to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'fred' }, 'hi'); + * func(); + * // => 'hi fred' + */ + function bind(func, thisArg) { + return arguments.length > 2 + ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) + : createWrapper(func, 1, null, null, thisArg); + } + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all the function properties + * of `object` will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...string} [methodName] The object method names to + * bind, specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { console.log('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), + index = -1, + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = createWrapper(object[key], 1, null, null, object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those provided to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {string} key The key of the method. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'fred', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi fred' + * + * object.greet = function(greeting) { + * return greeting + 'ya ' + this.name + '!'; + * }; + * + * func(); + * // => 'hiya fred!' + */ + function bindKey(object, key) { + return arguments.length > 2 + ? createWrapper(key, 19, slice(arguments, 2), null, object) + : createWrapper(key, 3, null, null, object); + } + + /** + * Creates a function that is the composition of the provided functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {...Function} [func] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var realNameMap = { + * 'pebbles': 'penelope' + * }; + * + * var format = function(name) { + * name = realNameMap[name.toLowerCase()] || name; + * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); + * }; + * + * var greet = function(formatted) { + * return 'Hiya ' + formatted + '!'; + * }; + * + * var welcome = _.compose(greet, format); + * welcome('pebbles'); + * // => 'Hiya Penelope!' + */ + function compose() { + var funcs = arguments, + length = funcs.length; + + while (length--) { + if (!isFunction(funcs[length])) { + throw new TypeError; + } + } + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function which accepts one or more arguments of `func` that when + * invoked either executes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` can be specified + * if `func.length` is not sufficient. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @returns {Function} Returns the new curried function. + * @example + * + * var curried = _.curry(function(a, b, c) { + * console.log(a + b + c); + * }); + * + * curried(1)(2)(3); + * // => 6 + * + * curried(1, 2)(3); + * // => 6 + * + * curried(1, 2, 3); + * // => 6 + */ + function curry(func, arity) { + arity = typeof arity == 'number' ? arity : (+arity || func.length); + return createWrapper(func, 4, null, null, null, arity); + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. + * Provide an options object to indicate that `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. Subsequent calls + * to the debounced function will return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {number} wait The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * var lazyLayout = _.debounce(calculateLayout, 150); + * jQuery(window).on('resize', lazyLayout); + * + * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * }); + * + * // ensure `batchLog` is executed once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * source.addEventListener('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * }, false); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + wait = nativeMax(0, wait) || 0; + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = options.leading; + maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); + trailing = 'trailing' in options ? options.trailing : trailing; + } + var delayed = function() { + var remaining = wait - (now() - stamp); + if (remaining <= 0) { + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + var isCalled = trailingCall; + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + } else { + timeoutId = setTimeout(delayed, remaining); + } + }; + + var maxDelayed = function() { + if (timeoutId) { + clearTimeout(timeoutId); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (trailing || (maxWait !== wait)) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + }; + + return function() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + return result; + }; + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { console.log(text); }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */ + function defer(func) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay execution. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { console.log(text); }, 1000, 'later'); + * // => logs 'later' after one second + */ + function delay(func, wait) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it will be used to determine the cache key for storing the result + * based on the arguments provided to the memoized function. By default, the + * first argument provided to the memoized function is used as the cache key. + * The `func` is executed with the `this` binding of the memoized function. + * The result cache is exposed as the `cache` property on the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + * + * fibonacci(9) + * // => 34 + * + * var data = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // modifying the result cache + * var get = _.memoize(function(name) { return data[name]; }, _.identity); + * get('pebbles'); + * // => { 'name': 'pebbles', 'age': 1 } + * + * get.cache.pebbles.name = 'penelope'; + * get('pebbles'); + * // => { 'name': 'penelope', 'age': 1 } + */ + function memoize(func, resolver) { + if (!isFunction(func)) { + throw new TypeError; + } + var memoized = function() { + var cache = memoized.cache, + key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + } + memoized.cache = {}; + return memoized; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those provided to the new function. This + * method is similar to `_.bind` except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('fred'); + * // => 'hi fred' + */ + function partial(func) { + return createWrapper(func, 16, slice(arguments, 1)); + } + + /** + * This method is like `_.partial` except that `partial` arguments are + * appended to those provided to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createWrapper(func, 32, null, slice(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` function + * at most once per every `wait` milliseconds. Provide an options object to + * indicate that `func` should be invoked on the leading and/or trailing edge + * of the `wait` timeout. Subsequent calls to the throttled function will + * return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {number} wait The number of milliseconds to throttle executions to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + * + * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? options.leading : leading; + trailing = 'trailing' in options ? options.trailing : trailing; + } + debounceOptions.leading = leading; + debounceOptions.maxWait = wait; + debounceOptions.trailing = trailing; + + return debounce(func, wait, debounceOptions); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Additional arguments provided to the function are appended + * to those provided to the wrapper function. The wrapper is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

    ' + func(text) + '

    '; + * }); + * + * p('Fred, Wilma, & Pebbles'); + * // => '

    Fred, Wilma, & Pebbles

    ' + */ + function wrap(value, wrapper) { + return createWrapper(wrapper, 16, [value]); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'name': 'fred' }; + * var getter = _.constant(object); + * getter() === object; + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name the created callback will return the property value for a given element. + * If `func` is an object the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // wrap to create custom callback shorthands + * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { + * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); + * return !match ? func(callback, thisArg) : function(object) { + * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * }; + * }); + * + * _.filter(characters, 'age__gt38'); + * // => [{ 'name': 'fred', 'age': 40 }] + */ + function createCallback(func, thisArg, argCount) { + var type = typeof func; + if (func == null || type == 'function') { + return baseCreateCallback(func, thisArg, argCount); + } + // handle "_.pluck" style callback shorthands + if (type != 'object') { + return property(func); + } + var props = keys(func), + key = props[0], + a = func[key]; + + // handle "_.where" style callback shorthands + if (props.length == 1 && a === a && !isObject(a)) { + // fast path the common case of providing an object with a single + // property containing a primitive value + return function(object) { + var b = object[key]; + return a === b && (a !== 0 || (1 / a == 1 / b)); + }; + } + return function(object) { + var length = props.length, + result = false; + + while (length--) { + if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) { + break; + } + } + return result; + }; + } + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Fred, Wilma, & Pebbles'); + * // => 'Fred, Wilma, & Pebbles' + */ + function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'name': 'fred' }; + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds function properties of a source object to the destination object. + * If `object` is a function methods will be added to its prototype as well. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Function|Object} [object=lodash] object The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options] The options object. + * @param {boolean} [options.chain=true] Specify whether the functions added are chainable. + * @example + * + * function capitalize(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * + * _.mixin({ 'capitalize': capitalize }); + * _.capitalize('fred'); + * // => 'Fred' + * + * _('fred').capitalize().value(); + * // => 'Fred' + * + * _.mixin({ 'capitalize': capitalize }, { 'chain': false }); + * _('fred').capitalize(); + * // => 'Fred' + */ + function mixin(object, source, options) { + var chain = true, + methodNames = source && functions(source); + + if (!source || (!options && !methodNames.length)) { + if (options == null) { + options = source; + } + ctor = lodashWrapper; + source = object; + object = lodash; + methodNames = functions(source); + } + if (options === false) { + chain = false; + } else if (isObject(options) && 'chain' in options) { + chain = options.chain; + } + var ctor = object, + isFunc = isFunction(ctor); + + forEach(methodNames, function(methodName) { + var func = object[methodName] = source[methodName]; + if (isFunc) { + ctor.prototype[methodName] = function() { + var chainAll = this.__chain__, + value = this.__wrapped__, + args = [value]; + + push.apply(args, arguments); + var result = func.apply(object, args); + if (chain || chainAll) { + if (value === result && isObject(result)) { + return this; + } + result = new ctor(result); + result.__chain__ = chainAll; + } + return result; + }; + } + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + context._ = oldDash; + return this; + } + + /** + * A no-operation function. + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var object = { 'name': 'fred' }; + * _.noop(object) === undefined; + * // => true + */ + function noop() { + // no operation performed + } + + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var stamp = _.now(); + * _.defer(function() { console.log(_.now() - stamp); }); + * // => logs the number of milliseconds it took for the deferred function to be called + */ + var now = isNative(now = Date.now) && now || function() { + return new Date().getTime(); + }; + + /** + * Converts the given value into an integer of the specified radix. + * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the + * `value` is a hexadecimal, in which case a `radix` of `16` is used. + * + * Note: This method avoids differences in native ES3 and ES5 `parseInt` + * implementations. See http://es5.github.io/#E. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} value The value to parse. + * @param {number} [radix] The radix used to interpret the value to parse. + * @returns {number} Returns the new integer value. + * @example + * + * _.parseInt('08'); + * // => 8 + */ + var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) { + // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt` + return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0); + }; + + /** + * Creates a "_.pluck" style function, which returns the `key` value of a + * given object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} key The name of the property to retrieve. + * @returns {Function} Returns the new function. + * @example + * + * var characters = [ + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 36 } + * ]; + * + * var getName = _.property('name'); + * + * _.map(characters, getName); + * // => ['barney', 'fred'] + * + * _.sortBy(characters, getName); + * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] + */ + function property(key) { + return function(object) { + return object[key]; + }; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number will be + * returned. If `floating` is truey or either `min` or `max` are floats a + * floating-point number will be returned instead of an integer. + * + * @static + * @memberOf _ + * @category Utilities + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating=false] Specify returning a floating-point number. + * @returns {number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max, floating) { + var noMin = min == null, + noMax = max == null; + + if (floating == null) { + if (typeof min == 'boolean' && noMax) { + floating = min; + min = 1; + } + else if (!noMax && typeof max == 'boolean') { + floating = max; + noMax = true; + } + } + if (noMin && noMax) { + max = 1; + } + min = +min || 0; + if (noMax) { + max = min; + min = 0; + } else { + max = +max || 0; + } + if (floating || min % 1 || max % 1) { + var rand = nativeRandom(); + return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max); + } + return baseRandom(min, max); + } + + /** + * Resolves the value of property `key` on `object`. If `key` is a function + * it will be invoked with the `this` binding of `object` and its result returned, + * else the property value is returned. If `object` is falsey then `undefined` + * is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to resolve. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, key) { + if (object) { + var value = object[key]; + return isFunction(value) ? object[key]() : value; + } + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'fred' }); + * // => 'hello fred' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm i --save lodash\n\n{sudo} npm i -g lodash\nnpm ln lodash\n```\n\nIn [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n// or as Underscore\nvar _ = require('lodash/dist/lodash.underscore');\n```\n\n**Notes:**\n * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL\n * 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 project’s root directory *before* requiring it\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader:\n\n```js\nrequire({\n 'packages': [\n { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }\n ]\n},\n['lodash'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n", + "readmeFilename": "README.md", + "_id": "lodash@2.4.1", + "dist": { + "shasum": "5b7723034dda4d262e5a46fb2c58d7cc22f71420" + }, + "_from": "lodash@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/.npmignore new file mode 100644 index 0000000..38344f8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/README.md new file mode 100644 index 0000000..be97668 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/README.md @@ -0,0 +1,768 @@ +# readable-stream + +A new class of streams for Node.js + +This module provides the new Stream base classes introduced in Node +v0.10, for use in Node v0.8. You can use it to have programs that +have to work with node v0.8, while being forward-compatible for v0.10 +and beyond. When you drop support for v0.8, you can remove this +module, and only use the native streams. + +This is almost exactly the same codebase as appears in Node v0.10. +However: + +1. The exported object is actually the Readable class. Decorating the + native `stream` module would be global pollution. +2. In v0.10, you can safely use `base64` as an argument to + `setEncoding` in Readable streams. However, in v0.8, the + StringDecoder class has no `end()` method, which is problematic for + Base64. So, don't use that, because it'll break and be weird. + +Other than that, the API is the same as `require('stream')` in v0.10, +so the API docs are reproduced below. + +---------- + + Stability: 2 - Unstable + +A stream is an abstract interface implemented by various objects in +Node. For example a request to an HTTP server is a stream, as is +stdout. Streams are readable, writable, or both. All streams are +instances of [EventEmitter][] + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for Readable streams, Writable +streams, Duplex streams, and Transform streams. + +## Compatibility + +In earlier versions of Node, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the `read()` method, `'data'` + events would start emitting immediately. If you needed to do some + I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The `pause()` method was advisory, rather than guaranteed. This + meant that you still had to be prepared to receive `'data'` events + even when the stream was in a paused state. + +In Node v0.10, the Readable class described below was added. For +backwards compatibility with older Node programs, Readable streams +switch into "old mode" when a `'data'` event handler is added, or when +the `pause()` or `resume()` methods are called. The effect is that, +even if you are not using the new `read()` method and `'readable'` +event, you no longer have to worry about losing `'data'` chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No `'data'` event handler is added. +* The `pause()` and `resume()` methods are never called. + +For example, consider the following code: + +```javascript +// WARNING! BROKEN! +net.createServer(function(socket) { + + // we add an 'end' method, but never consume the data + socket.on('end', function() { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of node prior to v0.10, the incoming message data would be +simply discarded. However, in Node v0.10 and beyond, the socket will +remain paused forever. + +The workaround in this situation is to call the `resume()` method to +trigger "old mode" behavior: + +```javascript +// Workaround +net.createServer(function(socket) { + + socket.on('end', function() { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into old-mode, pre-v0.10 +style streams can be wrapped in a Readable class using the `wrap()` +method. + +## Class: stream.Readable + + + +A `Readable Stream` has the following methods, members, and events. + +Note that `stream.Readable` is an abstract class designed to be +extended with an underlying implementation of the `_read(size)` +method. (See below.) + +### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default=16kb + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default=null + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that stream.read(n) returns + a single value instead of a Buffer of size n + +In classes that extend the Readable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **This function should NOT be called directly.** It should be +implemented by child classes, and called by the internal Readable +class methods only. + +All Readable stream implementations must provide a `_read` method +to fetch data from the underlying resource. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +When data is available, put it into the read queue by calling +`readable.push(chunk)`. If `push` returns false, then you should stop +reading. When `_read` is called again, you should start pushing more +data. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling `stream.push(chunk)`. + +### readable.push(chunk) + +* `chunk` {Buffer | null | String} Chunk of data to push into the read queue +* return {Boolean} Whether or not more pushes should be performed + +Note: **This function should be called by Readable implementors, NOT +by consumers of Readable subclasses.** The `_read()` function will not +be called again until at least one `push(chunk)` call is made. If no +data is available, then you MAY call `push('')` (an empty string) to +allow a future `_read` call, without adding any data to the queue. + +The `Readable` class works by putting data into a read queue to be +pulled out later by calling the `read()` method when the `'readable'` +event fires. + +The `push()` method will explicitly insert some data into the read +queue. If it is called with `null` then it will signal the end of the +data. + +In some cases, you may be wrapping a lower-level source which has some +sort of pause/resume mechanism, and a data callback. In those cases, +you could wrap the low-level source object by doing something like +this: + +```javascript +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +var stream = new Readable(); + +source.ondata = function(chunk) { + // if push() returns false, then we need to stop reading from source + if (!stream.push(chunk)) + source.readStop(); +}; + +source.onend = function() { + stream.push(null); +}; + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +stream._read = function(n) { + source.readStart(); +}; +``` + +### readable.unshift(chunk) + +* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue +* return {Boolean} Whether or not more pushes should be performed + +This is the corollary of `readable.push(chunk)`. Rather than putting +the data at the *end* of the read queue, it puts it at the *front* of +the read queue. + +This is useful in certain use-cases where a stream is being consumed +by a parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source. + +```javascript +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// Note: This can be done more simply as a Transform stream. See below. + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', function() { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', function() { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype = Object.create( + Readable.prototype, { constructor: { value: SimpleProtocol }}); + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +If you are using an older Node library that emits `'data'` events and +has a `pause()` method that is advisory only, then you can use the +`wrap()` method to create a Readable stream that uses the old stream +as its data source. + +For example: + +```javascript +var OldReader = require('./old-api-module.js').OldReader; +var oreader = new OldReader; +var Readable = require('stream').Readable; +var myReader = new Readable().wrap(oreader); + +myReader.on('readable', function() { + myReader.read(); // etc. +}); +``` + +### Event: 'readable' + +When there is data ready to be consumed, this event will fire. + +When this event emits, call the `read()` method to consume the data. + +### Event: 'end' + +Emitted when the stream has received an EOF (FIN in TCP terminology). +Indicates that no more `'data'` events will happen. If the stream is +also writable, it may be possible to continue writing. + +### Event: 'data' + +The `'data'` event emits either a `Buffer` (by default) or a string if +`setEncoding()` was used. + +Note that adding a `'data'` event listener will switch the Readable +stream into "old mode", where data is emitted as soon as it is +available, rather than waiting for you to call `read()` to consume it. + +### Event: 'error' + +Emitted if there was an error receiving data. + +### Event: 'close' + +Emitted when the underlying resource (for example, the backing file +descriptor) has been closed. Not all streams will emit this. + +### readable.setEncoding(encoding) + +Makes the `'data'` event emit a string instead of a `Buffer`. `encoding` +can be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`. + +The encoding can also be set by specifying an `encoding` field to the +constructor. + +### readable.read([size]) + +* `size` {Number | null} Optional number of bytes to read. +* Return: {Buffer | String | null} + +Note: **This function SHOULD be called by Readable stream users.** + +Call this method to consume data once the `'readable'` event is +emitted. + +The `size` argument will set a minimum number of bytes that you are +interested in. If not set, then the entire content of the internal +buffer is returned. + +If there is no data to consume, or if there are fewer bytes in the +internal buffer than the `size` argument, then `null` is returned, and +a future `'readable'` event will be emitted when more is available. + +Calling `stream.read(0)` will always return `null`, and will trigger a +refresh of the internal buffer, but otherwise be a no-op. + +### readable.pipe(destination, [options]) + +* `destination` {Writable Stream} +* `options` {Object} Optional + * `end` {Boolean} Default=true + +Connects this readable stream to `destination` WriteStream. Incoming +data on this stream gets written to `destination`. Properly manages +back-pressure so that a slow destination will not be overwhelmed by a +fast readable stream. + +This function returns the `destination` stream. + +For example, emulating the Unix `cat` command: + + process.stdin.pipe(process.stdout); + +By default `end()` is called on the destination when the source stream +emits `end`, so that `destination` is no longer writable. Pass `{ end: +false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + + reader.pipe(writer, { end: false }); + reader.on("end", function() { + writer.end("Goodbye\n"); + }); + +Note that `process.stderr` and `process.stdout` are never closed until +the process exits, regardless of the specified options. + +### readable.unpipe([destination]) + +* `destination` {Writable Stream} Optional + +Undo a previously established `pipe()`. If no destination is +provided, then all previously established pipes are removed. + +### readable.pause() + +Switches the readable stream into "old mode", where data is emitted +using a `'data'` event rather than being buffered for consumption via +the `read()` method. + +Ceases the flow of data. No `'data'` events are emitted while the +stream is in a paused state. + +### readable.resume() + +Switches the readable stream into "old mode", where data is emitted +using a `'data'` event rather than being buffered for consumption via +the `read()` method. + +Resumes the incoming `'data'` events after a `pause()`. + + +## Class: stream.Writable + + + +A `Writable` Stream has the following methods, members, and events. + +Note that `stream.Writable` is an abstract class designed to be +extended with an underlying implementation of the +`_write(chunk, encoding, cb)` method. (See below.) + +### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when `write()` starts + returning false. Default=16kb + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to `_write()`. Default=true + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be written. Will always + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. Ignore chunk is a buffer. Note that chunk will + **always** be a buffer unless the `decodeStrings` option is + explicitly set to `false`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a `_write` method to +send data to the underlying resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + + +### writable.write(chunk, [encoding], [callback]) + +* `chunk` {Buffer | String} Data to be written +* `encoding` {String} Optional. If `chunk` is a string, then encoding + defaults to `'utf8'` +* `callback` {Function} Optional. Called when this chunk is + successfully written. +* Returns {Boolean} + +Writes `chunk` to the stream. Returns `true` if the data has been +flushed to the underlying resource. Returns `false` to indicate that +the buffer is full, and the data will be sent out in the future. The +`'drain'` event will indicate when the buffer is empty again. + +The specifics of when `write()` will return false, is determined by +the `highWaterMark` option provided to the constructor. + +### writable.end([chunk], [encoding], [callback]) + +* `chunk` {Buffer | String} Optional final data to be written +* `encoding` {String} Optional. If `chunk` is a string, then encoding + defaults to `'utf8'` +* `callback` {Function} Optional. Called when the final chunk is + successfully written. + +Call this method to signal the end of the data being written to the +stream. + +### Event: 'drain' + +Emitted when the stream's write queue empties and it's safe to write +without buffering again. Listen for it when `stream.write()` returns +`false`. + +### Event: 'close' + +Emitted when the underlying resource (for example, the backing file +descriptor) has been closed. Not all streams will emit this. + +### Event: 'finish' + +When `end()` is called and there are no more chunks to write, this +event is emitted. + +### Event: 'pipe' + +* `source` {Readable Stream} + +Emitted when the stream is passed to a readable stream's pipe method. + +### Event 'unpipe' + +* `source` {Readable Stream} + +Emitted when a previously established `pipe()` is removed using the +source Readable stream's `unpipe()` method. + +## Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a +TCP socket connection. + +Note that `stream.Duplex` is an abstract class designed to be +extended with an underlying implementation of the `_read(size)` +and `_write(chunk, encoding, callback)` methods as you would with a Readable or +Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this +class prototypally inherits from Readable, and then parasitically from +Writable. It is thus up to the user to implement both the lowlevel +`_read(n)` method as well as the lowlevel `_write(chunk, encoding, cb)` method +on extension duplex classes. + +### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +## Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a zlib stream or a crypto +stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will either produce +much smaller or much larger than its input. + +Rather than implement the `_read()` and `_write()` methods, Transform +classes must implement the `_transform()` method, and may optionally +also implement the `_flush()` method. (See below.) + +### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be transformed. Will always + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. (Ignore if `decodeStrings` chunk is a buffer.) +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform` +method to accept input and produce output. + +`_transform` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush` method, which will be +called at the very end, after all the written data is consumed, but +before emitting `end` to signal the end of the readable side. Just +like with `_transform`, call `transform.push(chunk)` zero or more +times, as appropriate, and call `callback` when the flush operation is +complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +### Example: `SimpleProtocol` parser + +The example above of a simple protocol parser can be implemented much +more simply by using the higher level `Transform` stream class. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node stream +approach. + +```javascript +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype = Object.create( + Transform.prototype, { constructor: { value: SimpleProtocol }}); + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(b); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(b); + } + done(); +}; + +var parser = new SimpleProtocol(); +source.pipe(parser) + +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + + +## Class: stream.PassThrough + +This is a trivial implementation of a `Transform` stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy. + + +[EventEmitter]: events.html#events_class_events_eventemitter diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/duplex.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..ca807af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/float.patch b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/float.patch new file mode 100644 index 0000000..0ad71a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/float.patch @@ -0,0 +1,68 @@ +diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js +index c5a741c..a2e0d8e 100644 +--- a/lib/_stream_duplex.js ++++ b/lib/_stream_duplex.js +@@ -26,8 +26,8 @@ + + module.exports = Duplex; + var util = require('util'); +-var Readable = require('_stream_readable'); +-var Writable = require('_stream_writable'); ++var Readable = require('./_stream_readable'); ++var Writable = require('./_stream_writable'); + + util.inherits(Duplex, Readable); + +diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js +index a5e9864..330c247 100644 +--- a/lib/_stream_passthrough.js ++++ b/lib/_stream_passthrough.js +@@ -25,7 +25,7 @@ + + module.exports = PassThrough; + +-var Transform = require('_stream_transform'); ++var Transform = require('./_stream_transform'); + var util = require('util'); + util.inherits(PassThrough, Transform); + +diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js +index 2259d2e..e6681ee 100644 +--- a/lib/_stream_readable.js ++++ b/lib/_stream_readable.js +@@ -23,6 +23,9 @@ module.exports = Readable; + Readable.ReadableState = ReadableState; + + var EE = require('events').EventEmitter; ++if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { ++ return emitter.listeners(type).length; ++}; + var Stream = require('stream'); + var util = require('util'); + var StringDecoder; +diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js +index e925b4b..f08b05e 100644 +--- a/lib/_stream_transform.js ++++ b/lib/_stream_transform.js +@@ -64,7 +64,7 @@ + + module.exports = Transform; + +-var Duplex = require('_stream_duplex'); ++var Duplex = require('./_stream_duplex'); + var util = require('util'); + util.inherits(Transform, Duplex); + +diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js +index a26f711..56ca47d 100644 +--- a/lib/_stream_writable.js ++++ b/lib/_stream_writable.js +@@ -109,7 +109,7 @@ function WritableState(options, stream) { + function Writable(options) { + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. +- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex)) ++ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) + return new Writable(options); + + this._writableState = new WritableState(options, this); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..a2e0d8e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,69 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; +var util = require('util'); +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +Object.keys(Writable.prototype).forEach(function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..330c247 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,41 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); +var util = require('util'); +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..323f330 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,927 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +module.exports = Readable; +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +var Stream = require('stream'); +var util = require('util'); +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = false; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // In streams that never have any data, and do push(null) right away, + // the consumer can miss the 'end' event if they do some I/O before + // consuming the stream. So, we don't emit('end') until some reading + // happens. + this.calledRead = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (typeof chunk === 'string' && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null || chunk === undefined) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } + + if (state.needReadable) + emitReadable(stream); + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (isNaN(n) || n === null) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + var state = this._readableState; + state.calledRead = true; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + + // if we currently have less than the highWaterMark, then also read some + if (state.length - n <= state.highWaterMark) + doRead = true; + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) + doRead = false; + + if (doRead) { + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read called its callback synchronously, then `reading` + // will be false, and we need to re-evaluate how much data we + // can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we happened to read() exactly the remaining amount in the + // buffer, and the EOF has been seen at this point, then make sure + // that we emit 'end' on the very next tick. + if (state.ended && !state.endEmitted && state.length === 0) + endReadable(this); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode && + !er) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // if we've ended and we have some data left, then emit + // 'readable' now to make sure it gets picked up. + if (state.length > 0) + emitReadable(stream); + else + endReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (state.emittedReadable) + return; + + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); +} + +function emitReadable_(stream) { + stream.emit('readable'); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + if (readable !== src) return; + cleanup(); + } + + function onend() { + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (!dest._writableState || dest._writableState.needDrain) + ondrain(); + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (Array.isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + // the handler that waits for readable events after all + // the data gets sucked out in flow. + // This would be easier to follow with a .once() handler + // in flow(), but that is too slow. + this.on('readable', pipeOnReadable); + + state.flowing = true; + process.nextTick(function() { + flow(src); + }); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var dest = this; + var state = src._readableState; + state.awaitDrain--; + if (state.awaitDrain === 0) + flow(src); + }; +} + +function flow(src) { + var state = src._readableState; + var chunk; + state.awaitDrain = 0; + + function write(dest, i, list) { + var written = dest.write(chunk); + if (false === written) { + state.awaitDrain++; + } + } + + while (state.pipesCount && null !== (chunk = src.read())) { + + if (state.pipesCount === 1) + write(state.pipes, 0, null); + else + state.pipes.forEach(write); + + src.emit('data', chunk); + + // if anyone needs a drain, then we have to wait for that. + if (state.awaitDrain > 0) + return; + } + + // if every destination was unpiped, either before entering this + // function, or in the while loop, then stop flowing. + // + // NB: This is a pretty rare edge case. + if (state.pipesCount === 0) { + state.flowing = false; + + // if there were data event listeners added, then switch to old mode. + if (EE.listenerCount(src, 'data') > 0) + emitDataEvents(src); + return; + } + + // at this point, no one needed a drain, so we just ran out of data + // on the next readable event, start it over again. + state.ranOut = true; +} + +function pipeOnReadable() { + if (this._readableState.ranOut) { + this._readableState.ranOut = false; + flow(this); + } +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = state.pipes.indexOf(dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data' && !this._readableState.flowing) + emitDataEvents(this); + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + emitDataEvents(this); + this.read(0); + this.emit('resume'); +}; + +Readable.prototype.pause = function() { + emitDataEvents(this, true); + this.emit('pause'); +}; + +function emitDataEvents(stream, startPaused) { + var state = stream._readableState; + + if (state.flowing) { + // https://github.com/isaacs/readable-stream/issues/16 + throw new Error('Cannot switch to old mode now.'); + } + + var paused = startPaused || false; + var readable = false; + + // convert to an old-style stream. + stream.readable = true; + stream.pipe = Stream.prototype.pipe; + stream.on = stream.addListener = Stream.prototype.on; + + stream.on('readable', function() { + readable = true; + + var c; + while (!paused && (null !== (c = stream.read()))) + stream.emit('data', c); + + if (c === null) { + readable = false; + stream._readableState.needReadable = true; + } + }); + + stream.pause = function() { + paused = true; + this.emit('pause'); + }; + + stream.resume = function() { + paused = false; + if (readable) + process.nextTick(function() { + stream.emit('readable'); + }); + else + this.read(0); + this.emit('resume'); + }; + + // now make it start, just in case it hadn't already. + stream.emit('readable'); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + if (state.decoder) + chunk = state.decoder.write(chunk); + if (!chunk || !state.objectMode && !chunk.length) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (typeof stream[i] === 'function' && + typeof this[i] === 'undefined') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + events.forEach(function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted && state.calledRead) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..707e4b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,205 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); +var util = require('util'); +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + var ts = this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('finish', function() { + if ('function' === typeof this._flush) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var rs = stream._readableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..9eaf4ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,371 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; +Writable.WritableState = WritableState; + +var util = require('util'); +var assert = require('assert'); +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; +} + +function Writable(options) { + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) + ret = writeOrBuffer(this, state, chunk, encoding, cb); + + return ret; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + cb(er); + }); + else + cb(er); + + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && !state.bufferProcessing && state.buffer.length) + clearBuffer(stream, state); + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + cb(); + if (finished) + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + state.bufferProcessing = false; + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (typeof chunk !== 'undefined' && chunk !== null) + this.write(chunk, encoding); + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + state.finished = true; + stream.emit('finish'); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 0000000..206320c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 0000000..6de584a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 0000000..4d2aa00 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 0000000..2e44a03 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,200 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + this.charBuffer = new Buffer(6); + this.charReceived = 0; + this.charLength = 0; +}; + + +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + var offset = 0; + + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var i = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, offset, i); + this.charReceived += (i - offset); + offset = i; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (i == buffer.length) return charStr; + + // otherwise cut off the characters end from the beginning of this buffer + buffer = buffer.slice(i, buffer.length); + break; + } + + var lenIncomplete = this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end); + this.charReceived = lenIncomplete; + end -= lenIncomplete; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + + return i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 2; + this.charLength = incomplete ? 2 : 0; + return incomplete; +} + +function base64DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 3; + this.charLength = incomplete ? 3 : 0; + return incomplete; +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 0000000..8c153ca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,36 @@ +{ + "name": "string_decoder", + "version": "0.10.25-1", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.25-1", + "dist": { + "shasum": "7d787c8ec9b2e78e7a29e0e4c050782b3244d48c" + }, + "_from": "string_decoder@~0.10.x", + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/package.json new file mode 100644 index 0000000..2f43032 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/package.json @@ -0,0 +1,42 @@ +{ + "name": "readable-stream", + "version": "1.0.25", + "description": "An exploration of a new kind of readable streams for Node.js", + "main": "readable.js", + "dependencies": { + "string_decoder": "~0.10.x" + }, + "devDependencies": { + "tap": "~0.2.6" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "readme": "# readable-stream\n\nA new class of streams for Node.js\n\nThis module provides the new Stream base classes introduced in Node\nv0.10, for use in Node v0.8. You can use it to have programs that\nhave to work with node v0.8, while being forward-compatible for v0.10\nand beyond. When you drop support for v0.8, you can remove this\nmodule, and only use the native streams.\n\nThis is almost exactly the same codebase as appears in Node v0.10.\nHowever:\n\n1. The exported object is actually the Readable class. Decorating the\n native `stream` module would be global pollution.\n2. In v0.10, you can safely use `base64` as an argument to\n `setEncoding` in Readable streams. However, in v0.8, the\n StringDecoder class has no `end()` method, which is problematic for\n Base64. So, don't use that, because it'll break and be weird.\n\nOther than that, the API is the same as `require('stream')` in v0.10,\nso the API docs are reproduced below.\n\n----------\n\n Stability: 2 - Unstable\n\nA stream is an abstract interface implemented by various objects in\nNode. For example a request to an HTTP server is a stream, as is\nstdout. Streams are readable, writable, or both. All streams are\ninstances of [EventEmitter][]\n\nYou can load the Stream base classes by doing `require('stream')`.\nThere are base classes provided for Readable streams, Writable\nstreams, Duplex streams, and Transform streams.\n\n## Compatibility\n\nIn earlier versions of Node, the Readable stream interface was\nsimpler, but also less powerful and less useful.\n\n* Rather than waiting for you to call the `read()` method, `'data'`\n events would start emitting immediately. If you needed to do some\n I/O to decide how to handle data, then you had to store the chunks\n in some kind of buffer so that they would not be lost.\n* The `pause()` method was advisory, rather than guaranteed. This\n meant that you still had to be prepared to receive `'data'` events\n even when the stream was in a paused state.\n\nIn Node v0.10, the Readable class described below was added. For\nbackwards compatibility with older Node programs, Readable streams\nswitch into \"old mode\" when a `'data'` event handler is added, or when\nthe `pause()` or `resume()` methods are called. The effect is that,\neven if you are not using the new `read()` method and `'readable'`\nevent, you no longer have to worry about losing `'data'` chunks.\n\nMost programs will continue to function normally. However, this\nintroduces an edge case in the following conditions:\n\n* No `'data'` event handler is added.\n* The `pause()` and `resume()` methods are never called.\n\nFor example, consider the following code:\n\n```javascript\n// WARNING! BROKEN!\nnet.createServer(function(socket) {\n\n // we add an 'end' method, but never consume the data\n socket.on('end', function() {\n // It will never get here.\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n}).listen(1337);\n```\n\nIn versions of node prior to v0.10, the incoming message data would be\nsimply discarded. However, in Node v0.10 and beyond, the socket will\nremain paused forever.\n\nThe workaround in this situation is to call the `resume()` method to\ntrigger \"old mode\" behavior:\n\n```javascript\n// Workaround\nnet.createServer(function(socket) {\n\n socket.on('end', function() {\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n // start the flow of data, discarding it.\n socket.resume();\n\n}).listen(1337);\n```\n\nIn addition to new Readable streams switching into old-mode, pre-v0.10\nstyle streams can be wrapped in a Readable class using the `wrap()`\nmethod.\n\n## Class: stream.Readable\n\n\n\nA `Readable Stream` has the following methods, members, and events.\n\nNote that `stream.Readable` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nmethod. (See below.)\n\n### new stream.Readable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} The maximum number of bytes to store in\n the internal buffer before ceasing to read from the underlying\n resource. Default=16kb\n * `encoding` {String} If specified, then buffers will be decoded to\n strings using the specified encoding. Default=null\n * `objectMode` {Boolean} Whether this stream should behave\n as a stream of objects. Meaning that stream.read(n) returns\n a single value instead of a Buffer of size n\n\nIn classes that extend the Readable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### readable.\\_read(size)\n\n* `size` {Number} Number of bytes to read asynchronously\n\nNote: **This function should NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Readable\nclass methods only.\n\nAll Readable stream implementations must provide a `_read` method\nto fetch data from the underlying resource.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\nWhen data is available, put it into the read queue by calling\n`readable.push(chunk)`. If `push` returns false, then you should stop\nreading. When `_read` is called again, you should start pushing more\ndata.\n\nThe `size` argument is advisory. Implementations where a \"read\" is a\nsingle call that returns data can use this to know how much data to\nfetch. Implementations where that is not relevant, such as TCP or\nTLS, may ignore this argument, and simply provide data whenever it\nbecomes available. There is no need, for example to \"wait\" until\n`size` bytes are available before calling `stream.push(chunk)`.\n\n### readable.push(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to push into the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nNote: **This function should be called by Readable implementors, NOT\nby consumers of Readable subclasses.** The `_read()` function will not\nbe called again until at least one `push(chunk)` call is made. If no\ndata is available, then you MAY call `push('')` (an empty string) to\nallow a future `_read` call, without adding any data to the queue.\n\nThe `Readable` class works by putting data into a read queue to be\npulled out later by calling the `read()` method when the `'readable'`\nevent fires.\n\nThe `push()` method will explicitly insert some data into the read\nqueue. If it is called with `null` then it will signal the end of the\ndata.\n\nIn some cases, you may be wrapping a lower-level source which has some\nsort of pause/resume mechanism, and a data callback. In those cases,\nyou could wrap the low-level source object by doing something like\nthis:\n\n```javascript\n// source is an object with readStop() and readStart() methods,\n// and an `ondata` member that gets called when it has data, and\n// an `onend` member that gets called when the data is over.\n\nvar stream = new Readable();\n\nsource.ondata = function(chunk) {\n // if push() returns false, then we need to stop reading from source\n if (!stream.push(chunk))\n source.readStop();\n};\n\nsource.onend = function() {\n stream.push(null);\n};\n\n// _read will be called when the stream wants to pull more data in\n// the advisory size argument is ignored in this case.\nstream._read = function(n) {\n source.readStart();\n};\n```\n\n### readable.unshift(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nThis is the corollary of `readable.push(chunk)`. Rather than putting\nthe data at the *end* of the read queue, it puts it at the *front* of\nthe read queue.\n\nThis is useful in certain use-cases where a stream is being consumed\nby a parser, which needs to \"un-consume\" some data that it has\noptimistically pulled out of the source.\n\n```javascript\n// A parser for a simple data protocol.\n// The \"header\" is a JSON object, followed by 2 \\n characters, and\n// then a message body.\n//\n// Note: This can be done more simply as a Transform stream. See below.\n\nfunction SimpleProtocol(source, options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Readable.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n\n // source is a readable stream, such as a socket or file\n this._source = source;\n\n var self = this;\n source.on('end', function() {\n self.push(null);\n });\n\n // give it a kick whenever the source is readable\n // read(0) will not consume any bytes\n source.on('readable', function() {\n self.read(0);\n });\n\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Readable.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._read = function(n) {\n if (!this._inBody) {\n var chunk = this._source.read();\n\n // if the source doesn't have data, we don't have data yet.\n if (chunk === null)\n return this.push('');\n\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n this.push('');\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // now, because we got some extra data, unshift the rest\n // back into the read queue so that our consumer will see it.\n var b = chunk.slice(split);\n this.unshift(b);\n\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n }\n } else {\n // from there on, just provide the data to our consumer.\n // careful not to push(null), since that would indicate EOF.\n var chunk = this._source.read();\n if (chunk) this.push(chunk);\n }\n};\n\n// Usage:\nvar parser = new SimpleProtocol(source);\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n### readable.wrap(stream)\n\n* `stream` {Stream} An \"old style\" readable stream\n\nIf you are using an older Node library that emits `'data'` events and\nhas a `pause()` method that is advisory only, then you can use the\n`wrap()` method to create a Readable stream that uses the old stream\nas its data source.\n\nFor example:\n\n```javascript\nvar OldReader = require('./old-api-module.js').OldReader;\nvar oreader = new OldReader;\nvar Readable = require('stream').Readable;\nvar myReader = new Readable().wrap(oreader);\n\nmyReader.on('readable', function() {\n myReader.read(); // etc.\n});\n```\n\n### Event: 'readable'\n\nWhen there is data ready to be consumed, this event will fire.\n\nWhen this event emits, call the `read()` method to consume the data.\n\n### Event: 'end'\n\nEmitted when the stream has received an EOF (FIN in TCP terminology).\nIndicates that no more `'data'` events will happen. If the stream is\nalso writable, it may be possible to continue writing.\n\n### Event: 'data'\n\nThe `'data'` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was used.\n\nNote that adding a `'data'` event listener will switch the Readable\nstream into \"old mode\", where data is emitted as soon as it is\navailable, rather than waiting for you to call `read()` to consume it.\n\n### Event: 'error'\n\nEmitted if there was an error receiving data.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### readable.setEncoding(encoding)\n\nMakes the `'data'` event emit a string instead of a `Buffer`. `encoding`\ncan be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`.\n\nThe encoding can also be set by specifying an `encoding` field to the\nconstructor.\n\n### readable.read([size])\n\n* `size` {Number | null} Optional number of bytes to read.\n* Return: {Buffer | String | null}\n\nNote: **This function SHOULD be called by Readable stream users.**\n\nCall this method to consume data once the `'readable'` event is\nemitted.\n\nThe `size` argument will set a minimum number of bytes that you are\ninterested in. If not set, then the entire content of the internal\nbuffer is returned.\n\nIf there is no data to consume, or if there are fewer bytes in the\ninternal buffer than the `size` argument, then `null` is returned, and\na future `'readable'` event will be emitted when more is available.\n\nCalling `stream.read(0)` will always return `null`, and will trigger a\nrefresh of the internal buffer, but otherwise be a no-op.\n\n### readable.pipe(destination, [options])\n\n* `destination` {Writable Stream}\n* `options` {Object} Optional\n * `end` {Boolean} Default=true\n\nConnects this readable stream to `destination` WriteStream. Incoming\ndata on this stream gets written to `destination`. Properly manages\nback-pressure so that a slow destination will not be overwhelmed by a\nfast readable stream.\n\nThis function returns the `destination` stream.\n\nFor example, emulating the Unix `cat` command:\n\n process.stdin.pipe(process.stdout);\n\nBy default `end()` is called on the destination when the source stream\nemits `end`, so that `destination` is no longer writable. Pass `{ end:\nfalse }` as `options` to keep the destination stream open.\n\nThis keeps `writer` open so that \"Goodbye\" can be written at the\nend.\n\n reader.pipe(writer, { end: false });\n reader.on(\"end\", function() {\n writer.end(\"Goodbye\\n\");\n });\n\nNote that `process.stderr` and `process.stdout` are never closed until\nthe process exits, regardless of the specified options.\n\n### readable.unpipe([destination])\n\n* `destination` {Writable Stream} Optional\n\nUndo a previously established `pipe()`. If no destination is\nprovided, then all previously established pipes are removed.\n\n### readable.pause()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nCeases the flow of data. No `'data'` events are emitted while the\nstream is in a paused state.\n\n### readable.resume()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nResumes the incoming `'data'` events after a `pause()`.\n\n\n## Class: stream.Writable\n\n\n\nA `Writable` Stream has the following methods, members, and events.\n\nNote that `stream.Writable` is an abstract class designed to be\nextended with an underlying implementation of the\n`_write(chunk, encoding, cb)` method. (See below.)\n\n### new stream.Writable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} Buffer level when `write()` starts\n returning false. Default=16kb\n * `decodeStrings` {Boolean} Whether or not to decode strings into\n Buffers before passing them to `_write()`. Default=true\n\nIn classes that extend the Writable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### writable.\\_write(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be written. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. Ignore chunk is a buffer. Note that chunk will\n **always** be a buffer unless the `decodeStrings` option is\n explicitly set to `false`.\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nAll Writable stream implementations must provide a `_write` method to\nsend data to the underlying resource.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Writable\nclass methods only.\n\nCall the callback using the standard `callback(error)` pattern to\nsignal that the write completed successfully or with an error.\n\nIf the `decodeStrings` flag is set in the constructor options, then\n`chunk` may be a string rather than a Buffer, and `encoding` will\nindicate the sort of string that it is. This is to support\nimplementations that have an optimized handling for certain string\ndata encodings. If you do not explicitly set the `decodeStrings`\noption to `false`, then you can safely ignore the `encoding` argument,\nand assume that `chunk` will always be a Buffer.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n\n### writable.write(chunk, [encoding], [callback])\n\n* `chunk` {Buffer | String} Data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when this chunk is\n successfully written.\n* Returns {Boolean}\n\nWrites `chunk` to the stream. Returns `true` if the data has been\nflushed to the underlying resource. Returns `false` to indicate that\nthe buffer is full, and the data will be sent out in the future. The\n`'drain'` event will indicate when the buffer is empty again.\n\nThe specifics of when `write()` will return false, is determined by\nthe `highWaterMark` option provided to the constructor.\n\n### writable.end([chunk], [encoding], [callback])\n\n* `chunk` {Buffer | String} Optional final data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when the final chunk is\n successfully written.\n\nCall this method to signal the end of the data being written to the\nstream.\n\n### Event: 'drain'\n\nEmitted when the stream's write queue empties and it's safe to write\nwithout buffering again. Listen for it when `stream.write()` returns\n`false`.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### Event: 'finish'\n\nWhen `end()` is called and there are no more chunks to write, this\nevent is emitted.\n\n### Event: 'pipe'\n\n* `source` {Readable Stream}\n\nEmitted when the stream is passed to a readable stream's pipe method.\n\n### Event 'unpipe'\n\n* `source` {Readable Stream}\n\nEmitted when a previously established `pipe()` is removed using the\nsource Readable stream's `unpipe()` method.\n\n## Class: stream.Duplex\n\n\n\nA \"duplex\" stream is one that is both Readable and Writable, such as a\nTCP socket connection.\n\nNote that `stream.Duplex` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nand `_write(chunk, encoding, callback)` methods as you would with a Readable or\nWritable stream class.\n\nSince JavaScript doesn't have multiple prototypal inheritance, this\nclass prototypally inherits from Readable, and then parasitically from\nWritable. It is thus up to the user to implement both the lowlevel\n`_read(n)` method as well as the lowlevel `_write(chunk, encoding, cb)` method\non extension duplex classes.\n\n### new stream.Duplex(options)\n\n* `options` {Object} Passed to both Writable and Readable\n constructors. Also has the following fields:\n * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then\n the stream will automatically end the readable side when the\n writable side ends and vice versa.\n\nIn classes that extend the Duplex class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n## Class: stream.Transform\n\nA \"transform\" stream is a duplex stream where the output is causally\nconnected in some way to the input, such as a zlib stream or a crypto\nstream.\n\nThere is no requirement that the output be the same size as the input,\nthe same number of chunks, or arrive at the same time. For example, a\nHash stream will only ever have a single chunk of output which is\nprovided when the input is ended. A zlib stream will either produce\nmuch smaller or much larger than its input.\n\nRather than implement the `_read()` and `_write()` methods, Transform\nclasses must implement the `_transform()` method, and may optionally\nalso implement the `_flush()` method. (See below.)\n\n### new stream.Transform([options])\n\n* `options` {Object} Passed to both Writable and Readable\n constructors.\n\nIn classes that extend the Transform class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### transform.\\_transform(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be transformed. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. (Ignore if `decodeStrings` chunk is a buffer.)\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Transform\nclass methods only.\n\nAll Transform stream implementations must provide a `_transform`\nmethod to accept input and produce output.\n\n`_transform` should do whatever has to be done in this specific\nTransform class, to handle the bytes being written, and pass them off\nto the readable portion of the interface. Do asynchronous I/O,\nprocess things, and so on.\n\nCall `transform.push(outputChunk)` 0 or more times to generate output\nfrom this input chunk, depending on how much data you want to output\nas a result of this chunk.\n\nCall the callback function only when the current chunk is completely\nconsumed. Note that there may or may not be output as a result of any\nparticular input chunk.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### transform.\\_flush(callback)\n\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done flushing any remaining data.\n\nNote: **This function MUST NOT be called directly.** It MAY be implemented\nby child classes, and if so, will be called by the internal Transform\nclass methods only.\n\nIn some cases, your transform operation may need to emit a bit more\ndata at the end of the stream. For example, a `Zlib` compression\nstream will store up some internal state so that it can optimally\ncompress the output. At the end, however, it needs to do the best it\ncan with what is left, so that the data will be complete.\n\nIn those cases, you can implement a `_flush` method, which will be\ncalled at the very end, after all the written data is consumed, but\nbefore emitting `end` to signal the end of the readable side. Just\nlike with `_transform`, call `transform.push(chunk)` zero or more\ntimes, as appropriate, and call `callback` when the flush operation is\ncomplete.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### Example: `SimpleProtocol` parser\n\nThe example above of a simple protocol parser can be implemented much\nmore simply by using the higher level `Transform` stream class.\n\nIn this example, rather than providing the input as an argument, it\nwould be piped into the parser, which is a more idiomatic Node stream\napproach.\n\n```javascript\nfunction SimpleProtocol(options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Transform.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Transform.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._transform = function(chunk, encoding, done) {\n if (!this._inBody) {\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n\n // now, because we got some extra data, emit this first.\n this.push(b);\n }\n } else {\n // from there on, just provide the data to our consumer as-is.\n this.push(b);\n }\n done();\n};\n\nvar parser = new SimpleProtocol();\nsource.pipe(parser)\n\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n\n## Class: stream.PassThrough\n\nThis is a trivial implementation of a `Transform` stream that simply\npasses the input bytes across to the output. Its purpose is mainly\nfor examples and testing, but there are occasionally use cases where\nit can come in handy.\n\n\n[EventEmitter]: events.html#events_class_events_eventemitter\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "homepage": "https://github.com/isaacs/readable-stream", + "_id": "readable-stream@1.0.25", + "dist": { + "shasum": "3d234b55fd2a25db8327618f088e50a32044df50" + }, + "_from": "readable-stream@~1.0.24", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.25.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/passthrough.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..27e8d8a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/readable.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..4d1ddfc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/readable.js @@ -0,0 +1,6 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/transform.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..5d482f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/writable.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..e1e9efd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.npmignore b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.npmignore new file mode 100644 index 0000000..c766b8b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.npmignore @@ -0,0 +1,3 @@ +npm-debug.log +node_modules/ +tmp/ \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.travis.yml b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.travis.yml new file mode 100644 index 0000000..2ca91f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CHANGELOG b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CHANGELOG new file mode 100644 index 0000000..109f5dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CHANGELOG @@ -0,0 +1,21 @@ +v0.1.4: + date: 2014-02-07 + changes: + - drop readable-stream to node v0.10 compatible version. +v0.1.3: + date: 2014-01-10 + changes: + - see git log for more info. +v0.1.2: + date: 2014-01-10 + changes: + - empty buffers should STORE +v0.1.1: + date: 2014-01-10 + changes: + - bunch of little tweaks. see git log for more. +v0.1.0: + date: 2014-01-05 + changes: + - broke apart logic from archiver into this module. + - implemented basic api for adding entries. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CONTRIBUTING.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CONTRIBUTING.md new file mode 100644 index 0000000..1fa92d4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/CONTRIBUTING.md @@ -0,0 +1,14 @@ +## Contributing + +#### Code Style Guide + +* code should be indented with 2 spaces +* single quotes should be used where feasible +* commas should be followed by a single space (function params, etc) +* variable declaration should include `var`, [no multiple declarations](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) + +#### Tests + +* tests should be added to the nodeunit configs in `test/` +* tests can be run with `npm test` +* see existing tests for guidance \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT new file mode 100644 index 0000000..56420a6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2014 Chris Talkington, contributors. + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/README.md new file mode 100644 index 0000000..f1efc3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/README.md @@ -0,0 +1,95 @@ +# zip-stream v0.1.4 [![Build Status](https://secure.travis-ci.org/ctalkington/node-zip-stream.png?branch=master)](http://travis-ci.org/ctalkington/node-zip-stream) + +zip-stream is a streaming zip generator. It was built to be a successor to [zipstream](https://npmjs.org/package/zipstream). Dependencies are kept to a minimum through the use of many of node's built-in modules including the use of zlib module for compression. + +### Install + +```bash +npm install zip-stream --save +``` + +You can also use `npm install https://github.com/ctalkington/node-zip-stream/archive/master.tar.gz` to test upcoming versions. + +### Usage + +This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called "callback hell". + +If you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally. + +```js +var packer = require('zip-stream'); +var archive = new packer(); // OR new packer(options) + +archive.on('error', function(err) { + throw err; +}); + +// pipe archive where you want it (ie fs, http, etc) +// listen to the destination's end, close, or finish event + +archive.entry('string contents', { name: 'string.txt' }, function(err) { + if (err) throw err; + + archive.finalize(); +}); +``` + +### Instance API + +#### entry(input, data, callback(err)) + +Appends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the callback is fired. + +#### finalize() + +Finalizes the instance. You should listen to the destination stream's `end`/`close`/`finish` event to know when all output has been safely consumed. + +### Instance Options + +#### comment `string` + +Sets the zip comment. + +#### forceUTC `boolean` + +If true, forces the file date and time to UTC. Helps with testing across timezones. + +#### zlib `object` + +Passed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version. + +### Entry Data + +#### name `string` `required` + +Sets the entry name including internal path. + +#### type `string` + +Sets the entry type. Defaults to `file`. (allowed types to be expanded in future) + +#### date `string|Date` + +Sets the entry date. This can be any valid date string or instance. Defaults to current time in locale. + +#### store `boolean` + +If true, entry contents will be stored without compression. + +#### comment `string` + +Sets the entry comment. + +#### mode `number` + +Sets the entry permissions. (experimental) + +## Things of Interest + +- [Changelog](https://github.com/ctalkington/node-zip-stream/releases) +- [Contributing](https://github.com/ctalkington/node-zip-stream/blob/master/CONTRIBUTING.md) +- [MIT License](https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT) + +## Credits + +Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/docs/format.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/docs/format.md new file mode 100644 index 0000000..58d950e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/docs/format.md @@ -0,0 +1,397 @@ +# ZIP Format + +Archiver implements key aspects of PKWARE'S ZIP v2.0. + +``` +General Format of a ZIP file +---------------------------- + +Files stored in arbitrary order. Large zipfiles can span multiple +diskette media. + +Overall zipfile format: + + [local file header + file data + data_descriptor] . . . + [central directory] end of central directory record + + +A. Local file header: + +local file header signature 4 bytes (0x04034b50) +version needed to extract 2 bytes +general purpose bit flag 2 bytes +compression method 2 bytes +last mod file time 2 bytes +last mod file date 2 bytes +crc-32 4 bytes +compressed size 4 bytes +uncompressed size 4 bytes +filename length 2 bytes +extra field length 2 bytes + +filename (variable size) +extra field (variable size) + + +B. Data descriptor: + +crc-32 4 bytes +compressed size 4 bytes +uncompressed size 4 bytes + + This descriptor exists only if bit 3 of the general + purpose bit flag is set (see below). It is byte aligned + and immediately follows the last byte of compressed data. + This descriptor is used only when it was not possible to + seek in the output zip file, e.g., when the output zip file + was standard output or a non seekable device. + +C. Central directory structure: + + [file header] . . . end of central dir record + + File header: + +central file header signature 4 bytes (0x02014b50) +version made by 2 bytes +version needed to extract 2 bytes +general purpose bit flag 2 bytes +compression method 2 bytes +last mod file time 2 bytes +last mod file date 2 bytes +crc-32 4 bytes +compressed size 4 bytes +uncompressed size 4 bytes +filename length 2 bytes +extra field length 2 bytes +file comment length 2 bytes +disk number start 2 bytes +internal file attributes 2 bytes +external file attributes 4 bytes +relative offset of local header 4 bytes + +filename (variable size) +extra field (variable size) +file comment (variable size) + + End of central dir record: + +end of central dir signature 4 bytes (0x06054b50) +number of this disk 2 bytes +number of the disk with the +start of the central directory 2 bytes +total number of entries in +the central dir on this disk 2 bytes +total number of entries in +the central dir 2 bytes +size of the central directory 4 bytes +offset of start of central +directory with respect to +the starting disk number 4 bytes +zipfile comment length 2 bytes +zipfile comment (variable size) + + +D. Explanation of fields: + + version made by (2 bytes) + + The upper byte indicates the host system (OS) for the + file. Software can use this information to determine + the line record format for text files etc. The current + mappings are: + + 0 - MS-DOS and OS/2 (F.A.T. file systems) + 1 - Amiga 2 - VAX/VMS + 3 - *nix 4 - VM/CMS + 5 - Atari ST 6 - OS/2 H.P.F.S. + 7 - Macintosh 8 - Z-System + 9 - CP/M 10 thru 255 - unused + + The lower byte indicates the version number of the + software used to encode the file. The value/10 + indicates the major version number, and the value + mod 10 is the minor version number. + + version needed to extract (2 bytes) + + The minimum software version needed to extract the + file, mapped as above. + + general purpose bit flag: (2 bytes) + + bit 0: If set, indicates that the file is encrypted. + + (For Method 6 - Imploding) + bit 1: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + an 8K sliding dictionary was used. If clear, + then a 4K sliding dictionary was used. + bit 2: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + an 3 Shannon-Fano trees were used to encode the + sliding dictionary output. If clear, then 2 + Shannon-Fano trees were used. + + (For Method 8 - Deflating) + bit 2 bit 1 + 0 0 Normal (-en) compression option was used. + 0 1 Maximum (-ex) compression option was used. + 1 0 Fast (-ef) compression option was used. + 1 1 Super Fast (-es) compression option was used. + + Note: Bits 1 and 2 are undefined if the compression + method is any other. + + (For method 8) + bit 3: If this bit is set, the fields crc-32, compressed size + and uncompressed size are set to zero in the local + header. The correct values are put in the data descriptor + immediately following the compressed data. + + The upper three bits are reserved and used internally + by the software when processing the zipfile. The + remaining bits are unused. + + compression method: (2 bytes) + + (see accompanying documentation for algorithm + descriptions) + + 0 - The file is stored (no compression) + 1 - The file is Shrunk + 2 - The file is Reduced with compression factor 1 + 3 - The file is Reduced with compression factor 2 + 4 - The file is Reduced with compression factor 3 + 5 - The file is Reduced with compression factor 4 + 6 - The file is Imploded + 7 - Reserved for Tokenizing compression algorithm + 8 - The file is Deflated + + date and time fields: (2 bytes each) + + The date and time are encoded in standard MS-DOS format. + If input came from standard input, the date and time are + those at which compression was started for this data. + + CRC-32: (4 bytes) + + The CRC-32 algorithm was generously contributed by + David Schwaderer and can be found in his excellent + book "C Programmers Guide to NetBIOS" published by + Howard W. Sams & Co. Inc. The 'magic number' for + the CRC is 0xdebb20e3. The proper CRC pre and post + conditioning is used, meaning that the CRC register + is pre-conditioned with all ones (a starting value + of 0xffffffff) and the value is post-conditioned by + taking the one's complement of the CRC residual. + If bit 3 of the general purpose flag is set, this + field is set to zero in the local header and the correct + value is put in the data descriptor and in the central + directory. + + compressed size: (4 bytes) + uncompressed size: (4 bytes) + + The size of the file compressed and uncompressed, + respectively. If bit 3 of the general purpose bit flag + is set, these fields are set to zero in the local header + and the correct values are put in the data descriptor and + in the central directory. + + filename length: (2 bytes) + extra field length: (2 bytes) + file comment length: (2 bytes) + + The length of the filename, extra field, and comment + fields respectively. The combined length of any + directory record and these three fields should not + generally exceed 65,535 bytes. If input came from standard + input, the filename length is set to zero. + + + disk number start: (2 bytes) + + The number of the disk on which this file begins. + + internal file attributes: (2 bytes) + + The lowest bit of this field indicates, if set, that + the file is apparently an ASCII or text file. If not + set, that the file apparently contains binary data. + The remaining bits are unused in version 1.0. + + external file attributes: (4 bytes) + + The mapping of the external attributes is + host-system dependent (see 'version made by'). For + MS-DOS, the low order byte is the MS-DOS directory + attribute byte. If input came from standard input, this + field is set to zero. + + relative offset of local header: (4 bytes) + + This is the offset from the start of the first disk on + which this file appears, to where the local header should + be found. + + filename: (Variable) + + The name of the file, with optional relative path. + The path stored should not contain a drive or + device letter, or a leading slash. All slashes + should be forward slashes '/' as opposed to + backwards slashes '\' for compatibility with Amiga + and Unix file systems etc. If input came from standard + input, there is no filename field. + + extra field: (Variable) + + This is for future expansion. If additional information + needs to be stored in the future, it should be stored + here. Earlier versions of the software can then safely + skip this file, and find the next file or header. This + field will be 0 length in version 1.0. + + In order to allow different programs and different types + of information to be stored in the 'extra' field in .ZIP + files, the following structure should be used for all + programs storing data in this field: + + header1+data1 + header2+data2 . . . + + Each header should consist of: + + Header ID - 2 bytes + Data Size - 2 bytes + + Note: all fields stored in Intel low-byte/high-byte order. + + The Header ID field indicates the type of data that is in + the following data block. + + Header ID's of 0 thru 31 are reserved for use by PKWARE. + The remaining ID's can be used by third party vendors for + proprietary usage. + + The current Header ID mappings are: + + 0x0007 AV Info + 0x0009 OS/2 + 0x000c VAX/VMS + + The Data Size field indicates the size of the following + data block. Programs can use this value to skip to the + next header block, passing over any data blocks that are + not of interest. + + Note: As stated above, the size of the entire .ZIP file + header, including the filename, comment, and extra + field should not exceed 64K in size. + + In case two different programs should appropriate the same + Header ID value, it is strongly recommended that each + program place a unique signature of at least two bytes in + size (and preferably 4 bytes or bigger) at the start of + each data area. Every program should verify that its + unique signature is present, in addition to the Header ID + value being correct, before assuming that it is a block of + known type. + + -VAX/VMS Extra Field: + + The following is the layout of the VAX/VMS attributes "extra" + block. (Last Revision 12/17/91) + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- +(VMS) 0x000c Short Tag for this "extra" block type + TSize Short Size of the total "extra" block + CRC Long 32-bit CRC for remainder of the block + Tag1 Short VMS attribute tag value #1 + Size1 Short Size of attribute #1, in bytes + (var.) Size1 Attribute #1 data + . + . + . + TagN Short VMS attribute tage value #N + SizeN Short Size of attribute #N, in bytes + (var.) SizeN Attribute #N data + + Rules: + + 1. There will be one or more of attributes present, which will + each be preceded by the above TagX & SizeX values. These + values are identical to the ATR$C_XXXX and ATR$S_XXXX constants + which are defined in ATR.H under VMS C. Neither of these values + will ever be zero. + + 2. No word alignment or padding is performed. + + 3. A well-behaved PKZIP/VMS program should never produce more than + one sub-block with the same TagX value. Also, there will never + be more than one "extra" block of type 0x000c in a particular + directory record. + + file comment: (Variable) + + The comment for this file. + + number of this disk: (2 bytes) + + The number of this disk, which contains central + directory end record. + + number of the disk with the start of the central directory: (2 bytes) + + The number of the disk on which the central + directory starts. + + total number of entries in the central dir on this disk: (2 bytes) + + The number of central directory entries on this disk. + + total number of entries in the central dir: (2 bytes) + + The total number of files in the zipfile. + + + size of the central directory: (4 bytes) + + The size (in bytes) of the entire central directory. + + offset of start of central directory with respect to + the starting disk number: (4 bytes) + + Offset of the start of the central direcory on the + disk on which the central directory starts. + + zipfile comment length: (2 bytes) + + The length of the comment for this zipfile. + + zipfile comment: (Variable) + + The comment for this zipfile. + + +D. General notes: + + 1) All fields unless otherwise noted are unsigned and stored + in Intel low-byte:high-byte, low-word:high-word order. + + 2) String fields are not null terminated, since the + length is given explicitly. + + 3) Local headers should not span disk boundries. Also, even + though the central directory can span disk boundries, no + single record in the central directory should be split + across disks. + + 4) The entries in the central directory may not necessarily + be in the same order that files appear in the zipfile. +``` + +*Source: http://www.pkware.com/documents/APPNOTE/APPNOTE-2.0.txt* \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/headers.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/headers.js new file mode 100644 index 0000000..1dcbbb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/headers.js @@ -0,0 +1,204 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; + +var DEFAULT_FILE_MODE = 0100664; +var DEFAULT_DIR_MODE = 040755; +var BASE_FILE_MODE = 0100000; +var BASE_DIR_MODE = 040000; + +function ZipHeader() { + this.bufferSize = 0; + this.fields = []; +} + +ZipHeader.prototype.toBuffer = function(data) { + var buf = new Buffer(this.bufferSize); + var offset = 0; + var val; + var fallback; + + data = this._normalize(data); + + this.fields.forEach(function(value) { + fallback = (value.type === 'string') ? '' : 0; + val = data[value.field] || value.def || fallback; + + var noAssert = false; + + if (value.field === 'externalFileAttributes') { + noAssert = true; + } + + if (value.lenField) { + value.len = (data[value.lenField] > 0) ? buf.write(val, offset) : 0; + } else if (typeof buf['write' + value.type] === 'function') { + buf['write' + value.type](val, offset, noAssert); + } else if (val.length > 0) { + buf.write(val, offset); + } + + offset += value.len; + }); + + return buf.slice(0, offset); +}; + +ZipHeader.prototype.toObject = function(buf) { + var data = {}; + var offset = 0; + + this.fields.forEach(function(value) { + if (value.lenField) { + data[value.field] = (data[value.lenField] > 0) ? buf.toString('utf8', offset) : null; + } else if (typeof buf['read' + value.type] === 'function') { + data[value.field] = buf['read' + value.type](offset); + } else { + data[value.field] = buf.toString(null, offset, value.len); + } + + offset += value.len; + }); + + return data; +}; + +ZipHeader.prototype._normalize = function(data) { + // Don't always set mode as this is a experimental feature + // if (!data.mode) { + // data.mode = DEFAULT_FILE_MODE; + // } + + if (data.name) { + if (Buffer.byteLength(data.name) !== data.name.length) { + data.flags |= (1 << 11); + } + + data.filenameLength = Buffer.byteLength(data.name); + } + + if (data.comment) { + if (Buffer.byteLength(data.comment) !== data.comment.length) { + data.flags |= (1 << 11); + } + + data.commentLength = Buffer.byteLength(data.comment); + } + + if (data.extraField) { + data.extraFieldLength = data.extraField.length; + } + + if (data.mode) { + data.mode &= ~BASE_DIR_MODE; + data.mode |= BASE_FILE_MODE; + data.externalFileAttributes = (data.mode << 16); + } + + return data; +}; + +function ZipHeaderFile() { + ZipHeader.call(this); + + this.bufferSize = 1024; + this.fields = [ + {field: 'signature', len: 4, type: 'UInt32LE', def: 0x04034b50}, + {field: 'versionNeededToExtract', len: 2, type: 'UInt16LE', def: 20}, + {field: 'flags', len: 2, type: 'UInt16LE'}, + {field: 'compressionMethod', len: 2, type: 'UInt16LE'}, + {field: 'lastModifiedDate', len: 4, type: 'UInt32LE'}, + {field: 'crc32', len: 4, type: 'Int32LE', def: 0}, + {field: 'compressedSize', len: 4, type: 'UInt32LE'}, + {field: 'uncompressedSize', len: 4, type: 'UInt32LE'}, + {field: 'filenameLength', len: 2, type: 'UInt16LE'}, + {field: 'extraFieldLength', len: 2, type: 'UInt16LE'}, + {field: 'name', len: -1, lenField: 'filenameLength', type: 'string'}, + {field: 'extraField', len: -1, lenField: 'extraFieldLength', type: 'string'} + ]; +} +inherits(ZipHeaderFile, ZipHeader); + +function ZipHeaderFileDescriptor() { + ZipHeader.call(this); + + this.bufferSize = 16; + this.fields = [ + {field: 'signature', len: 4, type: 'UInt32LE', def: 0x08074b50}, + {field: 'crc32', len: 4, type: 'Int32LE'}, + {field: 'compressedSize', len: 4, type: 'UInt32LE'}, + {field: 'uncompressedSize', len: 4, type: 'UInt32LE'} + ]; +} +inherits(ZipHeaderFileDescriptor, ZipHeader); + +function ZipHeaderCentralDirectory() { + ZipHeader.call(this); + + this.bufferSize = 1024; + this.fields = [ + {field: 'signature', len: 4, type: 'UInt32LE', def: 0x02014b50}, + {field: 'versionMadeBy', len: 2, type: 'UInt16LE', def: 20}, + {field: 'versionNeededToExtract', len: 2, type: 'UInt16LE', def: 20}, + {field: 'flags', len: 2, type: 'UInt16LE'}, + {field: 'compressionMethod', len: 2, type: 'UInt16LE'}, + {field: 'lastModifiedDate', len: 4, type: 'UInt32LE'}, + {field: 'crc32', len: 4, type: 'Int32LE'}, + {field: 'compressedSize', len: 4, type: 'UInt32LE'}, + {field: 'uncompressedSize', len: 4, type: 'UInt32LE'}, + {field: 'filenameLength', len: 2, type: 'UInt16LE'}, + {field: 'extraFieldLength', len: 2, type: 'UInt16LE'}, + {field: 'commentLength', len: 2, type: 'UInt16LE'}, + {field: 'diskNumberStart', len: 2, type: 'UInt16LE'}, + {field: 'internalFileAttributes', len: 2, type: 'UInt16LE'}, + {field: 'externalFileAttributes', len: 4, type: 'UInt32LE'}, + {field: 'offset', len: 4, type: 'UInt32LE'}, + {field: 'name', len: -1, lenField: 'filenameLength', type: 'string'}, + {field: 'extraField', len: -1, lenField: 'extraFieldLength', type: 'string'}, + {field: 'comment', len: -1, lenField: 'commentLength', type: 'string'} + ]; +} +inherits(ZipHeaderCentralDirectory, ZipHeader); + +function ZipHeaderCentralFooter() { + ZipHeader.call(this); + + this.bufferSize = 512; + this.fields = [ + {field: 'signature', len: 4, type: 'UInt32LE', def: 0x06054b50}, + {field: 'diskNumber', len: 2, type: 'UInt16LE'}, + {field: 'diskNumberStart', len: 2, type: 'UInt16LE'}, + {field: 'directoryRecordsDisk', len: 2, type: 'UInt16LE'}, + {field: 'directoryRecords', len: 2, type: 'UInt16LE'}, + {field: 'centralDirectorySize', len: 4, type: 'UInt32LE'}, + {field: 'centralDirectoryOffset', len: 4, type: 'UInt32LE'}, + {field: 'commentLength', len: 2, type: 'UInt16LE'}, + {field: 'comment', len: -1, lenField: 'commentLength', type: 'string'} + ]; +} +inherits(ZipHeaderCentralFooter, ZipHeader); + +var headers = { + file: new ZipHeaderFile(), + fileDescriptor: new ZipHeaderFileDescriptor(), + centralDirectory: new ZipHeaderCentralDirectory(), + centralFooter: new ZipHeaderCentralFooter() +}; + +var encode = exports.encode = function(type, data) { + if (!headers[type] || typeof headers[type].toBuffer !== 'function') { + throw new Error('Unknown encode type'); + } + + return headers[type].toBuffer(data); +}; + +exports.file = ZipHeaderFile; +exports.fileDescriptor = ZipHeaderFileDescriptor; +exports.centralDirectory = ZipHeaderCentralDirectory; +exports.centralFooter = ZipHeaderCentralFooter; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/ChecksumStream.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/ChecksumStream.js new file mode 100644 index 0000000..477130e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/ChecksumStream.js @@ -0,0 +1,39 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('stream').Transform || require('readable-stream').Transform; + +var util = require('./'); + +function ChecksumStream(options) { + Transform.call(this, options); + + this.checksum = util.crc32(); + this.digest = null; + + this.rawSize = 0; +} + +inherits(ChecksumStream, Transform); + +ChecksumStream.prototype._transform = function(chunk, encoding, callback) { + if (chunk) { + this.checksum.update(chunk); + this.rawSize += chunk.length; + } + + callback(null, chunk); +}; + +ChecksumStream.prototype._flush = function(callback) { + this.digest = this.checksum.digest(); + + callback(); +}; + +module.exports = ChecksumStream; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/DeflateRawChecksum.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/DeflateRawChecksum.js new file mode 100644 index 0000000..03f0747 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/DeflateRawChecksum.js @@ -0,0 +1,42 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var zlib = require('zlib'); +var inherits = require('util').inherits; + +var util = require('./'); + +function DeflateRawChecksum(options) { + zlib.DeflateRaw.call(this, options); + + this.checksum = util.crc32(); + this.digest = null; + + this.rawSize = 0; + this.compressedSize = 0; + + this.on('data', function(chunk) { + this.compressedSize += chunk.length; + }); + + this.once('end', function() { + this.digest = this.checksum.digest(); + }); +} + +inherits(DeflateRawChecksum, zlib.DeflateRaw); + +DeflateRawChecksum.prototype.write = function(chunk, cb) { + if (chunk) { + this.checksum.update(chunk); + this.rawSize += chunk.length; + } + + return zlib.DeflateRaw.prototype.write.call(this, chunk, cb); +}; + +module.exports = DeflateRawChecksum; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/crc32.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/crc32.js new file mode 100644 index 0000000..c0ab65e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/crc32.js @@ -0,0 +1,98 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var lookup = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +]; + +function CRC32(data) { + if (!(this instanceof CRC32)) + return new CRC32(data); + + this.crc = ~0; + + if (data) { + this.update(data); + } +} + +CRC32.prototype.update = function(data) { + for (var i = 0; i < data.length; i++) { + this.crc = (this.crc >>> 8) ^ lookup[(this.crc ^ data[i]) & 0xff]; + } + + return this; +}; + +CRC32.prototype.digest = function() { + return this.crc ^ -1; +}; + +module.exports = CRC32; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/index.js new file mode 100644 index 0000000..def57af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/util/index.js @@ -0,0 +1,75 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var fs = require('fs'); +var path = require('path'); +var stream = require('stream'); + +var loDefaults = require('lodash.defaults'); + +var util = module.exports = {}; + +util.crc32 = require('./crc32'); + +util.dateify = function(dateish) { + dateish = dateish || new Date(); + + if (dateish instanceof Date) { + dateish = dateish; + } else if (typeof dateish === 'string') { + dateish = new Date(dateish); + } else { + dateish = new Date(); + } + + return dateish; +}; + +// this is slightly different from lodash version +util.defaults = function(object, source, guard) { + var args = arguments; + args[0] = args[0] || {}; + + return loDefaults.apply(null, args); +}; + +util.dosDateTime = function(d, utc) { + d = (d instanceof Date) ? d : util.dateify(d); + utc = utc || false; + + var year = utc ? d.getUTCFullYear() : d.getFullYear(); + + if (year < 1980) { + return (1<<21) | (1<<16); + } + + var val = { + year: year, + month: utc ? d.getUTCMonth() : d.getMonth(), + date: utc ? d.getUTCDate() : d.getDate(), + hours: utc ? d.getUTCHours() : d.getHours(), + minutes: utc ? d.getUTCMinutes() : d.getMinutes(), + seconds: utc ? d.getUTCSeconds() : d.getSeconds() + }; + + return ((val.year-1980) << 25) | ((val.month+1) << 21) | (val.date << 16) | + (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2); +}; + +util.isStream = function(source) { + return (source instanceof stream.Stream); +}; + +util.sanitizePath = function() { + var filepath = path.join.apply(path, arguments); + return filepath.replace(/\\/g, '/').replace(/:/g, '').replace(/^\/+/, ''); +}; + +util.unixifyPath = function() { + var filepath = path.join.apply(path, arguments); + return filepath.replace(/\\/g, '/'); +}; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js new file mode 100644 index 0000000..33f6c8c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js @@ -0,0 +1,281 @@ +/** + * node-zip-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('stream').Transform || require('readable-stream').Transform; +var PassThrough = require('stream').PassThrough || require('readable-stream').PassThrough; + +var ChecksumStream = require('./util/ChecksumStream'); +var DeflateRawChecksum = require('./util/DeflateRawChecksum'); +var headers = require('./headers'); +var util = require('./util'); + +var ZipStream = module.exports = function(options) { + if (!(this instanceof ZipStream)) { + return new ZipStream(opts); + } + + options = this.options = util.defaults(options, { + comment: '', + forceUTC: false + }); + + if (typeof options.zlib !== 'object') { + options.zlib = {}; + } + + if (typeof options.level === 'number' && options.level >= 0) { + options.zlib.level = options.level; + delete options.level; + } else if (typeof options.zlib.level !== 'number') { + options.zlib.level = 1; + } + + Transform.call(this, options); + + this.offset = 0; + this.files = []; + + this._finalize = false; + this._finalized = false; + this._processing = false; +}; + +inherits(ZipStream, Transform); + +ZipStream.prototype._afterAppend = function(file) { + this.files.push(file); + this._processing = false; + + if (this._finalize) { + this.finalize(); + } +}; + +ZipStream.prototype._appendBuffer = function(source, data, callback) { + var self = this; + + var file = data; + file.offset = self.offset; + + self.write(headers.encode('file', file)); + + function onend() { + self.write(headers.encode('fileDescriptor', file)); + + self._afterAppend(file); + + callback(null); + } + + if (file.store || source.length === 0) { + file.uncompressedSize = source.length; + file.compressedSize = file.uncompressedSize; + file.crc32 = util.crc32(source).digest(); + + self.write(source); + + onend(); + } else { + var processStream = self._newProcessStream(file.store); + processStream.once('error', callback); + + processStream.once('end', function() { + file.crc32 = processStream.digest; + file.uncompressedSize = processStream.rawSize; + file.compressedSize = processStream.compressedSize || processStream.rawSize; + + onend(); + }); + + processStream.pipe(self, { end: false }); + + processStream.end(source); + } +}; + +ZipStream.prototype._appendStream = function(source, data, callback) { + var self = this; + + var file = data; + file.offset = self.offset; + + self.write(headers.encode('file', file)); + + function onend() { + self.write(headers.encode('fileDescriptor', file)); + + self._afterAppend(file); + + callback(null); + } + + var processStream = self._newProcessStream(file.store); + processStream.once('error', callback); + + processStream.once('end', function() { + file.crc32 = processStream.digest; + file.uncompressedSize = processStream.rawSize; + file.compressedSize = processStream.compressedSize || processStream.rawSize; + + onend(); + }); + + processStream.pipe(self, { end: false }); + + source.pipe(processStream); +}; + +ZipStream.prototype._emitErrorCallback = function(err, data) { + if (err) { + this.emit('error', err); + } +}; + +ZipStream.prototype._newProcessStream = function(store) { + var process; + + if (store) { + process = new ChecksumStream(); + } else { + process = new DeflateRawChecksum(this.options.zlib); + } + + return process; +}; + +ZipStream.prototype._normalizeFileData = function(data) { + data = util.defaults(data, { + type: 'file', + name: null, + date: null, + store: false, + comment: '' + }); + + if (data.name) { + data.name = util.sanitizePath(data.name); + } + + if (typeof data.lastModifiedDate !== 'number') { + data.lastModifiedDate = util.dosDateTime(data.date, this.options.forceUTC); + } + + if (this.options.zlib && this.options.zlib.level === 0) { + data.store = true; + } + + data.flags = (1 << 3); + data.compressionMethod = data.store ? 0 : 8; + data.uncompressedSize = 0; + data.compressedSize = 0; + + return data; +}; + +ZipStream.prototype._normalizeSource = function(source) { + if (typeof source === 'string') { + return new Buffer(source); + } else if (util.isStream(source) && !source._readableState) { + var normalized = new PassThrough(); + source.pipe(normalized); + + return normalized; + } + + return source; +}; + +ZipStream.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; + +ZipStream.prototype._writeCentralDirectory = function() { + var files = this.files; + var comment = this.options.comment; + var cdoffset = this.offset; + var cdsize = 0; + + var centralDirectoryBuffer; + for (var i = 0; i < files.length; i++) { + var file = files[i]; + + centralDirectoryBuffer = headers.encode('centralDirectory', file); + this.write(centralDirectoryBuffer); + cdsize += centralDirectoryBuffer.length; + } + + var centralDirectoryFooterData = { + directoryRecordsDisk: files.length, + directoryRecords: files.length, + centralDirectorySize: cdsize, + centralDirectoryOffset: cdoffset, + comment: comment + }; + + this.write(headers.encode('centralFooter', centralDirectoryFooterData)); +}; + +ZipStream.prototype.entry = function(source, data, callback) { + if (typeof callback !== 'function') { + callback = this._emitErrorCallback.bind(this); + } + + if (this._processing) { + callback(new Error('already processing an entry')); + return; + } + + if (this._finalize || this._finalized) { + callback(new Error('entry after finalize()')); + return; + } + + data = this._normalizeFileData(data); + + if (data.type !== 'file') { + callback(new Error('only "file" entries are currently supported')); + return; + } + + if (typeof data.name !== 'string' || data.name.length === 0) { + callback(new Error('filename must be a non-empty string value')); + return; + } + + this._processing = true; + source = this._normalizeSource(source); + + if (Buffer.isBuffer(source)) { + this._appendBuffer(source, data, callback); + } else if (util.isStream(source)) { + this._appendStream(source, data, callback); + } else { + this._processing = false; + callback(new Error('input source must be valid Stream or Buffer instance')); + return; + } +}; + +ZipStream.prototype.finalize = function() { + if (this._processing) { + this._finalize = true; + return; + } + + this._writeCentralDirectory(); + this._finalized = true; + this.end(); +}; + +ZipStream.prototype.write = function(chunk, cb) { + if (chunk) { + this.offset += chunk.length; + } + + return Transform.prototype.write.call(this, chunk, cb); +}; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/README.md new file mode 100644 index 0000000..da283fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/README.md @@ -0,0 +1,15 @@ +# lodash.defaults v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.defaults`](http://lodash.com/docs#defaults) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/index.js new file mode 100644 index 0000000..52eec90 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/index.js @@ -0,0 +1,54 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var keys = require('lodash.keys'), + objectTypes = require('lodash._objecttypes'); + +/** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var object = { 'name': 'barney' }; + * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ +var defaults = function(object, source, guard) { + var index, iterable = object, result = iterable; + if (!iterable) return result; + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + while (++argsIndex < argsLength) { + iterable = args[argsIndex]; + if (iterable && objectTypes[typeof iterable]) { + var ownIndex = -1, + ownProps = objectTypes[typeof iterable] && keys(iterable), + length = ownProps ? ownProps.length : 0; + + while (++ownIndex < length) { + index = ownProps[ownIndex]; + if (typeof result[index] == 'undefined') result[index] = iterable[index]; + } + } + } + return result +}; + +module.exports = defaults; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/README.md new file mode 100644 index 0000000..16de730 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/README.md @@ -0,0 +1,15 @@ +# lodash._objecttypes v2.4.1 + +The internal [Lo-Dash](http://lodash.com/) variable `objectTypes` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/index.js new file mode 100644 index 0000000..da17c6c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/index.js @@ -0,0 +1,20 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to determine if values are of the language type Object */ +var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false +}; + +module.exports = objectTypes; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/package.json new file mode 100644 index 0000000..4ee6604 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash._objecttypes/package.json @@ -0,0 +1,50 @@ +{ + "name": "lodash._objecttypes", + "version": "2.4.1", + "description": "The internal Lo-Dash variable `objectTypes` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "readme": "# lodash._objecttypes v2.4.1\n\nThe internal [Lo-Dash](http://lodash.com/) variable `objectTypes` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash._objecttypes@2.4.1", + "dist": { + "shasum": "7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11" + }, + "_from": "lodash._objecttypes@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/README.md new file mode 100644 index 0000000..bee29a8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/README.md @@ -0,0 +1,15 @@ +# lodash.keys v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.keys`](http://lodash.com/docs#keys) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/index.js new file mode 100644 index 0000000..139568a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/index.js @@ -0,0 +1,36 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var isNative = require('lodash._isnative'), + isObject = require('lodash.isobject'), + shimKeys = require('lodash._shimkeys'); + +/* Native method shortcuts for methods with the same name as other `lodash` methods */ +var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys; + +/** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ +var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + return nativeKeys(object); +}; + +module.exports = keys; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/README.md new file mode 100644 index 0000000..fbcaad2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/README.md @@ -0,0 +1,15 @@ +# lodash._isnative v2.4.1 + +The internal [Lo-Dash](http://lodash.com/) function `isNative` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/index.js new file mode 100644 index 0000000..b34a350 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/index.js @@ -0,0 +1,34 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used for native method references */ +var objectProto = Object.prototype; + +/** Used to resolve the internal [[Class]] of values */ +var toString = objectProto.toString; + +/** Used to detect if a method is native */ +var reNative = RegExp('^' + + String(toString) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/toString| for [^\]]+/g, '.*?') + '$' +); + +/** + * Checks if `value` is a native function. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. + */ +function isNative(value) { + return typeof value == 'function' && reNative.test(value); +} + +module.exports = isNative; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/package.json new file mode 100644 index 0000000..aeff634 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._isnative/package.json @@ -0,0 +1,49 @@ +{ + "name": "lodash._isnative", + "version": "2.4.1", + "description": "The internal Lo-Dash function `isNative` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "readme": "# lodash._isnative v2.4.1\n\nThe internal [Lo-Dash](http://lodash.com/) function `isNative` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash._isnative@2.4.1", + "dist": { + "shasum": "3ea6404b784a7be836c7b57580e1cdf79b14832c" + }, + "_from": "lodash._isnative@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/README.md new file mode 100644 index 0000000..23f3000 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/README.md @@ -0,0 +1,15 @@ +# lodash._shimkeys v2.4.1 + +The internal [Lo-Dash](http://lodash.com/) function `shimKeys` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/index.js new file mode 100644 index 0000000..12be0bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/index.js @@ -0,0 +1,38 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var objectTypes = require('lodash._objecttypes'); + +/** Used for native method references */ +var objectProto = Object.prototype; + +/** Native method shortcuts */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ +var shimKeys = function(object) { + var index, iterable = object, result = []; + if (!iterable) return result; + if (!(objectTypes[typeof object])) return result; + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + result.push(index); + } + } + return result +}; + +module.exports = shimKeys; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/package.json new file mode 100644 index 0000000..5684f2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys/package.json @@ -0,0 +1,52 @@ +{ + "name": "lodash._shimkeys", + "version": "2.4.1", + "description": "The internal Lo-Dash function `shimKeys` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "dependencies": { + "lodash._objecttypes": "~2.4.1" + }, + "readme": "# lodash._shimkeys v2.4.1\n\nThe internal [Lo-Dash](http://lodash.com/) function `shimKeys` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash._shimkeys@2.4.1", + "dist": { + "shasum": "6e9cc9666ff081f0b5a6c978b83e242e6949d203" + }, + "_from": "lodash._shimkeys@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/README.md b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/README.md new file mode 100644 index 0000000..eeb0a78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/README.md @@ -0,0 +1,15 @@ +# lodash.isobject v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.isObject`](http://lodash.com/docs#isObject) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/index.js new file mode 100644 index 0000000..3596ac3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/index.js @@ -0,0 +1,39 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var objectTypes = require('lodash._objecttypes'); + +/** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); +} + +module.exports = isObject; diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/package.json new file mode 100644 index 0000000..8def494 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/package.json @@ -0,0 +1,59 @@ +{ + "name": "lodash.isobject", + "version": "2.4.1", + "description": "The Lo-Dash function `_.isObject` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "dependencies": { + "lodash._objecttypes": "~2.4.1" + }, + "readme": "# lodash.isobject v2.4.1\n\nThe [Lo-Dash](http://lodash.com/) function [`_.isObject`](http://lodash.com/docs#isObject) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash.isobject@2.4.1", + "dist": { + "shasum": "5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" + }, + "_from": "lodash.isobject@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/package.json new file mode 100644 index 0000000..c37b124 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/node_modules/lodash.keys/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.keys", + "version": "2.4.1", + "description": "The Lo-Dash function `_.keys` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "dependencies": { + "lodash._isnative": "~2.4.1", + "lodash.isobject": "~2.4.1", + "lodash._shimkeys": "~2.4.1" + }, + "readme": "# lodash.keys v2.4.1\n\nThe [Lo-Dash](http://lodash.com/) function [`_.keys`](http://lodash.com/docs#keys) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash.keys@2.4.1", + "dist": { + "shasum": "48dea46df8ff7632b10d706b8acb26591e2b3727" + }, + "_from": "lodash.keys@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/package.json new file mode 100644 index 0000000..dde9277 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/node_modules/lodash.defaults/package.json @@ -0,0 +1,60 @@ +{ + "name": "lodash.defaults", + "version": "2.4.1", + "description": "The Lo-Dash function `_.defaults` as a Node.js module generated by lodash-cli.", + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash-cli.git" + }, + "dependencies": { + "lodash.keys": "~2.4.1", + "lodash._objecttypes": "~2.4.1" + }, + "readme": "# lodash.defaults v2.4.1\n\nThe [Lo-Dash](http://lodash.com/) function [`_.defaults`](http://lodash.com/docs#defaults) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash.defaults@2.4.1", + "dist": { + "shasum": "a7e8885f05e68851144b6e12a8f3678026bc4c54" + }, + "_from": "lodash.defaults@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/package.json b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/package.json new file mode 100644 index 0000000..d839e0b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/package.json @@ -0,0 +1,53 @@ +{ + "name": "zip-stream", + "version": "0.1.4", + "description": "a streaming zip generator.", + "homepage": "https://github.com/ctalkington/node-zip-stream", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/ctalkington/node-zip-stream.git" + }, + "bugs": { + "url": "https://github.com/ctalkington/node-zip-stream/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT" + } + ], + "main": "lib/zip-stream.js", + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "mocha --reporter dot" + }, + "dependencies": { + "readable-stream": "~1.0.24", + "lodash.defaults": "~2.4.1" + }, + "devDependencies": { + "chai": "~1.8.1", + "mocha": "~1.16.0", + "rimraf": "~2.2.0", + "mkdirp": "~0.3.5" + }, + "keywords": [ + "archive", + "zip-stream", + "zip" + ], + "readme": "# zip-stream v0.1.4 [![Build Status](https://secure.travis-ci.org/ctalkington/node-zip-stream.png?branch=master)](http://travis-ci.org/ctalkington/node-zip-stream)\r\n\r\nzip-stream is a streaming zip generator. It was built to be a successor to [zipstream](https://npmjs.org/package/zipstream). Dependencies are kept to a minimum through the use of many of node's built-in modules including the use of zlib module for compression.\r\n\r\n### Install\r\n\r\n```bash\r\nnpm install zip-stream --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-zip-stream/archive/master.tar.gz` to test upcoming versions.\r\n\r\n### Usage\r\n\r\nThis module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called \"callback hell\".\r\n\r\nIf you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally.\r\n\r\n```js\r\nvar packer = require('zip-stream');\r\nvar archive = new packer(); // OR new packer(options)\r\n\r\narchive.on('error', function(err) {\r\n throw err;\r\n});\r\n\r\n// pipe archive where you want it (ie fs, http, etc)\r\n// listen to the destination's end, close, or finish event\r\n\r\narchive.entry('string contents', { name: 'string.txt' }, function(err) {\r\n if (err) throw err;\r\n\r\n archive.finalize();\r\n});\r\n```\r\n\r\n### Instance API\r\n\r\n#### entry(input, data, callback(err))\r\n\r\nAppends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the callback is fired.\r\n\r\n#### finalize()\r\n\r\nFinalizes the instance. You should listen to the destination stream's `end`/`close`/`finish` event to know when all output has been safely consumed.\r\n\r\n### Instance Options\r\n\r\n#### comment `string`\r\n\r\nSets the zip comment.\r\n\r\n#### forceUTC `boolean`\r\n\r\nIf true, forces the file date and time to UTC. Helps with testing across timezones.\r\n\r\n#### zlib `object`\r\n\r\nPassed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.\r\n\r\n### Entry Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the entry name including internal path.\r\n\r\n#### type `string`\r\n\r\nSets the entry type. Defaults to `file`. (allowed types to be expanded in future)\r\n\r\n#### date `string|Date`\r\n\r\nSets the entry date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### store `boolean`\r\n\r\nIf true, entry contents will be stored without compression.\r\n\r\n#### comment `string`\r\n\r\nSets the entry comment.\r\n\r\n#### mode `number`\r\n\r\nSets the entry permissions. (experimental)\r\n\r\n## Things of Interest\r\n\r\n- [Changelog](https://github.com/ctalkington/node-zip-stream/releases)\r\n- [Contributing](https://github.com/ctalkington/node-zip-stream/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT)\r\n\r\n## Credits\r\n\r\nConcept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated.", + "readmeFilename": "README.md", + "_id": "zip-stream@0.1.4", + "dist": { + "shasum": "dbcaf431c984c4f31815577367571a20ee4a79ee" + }, + "_from": "zip-stream@~0.1.0", + "_resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.1.4.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/level0.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/level0.txt new file mode 100644 index 0000000..a423c4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/level0.txt @@ -0,0 +1 @@ +level0 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/level1.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/level1.txt new file mode 100644 index 0000000..8d938e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/level1.txt @@ -0,0 +1 @@ +level1 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/subsub/level2.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/subsub/level2.txt new file mode 100644 index 0000000..00f8d1d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/directory/subdir/subsub/level2.txt @@ -0,0 +1 @@ +level2 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/empty.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralfooter.bin b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralfooter.bin new file mode 100644 index 0000000..1746fc5 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralfooter.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralheader.bin b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralheader.bin new file mode 100644 index 0000000..596638f Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-centralheader.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-data.bin b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-data.bin new file mode 100644 index 0000000..e068544 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-data.bin @@ -0,0 +1 @@ +this is a text file \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-file.bin b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-file.bin new file mode 100644 index 0000000..31275e1 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-file.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-filedescriptor.bin b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-filedescriptor.bin new file mode 100644 index 0000000..0703558 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/headers/zip-filedescriptor.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/test.txt b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/test.txt new file mode 100644 index 0000000..e068544 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/fixtures/test.txt @@ -0,0 +1 @@ +this is a text file \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/headers.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/headers.js new file mode 100644 index 0000000..d212d1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/headers.js @@ -0,0 +1,118 @@ +/*global before,describe,it */ +var fs = require('fs'); +var assert = require('chai').assert; + +var helpers = require('./helpers'); + +var headers = require('../lib/headers'); + +var testDate = new Date('Jan 03 2013 14:26:38 GMT'); +var testDateEpoch = 1357223198; + +describe('headers', function() { + + describe('zip', function() { + var fileFixture = fs.readFileSync('test/fixtures/headers/zip-file.bin'); + var fileDescriptorFixture = fs.readFileSync('test/fixtures/headers/zip-filedescriptor.bin'); + var centralDirectoryFixture = fs.readFileSync('test/fixtures/headers/zip-centralheader.bin'); + var centralFooterFixture = fs.readFileSync('test/fixtures/headers/zip-centralfooter.bin'); + + describe('#encode(type, object)', function() { + + describe('type->file', function() { + var actual = headers.encode('file', { + name: 'test.txt', + filenameLength: 8, + date: testDate, + comment: '', + store: true, + lastModifiedDate: 1109619539, + versionMadeBy: 20, + versionNeededToExtract: 20, + flags: 2056, + compressionMethod: 0, + uncompressedSize: 0, + compressedSize: 0, + offset: 0 + }); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should match provided fixture', function() { + // fs.writeFileSync('test/fixtures/headers/zip-file.bin', actual); + assert.deepEqual(actual, fileFixture); + }); + }); + + describe('type->fileDescriptor', function() { + var actual = headers.encode('fileDescriptor', { + crc32: 585446183, + uncompressedSize: 19, + compressedSize: 19, + }); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should match provided fixture', function() { + // fs.writeFileSync('test/fixtures/headers/zip-filedescriptor.bin', actual); + assert.deepEqual(actual, fileDescriptorFixture); + }); + }); + + describe('type->centralDirectory', function() { + var actual = headers.encode('centralDirectory', { + name: 'test.txt', + filenameLength: 8, + date: testDate, + store: true, + comment: '', + mode: 0644, + lastModifiedDate: 1109619539, + versionMadeBy: 20, + versionNeededToExtract: 20, + flags: 2056, + compressionMethod: 0, + uncompressedSize: 19, + compressedSize: 19, + offset: 0, + crc32: 585446183 + }); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should match provided fixture', function() { + // fs.writeFileSync('test/fixtures/headers/zip-centralheader.bin', actual); + assert.deepEqual(actual, centralDirectoryFixture); + }); + }); + + describe('type->centralFooter', function() { + var actual = headers.encode('centralFooter', { + directoryRecordsDisk: 1, + directoryRecords: 1, + centralDirectorySize: 56, + centralDirectoryOffset: 73, + comment: '' + }); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should match provided fixture', function() { + // fs.writeFileSync('test/fixtures/headers/zip-centralfooter.bin', actual); + assert.deepEqual(actual, centralFooterFixture); + }); + }); + + }); + + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/helpers/index.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/helpers/index.js new file mode 100644 index 0000000..debd4dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/helpers/index.js @@ -0,0 +1,87 @@ +var crypto = require('crypto'); +var fs = require('fs'); +var inherits = require('util').inherits; + +var Stream = require('stream').Stream; +var Readable = require('stream').Readable || require('readable-stream').Readable; +var Writable = require('stream').Writable || require('readable-stream').Writable; + +function adjustDateByOffset(d, offset) { + d = d instanceof Date || new Date(); + + if (offset >= 1) { + d.setMinutes(d.getMinutes() - offset); + } else { + d.setMinutes(d.getMinutes() + Math.abs(offset)); + } + + return d; +} + +module.exports.adjustDateByOffset = adjustDateByOffset; + +function binaryBuffer(n) { + var buffer = new Buffer(n); + + for (var i = 0; i < n; i++) { + buffer.writeUInt8(i&255, i); + } + + return buffer; +} + +module.exports.binaryBuffer = binaryBuffer; + +function BinaryStream(size, options) { + Readable.call(this, options); + + var buf = new Buffer(size); + + for (var i = 0; i < size; i++) { + buf.writeUInt8(i&255, i); + } + + this.push(buf); + this.push(null); +} + +inherits(BinaryStream, Readable); + +BinaryStream.prototype._read = function(size) {}; + +module.exports.BinaryStream = BinaryStream; + +function DeadEndStream(options) { + Writable.call(this, options); +} + +inherits(DeadEndStream, Writable); + +DeadEndStream.prototype._write = function(chuck, encoding, callback) { + callback(); +}; + +module.exports.DeadEndStream = DeadEndStream; + +function WriteHashStream(path, options) { + fs.WriteStream.call(this, path, options); + + this.hash = crypto.createHash('sha1'); + this.digest = null; + + this.on('close', function() { + this.digest = this.hash.digest('hex'); + }); +} + +inherits(WriteHashStream, fs.WriteStream); + +WriteHashStream.prototype.write = function(chunk) { + if (chunk) { + this.hash.update(chunk); + } + + return fs.WriteStream.prototype.write.call(this, chunk); +}; + +module.exports.WriteHashStream = WriteHashStream; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/pack.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/pack.js new file mode 100644 index 0000000..292ceb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/pack.js @@ -0,0 +1,247 @@ +/*global before,describe,it */ +var fs = require('fs'); + +var assert = require('chai').assert; +var mkdir = require('mkdirp'); + +var helpers = require('./helpers'); +var binaryBuffer = helpers.binaryBuffer; +var WriteHashStream = helpers.WriteHashStream; + +var packer = require('../lib/zip-stream.js'); + +var testDate = new Date('Jan 03 2013 14:26:38 GMT'); +var testDate2 = new Date('Feb 10 2013 10:24:42 GMT'); + +describe('pack', function() { + before(function() { + mkdir.sync('tmp'); + }); + + describe('#entry', function() { + + it('should append Buffer sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/buffer.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'f717caf8928848bb90963dfaae3f4794907ec9a3'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate }); + archive.finalize(); + }); + + it('should append Stream sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/stream.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '696d847c779cb4ad77c52de4dcb5995fabe82053'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream.txt', date: testDate }); + archive.finalize(); + }); + + it('should append multiple sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/multiple.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '404d35e59ee6d510774445cd8710bf37e1303aae'); + done(); + }); + + archive.pipe(testStream); + + archive.entry('string', { name: 'string.txt', date: testDate }, function(err) { + if (err) throw err; + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate2 }, function(err) { + if (err) throw err; + archive.entry(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream.txt', date: testDate2 }, function(err) { + if (err) throw err; + archive.entry(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream-store.txt', date: testDate, store: true }, function(err) { + if (err) throw err; + archive.finalize(); + }); + }); + }); + }); + }); + + it('should support STORE for Buffer sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/buffer-store.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'a8b0fdf44cc200f4b5e5361e0e4e59c8cf136c85'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate, store: true }); + archive.finalize(); + }); + + it('should support STORE for Stream sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/stream-store.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '0afeba5761199501ae58c3670713761b4d42bc3a'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream.txt', date: testDate, store: true }); + archive.finalize(); + }); + + it('should support archive and file comments', function(done) { + var archive = new packer({ + comment: 'this is a zip comment', + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/comments.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '2fad5e4b36b5030a36e218273c1b6cb94c238208'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate, comment: 'this is a file comment' }); + archive.finalize(); + }); + + it('should STORE files when compression level is zero', function(done) { + var archive = new packer({ + forceUTC: true, + level: 0 + }); + + var testStream = new WriteHashStream('tmp/store-level0.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'a8b0fdf44cc200f4b5e5361e0e4e59c8cf136c85'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate }); + archive.finalize(); + }); + + it('should properly handle utf8 encoded characters in file names and comments', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/accentedchars-filenames.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '78983b5596afa4a7844e0fb16ba8adcdaecfa4fd'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'àáâãäçèéêëìíîïñòóôõöùúûüýÿ.txt', date: testDate, comment: 'àáâãäçèéêëìíîïñòóôõöùúûüýÿ' }, function(err) { + if (err) throw err; + archive.entry(binaryBuffer(20000), { name: 'ÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ.txt', date: testDate2, comment: 'ÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ' }, function(err) { + if (err) throw err; + archive.finalize(); + }); + }); + }); + + it('should append zero length sources', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/zerolength.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '61ac99936f7dc99f38fbaa3789050b6b14900e47'); + done(); + }); + + archive.pipe(testStream); + + archive.entry('', { name: 'string.txt', date: testDate }, function(err) { + if (err) throw err; + archive.entry(new Buffer(0), { name: 'buffer.txt', date: testDate }, function(err) { + if (err) throw err; + archive.entry(fs.createReadStream('test/fixtures/empty.txt'), { name: 'stream.txt', date: testDate }, function(err) { + archive.finalize(); + }); + }); + }); + }); + + it('should support setting file mode (permissions)', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/filemode.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '41da8a79fb25b46b594105eb8618b6ebb0ed3135'); + done(); + }); + + archive.pipe(testStream); + + archive.entry(binaryBuffer(20000), { name: 'buffer.txt', date: testDate, mode: 0644 }); + archive.finalize(); + }); + + it('should support creating an empty zip', function(done) { + var archive = new packer({ + forceUTC: true + }); + + var testStream = new WriteHashStream('tmp/empty.zip'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'b04f3ee8f5e43fa3b162981b50bb72fe1acabb33'); + done(); + }); + + archive.pipe(testStream); + + archive.finalize(); + }); + + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/util.js b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/util.js new file mode 100644 index 0000000..ce31c52 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/node_modules/zip-stream/test/util.js @@ -0,0 +1,136 @@ +/*global before,describe,it */ +var fs = require('fs'); +var assert = require('chai').assert; + +var helpers = require('./helpers'); +var utils = require('../lib/util'); + +var BinaryStream = helpers.BinaryStream; +var ChecksumStream = require('../lib/util/ChecksumStream'); +var DeadEndStream = helpers.DeadEndStream; +var DeflateRawChecksum = require('../lib/util/DeflateRawChecksum'); + +var testDateString = 'Jan 03 2013 14:26:38 GMT'; +var testDate = new Date(testDateString); +var testDateDosUTC = 1109619539; + +var testTimezoneOffset = testDate.getTimezoneOffset(); + +describe('utils', function() { + + describe('ChecksumStream', function() { + it('should checksum data while transforming data', function(done) { + var binary = new BinaryStream(20000); + var checksum = new ChecksumStream(); + var deadend = new DeadEndStream(); + + checksum.on('end', function() { + assert.equal(checksum.digest, -270675091); + + done(); + }); + + checksum.pipe(deadend); + binary.pipe(checksum); + }); + + it('should calculate data size while transforming data', function(done) { + var binary = new BinaryStream(20000); + var checksum = new ChecksumStream(); + var deadend = new DeadEndStream(); + + checksum.on('end', function() { + assert.equal(checksum.rawSize, 20000); + + done(); + }); + + checksum.pipe(deadend); + binary.pipe(checksum); + }); + }); + + describe('crc32', function() { + + describe('crc32(data)', function() { + it('should initialize CRC32 instance based on data', function() { + var actual = utils.crc32('testing checksum'); + + assert.equal(actual.crc, 323269802); + }); + }); + + describe('#update(data)', function() { + it('should update CRC32 based on data', function() { + var actual = utils.crc32().update('testing checksum'); + + assert.equal(actual.crc, 323269802); + }); + }); + + describe('#digest()', function() { + it('should return digest of CRC32', function() { + var actual = utils.crc32().update('testing checksum').digest(); + + assert.equal(actual, -323269803); + }); + }); + + }); + + describe('dateify(dateish)', function() { + it('should return an instance of Date', function() { + assert.instanceOf(utils.dateify(testDate), Date); + assert.instanceOf(utils.dateify(testDateString), Date); + assert.instanceOf(utils.dateify(null), Date); + }); + + it('should passthrough an instance of Date', function() { + assert.deepEqual(utils.dateify(testDate), testDate); + }); + + it('should convert dateish string to an instance of Date', function() { + assert.deepEqual(utils.dateify(testDateString), testDate); + }); + }); + + describe('defaults(object, source, guard)', function() { + it('should default when object key is missing', function() { + var actual = utils.defaults({ value1: true }, { + value2: true + }); + + assert.deepEqual(actual, { + value1: true, + value2: true + }); + }); + }); + + describe('dosDateTime(date, utc)', function() { + it('should convert date into its DOS representation', function() { + assert.equal(utils.dosDateTime(testDate, true), testDateDosUTC); + }); + }); + + describe('isStream(source)', function() { + it('should return true if source is a stream', function() { + assert.ok(utils.isStream(new DeadEndStream())); + }); + }); + + describe('sanitizePath(filepath)', function() { + it('should sanitize filepath', function() { + assert.equal(utils.sanitizePath('\\this/path//file.txt'), 'this/path/file.txt'); + assert.equal(utils.sanitizePath('/this/path/file.txt'), 'this/path/file.txt'); + assert.equal(utils.sanitizePath('c:\\this\\path\\file.txt'), 'c/this/path/file.txt'); + }); + }); + + describe('unixifyPath(filepath)', function() { + it('should unixify filepath', function() { + assert.equal(utils.unixifyPath('this\\path\\file.txt'), 'this/path/file.txt'); + }); + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/package.json b/proj7/jquery-source/jquery/node_modules/archiver/package.json new file mode 100644 index 0000000..fc22b38 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/package.json @@ -0,0 +1,59 @@ +{ + "name": "archiver", + "version": "0.5.2", + "description": "Creates Archives (ZIP) via Node Streams.", + "homepage": "https://github.com/ctalkington/node-archiver", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/ctalkington/node-archiver.git" + }, + "bugs": { + "url": "https://github.com/ctalkington/node-archiver/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT" + } + ], + "main": "lib/archiver.js", + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "mocha --reporter dot", + "bench": "node benchmark/simple/pack-zip.js" + }, + "dependencies": { + "readable-stream": "~1.0.24", + "zip-stream": "~0.1.0", + "lazystream": "~0.1.0", + "file-utils": "~0.1.5", + "lodash": "~2.4.1" + }, + "devDependencies": { + "chai": "~1.8.1", + "mocha": "~1.16.0", + "rimraf": "~2.2.0", + "mkdirp": "~0.3.5", + "stream-bench": "~0.1.2" + }, + "keywords": [ + "archive", + "archiver", + "zip", + "tar" + ], + "readme": "# Archiver v0.5.2 [![Build Status](https://secure.travis-ci.org/ctalkington/node-archiver.png?branch=master)](http://travis-ci.org/ctalkington/node-archiver)\r\n\r\nCreates Archives (Zip, Tar) via Node Streams.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install archiver --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-archiver/archive/master.tar.gz` to test upcoming versions.\r\n\r\n## Archiver\r\n\r\n#### create(format, options)\r\n\r\nCreates an Archiver instance based on the format (zip, tar, etc) passed. Parameters can be passed directly to `Archiver` constructor for convenience.\r\n\r\n#### registerFormat(format, module)\r\n\r\nRegisters an archive format. Format modules are essentially transform streams with a few required methods. They will be further documented once a formal spec is in place.\r\n\r\n### Instance Methods\r\n\r\n#### append(input, data, callback(err))\r\n\r\nAppends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the callback is fired.\r\n\r\nReplaced `#addFile` in v0.5.\r\n\r\n```js\r\narchive.append('string', { name:'string.txt' });\r\narchive.append(new Buffer('string'), { name:'buffer.txt' });\r\narchive.append(fs.createReadStream('mydir/file.txt'), { name:'stream.txt' });\r\n```\r\n\r\n#### bulk(mappings)\r\n\r\nAppends multiple files from passed array of src-dest file mappings, based on [Grunt's \"Files Array\" format](http://gruntjs.com/configuring-tasks#files-array-format). A lazystream wrapper is used to prevent issues with open file limits.\r\n\r\n[Globbing patterns](http://gruntjs.com/configuring-tasks#globbing-patterns) and [multiple properties](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically) are supported through use of the [file-utils](https://github.com/SBoudrias/file-utils) package, based on Grunt's file utilities. Please note that multiple src files to single dest file (ie concat) is not supported.\r\n\r\nThe `data` property can be set (per src-dest mapping) to define file data for matched files.\r\n\r\n```js\r\narchive.bulk([\r\n { src: ['mydir/**'], data: { date: new Date() } },\r\n { expand: true, cwd: 'mydir', src: ['**'], dest: 'newdir' }\r\n]);\r\n```\r\n\r\n#### file(filepath, data, callback(err))\r\n\r\nAppends a file given its filepath. Uses a lazystream wrapper to prevent issues with open file limits.\r\n\r\n```js\r\narchive.file('mydir/file.txt', { name:'file.txt' });\r\n```\r\n\r\n#### finalize(callback(err, bytes))\r\n\r\nFinalizes the instance. When the instance's stream has finished emitting, the callback is fired. This generally doesn't correspond to the end of the destination stream; though a solution to track the destination stream may come in a future release.\r\n\r\n## Zip\r\n\r\n### Options\r\n\r\n#### comment `string`\r\n\r\nSets the zip comment.\r\n\r\n#### forceUTC `boolean`\r\n\r\nIf true, forces the file date and time to UTC. Helps with testing across timezones.\r\n\r\n#### zlib `object`\r\n\r\nPassed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.\r\n\r\n### File Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the file name including internal path.\r\n\r\n#### date `string|Date`\r\n\r\nSets the file date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### store `boolean`\r\n\r\nIf true, file contents will be stored without compression.\r\n\r\n#### comment `string`\r\n\r\nSets the file comment.\r\n\r\n#### mode `number`\r\n\r\nSets the file permissions. (experimental)\r\n\r\n## Tar\r\n\r\n### Options\r\n\r\n#### recordSize `number`\r\n\r\nSets the size (in bytes) of each record in a block, default is 512 (for advanced users only).\r\n\r\n#### recordsPerBlock `number`\r\n\r\nSets the number of records in a block, default is 20 (for advanced users only).\r\n\r\n### File Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the file name including internal path.\r\n\r\n#### date `string|Date`\r\n\r\nSets the file date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### mode `number`\r\n\r\nSets the file permissions. Defaults to 0664.\r\n\r\n## Things of Interest\r\n\r\n- [Examples](https://github.com/ctalkington/node-archiver/blob/master/examples)\r\n- [Changelog](https://github.com/ctalkington/node-archiver/releases)\r\n- [Archive Formats](https://github.com/ctalkington/node-archiver/blob/master/formats)\r\n- [Contributing](https://github.com/ctalkington/node-archiver/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT)\r\n\r\n## Credits\r\n\r\nConcept inspired by Antoine van Wel's [node-zipstream](https://github.com/wellawaretech/node-zipstream).\r\n\r\nTar inspired by isaacs's [node-tar](https://github.com/isaacs/node-tar).\r\n", + "readmeFilename": "README.md", + "_id": "archiver@0.5.2", + "dist": { + "shasum": "d9da5adf645e5110faaf972763c17aed0e068e06" + }, + "_from": "archiver@0.5.2", + "_resolved": "https://registry.npmjs.org/archiver/-/archiver-0.5.2.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/archiver.js b/proj7/jquery-source/jquery/node_modules/archiver/test/archiver.js new file mode 100644 index 0000000..56900ce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/archiver.js @@ -0,0 +1,211 @@ +/*global before,describe,it */ +var fs = require('fs'); +var PassThrough = require('stream').PassThrough || require('readable-stream/passthrough'); +var WriteStream = fs.createWriteStream; + +var assert = require('chai').assert; +var mkdir = require('mkdirp'); + +var common = require('./helpers/common'); +var HashStream = common.HashStream; +var UnBufferedStream = common.UnBufferedStream; +var WriteHashStream = common.WriteHashStream; +var binaryBuffer = common.binaryBuffer; + +var archiver = require('../lib/archiver'); + +var testDate = new Date('Jan 03 2013 14:26:38 GMT'); +var testDate2 = new Date('Feb 10 2013 10:24:42 GMT'); + +describe('archiver', function() { + + before(function() { + mkdir.sync('tmp'); + }); + + + describe('Archiver', function() { + var ArchiverCore = require('../lib/modules/core'); + + describe('#_normalizeSource(source)', function() { + var core = new ArchiverCore(); + + it('should normalize strings to an instanceOf Buffer', function() { + var normalized = core._normalizeSource('some string'); + + assert.instanceOf(normalized, Buffer); + }); + + it('should normalize older unbuffered streams', function() { + var noBufferStream = new UnBufferedStream(); + var normalized = core._normalizeSource(noBufferStream); + + assert.instanceOf(normalized, PassThrough); + }); + }); + + }); + + + describe('core', function() { + + describe('#file', function() { + var actual; + + before(function(done) { + var archive = archiver('json'); + var testStream = new WriteStream('tmp/file.json'); + + testStream.on('close', function() { + actual = common.readJSON('tmp/file.json'); + done(); + }); + + archive.pipe(testStream); + + archive + .file('test/fixtures/test.txt', { name: 'test.txt', date: testDate }) + .file('test/fixtures/test.txt') + .finalize(); + }); + + it('should append filepath', function() { + assert.isArray(actual); + assert.propertyVal(actual[0], 'name', 'test.txt'); + assert.propertyVal(actual[0], 'date', '2013-01-03T14:26:38.000Z'); + assert.propertyVal(actual[0], 'crc32', 585446183); + assert.propertyVal(actual[0], 'size', 19); + }); + + it('should fallback to filepath when no name is set', function() { + assert.isArray(actual); + assert.propertyVal(actual[1], 'name', 'test/fixtures/test.txt'); + }); + }); + + describe('#bulk', function() { + var actual; + + before(function(done) { + var archive = archiver('json'); + var testStream = new WriteStream('tmp/bulk.json'); + + testStream.on('close', function() { + actual = common.readJSON('tmp/bulk.json'); + done(); + }); + + archive.pipe(testStream); + + archive + .bulk([ + { expand: true, cwd: 'test/fixtures', src: 'directory/**' } + ]) + .finalize(); + }); + + it('should append multiple files', function() { + assert.isArray(actual); + assert.lengthOf(actual, 3); + }); + }); + + }); + + + describe('tar', function() { + + describe('#append', function() { + it('should append Buffer sources', function(done) { + var archive = archiver('tar'); + var testStream = new WriteHashStream('tmp/buffer.tar'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'bc84fec33e7a4f6c8777cabd0beba503a7bce331'); + done(); + }); + + archive.pipe(testStream); + + archive + .append(binaryBuffer(20000), { name: 'buffer.txt', date: testDate }) + .finalize(); + }); + + it('should append Stream sources', function(done) { + var archive = archiver('tar'); + var testStream = new WriteHashStream('tmp/stream.tar'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'b3bf662968c87989431a25b2f699eae213392e82'); + done(); + }); + + archive.pipe(testStream); + + archive + .append(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream.txt', date: testDate }) + .finalize(); + }); + + it('should append multiple sources', function(done) { + var archive = archiver('tar'); + var testStream = new WriteHashStream('tmp/multiple.tar'); + + testStream.on('close', function() { + assert.equal(testStream.digest, '0c4e2a79d0d2c41ae5eb2e1e70d315a617583e4d'); + done(); + }); + + archive.pipe(testStream); + + archive + .append('string', { name: 'string.txt', date: testDate }) + .append(binaryBuffer(20000), { name: 'buffer.txt', date: testDate2 }) + .append(fs.createReadStream('test/fixtures/test.txt'), { name: 'stream.txt', date: testDate }) + .finalize(); + }); + + it('should use prefix for deep paths', function(done) { + var archive = archiver('tar'); + var testStream = new WriteHashStream('tmp/feature-prefix.tar'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'c1efbfbdc9a49979a6e02b4009003de533fcda48'); + done(); + }); + + archive.pipe(testStream); + + var deepPath = 'vvmbtqhysigpregbdrc/pyqaznbelhppibmbykz/'; + deepPath += 'qcbclwjhktiazmhnsjt/kpsgdfyfkarbvnlinrt/'; + deepPath += 'holobndxfccyecblhcc/'; + deepPath += deepPath; + + archive + .append('deep path', { name: deepPath + 'file.txt', date: testDate }) + .finalize(); + }); + + it('should append zero length sources', function(done) { + var archive = archiver('tar'); + var testStream = new WriteHashStream('tmp/zerolength.tar'); + + testStream.on('close', function() { + assert.equal(testStream.digest, 'f4f7b53f8ee4c7124298695bffbacfa9e9c0a99f'); + done(); + }); + + archive.pipe(testStream); + + archive + .append('', { name: 'string.txt', date: testDate }) + .append(new Buffer(0), { name: 'buffer.txt', date: testDate }) + .append(fs.createReadStream('test/fixtures/empty.txt'), { name: 'stream.txt', date: testDate }) + .finalize(); + }); + }); + + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/level0.txt b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/level0.txt new file mode 100644 index 0000000..a423c4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/level0.txt @@ -0,0 +1 @@ +level0 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/level1.txt b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/level1.txt new file mode 100644 index 0000000..8d938e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/level1.txt @@ -0,0 +1 @@ +level1 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/subsub/level2.txt b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/subsub/level2.txt new file mode 100644 index 0000000..00f8d1d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/directory/subdir/subsub/level2.txt @@ -0,0 +1 @@ +level2 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/empty.txt b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-file.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-file.bin new file mode 100644 index 0000000..5abd66e Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-file.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-fileprefix.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-fileprefix.bin new file mode 100644 index 0000000..1537710 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/tar-fileprefix.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralfooter.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralfooter.bin new file mode 100644 index 0000000..1746fc5 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralfooter.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralheader.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralheader.bin new file mode 100644 index 0000000..596638f Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-centralheader.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-data.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-data.bin new file mode 100644 index 0000000..e068544 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-data.bin @@ -0,0 +1 @@ +this is a text file \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-file.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-file.bin new file mode 100644 index 0000000..31275e1 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-file.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-filedescriptor.bin b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-filedescriptor.bin new file mode 100644 index 0000000..0703558 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/headers/zip-filedescriptor.bin differ diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/test.txt b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/test.txt new file mode 100644 index 0000000..e068544 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/fixtures/test.txt @@ -0,0 +1 @@ +this is a text file \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/headers.js b/proj7/jquery-source/jquery/node_modules/archiver/test/headers.js new file mode 100644 index 0000000..7bc9acf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/headers.js @@ -0,0 +1,135 @@ +/*global before,describe,it */ +var fs = require('fs'); + +var assert = require('chai').assert; + +var common = require('./helpers/common'); + +var tar = require('../lib/modules/tar/headers'); + +var testDate = new Date('Jan 03 2013 14:26:38 GMT'); +var testDateEpoch = 1357223198; + +describe('headers', function() { + + describe('tar', function() { + var fileFixture = fs.readFileSync('test/fixtures/headers/tar-file.bin'); + var filePrefixFixture = fs.readFileSync('test/fixtures/headers/tar-fileprefix.bin'); + + describe('#encode(type, object)', function() { + + describe('type->file', function() { + var actual = tar.encode('file', { + name: 'test.txt', + date: testDate, + mode: 0644, + size: 23, + owner: 'test', + group: 'test' + }); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should have a length of 512 bytes', function() { + assert.lengthOf(actual, 512); + }); + + it('should match provided fixture', function() { + //fs.writeFileSync('test/fixtures/headers/tar-file.bin', actual); + assert.deepEqual(actual.toString(), fileFixture.toString()); + }); + + it('should use prefix for deep paths', function() { + var deepPath = 'vvmbtqhysigpregbdrc/pyqaznbelhppibmbykz/'; + deepPath += 'qcbclwjhktiazmhnsjt/kpsgdfyfkarbvnlinrt/'; + deepPath += 'holobndxfccyecblhcc/'; + deepPath += deepPath; + + var actual = tar.encode('file', { + name: deepPath + 'test.txt', + date: testDate, + size: 23 + }); + + //fs.writeFileSync('test/fixtures/headers/tar-fileprefix.bin', actual); + assert.deepEqual(actual.toString(), filePrefixFixture.toString()); + }); + }); + + }); + + describe('#decode(type, buffer)', function() { + + describe('type->file', function() { + var actual = tar.decode('file', fileFixture); + + it('should return an object', function() { + assert.isObject(actual); + }); + + it('should properly decode pre-posix attributes', function() { + assert.equal(actual.name, 'test.txt'); + assert.equal(actual.uid, 0); + assert.equal(actual.gid, 0); + assert.equal(actual.mode, 420); + assert.equal(actual.size, 23); + assert.deepEqual(actual.date, testDate); + assert.equal(actual.mtime, testDateEpoch); + assert.equal(actual.checksum, 5490); + assert.equal(actual.type, '0'); + assert.equal(actual.linkName, ''); + }); + + it('should properly decode ustar attributes', function() { + assert.equal(actual.ustar, true); + assert.equal(actual.ustarVersion, '00'); + assert.equal(actual.owner, 'test'); + assert.equal(actual.group, 'test'); + assert.equal(actual.devMajor, 0); + assert.equal(actual.devMinor, 0); + assert.equal(actual.prefix, ''); + }); + }); + + }); + + describe('HeaderTarFile', function() { + var HeaderTarFile = tar.file; + var thing = new HeaderTarFile(); + + describe('#_parseNumeric(num, len)', function() { + it('should convert octal strings to numeric values', function() { + assert.equal(thing._parseNumeric('00000021'), 17); + }); + }); + + describe('#_prepNumeric(num, len)', function() { + it('should convert numeric values to octal strings, padding when needed', function() { + assert.equal(thing._prepNumeric(17, 7), '000021\0'); + }); + }); + + describe('#_splitFilePath(filepath)', function() { + it('should split a filepath into a name and prefix', function() { + var deepPath = 'vvmbtqhysigpregbdrc/pyqaznbelhppibmbykz/'; + deepPath += 'qcbclwjhktiazmhnsjt/kpsgdfyfkarbvnlinrt/'; + deepPath += 'holobndxfccyecblhcc/'; + deepPath += deepPath; + + var actual = thing._splitFilePath(deepPath + 'file.txt'); + + assert.deepEqual(actual, [ + "qcbclwjhktiazmhnsjt/kpsgdfyfkarbvnlinrt/holobndxfccyecblhcc/file.txt", + "vvmbtqhysigpregbdrc/pyqaznbelhppibmbykz/qcbclwjhktiazmhnsjt/kpsgdfyfkarbvnlinrt/" + + "holobndxfccyecblhcc/vvmbtqhysigpregbdrc/pyqaznbelhppibmbykz" + ]); + }); + }); + + }); + + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/helpers/common.js b/proj7/jquery-source/jquery/node_modules/archiver/test/helpers/common.js new file mode 100644 index 0000000..001e126 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/helpers/common.js @@ -0,0 +1,108 @@ +var crypto = require('crypto'); +var fs = require('fs'); +var inherits = require('util').inherits; + +var Stream = require('stream').Stream; +var Readable = require('stream').Readable || require('readable-stream'); +var Writable = require('stream').Writable || require('readable-stream').Writable; + +function adjustDateByOffset(d, offset) { + if (offset >= 1) { + d.setMinutes(d.getMinutes() - offset); + } else { + d.setMinutes(d.getMinutes() + Math.abs(offset)); + } + + return d; +} + +module.exports.adjustDateByOffset = adjustDateByOffset; + +function binaryBuffer(n) { + var buffer = new Buffer(n); + + for (var i = 0; i < n; i++) { + buffer.writeUInt8(i&255, i); + } + + return buffer; +} + +module.exports.binaryBuffer = binaryBuffer; + +function BinaryStream(size, options) { + Readable.call(this, options); + + var buf = new Buffer(size); + + for (var i = 0; i < size; i++) { + buf.writeUInt8(i&255, i); + } + + this.push(buf); + this.push(null); +} + +inherits(BinaryStream, Readable); + +BinaryStream.prototype._read = function(size) {}; + +module.exports.BinaryStream = BinaryStream; + +function DeadEndStream(options) { + Writable.call(this, options); +} + +inherits(DeadEndStream, Writable); + +DeadEndStream.prototype._write = function(chuck, encoding, callback) { + callback(); +}; + +module.exports.DeadEndStream = DeadEndStream; + +function readJSON(filepath) { + var contents; + + try { + contents = fs.readFileSync(String(filepath)); + contents = JSON.parse(contents); + } catch(e) { + contents = null; + } + + return contents; +} + +module.exports.readJSON = readJSON; + +function UnBufferedStream() { + this.readable = true; +} + +inherits(UnBufferedStream, Stream); + +module.exports.UnBufferedStream = UnBufferedStream; + +function WriteHashStream(path, options) { + fs.WriteStream.call(this, path, options); + + this.hash = crypto.createHash('sha1'); + this.digest = null; + + this.on('close', function() { + this.digest = this.hash.digest('hex'); + }); +} + +inherits(WriteHashStream, fs.WriteStream); + +WriteHashStream.prototype.write = function(chunk) { + if (chunk) { + this.hash.update(chunk); + } + + return fs.WriteStream.prototype.write.call(this, chunk); +}; + +module.exports.WriteHashStream = WriteHashStream; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/archiver/test/util.js b/proj7/jquery-source/jquery/node_modules/archiver/test/util.js new file mode 100644 index 0000000..98ee974 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/archiver/test/util.js @@ -0,0 +1,196 @@ +/*global describe,it */ +var fs = require('fs'); +var assert = require('chai').assert; + +var common = require('./helpers/common'); +var adjustDateByOffset = common.adjustDateByOffset; +var binaryBuffer = common.binaryBuffer; +var BinaryStream = common.BinaryStream; +var DeadEndStream = common.DeadEndStream; + +var ChecksumStream = require('../lib/util/ChecksumStream'); +var crc32 = require('../lib/util/crc32'); +var utils = require('../lib/util'); + +var testBuffer = binaryBuffer(20000); + +var testDate = new Date('Jan 03 2013 14:26:38 GMT'); +var testDateEpoch = 1357223198; +var testDateOctal = 12071312436; + +var testTimezoneOffset = testDate.getTimezoneOffset(); + +describe('utils', function() { + + describe('ChecksumStream', function() { + it('should checksum data while transforming data', function(done) { + var binary = new BinaryStream(20000); + var checksum = new ChecksumStream(); + var deadend = new DeadEndStream(); + + checksum.on('end', function() { + assert.equal(checksum.digest, -270675091); + + done(); + }); + + checksum.pipe(deadend); + binary.pipe(checksum); + }); + + it('should calculate data size while transforming data', function(done) { + var binary = new BinaryStream(20000); + var checksum = new ChecksumStream(); + var deadend = new DeadEndStream(); + + checksum.on('end', function() { + assert.equal(checksum.rawSize, 20000); + + done(); + }); + + checksum.pipe(deadend); + binary.pipe(checksum); + }); + }); + + describe('crc32', function() { + + describe('crc32(data)', function() { + it('should initialize CRC32 instance based on data', function() { + var actual = crc32('testing checksum'); + + assert.equal(actual.crc, 323269802); + }); + }); + + describe('#update(data)', function() { + it('should update CRC32 based on data', function() { + var actual = crc32().update('testing checksum'); + + assert.equal(actual.crc, 323269802); + }); + }); + + describe('#digest()', function() { + it('should return digest of CRC32', function() { + var actual = crc32().update('testing checksum').digest(); + + assert.equal(actual, -323269803); + }); + }); + + }); + + describe('index', function() { + + describe('cleanBuffer(size)', function() { + var actual = utils.cleanBuffer(5); + + it('should return an instance of Buffer', function() { + assert.instanceOf(actual, Buffer); + }); + + it('should have a length of size', function() { + assert.lengthOf(actual, 5); + }); + + it('should be filled with zeros', function() { + var actualArray = []; + + for (var i = 0; i < actual.length ; i++) { + actualArray.push(actual[i]); + } + + assert.deepEqual(actualArray, [0, 0, 0, 0, 0]); + }); + }); + + describe('convertDateTimeEpoch(input)', function() { + it('should convert epoch input into an instance of Date', function() { + assert.deepEqual(utils.convertDateTimeEpoch(testDateEpoch), testDate); + }); + }); + + describe('convertDateTimeOctal(input)', function() { + it('should convert octal input into an instance of Date', function() { + assert.deepEqual(utils.convertDateTimeOctal(testDateOctal), testDate); + }); + }); + + describe('dateify(dateish)', function() { + it('should return an instance of Date', function() { + assert.instanceOf(utils.dateify(testDate), Date); + assert.instanceOf(utils.dateify('Jan 03 2013 14:26:38 GMT'), Date); + assert.instanceOf(utils.dateify(null), Date); + }); + + it('should passthrough an instance of Date', function() { + assert.deepEqual(utils.dateify(testDate), testDate); + }); + + it('should convert dateish string to an instance of Date', function() { + assert.deepEqual(utils.dateify('Jan 03 2013 14:26:38 GMT'), testDate); + }); + }); + + describe('defaults(object, source, guard)', function() { + it('should default when object key is missing', function() { + var actual = utils.defaults({ value1: true }, { + value2: true + }); + + assert.deepEqual(actual, { + value1: true, + value2: true + }); + }); + }); + + describe('epochDateTime(date)', function() { + it('should convert date into its epoch representation', function() { + assert.equal(utils.epochDateTime(testDate), testDateEpoch); + }); + }); + + describe('isStream(source)', function() { + it('should return true if source is a stream', function() { + assert.ok(utils.isStream(new DeadEndStream())); + }); + }); + + describe('octalDateTime(date)', function() { + it('should convert date into its octal representation', function() { + assert.equal(utils.octalDateTime(testDate), testDateOctal); + }); + }); + + describe('padNumber(number, bytes, base)', function() { + it('should pad number to specified bytes', function() { + assert.equal(utils.padNumber(0, 7), '0000000'); + }); + }); + + describe('repeat(pattern, count)', function() { + it('should repeat pattern by count', function() { + assert.equal(utils.repeat('x', 4), 'xxxx'); + }); + }); + + describe('sanitizePath(filepath)', function() { + it('should sanitize filepath', function() { + assert.equal(utils.sanitizePath('\\this/path//file.txt'), 'this/path/file.txt'); + assert.equal(utils.sanitizePath('/this/path/file.txt'), 'this/path/file.txt'); + assert.equal(utils.sanitizePath('c:\\this\\path\\file.txt'), 'c/this/path/file.txt'); + }); + }); + + describe('unixifyPath(filepath)', function() { + it('should unixify filepath', function() { + assert.equal(utils.unixifyPath('this\\path\\file.txt'), 'this/path/file.txt'); + }); + }); + + }); + +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.bowerrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.bowerrc new file mode 100644 index 0000000..2ffd6e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_modules" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.jshintrc new file mode 100644 index 0000000..169ceb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.jshintrc @@ -0,0 +1,23 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "es5": true, + "evil": true, + "expr": true, + "immed": true, + "latedef": true, + "maxerr": 100, + "newcap": true, + "noarg": true, + "node": true, + "quotmark": "single", + "smarttabs": true, + "strict": false, + "supernew": true, + "trailing": true, + "undef": true, + "unused": true, + "wsh": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.npmignore new file mode 100644 index 0000000..fa4f237 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.npmignore @@ -0,0 +1,4 @@ +node_modules +bower_components +npm-debug.log +tmp* diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.travis.yml new file mode 100644 index 0000000..db173c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.8" +before_install: + - npm install grunt-cli -g diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/CONTRIBUTING.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/CONTRIBUTING.md new file mode 100644 index 0000000..d00204d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/CONTRIBUTING.md @@ -0,0 +1,20 @@ +# Contributing to grunt-bowercopy + +Follow the [jQuery style guide](http://contribute.jquery.org/style-guide/js/), with these exceptions: + +- Use single quotes +- Multiple var statements can be used to group variable declarations logically +- Liberal spacing between parenthesis need not be used +- Use [jsdoc-style](http://usejsdoc.org/#JSDoc3_Tag_Dictionary) comments for functions + +Add tests to test/bowercopy_test.js. See the [nodeunit README](https://github.com/caolan/nodeunit) for documentation. + +If you're unfamiliar with grunt, [gruntjs.com](http://gruntjs.com/) is a good place to start. Follow instructions for installing grunt and see the Gruntfile for the tasks used. + +Always run tests before submitting a pull request, unless it is just a documentation or copy change. + +*Note: the bower.json in this repo is only used for testing. The `private` property is set to `true` on purpose.* + +### Development workflow + +There is a watch task defined in the Gruntfile to lint and test as you go. Simply run `grunt watch` to start. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/Gruntfile.js new file mode 100644 index 0000000..c640d87 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/Gruntfile.js @@ -0,0 +1,127 @@ +/* + * grunt-bowercopy + * + * Copyright (c) 2013 Timmy Willison + * Licensed under the MIT license. + */ + +'use strict'; + +module.exports = function (grunt) { + // Load all npm grunt tasks + require('load-grunt-tasks')(grunt); + + grunt.initConfig({ + jshint: { + all: [ + 'Gruntfile.js', + 'tasks/*.js', + '<%= nodeunit.tests %>' + ], + options: { + jshintrc: '.jshintrc', + reporter: require('jshint-stylish') + } + }, + + jsonlint: { + all: [ + '*.json' + ] + }, + + // Configuration to be run (and then tested) + bowercopy: { + default_options: { + files: { + 'tmp/js/libs/jquery.js': 'jquery/jquery.js', + 'tmp/js/plugins/jquery.panzoom.js': 'jquery.panzoom/dist/jquery.panzoom.js' + } + }, + prefix_options: { + options: { + srcPrefix: 'bower_modules', + destPrefix: 'tmp/js' + }, + src: 'backbone' + }, + process: { + options: { + destPrefix: 'tmp/js/jquery-ui', + copyOptions: { + process: function(content) { + var version = grunt.file.readJSON('bower.json').devDependencies['jquery-ui'].split('#')[1]; + return content.replace(/@VERSION/g, version); + } + } + }, + files: { + 'jquery.ui.core.js': 'jquery-ui/ui/jquery.ui.core.js', + 'jquery.ui.widget.js': 'jquery-ui/ui/jquery.ui.widget.js' + } + }, + images: { + options: { + srcPrefix: 'bower_modules/chosen/public', + destPrefix: 'tmp/images/chosen' + }, + // Test source arrays + src: ['chosen-sprite.png', 'chosen-sprite@2x.png'] + }, + glob: { + options: { + destPrefix: 'tmp/js/libs' + }, + // When using glob for source files, + // the destination will always be used as a FOLDER + // in which to place the matching files + src: 'lodash/**/*.js' + }, + clean: { + options: { + clean: true, + report: false + } + } + }, + + // Before generating any new files, remove any previously-created files + clean: { + tests: [ + 'tmp' + ] + }, + + // Unit tests + nodeunit: { + tests: ['test/*_test.js'] + }, + + // Development watch task + watch: { + dev: { + files: [ + '<%= jshint.all %>' + ], + tasks: [ 'default' ] + }, + json: { + files: [ + '<%= jsonlint.all %>' + ], + tasks: [ 'jsonlint' ] + } + } + }); + + // Actually load this plugin's task(s). + grunt.loadTasks('tasks'); + + // Whenever the "test" task is run, first clean the "tmp" dir, then run this + // plugin's task(s), then test the result. + grunt.registerTask('test', [ 'clean', 'bowercopy', 'nodeunit' ]); + + // By default, lint and run all tests. + grunt.registerTask('default', [ 'jshint', 'jsonlint', 'test' ]); + +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/README.md new file mode 100644 index 0000000..9753399 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/README.md @@ -0,0 +1,213 @@ +# grunt-bowercopy +[![Build Status](https://travis-ci.org/timmywil/grunt-bowercopy.png?branch=master)](https://travis-ci.org/timmywil/grunt-bowercopy) + +> Wrangle those bower dependencies and place each one where it's supposed to be. + +- Consistently positions your dependencies where you want them in your repository. +- Conveniently facilitates [tracking your dependencies](http://addyosmani.com/blog/checking-in-front-end-dependencies/) without committing the entire Bower components folder. +- Has the potential to reduce build times dramatically. For instance, if you were building a particular source folder for your webapp or website (compiling, concatenating, and minifying JavaScript and CSS), you were forced to include the entire `bower_components` directory in your build to make it work. This plugin clears the detritus. + +## Workflow + +Whenever you add a new bower dependency, add which file should be copied and where to your Gruntfile `"bowercopy"` config. Then, run `grunt bowercopy`. + +By default, bowercopy runs `bower install` for you (turn this off with the `runbower` option). Your bower directory is not removed so you can see which files you need from each component. +It is suggested that you add the bower directory (usually `'bower_components'`) to your `.gitignore`. + +## Getting Started +This plugin requires Grunt. + +If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: + +```shell +npm install grunt-bowercopy --save-dev +``` + +Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: + +```js +grunt.loadNpmTasks('grunt-bowercopy'); +``` + +*Note: have a look at [load-grunt-tasks](https://github.com/sindresorhus/load-grunt-tasks) so you can skip this step for all your grunt plugins.* + +## The "bowercopy" task + +### Overview +In your project's Gruntfile, add a section named `bowercopy` to the data object passed into `grunt.initConfig()`. + +```js +grunt.initConfig({ + bowercopy: { + options: { + // Task-specific options go here + }, + your_target: { + // Target-specific file lists and/or options go here + } + } +}); +``` + +### Options + +#### options.srcPrefix +Type: `String` +Default value: The `directory` property value in your `.bowerrc` or `'bower_components'` if the `.bowerrc` cannot be found. + +`srcPrefix` will prefix your source locations with the correct bower folder location. + +#### options.destPrefix +Type: `String` +Default value: `''` + +`destPrefix` will be used as the prefix for destinations. + +#### options.report +Type: `Boolean` +Default value: `true` + +Report any modules in your bower.json that have not been configured to copy at least one file with `bowercopy`. + +#### options.runBower +Type: `Boolean` +Default value: `true` + +Run `bower install` in conjunction with the `bowercopy` task. + +#### options.clean +Type: `Boolean` +Default value: `false` + +Removes the bower components directory on completion. The folder path that is removed is `options.srcPrefix`. + +**Note: the directory will only be removed if the following conditions are met.** + + 1. All task targets are run (i.e. grunt-bowercopy was run with the command `grunt bowercopy` and not `grunt bowercopy:target`). + 2. At least one thing was copied from each bower component (grunt-bowercopy tracks this for you). + +#### options.copyOptions +Type: `Object` +Default value: `{}` + +Options to pass to `grunt.file.copy` when copying the files. See [grunt.file.copy](http://gruntjs.com/api/grunt.file#grunt.file.copy) + +### Usage Examples + +```js +grunt.initConfig({ + bowercopy: { + options: { + // Bower components folder will be removed afterwards + clean: true + }, + // Anything can be copied + test: { + options: { + destPrefix: 'test/js' + }, + files: { + // Keys are destinations (prefixed with `options.destPrefix`) + // Values are sources (prefixed with `options.srcPrefix`); One source per destination + // e.g. 'bower_components/chai/lib/chai.js' will be copied to 'test/js/libs/chai.js' + 'libs/chai.js': 'chai/lib/chai.js': , + 'mocha/mocha.js': 'libs/mocha/mocha.js', + 'mocha/mocha.css': 'libs/mocha/mocha.css' + } + }, + // Javascript + libs: { + options: { + destPrefix: 'public/js/libs' + }, + files: { + 'jquery.js': 'jquery/jquery.js', + 'require.js': 'requirejs/require.js' + }, + }, + plugins: { + options: { + destPrefix: 'public/js/plugins' + }, + files: { + // Make dependencies follow your naming conventions + 'jquery.chosen.js': 'chosen/public/chosen.js' + } + }, + // Less + less: { + options: { + destPrefix: 'less' + }, + files: { + // If either the src or the dest is not present, + // the specified location will be used for both. + // In other words, this will copy + // 'bower_components/bootstrap/less/dropdowns.less' to 'less/bootstrap/less/dropdowns.less' + // See http://gruntjs.com/configuring-tasks#files for recommended files formats + src: 'bootstrap/less/dropdowns.less' + } + }, + // Images + images: { + options: { + destPrefix: 'public/images' + }, + files: { + 'account/chosen-sprite.png': 'chosen/public/chosen-sprite.png', + 'account/chosen-sprite@2x.png': 'chosen/public/chosen-sprite@2x.png' + } + }, + // Entire folders + folders: { + files: { + // Note: when copying folders, the destination (key) will be used as the location for the folder + 'public/js/libs/lodash': 'lodash' + } + }, + // Glob patterns + glob: { + files: { + // When using glob patterns, destinations are *always* folder names + // into which matching files will be copied + // Also note that subdirectories are **not** maintained + // if a destination is specified + // For example, one of the files copied here is + // 'lodash/dist/lodash.js' -> 'public/js/libs/lodash/lodash.js' + 'public/js/libs/lodash': 'lodash/dist/*.js' + } + }, + // Glob without destination + globSrc: { + options: { + destPrefix: 'public/js/libs' + }, + // By not specifying a destination, you are denoting + // that the lodash directory structure should be maintained + // when copying. + // For example, one of the files copied here is + // 'lodash/dist/lodash.js' -> 'public/js/libs/lodash/dist/lodash.js' + src: 'lodash/**/*.js' + } + } +}); +``` + +## Contributing +Follow the same coding style present in the repo and add tests for any bug fix or feature addition. + +See the [CONTRIBUTING.md](https://github.com/timmywil/grunt-bowercopy/blob/master/CONTRIBUTING.md) for more info. + +## Release History + +- **0.7.1** *1-20-2014* Fix Windows issue with path seperators. +- **0.7.0** *1-13-2014* Add `options.report`. Camelcase `options.runBower`. Fix an issue with a source format (gh-9). +- **0.6.0** *1-13-2014* Add glob matcher. +- **0.5.0** *12-31-2013* Add `options.copyOptions` to be passed along to `grunt.file.copy` and fix issue with local-only bower usage. +- **0.4.0** *12-3-2013* Update grunt to 0.4.2. Add the ability to copy folders. +- **0.3.0** *12-2-2013* Add clean option for removing the bower components directory on full task completion. +- **0.2.0** *11-19-2013* Report any bower components not configured to be copied when all targets are run together. +- **0.1.0** *11-19-2013* First Release + +## License +Copyright (c) 2013 Timmy Willison. Licensed under the MIT license. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/bower.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/bower.json new file mode 100644 index 0000000..11ab24c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/bower.json @@ -0,0 +1,32 @@ +{ + "name": "grunt-bowercopy", + "version": "0.7.1", + "homepage": "https://github.com/timmywil/grunt-bowercopy", + "authors": [ + "Timmy Willison " + ], + "description": "Scrupulously manage file locations for bower dependencies.", + "main": "Gruntfile.js", + "keywords": [ + "gruntplugin", + "bowercopy", + "bower", + "copy" + ], + "license": "MIT", + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_modules", + "test" + ], + "devDependencies": { + "backbone": "1.1.0", + "chosen": "1.0.0", + "jquery": "2.0.3", + "jquery.panzoom": "1.8.1", + "jquery-ui": "jquery/jquery-ui#c0ab71056b936627e8a7821f03c044aec6280a40", + "lodash": "2.4.1" + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/.bin/bower b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/.bin/bower new file mode 120000 index 0000000..fb14129 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/.bin/bower @@ -0,0 +1 @@ +../bower/bin/bower \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.editorconfig new file mode 100644 index 0000000..4020877 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[**.std] +insert_final_newline = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.jshintrc new file mode 100644 index 0000000..2d3e748 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.jshintrc @@ -0,0 +1,62 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": "vars", + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.npmignore new file mode 100644 index 0000000..4a75fd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.npmignore @@ -0,0 +1,12 @@ +/node_modules +/npm-debug.log + +/test/assets/temp +/test/assets/temp2 +/test/assets/temp-resolve-cache +/test/assets/package-*/ +/test/reports + +/bower.json +/component.json +/bower_components diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.travis.yml new file mode 100644 index 0000000..3d82b84 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.8" +before_script: + - npm install grunt-cli -g diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CHANGELOG.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CHANGELOG.md new file mode 100644 index 0000000..6ce1ab4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CHANGELOG.md @@ -0,0 +1,346 @@ +# Changelog + + +##1.2.8 - 2013-12-02 +- Fix absolute paths ending with / not going through the FsResolver, ([#898](https://github.com/bower/bower/issues/898)) +- Allow query string parameters in package URLs +- Swapped 'unzip' module for 'decompress-zip', and some other small unzipping fixes([#873](https://github.com/bower/bower/issues/873), [#896](https://github.com/bower/bower/issues/896)) +- Allow the root-check to be overidden when calling bower programmatically. +- Fixed some bugs relating to packages with a very large dependency tree +- Fix a bug caused by a recent change to semver + + + +## 1.2.7 - 2013-09-29 + +- Do not swallow sync errors when using the programmatic API ([#849](https://github.com/bower/bower/issues/849)) +- Fix resolutions not being saved if `--force-latest` is specified ([#861](https://github.com/bower/bower/issues/861)) +- Fix `bower register` warning about URL conversion, even if no conversion occurred +- Fix `bower update` not correctly catching up branch commits +- Add configured directory in `.bowerrc` to the ignores in `bower init` ([#854](https://github.com/bower/bower/issues/854)) +- Fix some case sensitive issues with data stored in registry cache (e.g.: jquery/jQuery, [#859](https://github.com/bower/bower/issues/859)) +- Fix bower not checking out a tag if it looks like a semver (e.g.: 1.0, [#872](https://github.com/bower/bower/issues/872)) +- Fix install & update commands printing the wrong versions in some cases ([#879](https://github.com/bower/bower/issues/879)) +- Give priority to mime type headers when deciding if a package need to be extracted, except if it is `octet-stream` + +_NOTE_: It's advisable that users run `bower cache clean`. + + +## 1.2.6 - 2013-09-04 + +- Bower now reports download progress even for servers that do not respond with `content-length` header. +- Do not translate endpoints when registering a package to a private registry server ([#832](https://github.com/bower/bower/issues/832)) +- Detect corrupted downloads by comparing downloaded bytes with `content-length` header if possible; this fixes Bower silently failing on unstable networks ([#824](https://github.com/bower/bower/issues/824) and [#792](https://github.com/bower/bower/issues/792)) +- Fix quotes in fields causing Bower to crash in the `init` command ([#841](https://github.com/bower/bower/issues/841)) + + +## 1.2.5 - 2013-08-28 + +- Fix persistent conflict resolutions not working correctly for branches ([#818](https://github.com/bower/bower/issues/818)) +- Fix Bower failing to run if HOME is not set ([#826](https://github.com/bower/bower/issues/826)) +- Bower now prints a warning if HOME is not set ([#827](https://github.com/bower/bower/issues/827)) +- Fix progress message being fired after completion of long running `git clone` commands +- Other minor improvements + + +## 1.2.4 - 2013-08-23 + +- Fix ignored nested folders not being correctly handled in some cases ([#814](https://github.com/bower/bower/issues/814)) + + +## 1.2.3 - 2013-08-22 + +- Fix read of environment variables that map to config properties with dashes and also support nested ones ([#8@bower-config](https://github.com/bower/config/issues/8)) +- Fix `bower info ` printing the available versions (it shouldn't!) +- Fix interactive shell not being correctly detected in node `0.8.x` ([#802](https://github.com/bower/bower/issues/802)) +- Fix `extraneous` flag in the `list` command being incorrectly set for saved dev dependencies in some cases +- Fix linked dependencies not being read in `bower list` on Windows ([#813](https://github.com/bower/bower/issues/813)) +- Fix update notice not working with `--json` + + +## 1.2.2 - 2013-08-20 + +- Standardize prompt behaviour with and without `--json` +- Improve detection of `git` servers that do not support shallow clones ([#805](https://github.com/bower/bower/issues/805)) +- Ignore remote tags (tags ending with ^{}) +- Fix bower not saving the correct endpoint in some edge cases ([#806](https://github.com/bower/bower/issues/806)) + + +## 1.2.1 - 2013-08-19 + +- Fix bower throwing on non-semver targets ([#800](https://github.com/bower/bower/issues/800)) + + +## 1.2.0 - 2013-08-19 + +- __Bower no longer installs a pre-release version by default, that is, if no version/range is specified__ ([#782](https://github.com/bower/bower/issues/782)) +- __`bower info ` will now show the latest `` information along with the available versions__ ([#759](https://github.com/bower/bower/issues/759)) +- __`bower link` no longer requires an elevated user on Windows in most cases__ ([#472](https://github.com/bower/bower/issues/472)) +- __Init command now prompts for the whole `bower.json` spec properties, filling in default values for `author` and `homepage` based on `git` settings__ ([#693](https://github.com/bower/bower/issues/693)) +- Changes to endpoint sources in `bower.json` are now catched up by `bower install` and `bower update` ([#788](https://github.com/bower/bower/issues/788)) +- Allow semver ranges in `bower cache clean`, e.g. `bower cache clean jquery#<2.0.0` ([#688](https://github.com/bower/bower/issues/688)) +- Normalize `bower list --paths` on Windows ([#279](https://github.com/bower/bower/issues/279)) +- Multiple mains are now correctly outputted as an array in `bower list --paths` ([#784](https://github.com/bower/bower/issues/784)) +- Add `--relative` option to `bower list --json` so that Bower outputs relative paths instead of absolute ([#714](https://github.com/bower/bower/issues/714)) +- `bower list --paths` now outputs relative paths by default; can be turned off with `--no-relative` ([#785](https://github.com/bower/bower/issues/785)) +- Bower no longer fails if `symlinks` to files are present in the `bower_components` folder ([#783](https://github.com/bower/bower/issues/783) and [#791](https://github.com/bower/bower/issues/791)) +- Disable git templates/hooks when running `git` ([#761](https://github.com/bower/bower/issues/761)) +- Add instructions to setup git workaround for proxies when execution of `git` fails ([#250](https://github.com/bower/bower/issues/250)) +- Ignore `component.json` if it looks like a component(1) file ([#556](https://github.com/bower/bower/issues/556)) +- Fix multi-user usage on bower when it creates temporary directories to hold some files +- Fix prompting causing an invalid JSON output when running commands with `--json` +- When running Bower commands programmatically, prompting is now disabled by default (see the updated progammatic [usage](https://github.com/bower/bower#programmatic-api) for more info) +- Other minor improvements and fixes + +Fix for `#788` requires installed components to be re-installed. + + +## 1.1.2 - 2013-08-10 + +- Detect and fallback if the git server does not support `--depth=1` when cloning ([#747](https://github.com/bower/bower/issues/747)) + + +## 1.1.1 - 2013-08-08 + +- Fix silent fail when spawning child processes in some edge cases ([#722](https://github.com/bower/bower/issues/722)) +- Fix `home` command not guessing the correct URL for `GitHub` ssh endpoints (requires `bower cache-clean`) +- Fix bower not correctly filtering packages with symlinks in some cases ([#730](https://github.com/bower/bower/issues/730)) +- Fix multi-user usage on bower when it falls back to create a `/tmp/bower` folder ([#743](https://github.com/bower/bower/issues/743)) +- Bower now sends a fake user agent when behind a proxy by default, so that corporate proxies do not block requests ([#698](https://github.com/bower/bower/issues/698)) +- Bower now translates GitHub public `git://` URLs to `git@` when behind a proxy ([#731](https://github.com/bower/bower/issues/731)) +- Minor improvements to the CLI output on small terminals +- Minor programmatic usage improvements +- Minor help usage fixes + + +## 1.1.0 - 2013-08-03 + +- __Fix `--save` and `--save-dev` not working correctly for the uninstall command in some situations__ +- __Attempting to register a package that declares `"private": true` in `bower.json` will result in an error ([#162](https://github.com/bower/bower/issues/162))__ +- __Fix retry strategy on download error that was causing some strange I/O errors__ ([#699](https://github.com/bower/bower/issues/699) and [#704](https://github.com/bower/bower/issues/704)) +- __`bower prune` now clears pruned packages dependencies if they are also extraneous__ ([#708](https://github.com/bower/bower/issues/708)) +- __`bower uninstall` now uninstalls uninstalled packages dependencies if they are not shared ([#609](https://github.com/bower/bower/issues/609))__ +- Fix `bower list` display the `incompatible` label even if they are compatible ([#710](https://github.com/bower/bower/issues/710)) +- Fix `bower cache clean` not working correctly when `package#non-semver` is specified +- Implement no operation `completion` command to prevent weird output when hitting tab ([#691](https://github.com/bower/bower/issues/691)) +- Fix `bower info --help` ([#703](https://github.com/bower/bower/issues/703)) +- Add colorized output for `bower info #` ([#571](https://github.com/bower/bower/issues/571)) +- Added `bower ls` as an alias to `bower list` +- Fix regression: do not create a json file when saving is required, warn instead +- Ignore linked packages when reading dependencies in `bower init` ([#709](https://github.com/bower/bower/issues/709)) +- `bower list` is now able to (partially) reconstruct the dependency tree, even for dependencies not declared in `bower.json` ([#622](https://github.com/bower/bower/issues/622)) + + +## 1.0.3 - 2013-07-30 + +- Fix some changes not being saved to bower.json ([#685](https://github.com/bower/bower/issues/685)) +- Fix `bower info ` not showing information related to property of the latest version of that package ([#684](https://github.com/bower/bower/issues/684)) + + +## 1.0.2 - 2013-07-30 + +- Fix severe bug originated from a wrong merge that caused conflict messages to not show up correctly + + +## 1.0.1 - 2013-07-29 + +- Fix `bower register` going ahead even if the answer was `no` ([#644](https://github.com/bower/bower/issues/644)) +- Fix local endpoints with backslashes on Windows ([#2@endpoint-parser](https://github.com/bower/endpoint-parser/pull/2)) +- Fix usage of multiple registries in the registry-client ([#3@registry-client](https://github.com/bower/registry-client/pull/3) and [#2@registry-client](https://github.com/bower/registry-client/pull/2)) +- File extensions now have more priority than mime types when deciding if extraction is necessary ([#657](https://github.com/bower/bower/pull/657)) +- Fix `Bower` not working when calling `.bat`/`.cmd` commands on Windows; it affected people using `Git portable` ([#626](https://github.com/bower/bower/issues/626)) +- Fix `bower list --paths` not resolving all files to absolute paths when the `main` property contained multiple files ([660](https://github.com/bower/bower/issues/660)) +- Fix `Bower` renaming `bower.json` and `component.json` files to `index.json` when it was the only file in the folder ([#674](https://github.com/bower/bower/issues/674)) +- Ignore symlinks when copying/extracting since they are not portable, specially accross different hard-drives ([#665](https://github.com/bower/bower/issues/665)) +- Local file/dir endpoints are now exclusively referenced by an absolute path or relative path starting with `.` ([#666](https://github.com/bower/bower/issues/666)) +- Linked packages `bower.json` files are now parsed, making `bower list` account linked packages dependencies ([#659](https://github.com/bower/bower/issues/659)) +- Bower now fails to run with sudo unless `--allow-root` is passed ([#498](https://github.com/bower/bower/issues/498)) +- Add additional system information such as node version, bower version, OS version when an error occurs ([#670](https://github.com/bower/bower/issues/670)) +- `bower install` no longer overwrites `linked` packages unless it needs to ([#593](https://github.com/bower/bower/issues/593)). +- All endpoint parts are now trimmed so that the Manager can better detect similar endpoints ([#3@endpoint-parser](https://github.com/bower/endpoint-parser/pull/3)) +- `bower register` now shows the server that will be used ([#647](https://github.com/bower/endpoint-parser/pull/647)) + + +## 1.0.0 - 2013-07-23 + +Total rewrite of bower. +The list bellow highlights the most important stuff. +For a complete list of changes that this rewrite and release brings please read: https://github.com/bower/bower/wiki/Rewrite-state + + +- Clear architecture and separation of concerns +- Much much faster +- `--json` output for all commands +- `--offline` usage for all commands, except `register` +- Proper `install` and `update` commands, similar to `npm` in behaviour +- Named endpoints when installing, e.g. `bower install backbone-amd=backbone#~1.0.0` +- New interactive conflict resolution strategy +- Prevent human errors when using `register` +- New `home` command, similar to `npm` +- New `cache list` command +- New `prune` command +- Many many general bug fixes + +Non-backwards compatible changes: + +- The value of the `json` property from .bowerrc is no longer used +- `--map` and `--sources` from the list command were removed, use `--json` instead +- Programmatic usage changed, specially the commands interface + +Users upgrading from `bower-canary` and `bower@~0.x.x` should do a `bower cache clean`. +Additionally you may remove the `~/.bower` folder manually since it's no longer used. +On Windows the folder is located in `AppData/bower`. + + +## 0.10.0 - 2013-07-02 + +- __Allow specific commits to be targeted__ ([#275](https://github.com/bower/bower/issues/275)) +- __Change bower default folder from `components` to `bower_components`__ ([#434](https://github.com/bower/bower/issues/434)) +- __Support semver pre-releases and builds__ ([#188](https://github.com/bower/bower/issues/188)) +- Use `Content-Type` and `Content-Disposition` to guess file types, such as zip files ([#454](https://github.com/bower/bower/pull/454)) +- Fix bower failing silently when using an invalid version value in the bower.json file ([#439](https://github.com/bower/bower/issues/439)) +- Fix bower slowness when downloading after redirects ([#437](https://github.com/bower/bower/issues/437)) +- Detect and error out with a friendly message when `git` is not installed ([#362](https://github.com/bower/bower/issues/362)) +- Add `--quiet` and `--silent` CLI options ([#343](https://github.com/bower/bower/issues/343)) +- Minor programmatic usage improvements + +_NOTE_: The `components` folder will still be used if already created, making it easier for users to upgrade. + +## 0.9.2 - 2013-04-28 +- Better fix for [#429](https://github.com/bower/bower/issues/429) + +## 0.9.1 - 2013-04-27 +- Update `package.json`, docs and other stuff to point to the new `Bower` organisation on GitHub +- Fix root label of `bower list` being an absolute path; now uses the package name +- Fix `bower update ` updating all packages; now throws when updating an unknown package +- Fix `list` command when package use different names than the `guessed` one ([#429](https://github.com/bower/bower/issues/429)) + +## 0.9.0 - 2013-04-25 +- __Change from `component.json` to `bower.json`__ ([#39](https://github.com/bower/bower/issues/39)) +- __Compatibility with `node 0.10.x`, including fix hangs/errors when extracting `zip` files__ +- Fix `--save` and `--save-dev` not working with URLs that get redirected ([#417](https://github.com/bower/bower/issues/417)) +- Fix `init` command targeting `~commit` instead of `*`. ([#385](https://github.com/bower/bower/issues/385)) +- Remove temporary directories before exiting ([#345](https://github.com/bower/bower/issues/345)) +- Integrate `update-notifier` ([#202](https://github.com/bower/bower/issues/202)) +- Use `json` name when a package name was inferred ([#192](https://github.com/bower/bower/issues/192)) +- Fix `bin/bower` not exiting with an exit code greater than zero when an error occurs ([#187](https://github.com/bower/bower/issues/187)) +- Fix `--save` and `--save-dev` saving resolved shorthands instead of the actual shorthands +- Fix bower using user defined git templates ([#324](https://github.com/bower/bower/issues/324)) +- Add command abbreviations ([#262](https://github.com/bower/bower/issues/262)) +- Improve help messages and fix abuse of colors in output +- Wait for every package to resolve before printing error messages ([#290](https://github.com/bower/bower/issues/290)) +- Add `shorthand_resolver` to allow shorthands to be resolved to repositories other than GitHub ([#278](https://github.com/bower/bower/issues/278)) + +## 0.8.6 - 2013-04-03 +- Emergency fix for `node 0.8.x` users to make `zip` extraction work again + +## 0.8.5 - 2013-03-04 +- Fix `cache-clean` command clearing the completion cache when the command was called with specific packages +- Add error message when an error is caught parsing an invalid `component.json` + +## 0.8.4 - 2013-03-01 +- Fix some more duplicate async callbacks being called twice +- Preserve new lines when saving `component.json` ([#285](https://github.com/bower/bower/issues/285)) + +## 0.8.3 - 2013-02-27 +- Fix error when using the `update` command ([#282](https://github.com/bower/bower/issues/282)) + +## 0.8.2 - 2013-02-26 +- Fix some errors in windows while removing directories, had to downgrade `rimraf` ([#274](https://github.com/bower/bower/issues/274)) +- Prevent duplicate package names in error summaries ([#277](https://github.com/bower/bower/issues/277)) + +## 0.8.1 - 2013-02-25 +- Fix some async callbacks being fired twice ([#274](https://github.com/bower/bower/issues/274)) + +## 0.8.0 - 2013-02-24 +- __Add init command similar to `npm init`__ ([#219](https://github.com/bower/bower/issues/219)) +- __Add devDependencies__ support ([#251](https://github.com/bower/bower/issues/251)) +- __Add `--save-dev` flag to install/uninstall commands__ ([#258](https://github.com/bower/bower/issues/258)) +- `cache-clean` command now clears links pointing to nonexistent folders ([#182](https://github.com/bower/bower/issues/182)) +- Fix issue when downloading assets behind a proxy using `https` ([#230](https://github.com/bower/bower/issues/230)) +- Fix --save saving unresolved components ([#240](https://github.com/bower/bower/issues/240)) +- Fix issue when extracting some zip files ([#225](https://github.com/bower/bower/issues/225)) +- Fix automatic conflict resolver not selecting the correct version +- Add `--sources` option to the `list` command ([#235](https://github.com/bower/bower/issues/235)) +- Automatically clear cache when git commands fail with code 128 ([#216](https://github.com/bower/bower/issues/216)) +- Fix `bower` not working correctly behind a proxy in some commands ([#208](https://github.com/bower/bower/issues/208)) + +## 0.7.1 - 2013-02-20 +- Remove postinstall script from `bower` installation + +## 0.7.0 - 2013-02-01 +- __Ability to resolve conflicts__ ([#214](https://github.com/bower/bower/issues/214)) +- __Ability to search and publish to different endpoints by specifying them in the `.bowerrc` file__ +- __Experimental autocompletion__ +- __Ability to exclude (ignore) files__ +- Fix minor issues in the cache clean command +- Better error message for invalid semver tags ([#185](https://github.com/bower/bower/issues/185)) +- Only show discover message in the list command only if there are packages +- Fix mismatch issue due to reading cached component.json files ([#214](https://github.com/bower/bower/issues/214)) +- Better error messages when reading invalid .bowerrc files ([#220](https://github.com/bower/bower/issues/220)) +- Fix update command when used in packages pointing to assets ([#197](https://github.com/bower/bower/issues/197)) +- Bower now obeys packages's `.bowerrc` if they define a different `json` ([#205](https://github.com/bower/bower/issues/205)) + +## 0.6.8 - 2012-12-14 +- Improve list command + - Does not fetch versions if not necessary (for --map and --paths options) + - Add --offline option to prevent versions from being fetched +- Fix uninstall command not firing the `end` event +- Fix error when executing an unknown command ([#179](https://github.com/bower/bower/issues/179)) +- Fix help for the ls command (alias of list) + +## 0.6.7 - 2012-12-10 +- Fix uninstall removing all unsaved dependencies ([#178](https://github.com/bower/bower/issues/178)) +- Fix uninstall --force flag in some cases +- Add --silent option to the register option, to avoid questioning +- Fix possible issues with options in some commands +- Fix error reporting when reading invalid project component.json + +## 0.6.6 - 2012-12-03 +- Improve error handling while reading component.json +- Fix package name not being correctly collected in the error summary + +## 0.6.5 - 2012-12-01 +- Fix error summary not being displayed in some edge cases +- Fix bower not fetching latest commits correctly in some cases + +## 0.6.4 - 2012-11-29 +- Fix permission on downloaded files ([#160](https://github.com/bower/bower/issues/160)) + +## 0.6.3 - 2012-11-24 +- Fix version not being correctly set for local packages ([#155](https://github.com/bower/bower/issues/155)) + +## 0.6.2 - 2012-11-23 +- Fix uninstall --save when there is no component.json + +## 0.6.1 - 2012-11-22 +- Fix uninstall when the project component.json has no deps saved ([#153](https://github.com/bower/bower/issues/153)) +- Fix uncaught errors when using file writter (they are now caught and reported) +- Fix temporary directories not being deleted when an exception occurs ([#153](https://github.com/bower/bower/issues/140)) + +## 0.6.0 - 2012-11-21 +- __Add link command__ (similar to npm) +- Fix error reporting for nested deps +- Abort if a repository is detected when installing. + This is useful to prevent people from loosing their work +- Minor fixes and improvements + +## 0.5.1 - 2012-11-20 +- Add errors summary to the end of install/update commands +- Add windows instructions to the README + +## 0.5.0 - 2012-11-19 +- __Remove package.json support__ +- __Support for local path repositories__ ([#132](https://github.com/bower/bower/issues/132)) +- `install --save` now saves the correct tag (e.g: ~0.0.1) instead of 'latest' +- `install --save` now saves packages pointing directly to assets correctly +- Bower automatically creates a component.json when install with `--save` is used +- Fix issues with list command ([#142](https://github.com/bower/bower/issues/142)) +- Fix local paths not being saved when installing with --save ([#114](https://github.com/bower/bower/issues/114)) +- `uninstall` now uninstalls nested dependencies if they are not shared ([#83](https://github.com/bower/bower/issues/83)) +- `uninstall` now warns when a dependency conflict occurs and aborts. + It will only proceed if the `--force` flag is passed +- Bower now detects mismatches between the version specified in the component.json and the tag, informing the user +- `bower ls` now informs when a package has a new commit (for non-tagged repos) +- Add jshintrc and fix a lot of issues related with JSHint warnings +- `bower register` now prompts if the user really wants to proceed diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CONTRIBUTING.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CONTRIBUTING.md new file mode 100644 index 0000000..f65d5d5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/CONTRIBUTING.md @@ -0,0 +1,194 @@ +# Contributing to Bower + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue, assessing +changes, and helping you finalize your pull requests. + + +## Using the issue tracker + +The issue tracker is the preferred channel for [bug reports](#bugs), +[features requests](#features) and [submitting pull +requests](#pull-requests), but please respect the following restrictions: + +* Please **do not** use the issue tracker for personal support requests. Use + [Stack Overflow](http://stackoverflow.com/questions/tagged/bower), our + [Mailing List](http://groups.google.com/group/twitter-bower) + (twitter-bower@googlegroups.com), or + [#bower](http://webchat.freenode.net/?channels=bower) on Freenode. + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful - thank you! + +Guidelines for bug reports: + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `master` or development branch in the repository. + +3. **Isolate the problem** — ideally create a [reduced test + case](http://css-tricks.com/6263-reduced-test-cases/). + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What OS experiences the +problem? What would you expect to be the outcome? All these details will help +people to fix any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/OS environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the reduced test case +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + + +## Pull requests + +Good pull requests - patches, improvements, new features - are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code), otherwise you risk spending a lot of +time working on something that the project's developers might not want to merge +into the project. + +Please adhere to the coding conventions used throughout a project (indentation, +accurate comments, etc.) and any other requirements (such as test coverage). + +Adhering to the following this process is the best way to get your work +included in the project: + +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//bower + # Navigate to the newly cloned directory + cd bower + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/bower/bower + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout master + git pull upstream master + ``` + +3. Create a new topic branch (off the main project development branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +4. Make sure to update, or add to the tests when appropriate. Patches and + features will not be accepted without tests. Run `npm test` to check that + all tests pass after you've made changes. + +5. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git's + [interactive rebase](https://help.github.com/articles/interactive-rebase) + feature to tidy up your commits before making them public. + +6. Locally merge (or rebase) the upstream development branch into your topic branch: + + ```bash + git pull [--rebase] upstream master + ``` + +7. Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) + with a clear title and description. + +9. If you are asked to amend your changes before they can be merged in, please + use `git commit --amend` (or rebasing for multi-commit Pull Requests) and + force push to your remote feature branch. You may also be asked to squash + commits. + +**IMPORTANT**: By submitting a patch, you agree to license your work under the +same license as that used by the project. + + + +## Maintainers + +If you have commit access, please follow this process for merging patches and cutting new releases. + +### Reviewing changes + +1. Check that a change is within the scope and philosophy of the project. +2. Check that a change has any necessary tests and a proper, descriptive commit message. +3. Checkout the change and test it locally. +4. If the change is good, and authored by someone who cannot commit to + `master`, please try to avoid using GitHub's merge button. Apply the change + to `master` locally (feel free to amend any minor problems in the author's + original commit if necessary). +5. If the change is good, and authored by another maintainer/collaborator, give + them a "Ship it!" comment and let them handle the merge. + +### Submitting changes + +1. All non-trivial changes should be put up for review using GitHub Pull + Requests. +2. Your change should not be merged into `master` (or another feature branch), + without at least one "Ship it!" comment from another maintainer/collaborator + on the project. "Looks good to me" is not the same as "Ship it!". +3. Try to avoid using GitHub's merge button. Locally rebase your change onto + `master` and then push to GitHub. +4. Once a feature branch has been merged into its target branch, please delete + the feature branch from the remote repository. + +### Releasing a new version + +1. Include all new functional changes in the CHANGELOG. +2. Use a dedicated commit to increment the version. The version needs to be + added to the `CHANGELOG.md` (inc. date) and the `package.json`. +3. The commit message must be of `v0.0.0` format. +4. Create an annotated tag for the version: `git tag -m "v0.0.0" v0.0.0`. +5. Push the changes and tags to GitHub: `git push --tags origin master`. +6. Publish the new version to npm: `npm publish`. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/Gruntfile.js new file mode 100644 index 0000000..400ee85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/Gruntfile.js @@ -0,0 +1,48 @@ +module.exports = function (grunt) { + grunt.initConfig({ + jshint: { + options: { + jshintrc: '.jshintrc' + }, + files: ['Gruntfile.js', 'bin/*', 'lib/**/*.js', 'test/**/*.js', '!test/assets/**/*', '!test/reports/**/*'] + }, + simplemocha: { + options: { + reporter: 'spec', + timeout: '5000' + }, + full: { src: ['test/test.js'] }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/test.js'] + } + }, + exec: { + assets: { + command: 'node test/packages.js' + }, + 'assets-force': { + command: 'node test/packages.js --force' + }, + cover: { + command: 'node node_modules/istanbul/lib/cli.js cover --dir ./test/reports node_modules/mocha/bin/_mocha -- -R dot test/test.js' + } + }, + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + }); + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-mocha'); + grunt.loadNpmTasks('grunt-exec'); + + grunt.registerTask('assets', ['exec:assets-force']); + grunt.registerTask('test', ['jshint', 'exec:assets', 'simplemocha:full']); + grunt.registerTask('cover', 'exec:cover'); + grunt.registerTask('default', 'test'); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/README.md new file mode 100644 index 0000000..30c3c5c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/README.md @@ -0,0 +1,381 @@ +# Bower + +[![Build Status](https://secure.travis-ci.org/bower/bower.png?branch=master)](http://travis-ci.org/bower/bower) [![Views in the last 24 hours](https://sourcegraph.com/api/repos/github.com/bower/bower/counters/views-24h.png)](https://sourcegraph.com/github.com/bower/bower) + + + +Bower is a package manager for the web. It offers a generic, unopinionated +solution to the problem of **front-end package management**, while exposing the +package dependency model via an API that can be consumed by a more opinionated +build stack. There are no system wide dependencies, no dependencies are shared +between different apps, and the dependency tree is flat. + +Bower runs over Git, and is package-agnostic. A packaged component can be made +up of any type of asset, and use any type of transport (e.g., AMD, CommonJS, +etc.). + +[View all packages available through Bower's registry](http://sindresorhus.com/bower-components/). + + +## Installing Bower + +Bower depends on [Node](http://nodejs.org/) and [npm](http://npmjs.org/). It's +installed globally using npm: + +``` +npm install -g bower +``` + +Also make sure that [git](http://git-scm.com/) is installed as some bower +packages require it to be fetched and installed. + + +## Usage + +Much more information is available via `bower help` once it's installed. This +is just enough to get you started. + +### Installing packages and dependencies + +Bower offers several ways to install packages: + +#####Using the dependencies listed in the current directory's bower.json +``` +bower install +``` +##### Using a local or remote package +``` +bower install +``` +##### Using a specific version of a package +``` +bower install # +``` +##### Using a different name and a specific version of a package +``` +bower install =# +``` + +Where `` can be any one of the following: + +* A name that maps to a package registered with Bower, e.g, `jquery`. ‡ +* A remote Git endpoint, e.g., `git://github.com/someone/some-package.git`. Can be + public or private. ‡ +* A local endpoint, i.e., a folder that's a Git repository. ‡ +* A shorthand endpoint, e.g., `someone/some-package` (defaults to GitHub). ‡ +* A URL to a file, including `zip` and `tar` files. Its contents will be + extracted. + +‡ These types of `` might have versions available. You can specify a +[semver](http://semver.org/) compatible version to fetch a specific release, and lock the +package to that version. You can also use ranges to specify a range of versions. + +All package contents are installed in the `bower_components` directory by default. +You should **never** directly modify the contents of this directory. + +Using `bower list` will show all the packages that are installed locally. + +**N.B.** If you aren't authoring a package that is intended to be consumed by +others (e.g., you're building a web app), you should always [check installed +packages into source control](http://addyosmani.com/blog/checking-in-front-end-dependencies/). + +### Finding packages + +To search for packages registered with Bower: + +``` +bower search [] +``` + +Using just `bower search` will list all packages in the registry. + +### Using packages + +The easiest approach is to use Bower statically, just reference the package's +installed components manually using a `script` tag: + +```html + +``` + +For more complex projects, you'll probably want to concatenate your scripts or +use a module loader. Bower is just a package manager, but there are plenty of +other tools -- such as [Sprockets](https://github.com/sstephenson/sprockets) +and [RequireJS](http://requirejs.org/) -- that will help you do this. + +### Uninstalling packages + +To uninstall a locally installed package: + +``` +bower uninstall +``` + + +#### Warning + +On `prezto` or `oh-my-zsh`, do not forget to `alias bower='noglob bower'` or `bower install jquery\#1.9.1` + +#### Running commands with sudo + +Bower is a user command, there is no need to execute it with superuser permissions. +However, if you still want to run commands with sudo, use `--allow-root` option. + +#### A note for Windows users + +To use Bower on Windows, you must install +[msysgit](http://code.google.com/p/msysgit/) correctly. Be sure to check the +option shown below: + +![msysgit](http://f.cl.ly/items/2V2O3i1p3R2F1r2v0a12/mysgit.png) + +Note that if you use TortoiseGit and if Bower keeps asking for your SSH +password, you should add the following environment variable: `GIT_SSH - +C:\Program Files\TortoiseGit\bin\TortoisePlink.exe`. Adjust the `TortoisePlink` +path if needed. + +### Using bower's cache + +Bower supports installing packages from its local cache (without internet connection), if the packages were installed before. +``` +bower install --offline +``` +The content of the cache can be listed with: +``` +bower cache list +``` +The cache can be cleaned with: +``` +bower cache clean +``` + +## Configuration + +Bower can be configured using JSON in a `.bowerrc` file. + +The current spec can be read +[here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/edit#heading=h.4pzytc1f9j8k) +in the `Configuration` section. + + +## Defining a package + +You must create a `bower.json` in your project's root, and specify all of its +dependencies. This is similar to Node's `package.json`, or Ruby's `Gemfile`, +and is useful for locking down a project's dependencies. + +*NOTE:* In versions of Bower before 0.9.0 the package metadata file was called +`component.json` rather than `bower.json`. This has changed to avoid a name +clash with another tool. You can still use `component.json` for now but it is +deprecated and the automatic fallback is likely to be removed in an upcoming +release. + +You can interactively create a `bower.json` with the following command: + +``` +bower init +``` + +The `bower.json` defines several options: + +* `name` (required): The name of your package. +* `version`: A semantic version number (see [semver](http://semver.org/)). +* `main` [string|array]: The primary endpoints of your package. +* `ignore` [array]: An array of paths not needed in production that you want + Bower to ignore when installing your package. +* `dependencies` [hash]: Packages your package depends upon in production. +* `devDependencies` [hash]: Development dependencies. +* `private` [boolean]: Set to true if you want to keep the package private and + do not want to register the package in future. + +```json +{ + "name": "my-project", + "version": "1.0.0", + "main": "path/to/main.css", + "ignore": [ + ".jshintrc", + "**/*.txt" + ], + "dependencies": { + "": "", + "": "", + "": "" + }, + "devDependencies": { + "": "" + } +} +``` + +### Registering packages + +To register a new package: + +* There **must** be a valid manifest JSON in the current working directory. +* Your package should use [semver](http://semver.org/) Git tags. +* Your package **must** be available at a Git endpoint (e.g., GitHub); remember + to push your Git tags! + +Then use the following command: + +``` +bower register +``` + +The Bower registry does not have authentication or user management at this point +in time. It's on a first come, first served basis. Think of it like a URL +shortener. Now anyone can run `bower install `, and get your +library installed. + +There is no direct way to unregister a package yet. For now, you can [request a +package be unregistered](https://github.com/bower/bower/issues/120). + + +## Consuming a package + +Bower also makes available a source mapping. This can be used by build tools to +easily consume Bower packages. + +If you pass the `--paths` option to Bower's `list` command, you will get a +simple path-to-name mapping: + +```json +{ + "backbone": "bower_components/backbone/index.js", + "jquery": "bower_components/jquery/index.js", + "underscore": "bower_components/underscore/index.js" +} +``` + +Alternatively, every command supports the `--json` option that makes bower +output JSON. Command result is outputted to `stdout` and error/logs to +`stderr`. + + +## Programmatic API + +Bower provides a powerful, programmatic API. All commands can be accessed +through the `bower.commands` object. + +```js +var bower = require('bower'); + +bower.commands +.install(['jquery'], { save: true }, { /* custom config */ }) +.on('end', function (installed) { + console.log(installed); +}); + +bower.commands +.search('jquery', {}) +.on('end', function (results) { + console.log(results); +}); +``` + +Commands emit four types of events: `log`, `prompt`, `end`, `error`. + +* `log` is emitted to report the state/progress of the command. +* `prompt` is emitted whenever the user needs to be prompted. +* `error` will only be emitted if something goes wrong. +* `end` is emitted when the command successfully ends. + +For a better of idea how this works, you may want to check out [our bin +file](https://github.com/bower/bower/blob/master/bin/bower). + +When using bower programmatically, prompting is disabled by default. Though you can enable it when calling commands with `interactive: true` in the config. +This requires you to listen for the `prompt` event and handle the prompting yourself. The easiest way is to use the [inquirer](https://npmjs.org/package/inquirer) npm module like so: + +```js +var inquirer = require('inquirer'); + +bower.commands +.install(['jquery'], { save: true }, { interactive: true }) +// .. +.on('prompt', function (prompts, callback) { + inquirer.prompt(prompts, callback); +}); +``` + + +## Completion (experimental) + +_NOTE_: Completion is still not implemented for the 1.0.0 release + +Bower now has an experimental `completion` command that is based on, and works +similarly to the [npm completion](https://npmjs.org/doc/completion.html). It is +not available for Windows users. + +This command will output a Bash / ZSH script to put into your `~/.bashrc`, +`~/.bash_profile`, or `~/.zshrc` file. + +``` +bower completion >> ~/.bash_profile +``` + + +## Contact + +Have a question? + +* [StackOverflow](http://stackoverflow.com/questions/tagged/bower) +* [Mailinglist](http://groups.google.com/group/twitter-bower) - twitter-bower@googlegroups.com +* [\#bower](http://webchat.freenode.net/?channels=bower) on Freenode + + +## Contributing to this project + +Anyone and everyone is welcome to contribute. Please take a moment to +review the [guidelines for contributing](CONTRIBUTING.md). + +* [Bug reports](CONTRIBUTING.md#bugs) +* [Feature requests](CONTRIBUTING.md#features) +* [Pull requests](CONTRIBUTING.md#pull-requests) + + +## Authors + +* [@fat](https://github.com/fat) +* [@maccman](https://github.com/maccman) +* [@satazor](https://github.com/satazor) + +Thanks for assistance and contributions: + +[@addyosmani](https://github.com/addyosmani), +[@angus-c](https://github.com/angus-c), +[@borismus](https://github.com/borismus), +[@carsonmcdonald](https://github.com/carsonmcdonald), +[@chriseppstein](https://github.com/chriseppstein), +[@danwrong](https://github.com/danwrong), +[@davidmaxwaterman](https://github.com/davidmaxwaterman), +[@desandro](https://github.com/desandro), +[@hemanth](https://github.com/hemanth), +[@isaacs](https://github.com/isaacs), +[@josh](https://github.com/josh), +[@jrburke](https://github.com/jrburke), +[@marcelombc](https://github.com/marcelombc), +[@marcooliveira](https://github.com/marcooliveira), +[@mklabs](https://github.com/mklabs), +[@MrDHat](https://github.com/MrDHat), +[@necolas](https://github.com/necolas), +[@paulirish](https://github.com/paulirish), +[@richo](https://github.com/richo), +[@rvagg](https://github.com/rvagg), +[@sindresorhus](https://github.com/sindresorhus), +[@SlexAxton](https://github.com/SlexAxton), +[@sstephenson](https://github.com/sstephenson), +[@svnlto](https://github.com/svnlto), +[@tomdale](https://github.com/tomdale), +[@uzquiano](https://github.com/uzquiano), +[@visionmedia](https://github.com/visionmedia), +[@wagenet](https://github.com/wagenet), +[@wibblymat](https://github.com/wibblymat), +[@wycats](https://github.com/wycats) + + +## License + +Copyright 2012 Twitter, Inc. + +Licensed under the MIT License diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/bin/bower b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/bin/bower new file mode 100755 index 0000000..f3d48f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/bin/bower @@ -0,0 +1,139 @@ +#!/usr/bin/env node + +process.bin = process.title = 'bower'; + +var path = require('path'); +var mout = require('mout'); +var updateNotifier = require('update-notifier'); +var Logger = require('bower-logger'); +var osenv = require('osenv'); +var bower = require('../lib'); +var pkg = require(path.join(__dirname, '..', 'package.json')); +var cli = require('../lib/util/cli'); +var rootCheck = require('../lib/util/rootCheck'); + +// -------- + +var options; +var renderer; +var loglevel; +var command; +var commandFunc; +var logger; +var notifier; +var levels = Logger.LEVELS; + +options = cli.readOptions({ + version: { type: Boolean, shorthand: 'v' }, + help: { type: Boolean, shorthand: 'h' }, + 'allow-root': { type: Boolean } +}); + +// Handle print of version +if (options.version) { + process.stdout.write(pkg.version + '\n'); + process.exit(); +} + +// Root check +rootCheck(options, bower.config); + +// Set loglevel +if (bower.config.silent) { + loglevel = levels.error; +} else if (bower.config.verbose) { + loglevel = -Infinity; +} else if (bower.config.quiet) { + loglevel = levels.warn; +} else { + loglevel = levels[bower.config.loglevel] || levels.info; +} + +// Get the command to execute +while (options.argv.remain.length) { + command = options.argv.remain.join(' '); + + // Alias lookup + if (bower.abbreviations[command]) { + command = bower.abbreviations[command].replace(/\s/g, '.'); + break; + } + + command = command.replace(/s/g, '.'); + + // Direct lookup + if (mout.object.has(bower.commands, command)) { + break; + } + + options.argv.remain.pop(); +} + +// Execute the command +commandFunc = command && mout.object.get(bower.commands, command); +command = command && command.replace(/\./g, ' '); + +// If no command was specified, show bower help +// Do the same if the command is unknown +if (!commandFunc) { + logger = bower.commands.help(); + command = 'help'; +// If the user requested help, show the command's help +// Do the same if the actual command is a group of other commands (e.g.: cache) +} else if (options.help || !commandFunc.line) { + logger = bower.commands.help(command); + command = 'help'; +// Call the line method +} else { + logger = commandFunc.line(process.argv); + + // If the method failed to interpret the process arguments + // show the command help + if (!logger) { + logger = bower.commands.help(command); + command = 'help'; + } +} + +// Get the renderer and configure it with the executed command +renderer = cli.getRenderer(command, logger.json, bower.config); + +logger +.on('end', function (data) { + if (!bower.config.silent) { + renderer.end(data); + } +}) +.on('error', function (err) { + if (levels.error >= loglevel) { + renderer.error(err); + } + + process.exit(1); +}) +.on('log', function (log) { + if (levels[log.level] >= loglevel) { + renderer.log(log); + } +}) +.on('prompt', function (prompt, callback) { + renderer.prompt(prompt) + .then(function (answer) { + callback(answer); + }); +}); + +// Warn if HOME is not SET +if (!osenv.home()) { + logger.warn('no-home', 'HOME not set, user configuration will not be loaded'); +} + +// Check for newer version of Bower +notifier = updateNotifier({ + packageName: pkg.name, + packageVersion: pkg.version +}); + +if (notifier.update && levels.info >= loglevel) { + renderer.updateNotice(notifier.update); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/clean.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/clean.js new file mode 100644 index 0000000..411cfca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/clean.js @@ -0,0 +1,217 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var rimraf = require('rimraf'); +var Logger = require('bower-logger'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('../../core/PackageRepository'); +var semver = require('../../util/semver'); +var cli = require('../../util/cli'); +var defaultConfig = require('../../config'); + +function clean(endpoints, options, config) { + var logger = new Logger(); + var decEndpoints; + var names; + + options = options || {}; + config = mout.object.deepFillIn(config || {}, defaultConfig); + + // If endpoints is an empty array, null them + if (endpoints && !endpoints.length) { + endpoints = null; + } + + // Generate decomposed endpoints and names based on the endpoints + if (endpoints) { + decEndpoints = endpoints.map(function (endpoint) { + return endpointParser.decompose(endpoint); + }); + names = decEndpoints.map(function (decEndpoint) { + return decEndpoint.name || decEndpoint.source; + }); + } + + Q.all([ + clearPackages(decEndpoints, config, logger), + clearLinks(names, config, logger), + !names ? clearCompletion(config, logger) : null + ]) + .spread(function (entries) { + return entries; + }) + .done(function (entries) { + logger.emit('end', entries); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function clearPackages(decEndpoints, config, logger) { + var repository = new PackageRepository(config, logger); + + return repository.list() + .then(function (entries) { + var promises; + + // Filter entries according to the specified packages + if (decEndpoints) { + entries = entries.filter(function (entry) { + return !!mout.array.find(decEndpoints, function (decEndpoint) { + var entryPkgMeta = entry.pkgMeta; + + // Check if name or source match the entry + if (decEndpoint.name !== entryPkgMeta.name && + decEndpoint.source !== entryPkgMeta.name && + decEndpoint.source !== entryPkgMeta._source + ) { + return false; + } + + // If target is a wildcard, simply return true + if (decEndpoint.target === '*') { + return true; + } + + // If it's a semver target, compare using semver spec + if (semver.validRange(decEndpoint.target)) { + return semver.satisfies(entryPkgMeta.version, decEndpoint.target); + } + + // Otherwise, compare against target/release + return decEndpoint.target === entryPkgMeta._target || + decEndpoint.target === entryPkgMeta._release; + }); + }); + } + + promises = entries.map(function (entry) { + return repository.eliminate(entry.pkgMeta) + .then(function () { + logger.info('deleted', 'Cached package ' + entry.pkgMeta.name + ': ' + entry.canonicalDir, { + file: entry.canonicalDir + }); + }); + }); + + return Q.all(promises) + .then(function () { + if (!decEndpoints) { + // Ensure that everything is cleaned, + // even invalid packages in the cache + return repository.clear(); + } + }) + .then(function () { + return entries; + }); + }); +} + +function clearLinks(names, config, logger) { + var promise; + var dir = config.storage.links; + + // If no names are passed, grab all links + if (!names) { + promise = Q.nfcall(fs.readdir, dir) + .fail(function (err) { + if (err.code === 'ENOENT') { + return []; + } + + throw err; + }); + // Otherwise use passed ones + } else { + promise = Q.resolve(names); + } + + return promise + .then(function (names) { + var promises; + var linksToRemove = []; + + // Decide which links to delete + promises = names.map(function (name) { + var link = path.join(config.storage.links, name); + + return Q.nfcall(fs.readlink, link) + .then(function (linkTarget) { + // Link exists, check if it points to a folder + // that still exists + return Q.nfcall(fs.stat, linkTarget) + .then(function (stat) { + // Target is not a folder.. + if (!stat.isDirectory()) { + linksToRemove.push(link); + } + }) + // Error occurred reading the link + .fail(function () { + linksToRemove.push(link); + }); + // Ignore if link does not exist + }, function (err) { + if (err.code !== 'ENOENT') { + linksToRemove.push(link); + } + }); + }); + + return Q.all(promises) + .then(function () { + var promises; + + // Remove each link that was declared as invalid + promises = linksToRemove.map(function (link) { + return Q.nfcall(rimraf, link) + .then(function () { + logger.info('deleted', 'Invalid link: ' + link, { + file: link + }); + }); + }); + + return Q.all(promises); + }); + }); +} + +function clearCompletion(config, logger) { + var dir = config.storage.completion; + + return Q.nfcall(fs.stat, dir) + .then(function () { + return Q.nfcall(rimraf, dir) + .then(function () { + logger.info('deleted', 'Completion cache', { + file: dir + }); + }); + }, function (error) { + if (error.code !== 'ENOENT') { + throw error; + } + }); +} + +// ------------------- + +clean.line = function (argv) { + var options = clean.options(argv); + return clean(options.argv.remain.slice(2), options); +}; + +clean.options = function (argv) { + return cli.readOptions(argv); +}; + +clean.completion = function () { + // TODO: +}; + +module.exports = clean; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/index.js new file mode 100644 index 0000000..2961b74 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/index.js @@ -0,0 +1,4 @@ +module.exports = { + clean: require('./clean'), + list: require('./list') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/list.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/list.js new file mode 100644 index 0000000..49d0217 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/cache/list.js @@ -0,0 +1,56 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var PackageRepository = require('../../core/PackageRepository'); +var cli = require('../../util/cli'); +var defaultConfig = require('../../config'); + +function list(packages, options, config) { + var repository; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + repository = new PackageRepository(config, logger); + + // If packages is an empty array, null them + if (packages && !packages.length) { + packages = null; + } + + repository.list() + .then(function (entries) { + if (packages) { + // Filter entries according to the specified packages + entries = entries.filter(function (entry) { + return !!mout.array.find(packages, function (pkg) { + return pkg === entry.pkgMeta.name; + }); + }); + } + + return entries; + }) + .done(function (entries) { + logger.emit('end', entries); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +list.line = function (argv) { + var options = list.options(argv); + return list(options.argv.remain.slice(2), options); +}; + +list.options = function (argv) { + return cli.readOptions(argv); +}; + +list.completion = function () { + // TODO: +}; + +module.exports = list; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/completion.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/completion.js new file mode 100644 index 0000000..a8e16d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/completion.js @@ -0,0 +1,31 @@ +var Logger = require('bower-logger'); +var cli = require('../util/cli'); + +function completion(config) { + var logger = new Logger(); + + process.nextTick(function () { + logger.emit('end'); + }); + + return logger; +} + +// ------------------- + +completion.line = function (argv) { + var options = completion.options(argv); + var name = options.argv.remain[1]; + + return completion(name); +}; + +completion.options = function (argv) { + return cli.readOptions(argv); +}; + +completion.completion = function () { + // TODO: +}; + +module.exports = completion; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/help.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/help.js new file mode 100644 index 0000000..0daf5c6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/help.js @@ -0,0 +1,52 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var Logger = require('bower-logger'); +var cli = require('../util/cli'); +var createError = require('../util/createError'); + +function help(name) { + var json; + var logger = new Logger(); + + if (name) { + json = path.resolve(__dirname, '../../templates/json/help-' + name.replace(/\s+/g, '/') + '.json'); + } else { + json = path.resolve(__dirname, '../../templates/json/help.json'); + } + + fs.exists(json, function (exists) { + if (!exists) { + return logger.emit('error', createError('Unknown command: ' + name, 'EUNKOWNCMD', { + command: name + })); + } + + try { + json = require(json); + } catch (error) { + return logger.emit('error', error); + } + + logger.emit('end', json); + }); + + return logger; +} + +// ------------------- + +help.line = function (argv) { + var options = help.options(argv); + + return help(options.argv.remain.slice(1).join(' ')); +}; + +help.options = function (argv) { + return cli.readOptions(argv); +}; + +help.completion = function () { + // TODO +}; + +module.exports = help; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/home.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/home.js new file mode 100644 index 0000000..7c5981f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/home.js @@ -0,0 +1,76 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var Project = require('../core/Project'); +var open = require('open'); +var endpointParser = require('bower-endpoint-parser'); +var cli = require('../util/cli'); +var createError = require('../util/createError'); +var defaultConfig = require('../config'); + +function home(name, config) { + var project; + var promise; + var decEndpoint; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + // Get the package meta + // If no name is specified, read the project json + // If a name is specified, fetch from the package repository + if (!name) { + promise = project.hasJson() + .then(function (json) { + if (!json) { + throw createError('You are not inside a package', 'ENOENT'); + } + + return project.getJson(); + }); + } else { + decEndpoint = endpointParser.decompose(name); + promise = project.getPackageRepository().fetch(decEndpoint) + .spread(function (canonicalDir, pkgMeta) { + return pkgMeta; + }); + } + + // Get homepage and open it + promise.then(function (pkgMeta) { + var homepage = pkgMeta.homepage; + + if (!homepage) { + throw createError('No homepage set for ' + pkgMeta.name, 'ENOHOME'); + } + + open(homepage); + return homepage; + }) + .done(function (homepage) { + logger.emit('end', homepage); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +home.line = function (argv) { + var options = home.options(argv); + var name = options.argv.remain[1]; + + return home(name); +}; + +home.options = function (argv) { + return cli.readOptions(argv); +}; + +home.completion = function () { + // TODO: +}; + +module.exports = home; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/index.js new file mode 100644 index 0000000..57522a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/index.js @@ -0,0 +1,17 @@ +module.exports = { + cache: require('./cache'), + completion: require('./completion'), + help: require('./help'), + home: require('./home'), + info: require('./info'), + init: require('./init'), + install: require('./install'), + link: require('./link'), + list: require('./list'), + lookup: require('./lookup'), + prune: require('./prune'), + register: require('./register'), + search: require('./search'), + update: require('./update'), + uninstall: require('./uninstall') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/info.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/info.js new file mode 100644 index 0000000..67573c9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/info.js @@ -0,0 +1,81 @@ +var mout = require('mout'); +var Q = require('q'); +var Logger = require('bower-logger'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('../core/PackageRepository'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function info(endpoint, property, config) { + var repository; + var decEndpoint; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + repository = new PackageRepository(config, logger); + + decEndpoint = endpointParser.decompose(endpoint); + + Q.all([ + getPkgMeta(repository, decEndpoint, property), + decEndpoint.target === '*' && !property ? repository.versions(decEndpoint.source) : null + ]) + .spread(function (pkgMeta, versions) { + if (versions) { + return { + name: decEndpoint.source, + versions: versions, + latest: pkgMeta + }; + } + + return pkgMeta; + }) + .done(function (result) { + logger.emit('end', result); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function getPkgMeta(repository, decEndpoint, property) { + return repository.fetch(decEndpoint) + .spread(function (canonicalDir, pkgMeta) { + pkgMeta = mout.object.filter(pkgMeta, function (value, key) { + return key.charAt(0) !== '_'; + }); + + // Retrieve specific property + if (property) { + pkgMeta = mout.object.get(pkgMeta, property); + } + + return pkgMeta; + }); +} + +// ------------------- + +info.line = function (argv) { + var options = info.options(argv); + var pkg = options.argv.remain[1]; + var property = options.argv.remain[2]; + + if (!pkg) { + return null; + } + + return info(pkg, property); +}; + +info.options = function (argv) { + return cli.readOptions(argv); +}; + +info.completion = function () { + // TODO: +}; + +module.exports = info; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/init.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/init.js new file mode 100644 index 0000000..7796ad6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/init.js @@ -0,0 +1,337 @@ +var mout = require('mout'); +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var Logger = require('bower-logger'); +var endpointParser = require('bower-endpoint-parser'); +var Project = require('../core/Project'); +var defaultConfig = require('../config'); +var GitHubResolver = require('../core/resolvers/GitHubResolver'); +var GitFsResolver = require('../core/resolvers/GitFsResolver'); +var cli = require('../util/cli'); +var cmd = require('../util/cmd'); +var createError = require('../util/createError'); + +function init(config) { + var project; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + + // This command requires interactive to be enabled + if (!config.interactive) { + process.nextTick(function () { + logger.emit('error', createError('Register requires an interactive shell', 'ENOINT', { + details: 'Note that you can manually force an interactive shell with --config.interactive' + })); + }); + return logger; + } + + project = new Project(config, logger); + + // Start with existing JSON details + readJson(project, logger) + // Fill in defaults + .then(setDefaults.bind(null, config)) + // Now prompt user to make changes + .then(promptUser.bind(null, logger)) + // Set ignore based on the response + .spread(setIgnore.bind(null, config)) + // Set dependencies based on the response + .spread(setDependencies.bind(null, project)) + // All done! + .spread(saveJson.bind(null, project, logger)) + .done(function (json) { + logger.emit('end', json); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function readJson(project, logger) { + return project.hasJson() + .then(function (json) { + if (json) { + logger.warn('existing', 'The existing ' + path.basename(json) + ' file will be used and filled in'); + } + + return project.getJson(); + }); +} + +function saveJson(project, logger, json) { + // Cleanup empty props (null values, empty strings, objects and arrays) + mout.object.forOwn(json, function (value, key) { + if (value == null || mout.lang.isEmpty(value)) { + delete json[key]; + } + }); + + logger.info('json', 'Generated json', { json: json }); + + // Confirm the json with the user + return Q.nfcall(logger.prompt.bind(logger), { + type: 'confirm', + message: 'Looks good?', + default: true + }) + .then(function (good) { + if (!good) { + return null; + } + + // Save json (true forces file creation) + return project.saveJson(true); + }); +} + +function setDefaults(config, json) { + var name; + var promise = Q.resolve(); + + // Name + if (!json.name) { + json.name = path.basename(config.cwd); + } + + // Version + if (!json.version) { + // Assume latest semver tag if it's a git repo + promise = promise.then(function () { + return GitFsResolver.versions(config.cwd) + .then(function (versions) { + json.version = versions[0] || '0.0.0'; + }, function () { + json.version = '0.0.0'; + }); + }); + } + + // Main + if (!json.main) { + // Remove '.js' from the end of the package name if it is there + name = path.basename(json.name, '.js'); + + if (fs.existsSync(path.join(config.cwd, 'index.js'))) { + json.main = 'index.js'; + } else if (fs.existsSync(path.join(config.cwd, name + '.js'))) { + json.main = name + '.js'; + } + } + + // Homepage + if (!json.homepage) { + // Set as GitHub homepage if it's a GitHub repository + promise = promise.then(function () { + return cmd('git', ['config', '--get', 'remote.origin.url']) + .spread(function (stdout) { + var pair; + + stdout = stdout.trim(); + if (!stdout) { + return; + } + + pair = GitHubResolver.getOrgRepoPair(stdout); + if (pair) { + json.homepage = 'https://github.com/' + pair.org + '/' + pair.repo; + } + }) + .fail(function () { }); + }); + } + + if (!json.authors) { + promise = promise.then(function () { + // Get the user name configured in git + return cmd('git', ['config', '--get', '--global', 'user.name']) + .spread(function (stdout) { + var gitEmail; + var gitName = stdout.trim(); + + // Abort if no name specified + if (!gitName) { + return; + } + + // Get the user email configured in git + return cmd('git', ['config', '--get', '--global', 'user.email']) + .spread(function (stdout) { + gitEmail = stdout.trim(); + }, function () {}) + .then(function () { + json.authors = gitName; + json.authors += gitEmail ? ' <' + gitEmail + '>' : ''; + }); + }, function () {}); + }); + } + + return promise.then(function () { + return json; + }); +} + +function promptUser(logger, json) { + var questions = [ + { + 'name': 'name', + 'message': 'name', + 'default': json.name, + 'type': 'input' + }, + { + 'name': 'version', + 'message': 'version', + 'default': json.version, + 'type': 'input' + }, + { + 'name': 'description', + 'message': 'description', + 'default': json.description, + 'type': 'input' + }, + { + 'name': 'main', + 'message': 'main file', + 'default': json.main, + 'type': 'input' + }, + { + 'name': 'keywords', + 'message': 'keywords', + 'default': json.keywords ? json.keywords.toString() : null, + 'type': 'input' + }, + { + 'name': 'authors', + 'message': 'authors', + 'default': json.authors ? json.authors.toString() : null, + 'type': 'input' + }, + { + 'name': 'license', + 'message': 'license', + 'default': json.license || 'MIT', + 'type': 'input' + }, + { + 'name': 'homepage', + 'message': 'homepage', + 'default': json.homepage, + 'type': 'input' + }, + { + 'name': 'dependencies', + 'message': 'set currently installed components as dependencies?', + 'default': !mout.object.size(json.dependencies) && !mout.object.size(json.devDependencies), + 'type': 'confirm' + }, + { + 'name': 'ignore', + 'message': 'add commonly ignored files to ignore list?', + 'default': true, + 'type': 'confirm' + }, + { + 'name': 'private', + 'message': 'would you like to mark this package as private which prevents it from being accidentally published to the registry?', + 'default': !!json.private, + 'type': 'confirm' + } + ]; + + return Q.nfcall(logger.prompt.bind(logger), questions) + .then(function (answers) { + json.name = answers.name; + json.version = answers.version; + json.description = answers.description; + json.main = answers.main; + json.keywords = toArray(answers.keywords); + json.authors = toArray(answers.authors, ','); + json.license = answers.license; + json.homepage = answers.homepage; + json.private = answers.private || null; + + return [json, answers]; + }); +} + +function toArray(value, splitter) { + var arr = value.split(splitter || /[\s,]/); + + // Trim values + arr = arr.map(function (item) { + return item.trim(); + }); + + // Filter empty values + arr = arr.filter(function (item) { + return !!item; + }); + + return arr.length ? arr : null; +} + +function setIgnore(config, json, answers) { + if (answers.ignore) { + json.ignore = mout.array.combine(json.ignore || [], [ + '**/.*', + 'node_modules', + 'bower_components', + config.directory, + 'test', + 'tests' + ]); + } + + return [json, answers]; +} + +function setDependencies(project, json, answers) { + if (answers.dependencies) { + return project.getTree() + .spread(function (tree, flattened, extraneous) { + if (extraneous.length) { + json.dependencies = {}; + + // Add extraneous as dependencies + extraneous.forEach(function (extra) { + var jsonEndpoint; + + // Skip linked packages + if (extra.linked) { + return; + } + + jsonEndpoint = endpointParser.decomposed2json(extra.endpoint); + mout.object.mixIn(json.dependencies, jsonEndpoint); + }); + } + + return [json, answers]; + }); + } + + return [json, answers]; +} + +// ------------------- + +init.line = function () { + return init(); +}; + +init.options = function (argv) { + return cli.readOptions(argv); +}; + +init.completion = function () { + // TODO: +}; + +module.exports = init; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/install.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/install.js new file mode 100644 index 0000000..665a926 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/install.js @@ -0,0 +1,53 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var endpointParser = require('bower-endpoint-parser'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function install(endpoints, options, config) { + var project; + var decEndpoints; + var logger = new Logger(); + + options = options || {}; + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + // Convert endpoints to decomposed endpoints + endpoints = endpoints || []; + decEndpoints = endpoints.map(function (endpoint) { + return endpointParser.decompose(endpoint); + }); + + project.install(decEndpoints, options) + .done(function (installed) { + logger.emit('end', installed); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +install.line = function (argv) { + var options = install.options(argv); + return install(options.argv.remain.slice(1), options); +}; + +install.options = function (argv) { + return cli.readOptions({ + 'force-latest': { type: Boolean, shorthand: 'F'}, + 'production': { type: Boolean, shorthand: 'p' }, + 'save': { type: Boolean, shorthand: 'S' }, + 'save-dev': { type: Boolean, shorthand: 'D' } + }, argv); +}; + +install.completion = function () { + // TODO: +}; + +module.exports = install; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/link.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/link.js new file mode 100644 index 0000000..3a10f96 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/link.js @@ -0,0 +1,104 @@ +var path = require('path'); +var rimraf = require('rimraf'); +var mout = require('mout'); +var Q = require('q'); +var Logger = require('bower-logger'); +var Project = require('../core/Project'); +var createLink = require('../util/createLink'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function linkSelf(config) { + var project; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + project.getJson() + .then(function (json) { + var src = config.cwd; + var dst = path.join(config.storage.links, json.name); + + // Delete previous link if any + return Q.nfcall(rimraf, dst) + // Link globally + .then(function () { + return createLink(src, dst); + }) + .then(function () { + return { + src: src, + dst: dst + }; + }); + }) + .done(function (result) { + logger.emit('end', result); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function linkTo(name, localName, config) { + var src; + var dst; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + + localName = localName || name; + src = path.join(config.storage.links, name); + dst = path.join(process.cwd(), config.directory, localName); + + // Delete destination folder if any + Q.nfcall(rimraf, dst) + // Link locally + .then(function () { + return createLink(src, dst); + }) + .then(function () { + return { + src: src, + dst: dst + }; + }) + .done(function (result) { + logger.emit('end', result); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +var link = { + linkTo: linkTo, + linkSelf: linkSelf +}; + +link.line = function (argv) { + var options = link.options(argv); + var name = options.argv.remain[1]; + var localName = options.argv.remain[2]; + + if (name) { + return linkTo(name, localName); + } + + return linkSelf(); +}; + +link.options = function (argv) { + return cli.readOptions(argv); +}; + +link.completion = function () { + // TODO: +}; + +module.exports = link; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/list.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/list.js new file mode 100644 index 0000000..59eaee9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/list.js @@ -0,0 +1,181 @@ +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var Logger = require('bower-logger'); +var Project = require('../core/Project'); +var semver = require('../util/semver'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function list(options, config) { + var project; + var logger = new Logger(); + + options = options || {}; + + // Make relative option true by default when used with paths + if (options.paths && options.relative == null) { + options.relative = true; + } + + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + project.getTree() + .spread(function (tree, flattened) { + var baseDir = path.dirname(path.join(config.cwd, config.directory)); + + // Relativize paths + // Also normalize paths on windows + project.walkTree(tree, function (node) { + if (node.missing) { + return; + } + + if (options.relative) { + node.canonicalDir = path.relative(baseDir, node.canonicalDir); + } + if (options.paths) { + node.canonicalDir = normalize(node.canonicalDir); + } + }, true); + + // Note that we need to to parse the flattened tree because it might + // contain additional packages + mout.object.forOwn(flattened, function (node) { + if (node.missing) { + return; + } + + if (options.relative) { + node.canonicalDir = path.relative(baseDir, node.canonicalDir); + } + if (options.paths) { + node.canonicalDir = normalize(node.canonicalDir); + } + }); + + // Render paths? + if (options.paths) { + return paths(flattened); + } + + // Do not check for new versions? + if (config.offline) { + return tree; + } + + // Check for new versions + return checkVersions(project, tree, logger) + .then(function () { + return tree; + }); + }) + .done(function (value) { + logger.emit('end', value); + }, function (error) { + logger.emit('error', error); + }); + + logger.json = !!options.paths; + + return logger; +} + +function checkVersions(project, tree, logger) { + var promises; + var nodes = []; + var repository = project.getPackageRepository(); + + // Gather all nodes + project.walkTree(tree, function (node) { + nodes.push(node); + }, true); + + if (nodes.length) { + logger.info('check-new', 'Checking for new versions of the project dependencies..'); + } + + // Check for new versions for each node + promises = nodes.map(function (node) { + var target = node.endpoint.target; + + return repository.versions(node.endpoint.source) + .then(function (versions) { + node.versions = versions; + + // Do not check if node's target is not a valid semver one + if (versions.length && semver.validRange(target)) { + node.update = { + target: semver.maxSatisfying(versions, target), + latest: semver.maxSatisfying(versions, '*') + }; + } + }); + }); + + // Set the versions also for the root node + tree.versions = []; + + return Q.all(promises); +} + +function paths(flattened) { + var ret = {}; + + mout.object.forOwn(flattened, function (pkg, name) { + var main; + + if (pkg.missing) { + return; + } + + main = pkg.pkgMeta.main; + + // If no main was specified, fallback to canonical dir + if (!main) { + ret[name] = pkg.canonicalDir; + return; + } + + // Normalize main + if (typeof main === 'string') { + main = [main]; + } + + // Concatenate each main entry with the canonical dir + main = main.map(function (part) { + return normalize(path.join(pkg.canonicalDir, part).trim()); + }); + + // If only one main file, use a string + // Otherwise use an array + ret[name] = main.length === 1 ? main[0] : main; + }); + + return ret; +} + +function normalize(src) { + return src.replace(/\\/g, '/'); +} + +// ------------------- + +list.line = function (argv) { + var options = list.options(argv); + return list(options); +}; + +list.options = function (argv) { + return cli.readOptions({ + 'paths': { type: Boolean, shorthand: 'p' }, + 'relative': { type: Boolean, shorthand: 'r' } + }, argv); +}; + +list.completion = function () { + // TODO: +}; + +module.exports = list; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/lookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/lookup.js new file mode 100644 index 0000000..5812f87 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/lookup.js @@ -0,0 +1,56 @@ +var mout = require('mout'); +var Q = require('q'); +var Logger = require('bower-logger'); +var RegistryClient = require('bower-registry-client'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function lookup(name, config) { + var registryClient; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + config.cache = config.storage.registry; + + registryClient = new RegistryClient(config, logger); + + Q.nfcall(registryClient.lookup.bind(registryClient), name) + .then(function (entry) { + // TODO: Handle entry.type.. for now it's only 'alias' + // When we got published packages, this needs to be adjusted + return !entry ? null : { + name: name, + url: entry && entry.url + }; + }) + .done(function (result) { + logger.emit('end', result); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +lookup.line = function (argv) { + var options = lookup.options(argv); + var name = options.argv.remain[1]; + + if (!name) { + return null; + } + + return lookup(name); +}; + +lookup.options = function (argv) { + return cli.readOptions(argv); +}; + +lookup.completion = function () { + // TODO: +}; + +module.exports = lookup; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/prune.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/prune.js new file mode 100644 index 0000000..1743a80 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/prune.js @@ -0,0 +1,64 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function prune(config) { + var project; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + clean(project) + .done(function (removed) { + logger.emit('end', removed); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function clean(project, removed) { + removed = removed || {}; + + // Continually call clean until there is no more extraneous + // dependencies to remove + return project.getTree() + .spread(function (tree, flattened, extraneous) { + var names = extraneous.map(function (extra) { + return extra.endpoint.name; + }); + + // Uninstall extraneous + project.uninstall(names) + .then(function (uninstalled) { + // Are we done? + if (!mout.object.size(uninstalled)) { + return removed; + } + + // Not yet, recurse! + mout.object.mixIn(removed, uninstalled); + return clean(project, removed); + }); + }); +} + +// ------------------- + +prune.line = function () { + return prune(); +}; + +prune.options = function (argv) { + return cli.readOptions(argv); +}; + +prune.completion = function () { + // TODO: +}; + +module.exports = prune; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/register.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/register.js new file mode 100644 index 0000000..06c5208 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/register.js @@ -0,0 +1,131 @@ +var mout = require('mout'); +var Q = require('q'); +var chalk = require('chalk'); +var PackageRepository = require('../core/PackageRepository'); +var Logger = require('bower-logger'); +var Config = require('bower-config'); +var cli = require('../util/cli'); +var createError = require('../util/createError'); +var defaultConfig = require('../config'); +var GitHubResolver = require('../core/resolvers/GitHubResolver'); + +function register(name, url, config) { + var repository; + var registryClient; + var logger = new Logger(); + var force; + + config = mout.object.deepFillIn(config || {}, defaultConfig); + force = config.force; + + // Bypass any cache + config.offline = false; + config.force = true; + + // Trim name + name = name.trim(); + + process.nextTick(function () { + // Verify name + // TODO: Verify with the new spec regexp? + if (!name) { + return logger.emit('error', createError('Please type a name', 'EINVNAME')); + } + + // The public registry only allows git:// endpoints + // As such, we attempt to convert URLs as necessary + if (config.registry.register === Config.DEFAULT_REGISTRY) { + url = convertUrl(url, logger); + + if (!mout.string.startsWith(url, 'git://')) { + return logger.emit('error', createError('The registry only accepts URLs starting with git://', 'EINVFORMAT')); + } + } + + // Attempt to resolve the package referenced by the URL to ensure + // everything is ok before registering + repository = new PackageRepository(config, logger); + repository.fetch({ name: name, source: url, target: '*' }) + .spread(function (canonicalDir, pkgMeta) { + if (pkgMeta.private) { + throw createError('The package you are trying to register is marked as private', 'EPRIV'); + } + + // If non interactive or user forced, bypass confirmation + if (!config.interactive || force) { + return true; + } + + // Confirm if the user really wants to register + return Q.nfcall(logger.prompt.bind(logger), { + type: 'confirm', + message: 'Registering a package will make it installable via the registry (' + + chalk.cyan.underline(config.registry.register) + '), continue?', + default: true + }); + }) + .then(function (result) { + // If user response was negative, abort + if (!result) { + return; + } + + // Register + registryClient = repository.getRegistryClient(); + + logger.action('register', url, { + name: name, + url: url + }); + + return Q.nfcall(registryClient.register.bind(registryClient), name, url); + }) + .done(function (result) { + logger.emit('end', result); + }, function (error) { + logger.emit('error', error); + }); + }); + + return logger; +} + +function convertUrl(url, logger) { + var pair; + var newUrl; + + if (!mout.string.startsWith(url, 'git://')) { + // Convert GitHub ssh & https to git:// + pair = GitHubResolver.getOrgRepoPair(url); + if (pair) { + newUrl = 'git://github.com/' + pair.org + '/' + pair.repo + '.git'; + logger.warn('convert', 'Converted ' + url + ' to ' + newUrl); + } + } + + return newUrl || url; +} + +// ------------------- + +register.line = function (argv) { + var options = register.options(argv); + var name = options.argv.remain[1]; + var url = options.argv.remain[2]; + + if (!name || !url) { + return null; + } + + return register(name, url); +}; + +register.options = function (argv) { + return cli.readOptions(argv); +}; + +register.completion = function () { + // TODO: +}; + +module.exports = register; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/search.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/search.js new file mode 100644 index 0000000..960f9c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/search.js @@ -0,0 +1,51 @@ +var mout = require('mout'); +var Q = require('q'); +var Logger = require('bower-logger'); +var RegistryClient = require('bower-registry-client'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function search(name, config) { + var registryClient; + var promise; + var logger = new Logger(); + + config = mout.object.deepFillIn(config || {}, defaultConfig); + config.cache = config.storage.registry; + + registryClient = new RegistryClient(config, logger); + + // If no name was specified, list all packages + if (!name) { + promise = Q.nfcall(registryClient.list.bind(registryClient)); + // Otherwise search it + } else { + promise = Q.nfcall(registryClient.search.bind(registryClient), name); + } + + promise + .done(function (results) { + logger.emit('end', results); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +search.line = function (argv) { + var options = search.options(argv); + return search(options.argv.remain.slice(1).join(' '), options); +}; + +search.options = function (argv) { + return cli.readOptions(argv); +}; + +search.completion = function () { + // TODO: +}; + +module.exports = search; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/uninstall.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/uninstall.js new file mode 100644 index 0000000..f1f15c3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/uninstall.js @@ -0,0 +1,118 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var Q = require('q'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function uninstall(names, options, config) { + var project; + var logger = new Logger(); + + options = options || {}; + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + project.getTree() + .spread(function (tree, flattened) { + // Uninstall nodes + return project.uninstall(names, options) + // Clean out non-shared uninstalled dependencies + .then(function (uninstalled) { + var names = Object.keys(uninstalled); + var children = []; + + // Grab the dependencies of packages that were uninstalled + mout.object.forOwn(flattened, function (node) { + if (names.indexOf(node.endpoint.name) !== -1) { + children.push.apply(children, mout.object.keys(node.dependencies)); + } + }); + + // Clean them! + return clean(project, children, uninstalled); + }); + }) + .done(function (uninstalled) { + logger.emit('end', uninstalled); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +function clean(project, names, removed) { + removed = removed || {}; + + return project.getTree() + .spread(function (tree, flattened) { + var nodes = []; + + // Grab the nodes of each specified name + mout.object.forOwn(flattened, function (node) { + if (names.indexOf(node.endpoint.name) !== -1) { + nodes.push(node); + } + }); + + // Filter out those that have dependants + nodes = nodes.filter(function (node) { + return !node.nrDependants; + }); + + // Are we done? + if (!nodes.length) { + return Q.resolve(removed); + } + + // Grab the nodes after filtering + names = nodes.map(function (node) { + return node.endpoint.name; + }); + + // Uninstall them + return project.uninstall(names) + // Clean out non-shared uninstalled dependencies + .then(function (uninstalled) { + var children; + + mout.object.mixIn(removed, uninstalled); + + // Grab the dependencies of packages that were uninstalled + children = []; + nodes.forEach(function (node) { + children.push.apply(children, mout.object.keys(node.dependencies)); + }); + + // Recurse! + return clean(project, children, removed); + }); + }); +} + +// ------------------- + +uninstall.line = function (argv) { + var options = uninstall.options(argv); + var names = options.argv.remain.slice(1); + + if (!names.length) { + return null; + } + + return uninstall(names, options); +}; + +uninstall.options = function (argv) { + return cli.readOptions({ + 'save': { type: Boolean, shorthand: 'S' }, + 'save-dev': { type: Boolean, shorthand: 'D' } + }, argv); +}; + +uninstall.completion = function () { + // TODO: +}; + +module.exports = uninstall; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/update.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/update.js new file mode 100644 index 0000000..d313353 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/commands/update.js @@ -0,0 +1,48 @@ +var mout = require('mout'); +var Logger = require('bower-logger'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function update(names, options, config) { + var project; + var logger = new Logger(); + + options = options || {}; + config = mout.object.deepFillIn(config || {}, defaultConfig); + project = new Project(config, logger); + + // If names is an empty array, null them + if (names && !names.length) { + names = null; + } + + project.update(names, options) + .done(function (installed) { + logger.emit('end', installed); + }, function (error) { + logger.emit('error', error); + }); + + return logger; +} + +// ------------------- + +update.line = function (argv) { + var options = update.options(argv); + return update(options.argv.remain.slice(1), options); +}; + +update.options = function (argv) { + return cli.readOptions({ + 'force-latest': { type: Boolean, shorthand: 'F' }, + 'production': { type: Boolean, shorthand: 'p' } + }, argv); +}; + +update.completion = function () { + // TODO: +}; + +module.exports = update; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/config.js new file mode 100644 index 0000000..3ba2179 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/config.js @@ -0,0 +1,26 @@ +var tty = require('tty'); +var mout = require('mout'); +var config = require('bower-config').read(); +var cli = require('./util/cli'); + +// Delete the json attribute because it is no longer supported +// and conflicts with --json +delete config.json; + +// If interactive is auto (null), guess its value +if (config.interactive == null) { + config.interactive = process.bin === 'bower' && tty.isatty(1); +} + +// Merge common CLI options into the config +mout.object.mixIn(config, cli.readOptions({ + force: { type: Boolean, shorthand: 'f' }, + offline: { type: Boolean, shorthand: 'o' }, + verbose: { type: Boolean, shorthand: 'V' }, + quiet: { type: Boolean, shorthand: 'q' }, + loglevel: { type: String, shorthand: 'l' }, + json: { type: Boolean, shorthand: 'j' }, + silent: { type: Boolean, shorthand: 's' } +})); + +module.exports = config; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Manager.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Manager.js new file mode 100644 index 0000000..2f6e997 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Manager.js @@ -0,0 +1,882 @@ +var Q = require('q'); +var mout = require('mout'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var fs = require('graceful-fs'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('./PackageRepository'); +var semver = require('../util/semver'); +var copy = require('../util/copy'); +var createError = require('../util/createError'); + +function Manager(config, logger) { + this._config = config; + this._logger = logger; + this._repository = new PackageRepository(this._config, this._logger); + + this.configure({}); +} + +// ----------------- + +Manager.prototype.configure = function (setup) { + var targetsHash = {}; + + this._conflicted = {}; + + // Targets + this._targets = setup.targets || []; + this._targets.forEach(function (decEndpoint) { + decEndpoint.initialName = decEndpoint.name; + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + targetsHash[decEndpoint.name] = true; + + // If the endpoint is marked as newly, make it unresolvable + decEndpoint.unresolvable = !!decEndpoint.newly; + }); + + // Resolved & installed + this._resolved = {}; + this._installed = {}; + mout.object.forOwn(setup.resolved, function (decEndpoint, name) { + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + this._resolved[name] = [decEndpoint]; + this._installed[name] = decEndpoint.pkgMeta; + }, this); + + // Installed + mout.object.mixIn(this._installed, setup.installed); + + // Incompatibles + this._incompatibles = {}; + setup.incompatibles = this._uniquify(setup.incompatibles || []); + setup.incompatibles.forEach(function (decEndpoint) { + var name = decEndpoint.name; + + this._incompatibles[name] = this._incompatibles[name] || []; + this._incompatibles[name].push(decEndpoint); + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + + // Mark as conflicted so that the resolution is not removed + this._conflicted[name] = true; + + // If not a target/resolved, add as target + if (!targetsHash[name] && !this._resolved[name]) { + this._targets.push(decEndpoint); + } + }, this); + + // Resolutions + this._resolutions = setup.resolutions || {}; + + // Uniquify targets + this._targets = this._uniquify(this._targets); + + // Force-latest + this._forceLatest = !!setup.forceLatest; + + return this; +}; + +Manager.prototype.resolve = function () { + // If already resolving, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + // Reset stuff + this._fetching = {}; + this._nrFetching = 0; + this._failed = {}; + this._hasFailed = false; + this._deferred = Q.defer(); + + // If there's nothing to resolve, simply dissect + if (!this._targets.length) { + process.nextTick(this._dissect.bind(this)); + // Otherwise, fetch each target from the repository + // and let the process roll out + } else { + this._targets.forEach(this._fetch.bind(this)); + } + + // Unset working flag when done + return this._deferred.promise + .fin(function () { + this._working = false; + }.bind(this)); +}; + +Manager.prototype.install = function () { + var componentsDir; + var that = this; + + // If already resolving, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + // If nothing to install, skip the code bellow + if (mout.lang.isEmpty(that._dissected)) { + return Q.resolve({}); + } + + componentsDir = path.join(this._config.cwd, this._config.directory); + return Q.nfcall(mkdirp, componentsDir) + .then(function () { + var promises = []; + + mout.object.forOwn(that._dissected, function (decEndpoint, name) { + var promise; + var dst; + var release = decEndpoint.pkgMeta._release; + + that._logger.action('install', name + (release ? '#' + release : ''), that.toData(decEndpoint)); + + dst = path.join(componentsDir, name); + + // Remove existent and copy canonical dir + promise = Q.nfcall(rimraf, dst) + .then(copy.copyDir.bind(copy, decEndpoint.canonicalDir, dst)) + .then(function () { + var metaFile = path.join(dst, '.bower.json'); + + decEndpoint.canonicalDir = dst; + + // Store additional metadata in bower.json + return Q.nfcall(fs.readFile, metaFile) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + + json._target = decEndpoint.target; + json._originalSource = decEndpoint.source; + if (decEndpoint.newly) { + json._direct = true; + } + + json = JSON.stringify(json, null, ' '); + return Q.nfcall(fs.writeFile, metaFile, json); + }); + }); + + promises.push(promise); + }); + + return Q.all(promises); + }) + .then(function () { + // Sync up dissected dependencies and dependants + // See: https://github.com/bower/bower/issues/879 + mout.object.forOwn(that._dissected, function (pkg) { + // Sync dependencies + mout.object.forOwn(pkg.dependencies, function (dependency, name) { + var dissected = this._dissected[name] || (this._resolved[name] ? this._resolved[name][0] : dependency); + pkg.dependencies[name] = dissected; + }, this); + + // Sync dependants + pkg.dependants = pkg.dependants.map(function (dependant) { + var name = dependant.name; + var dissected = this._dissected[name] || (this._resolved[name] ? this._resolved[name][0] : dependant); + + return dissected; + }, this); + }, that); + + // Resolve with meaningful data + return mout.object.map(that._dissected, function (decEndpoint) { + return this.toData(decEndpoint); + }, that); + }) + .fin(function () { + this._working = false; + }.bind(this)); +}; + +Manager.prototype.toData = function (decEndpoint, extraKeys) { + var names; + var extra; + + var data = {}; + data.endpoint = mout.object.pick(decEndpoint, ['name', 'source', 'target']); + + if (decEndpoint.canonicalDir) { + data.canonicalDir = decEndpoint.canonicalDir; + data.pkgMeta = decEndpoint.pkgMeta; + } + + if (extraKeys) { + extra = mout.object.pick(decEndpoint, extraKeys); + extra = mout.object.filter(extra, function (value) { + return !!value; + }); + mout.object.mixIn(data, extra); + } + + if (decEndpoint.dependencies) { + data.dependencies = {}; + + // Call recursively for each dependency but ordered + // by dependency names + names = Object.keys(decEndpoint.dependencies).sort(); + names.forEach(function (name) { + data.dependencies[name] = this.toData(decEndpoint.dependencies[name], extraKeys); + }, this); + } + + data.nrDependants = mout.object.size(decEndpoint.dependants); + + return data; +}; + +Manager.prototype.getPackageRepository = function () { + return this._repository; +}; + +// ----------------- + +Manager.prototype._fetch = function (decEndpoint) { + var name = decEndpoint.name; + + // Check if the whole process started to fail fast + if (this._hasFailed) { + return; + } + + // Mark as being fetched + this._fetching[name] = this._fetching[name] || []; + this._fetching[name].push(decEndpoint); + this._nrFetching++; + + // Fetch it from the repository + // Note that the promise is stored in the decomposed endpoint + // because it might be reused if a similar endpoint needs to be resolved + return decEndpoint.promise = this._repository.fetch(decEndpoint) + // When done, call onFetchSuccess + .spread(this._onFetchSuccess.bind(this, decEndpoint)) + // If it fails, call onFetchFailure + .fail(this._onFetchError.bind(this, decEndpoint)); +}; + +Manager.prototype._onFetchSuccess = function (decEndpoint, canonicalDir, pkgMeta, isTargetable) { + var name; + var resolved; + var index; + var incompatibles; + var initialName = decEndpoint.initialName != null ? decEndpoint.initialName : decEndpoint.name; + var fetching = this._fetching[initialName]; + + // Remove from being fetched list + mout.array.remove(fetching, decEndpoint); + this._nrFetching--; + + // Store some needed stuff + decEndpoint.name = name = decEndpoint.name || pkgMeta.name; + decEndpoint.canonicalDir = canonicalDir; + decEndpoint.pkgMeta = pkgMeta; + delete decEndpoint.promise; + + // Add to the resolved list + // If there's an exact equal endpoint, replace instead of adding + // This can happen because the name might not be known from the start + resolved = this._resolved[name] = this._resolved[name] || []; + index = mout.array.findIndex(resolved, function (resolved) { + return resolved.target === decEndpoint.target; + }); + if (index !== -1) { + // Merge dependants + decEndpoint.dependants.push.apply(decEndpoint.dependants, resolved[index.dependants]); + decEndpoint.dependants = this._uniquify(decEndpoint.dependants); + resolved.splice(index, 1); + } + resolved.push(decEndpoint); + + // Parse dependencies + this._parseDependencies(decEndpoint, pkgMeta, 'dependencies'); + + // Check if there are incompatibilities for this package name + // If there are, we need to fetch them + incompatibles = this._incompatibles[name]; + if (incompatibles) { + // Filter already resolved + incompatibles = incompatibles.filter(function (incompatible) { + return !resolved.some(function (decEndpoint) { + return incompatible.target === decEndpoint.target; + }); + }, this); + // Filter being resolved + incompatibles = incompatibles.filter(function (incompatible) { + return !fetching.some(function (decEndpoint) { + return incompatible.target === decEndpoint.target; + }); + }, this); + + incompatibles.forEach(this._fetch.bind(this)); + delete this._incompatibles[name]; + } + + // If the package is not targetable, flag it + // It will be needed later so that untargetable endpoints + // will not get * converted to ~version + if (!isTargetable) { + decEndpoint.untargetable = true; + } + + // If there are no more packages being fetched, + // finish the resolve process by dissecting all resolved packages + if (this._nrFetching <= 0) { + process.nextTick(this._dissect.bind(this)); + } +}; + +Manager.prototype._onFetchError = function (decEndpoint, err) { + var name = decEndpoint.name; + + err.data = err.data || {}; + err.data.endpoint = mout.object.pick(decEndpoint, ['name', 'source', 'target']); + + // Remove from being fetched list + mout.array.remove(this._fetching[name], decEndpoint); + this._nrFetching--; + + // Add to the failed list + this._failed[name] = this._failed[name] || []; + this._failed[name].push(err); + delete decEndpoint.promise; + + // Make the whole process to fail fast + this._failFast(); + + // If there are no more packages being fetched, + // finish the resolve process (with an error) + if (this._nrFetching <= 0) { + process.nextTick(this._dissect.bind(this)); + } +}; + +Manager.prototype._failFast = function () { + if (this._hasFailed) { + return; + } + + this._hasFailed = true; + + // If after some amount of time all pending tasks haven't finished, + // we force the process to end + this._failFastTimeout = setTimeout(function () { + this._nrFetching = Infinity; + this._dissect(); + }.bind(this), 20000); +}; + +Manager.prototype._parseDependencies = function (decEndpoint, pkgMeta, jsonKey) { + var pending = []; + + decEndpoint.dependencies = decEndpoint.dependencies || {}; + + // Parse package dependencies + mout.object.forOwn(pkgMeta[jsonKey], function (value, key) { + var resolved; + var fetching; + var compatible; + var childDecEndpoint = endpointParser.json2decomposed(key, value); + + // Check if a compatible one is already resolved + // If there's one, we don't need to resolve it twice + resolved = this._resolved[key]; + if (resolved) { + // Find if there's one with the exact same target + compatible = mout.array.find(resolved, function (resolved) { + return childDecEndpoint.target === resolved.target; + }, this); + + // If we found one, merge stuff instead of adding as resolved + if (compatible) { + decEndpoint.dependencies[key] = compatible; + compatible.dependants.push(decEndpoint); + compatible.dependants = this._uniquify(compatible.dependants); + + return; + } + + // Find one that is compatible + compatible = mout.array.find(resolved, function (resolved) { + return this._areCompatible(childDecEndpoint, resolved); + }, this); + + // If we found one, add as resolved + // and copy resolved properties from the compatible one + if (compatible) { + decEndpoint.dependencies[key] = compatible; + childDecEndpoint.canonicalDir = compatible.canonicalDir; + childDecEndpoint.pkgMeta = compatible.pkgMeta; + childDecEndpoint.dependencies = compatible.dependencies; + childDecEndpoint.dependants = [decEndpoint]; + this._resolved[key].push(childDecEndpoint); + + return; + } + } + + // Check if a compatible one is being fetched + // If there's one, we wait and reuse it to avoid resolving it twice + fetching = this._fetching[key]; + if (fetching) { + compatible = mout.array.find(fetching, function (fetching) { + return this._areCompatible(childDecEndpoint, fetching); + }, this); + + if (compatible) { + pending.push(compatible.promise); + return; + } + } + + // Mark endpoint as unresolvable if the parent is also unresolvable + childDecEndpoint.unresolvable = !!decEndpoint.unresolvable; + + // Otherwise, just fetch it from the repository + decEndpoint.dependencies[key] = childDecEndpoint; + childDecEndpoint.dependants = [decEndpoint]; + this._fetch(childDecEndpoint); + }, this); + + if (pending.length > 0) { + Q.all(pending) + .then(function () { + this._parseDependencies(decEndpoint, pkgMeta, jsonKey); + }.bind(this)); + } +}; + +Manager.prototype._dissect = function () { + var err; + var componentsDir; + var promise = Q.resolve(); + var suitables = {}; + var that = this; + + // If something failed, reject the whole resolve promise + // with the first error + if (this._hasFailed) { + clearTimeout(this._failFastTimeout); // Cancel fail fast timeout + + err = mout.object.values(this._failed)[0][0]; + this._deferred.reject(err); + return; + } + + // Find a suitable version for each package name + mout.object.forOwn(this._resolved, function (decEndpoints, name) { + var semvers; + var nonSemvers; + + // Filter out non-semver ones + semvers = decEndpoints.filter(function (decEndpoint) { + return !!decEndpoint.pkgMeta.version; + }); + + // Sort semver ones DESC + semvers.sort(function (first, second) { + var result = semver.rcompare(first.pkgMeta.version, second.pkgMeta.version); + + // If they are equal and one of them is a wildcard target, + // give lower priority + if (!result) { + if (first.target === '*') { + return 1; + } + if (second.target === '*') { + return -1; + } + } + + return result; + }); + + // Convert wildcard targets to semver range targets if they are newly + // Note that this can only be made if they can be targetable + // If they are not, the resolver is incapable of handling targets + semvers.forEach(function (decEndpoint) { + if (decEndpoint.newly && decEndpoint.target === '*' && !decEndpoint.untargetable) { + decEndpoint.target = '~' + decEndpoint.pkgMeta.version; + decEndpoint.originalTarget = '*'; + } + }); + + // Filter non-semver ones + nonSemvers = decEndpoints.filter(function (decEndpoint) { + return !decEndpoint.pkgMeta.version; + }); + + promise = promise.then(function () { + return that._electSuitable(name, semvers, nonSemvers) + .then(function (suitable) { + suitables[name] = suitable; + }); + }); + }, this); + + // After a suitable version has been elected for every package + promise + .then(function () { + // Look for extraneous resolutions + mout.object.forOwn(this._resolutions, function (resolution, name) { + if (this._conflicted[name]) { + return; + } + + this._logger.info('resolution', 'Removed unnecessary ' + name + '#' + resolution + ' resolution', { + name: name, + resolution: resolution, + action: 'delete' + }); + + delete this._resolutions[name]; + }, this); + + // Filter only packages that need to be installed + componentsDir = path.resolve(that._config.cwd, that._config.directory); + this._dissected = mout.object.filter(suitables, function (decEndpoint, name) { + var installedMeta = this._installed[name]; + var dst; + + // Analyse a few props + if (installedMeta && + installedMeta._target === decEndpoint.target && + installedMeta._originalSource === decEndpoint.source && + installedMeta._release === decEndpoint.pkgMeta._release + ) { + return false; + } + + // Skip if source is the same as dest + dst = path.join(componentsDir, name); + if (dst === decEndpoint.canonicalDir) { + return false; + } + + return true; + }, this); + }.bind(this)) + .then(this._deferred.resolve, this._deferred.reject); +}; + +Manager.prototype._electSuitable = function (name, semvers, nonSemvers) { + var suitable; + var resolution; + var unresolvable; + var dataPicks; + var save; + var choices; + var picks = []; + + // If there are both semver and non-semver, there's no way + // to figure out the suitable one + if (semvers.length && nonSemvers.length) { + picks.push.apply(picks, semvers); + picks.push.apply(picks, nonSemvers); + // If there are only non-semver ones, the suitable is elected + // only if there's one + } else if (nonSemvers.length) { + if (nonSemvers.length === 1) { + return Q.resolve(nonSemvers[0]); + } + + picks.push.apply(picks, nonSemvers); + // If there are only semver ones, figure out which one is + // compatible with every requirement + } else { + suitable = mout.array.find(semvers, function (subject) { + return semvers.every(function (decEndpoint) { + return subject === decEndpoint || + semver.satisfies(subject.pkgMeta.version, decEndpoint.target); + }); + }); + + if (suitable) { + return Q.resolve(suitable); + } + + picks.push.apply(picks, semvers); + } + + // At this point, there's a conflict + this._conflicted[name] = true; + + // Prepare data to be sent bellow + // 1 - Sort picks by version/release + picks.sort(function (pick1, pick2) { + var version1 = pick1.pkgMeta.version; + var version2 = pick2.pkgMeta.version; + var comp; + + // If both have versions, compare their versions using semver + if (version1 && version2) { + comp = semver.compare(version1, version2); + if (comp) { + return comp; + } + } else { + // If one of them has a version, it's considered higher + if (version1) { + return 1; + } + if (version2) { + return -1; + } + } + + // Give priority to the one with most dependants + if (pick1.dependants.length > pick2.dependants.length) { + return -1; + } + if (pick1.dependants.length < pick2.dependants.length) { + return 1; + } + + return 0; + }); + + // 2 - Transform data + dataPicks = picks.map(function (pick) { + var dataPick = this.toData(pick); + dataPick.dependants = pick.dependants.map(this.toData, this); + dataPick.dependants.sort(function (dependant1, dependant2) { + return dependant1.endpoint.name.localeCompare(dependant2.endpoint.name); + }); + return dataPick; + }, this); + + // Check if there's a resolution that resolves the conflict + // Note that if one of them is marked as unresolvable, + // the resolution has no effect + resolution = this._resolutions[name]; + unresolvable = mout.object.find(picks, function (pick) { + return pick.unresolvable; + }); + + if (resolution && !unresolvable) { + suitable = -1; + + // Range resolution + if (semver.validRange(resolution)) { + suitable = mout.array.findIndex(picks, function (pick) { + return pick.pkgMeta.version && + semver.satisfies(pick.pkgMeta.version, resolution); + }); + } + + // Exact match resolution (e.g. branches/tags) + if (suitable === -1) { + suitable = mout.array.findIndex(picks, function (pick) { + return pick.target === resolution || + pick.pkgMeta._release === resolution; + }); + } + + if (suitable === -1) { + this._logger.warn('resolution', 'Unsuitable resolution declared for ' + name + ': ' + resolution, { + name: name, + picks: dataPicks, + resolution: resolution + }); + } else { + this._logger.conflict('solved', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks, + resolution: resolution, + suitable: dataPicks[suitable] + }); + return Q.resolve(picks[suitable]); + } + } + + // If force latest is enabled, resolve to the highest semver version + // or whatever non-semver if none available + if (this._forceLatest) { + suitable = picks.length - 1; + + this._logger.conflict('solved', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks, + suitable: dataPicks[suitable], + forced: true + }); + + // Save resolution + this._storeResolution(picks[suitable]); + + return Q.resolve(picks[suitable]); + } + + // If interactive is disabled, error out + if (!this._config.interactive) { + throw createError('Unable to find suitable version for ' + name, 'ECONFLICT', { + name: name, + picks: dataPicks + }); + } + + // At this point the user needs to make a decision + this._logger.conflict('incompatible', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks + }); + + choices = picks.map(function (pick, index) { return index + 1; }); + return Q.nfcall(this._logger.prompt.bind(this._logger), { + type: 'input', + message: 'Answer:', + validate: function (choice) { + choice = Number(mout.string.trim(choice.trim(), '!')); + + if (!choice || choice < 1 || choice > picks.length) { + return 'Invalid choice'; + } + + return true; + } + }) + .then(function (choice) { + var pick; + + // Sanitize choice + choice = choice.trim(); + save = /^!/.test(choice) || /!$/.test(choice); // Save if prefixed or suffixed with ! + choice = Number(mout.string.trim(choice, '!')); + pick = picks[choice - 1]; + + // Save resolution + if (save) { + this._storeResolution(pick); + } + + return pick; + }.bind(this)); +}; + +Manager.prototype._storeResolution = function (pick) { + var resolution; + var name = pick.name; + + if (pick.target === '*') { + resolution = pick.pkgMeta._release || '*'; + } else { + resolution = pick.target; + } + + this._logger.info('resolution', 'Saved ' + name + '#' + resolution + ' as resolution', { + name: name, + resolution: resolution, + action: this._resolutions[name] ? 'edit' : 'add' + }); + this._resolutions[name] = resolution; +}; + +Manager.prototype._areCompatible = function (candidate, resolved) { + var resolvedVersion; + var highestCandidate; + var highestResolved; + + // Check if targets are equal + if (candidate.target === resolved.target) { + return true; + } + + resolvedVersion = resolved.pkgMeta && resolved.pkgMeta.version; + if (!resolvedVersion) { + return false; + } + + // If target is a version, compare against the resolved version + if (semver.valid(candidate.target)) { + return semver.eq(candidate.target, resolvedVersion); + } + + // If target is a range, check if the max versions of the range are the same + // and if the resolved version satisfies the candidate target + if (semver.validRange(candidate.target) && semver.validRange(resolved.target)) { + highestCandidate = this._getCap(semver.toComparators(candidate.target), 'highest'); + highestResolved = this._getCap(semver.toComparators(resolved.target), 'highest'); + + return highestCandidate.version && highestResolved.version && + semver.eq(highestCandidate.version, highestResolved.version) && + highestCandidate.comparator === highestResolved.comparator && + semver.satisfies(resolvedVersion, candidate.target); + } + + return false; +}; + +Manager.prototype._getCap = function (comparators, side) { + var matches; + var candidate; + var cap = {}; + var compare = side === 'lowest' ? semver.lt : semver.gt; + + comparators.forEach(function (comparator) { + // Get version of this comparator + // If it's an array, call recursively + if (Array.isArray(comparator)) { + candidate = this._getCap(comparator, side); + + // Compare with the current highest version + if (!cap.version || compare(candidate.version, cap.version)) { + cap = candidate; + } + // Otherwise extract the version from the comparator + // using a simple regexp + } else { + matches = comparator.match(/(.*?)(\d+\.\d+\.\d+.*)$/); + if (!matches) { + return; + } + + // Compare with the current highest version + if (!cap.version || compare(matches[2], cap.version)) { + cap.version = matches[2]; + cap.comparator = matches[1]; + } + } + }, this); + + return cap; +}; + +Manager.prototype._uniquify = function (decEndpoints) { + var length = decEndpoints.length; + + return decEndpoints.filter(function (decEndpoint, index) { + var x; + var current; + + for (x = index + 1; x < length; ++x) { + current = decEndpoints[x]; + + if (current === decEndpoint) { + return false; + } + + // Compare name if both set + // Fallback to compare sources + if (!current.name && !decEndpoint.name) { + if (current.source !== decEndpoint.source) { + continue; + } + } else if (current.name !== decEndpoint.name) { + continue; + } + + // Compare targets if name/sources are equal + if (current.target === decEndpoint.target) { + return false; + } + } + + return true; + }); +}; + +module.exports = Manager; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/PackageRepository.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/PackageRepository.js new file mode 100644 index 0000000..46327d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/PackageRepository.js @@ -0,0 +1,209 @@ +var mout = require('mout'); +var Q = require('q'); +var RegistryClient = require('bower-registry-client'); +var ResolveCache = require('./ResolveCache'); +var resolverFactory = require('./resolverFactory'); +var createError = require('../util/createError'); + +function PackageRepository(config, logger) { + var registryOptions; + + this._config = config; + this._logger = logger; + + // Instantiate the registry + registryOptions = mout.object.deepMixIn({}, this._config); + registryOptions.cache = this._config.storage.registry; + this._registryClient = new RegistryClient(registryOptions, logger); + + // Instantiate the resolve cache + this._resolveCache = new ResolveCache(this._config); +} + +// ----------------- + +PackageRepository.prototype.fetch = function (decEndpoint) { + var logger; + var that = this; + var isTargetable; + var info = { + decEndpoint: decEndpoint + }; + + // Create a new logger that pipes everything to ours that will be + // used to fetch + logger = this._logger.geminate(); + // Intercept all logs, adding additional information + logger.intercept(function (log) { + that._extendLog(log, info); + }); + + // Get the appropriate resolver + return resolverFactory(decEndpoint, this._config, logger, this._registryClient) + // Decide if we retrieve from the cache or not + // Also decide if we validate the cached entry or not + .then(function (resolver) { + info.resolver = resolver; + isTargetable = resolver.constructor.isTargetable; + + // If force flag is used, bypass cache + if (that._config.force) { + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + return that._resolve(resolver, logger); + } + + // Note that we use the resolver methods to query the + // cache because transformations/normalisations can occur + return that._resolveCache.retrieve(resolver.getSource(), resolver.getTarget()) + // Decide if we can use the one from the resolve cache + .spread(function (canonicalDir, pkgMeta) { + // If there's no package in the cache + if (!canonicalDir) { + // And the offline flag is passed, error out + if (that._config.offline) { + throw createError('No cached version for ' + resolver.getSource() + '#' + resolver.getTarget(), 'ENOCACHE', { + resolver: resolver + }); + } + + // Otherwise, we have to resolve it + logger.info('not-cached', resolver.getSource() + (resolver.getTarget() ? '#' + resolver.getTarget() : '')); + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + + return that._resolve(resolver, logger); + } + + info.canonicalDir = canonicalDir; + info.pkgMeta = pkgMeta; + + logger.info('cached', resolver.getSource() + (pkgMeta._release ? '#' + pkgMeta._release : '')); + + // If offline flag is used, use directly the cached one + if (that._config.offline) { + return [canonicalDir, pkgMeta, isTargetable]; + } + + // Otherwise check for new contents + logger.action('validate', (pkgMeta._release ? pkgMeta._release + ' against ': '') + + resolver.getSource() + (resolver.getTarget() ? '#' + resolver.getTarget() : '')); + + return resolver.hasNew(canonicalDir, pkgMeta) + .then(function (hasNew) { + // If there are no new contents, resolve to + // the cached one + if (!hasNew) { + return [canonicalDir, pkgMeta, isTargetable]; + } + + // Otherwise resolve to the newest one + logger.info('new', 'version for ' + resolver.getSource() + '#' + resolver.getTarget()); + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + + return that._resolve(resolver, logger); + }); + }); + }) + // If something went wrong, also extend the error + .fail(function (err) { + that._extendLog(err, info); + throw err; + }); +}; + +PackageRepository.prototype.versions = function (source) { + // Resolve the source using the factory because the + // source can actually be a registry name + return resolverFactory.getConstructor(source, this._config, this._registryClient) + .spread(function (ConcreteResolver, source) { + // If offline, resolve using the cached versions + if (this._config.offline) { + return this._resolveCache.versions(source); + } + + // Otherwise, fetch remotely + return ConcreteResolver.versions(source); + }.bind(this)); +}; + +PackageRepository.prototype.eliminate = function (pkgMeta) { + return Q.all([ + this._resolveCache.eliminate(pkgMeta), + Q.nfcall(this._registryClient.clearCache.bind(this._registryClient), pkgMeta.name) + ]); +}; + +PackageRepository.prototype.clear = function () { + return Q.all([ + this._resolveCache.clear(), + Q.nfcall(this._registryClient.clearCache.bind(this._registryClient)) + ]); +}; + +PackageRepository.prototype.reset = function () { + this._resolveCache.reset(); + this._registryClient.resetCache(); +}; + +PackageRepository.prototype.list = function () { + return this._resolveCache.list(); +}; + +PackageRepository.prototype.getRegistryClient = function () { + return this._registryClient; +}; + +PackageRepository.prototype.getResolveCache = function () { + return this._resolveCache; +}; + +PackageRepository.clearRuntimeCache = function () { + ResolveCache.clearRuntimeCache(); + RegistryClient.clearRuntimeCache(); + resolverFactory.clearRuntimeCache(); +}; + +// --------------------- + +PackageRepository.prototype._resolve = function (resolver, logger) { + // Resolve the resolver + return resolver.resolve() + // Store in the cache + .then(function (canonicalDir) { + return this._resolveCache.store(canonicalDir, resolver.getPkgMeta()); + }.bind(this)) + // Resolve promise with canonical dir and package meta + .then(function (dir) { + var pkgMeta = resolver.getPkgMeta(); + + logger.info('resolved', resolver.getSource() + (pkgMeta._release ? '#' + pkgMeta._release : '')); + return [dir, pkgMeta, resolver.constructor.isTargetable()]; + }.bind(this)); +}; + +PackageRepository.prototype._extendLog = function (log, info) { + log.data = log.data || {}; + + // Store endpoint info in each log + if (info.decEndpoint) { + log.data.endpoint = mout.object.pick(info.decEndpoint, ['name', 'source', 'target']); + } + + // Store the resolver info in each log + if (info.resolver) { + log.data.resolver = { + name: info.resolver.getName(), + source: info.resolver.getSource(), + target: info.resolver.getTarget() + }; + } + + // Store the canonical dir and its meta in each log + if (info.canonicalDir) { + log.data.canonicalDir = info.canonicalDir; + log.data.pkgMeta = info.pkgMeta; + } + + return log; +}; + +module.exports = PackageRepository; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Project.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Project.js new file mode 100644 index 0000000..9a99c1d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/Project.js @@ -0,0 +1,801 @@ +var glob = require('glob'); +var path = require('path'); +var fs = require('graceful-fs'); +var Q = require('q'); +var mout = require('mout'); +var rimraf = require('rimraf'); +var endpointParser = require('bower-endpoint-parser'); +var Logger = require('bower-logger'); +var Manager = require('./Manager'); +var defaultConfig = require('../config'); +var semver = require('../util/semver'); +var md5 = require('../util/md5'); +var createError = require('../util/createError'); +var readJson = require('../util/readJson'); +var validLink = require('../util/validLink'); + +function Project(config, logger) { + // This is the only architecture component that ensures defaults + // on config and logger + // The reason behind it is that users can likely use this component + // directly if commands do not fulfil their needs + this._config = config || defaultConfig; + this._logger = logger || new Logger(); + this._manager = new Manager(this._config, this._logger); + + this._options = {}; +} + +// ----------------- + +Project.prototype.install = function (decEndpoints, options) { + var that = this; + var targets = []; + var resolved = {}; + var incompatibles = []; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._working = true; + + // Analyse the project + return this._analyse() + .spread(function (json, tree) { + // Recover tree + that.walkTree(tree, function (node, name) { + if (node.missing || node.different) { + targets.push(node); + } else if (node.incompatible) { + incompatibles.push(node); + } else { + resolved[name] = node; + } + + // Ignore linked dependencies because it's too complex to parse them + // Note that this might change in the future: #673 + if (node.linked) { + return false; + } + }); + + // Add decomposed endpoints as targets + decEndpoints = decEndpoints || []; + decEndpoints.forEach(function (decEndpoint) { + // Mark as new so that a conflict for this target + // always require a choice + // Also allows for the target to be converted in case + // of being * + decEndpoint.newly = true; + targets.push(decEndpoint); + }); + + // Bootstrap the process + return that._bootstrap(targets, resolved, incompatibles); + }) + .then(function (installed) { + // Handle save and saveDev options + if (that._options.save || that._options.saveDev) { + // Cycle through the specified endpoints + decEndpoints.forEach(function (decEndpoint) { + var jsonEndpoint; + + jsonEndpoint = endpointParser.decomposed2json(decEndpoint); + + if (that._options.save) { + that._json.dependencies = mout.object.mixIn(that._json.dependencies || {}, jsonEndpoint); + } + + if (that._options.saveDev) { + that._json.devDependencies = mout.object.mixIn(that._json.devDependencies || {}, jsonEndpoint); + } + }); + } + + // Save JSON, might contain changes to dependencies and resolutions + return that.saveJson() + .then(function () { + return installed; + }); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.update = function (names, options) { + var that = this; + var targets = []; + var resolved = {}; + var incompatibles = []; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._working = true; + + // Analyse the project + return this._analyse() + .spread(function (json, tree, flattened) { + // If no names were specified, update every package + if (!names) { + // Mark each root dependency as targets + that.walkTree(tree, function (node) { + // Ignore linked extraneous because + // we don't know their real sources + if (node.extraneous && node.linked) { + return false; + } + + targets.push(node); + return false; + }, true); + // Otherwise, selectively update the specified ones + } else { + // Error out if some of the specified names + // are not installed + names.forEach(function (name) { + if (!flattened[name]) { + throw createError('Package ' + name + ' is not installed', 'ENOTINS', { + name: name + }); + } + }); + + // Add packages whose names are specified to be updated + that.walkTree(tree, function (node, name) { + // Ignore linked extraneous because + // we don't know their real source + if (node.extraneous && node.linked) { + return false; + } + + if (names.indexOf(name) !== -1) { + targets.push(node); + return false; + } + }, true); + + // Recover tree + that.walkTree(tree, function (node, name) { + if (node.missing || node.different) { + targets.push(node); + } else if (node.incompatible) { + incompatibles.push(node); + } else { + resolved[name] = node; + } + + // Ignore linked dependencies because it's too complex to parse them + // Note that this might change in the future: #673 + if (node.linked) { + return false; + } + }, true); + } + + // Bootstrap the process + return that._bootstrap(targets, resolved, incompatibles) + .then(function (installed) { + // Save JSON, might contain changes to resolutions + return that.saveJson() + .then(function () { + return installed; + }); + }); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.uninstall = function (names, options) { + var that = this; + var packages = {}; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._working = true; + + // Analyse the project + return this._analyse() + // Fill in the packages to be uninstalled + .spread(function (json, tree, flattened) { + var promise = Q.resolve(); + + names.forEach(function (name) { + var decEndpoint = flattened[name]; + + // Check if it is not installed + if (!decEndpoint || decEndpoint.missing) { + packages[name] = null; + return; + } + + promise = promise + .then(function () { + var message; + var data; + var dependantsNames; + var dependants = []; + + // Walk the down the tree, gathering dependants of the package + that.walkTree(tree, function (node, nodeName) { + if (name === nodeName) { + dependants.push.apply(dependants, mout.object.values(node.dependants)); + } + }, true); + + // Remove duplicates + dependants = mout.array.unique(dependants); + + // Note that the root is filtered from the dependants + // as well as other dependants marked to be uninstalled + dependants = dependants.filter(function (dependant) { + return !dependant.root && names.indexOf(dependant.name) === -1; + }); + + // If the package has no dependants or the force config is enabled, + // mark it to be removed + if (!dependants.length || that._config.force) { + packages[name] = decEndpoint.canonicalDir; + return; + } + + // Otherwise we need to figure it out if the user really wants to remove it, + // even with dependants + // As such we need to prompt the user with a meaningful message + dependantsNames = dependants.map(function (dep) { return dep.name; }); + dependantsNames.sort(function (name1, name2) { return name1.localeCompare(name2); }); + dependantsNames = mout.array.unique(dependantsNames); + dependants = dependants.map(function (dependant) { return that._manager.toData(dependant); }); + message = dependantsNames.join(', ') + ' depends on ' + decEndpoint.name; + data = { + name: decEndpoint.name, + dependants: dependants + }; + + // If interactive is disabled, error out + if (!that._config.interactive) { + throw createError(message, 'ECONFLICT', { + data: data + }); + } + + that._logger.conflict('mutual', message, data); + + // Prompt the user + return Q.nfcall(that._logger.prompt.bind(that._logger), { + type: 'confirm', + message: 'Continue anyway?', + default: true + }) + .then(function (confirmed) { + // If the user decided to skip it, remove from the array so that it won't + // influence subsequent dependants + if (!confirmed) { + mout.array.remove(names, name); + } else { + packages[name] = decEndpoint.canonicalDir; + } + }); + }); + }); + + return promise; + }) + // Remove packages + .then(function () { + return that._removePackages(packages); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.getTree = function () { + return this._analyse() + .spread(function (json, tree, flattened) { + var extraneous = []; + var additionalKeys = ['missing', 'extraneous', 'different', 'linked']; + + // Convert tree + tree = this._manager.toData(tree, additionalKeys); + + // Mark incompatibles + this.walkTree(tree, function (node) { + var version; + var target = node.endpoint.target; + + if (node.pkgMeta && semver.validRange(target)) { + version = node.pkgMeta.version; + + // Ignore if target is '*' and resolved to a non-semver release + if (!version && target === '*') { + return; + } + + if (!version || !semver.satisfies(version, target)) { + node.incompatible = true; + } + } + }, true); + + // Convert extraneous + mout.object.forOwn(flattened, function (pkg) { + if (pkg.extraneous) { + extraneous.push(this._manager.toData(pkg, additionalKeys)); + } + }, this); + + // Convert flattened + flattened = mout.object.map(flattened, function (node) { + return this._manager.toData(node, additionalKeys); + }, this); + + return [tree, flattened, extraneous]; + }.bind(this)); +}; + +Project.prototype.walkTree = function (node, fn, onlyOnce) { + var result; + var dependencies; + var queue = mout.object.values(node.dependencies); + + if (onlyOnce === true) { + onlyOnce = []; + } + + while (queue.length) { + node = queue.shift(); + result = fn(node, node.name); + + // Abort traversal if result is false + if (result === false) { + continue; + } + + // Add dependencies to the queue + dependencies = mout.object.values(node.dependencies); + + // If onlyOnce was true, do not add if already traversed + if (onlyOnce) { + dependencies = dependencies.filter(function (dependency) { + return !mout.array.find(onlyOnce, function (stacked) { + if (dependency.endpoint) { + return mout.object.equals(dependency.endpoint, stacked.endpoint); + } + + return dependency.name === stacked.name && + dependency.source === stacked.source && + dependency.target === stacked.target; + }); + }); + + onlyOnce.push.apply(onlyOnce, dependencies); + } + + queue.unshift.apply(queue, dependencies); + } +}; + +Project.prototype.saveJson = function (forceCreate) { + var file; + var jsonStr = JSON.stringify(this._json, null, ' ') + '\n'; + var jsonHash = md5(jsonStr); + + // Save only if there's something different + if (jsonHash === this._jsonHash) { + return Q.resolve(); + } + + // Error out if the json file does not exist, unless force create + // is true + if (!this._jsonFile && !forceCreate) { + this._logger.warn('no-json', 'No bower.json file to save to, use bower init to create one'); + return Q.resolve(); + } + + file = this._jsonFile || path.join(this._config.cwd, 'bower.json'); + return Q.nfcall(fs.writeFile, file, jsonStr) + .then(function () { + this._jsonHash = jsonHash; + this._jsonFile = file; + return this._json; + }.bind(this)); +}; + +Project.prototype.hasJson = function () { + return this._readJson() + .then(function (json) { + return json ? this._jsonFile : false; + }.bind(this)); +}; + +Project.prototype.getJson = function () { + return this._readJson(); +}; + +Project.prototype.getManager = function () { + return this._manager; +}; + +Project.prototype.getPackageRepository = function () { + return this._manager.getPackageRepository(); +}; + +// ----------------- + +Project.prototype._analyse = function () { + return Q.all([ + this._readJson(), + this._readInstalled(), + this._readLinks() + ]) + .spread(function (json, installed, links) { + var root; + var jsonCopy = mout.lang.deepClone(json); + var flattened = mout.object.mixIn({}, installed, links); + + root = { + name: json.name, + source: this._config.cwd, + target: json.version || '*', + pkgMeta: jsonCopy, + canonicalDir: this._config.cwd, + root: true + }; + + // Mix direct extraneous as dependencies + // (dependencies installed without --save/--save-dev) + jsonCopy.dependencies = jsonCopy.dependencies || {}; + jsonCopy.devDependencies = jsonCopy.devDependencies || {}; + mout.object.forOwn(installed, function (decEndpoint, key) { + var pkgMeta = decEndpoint.pkgMeta; + var isSaved = jsonCopy.dependencies[key] || jsonCopy.devDependencies[key]; + + // The _direct propery is saved by the manager when .newly is specified + if (!isSaved && pkgMeta._direct) { + decEndpoint.extraneous = true; + jsonCopy.dependencies[key] = (pkgMeta._originalSource || pkgMeta._source) + '#' + pkgMeta._target; + } + }); + + // Restore the original dependencies cross-references, + // that is, the parent-child relationships + this._restoreNode(root, flattened, 'dependencies'); + // Do the same for the dev dependencies + if (!this._options.production) { + this._restoreNode(root, flattened, 'devDependencies'); + } + + // Restore the rest of the extraneous (not installed directly) + mout.object.forOwn(flattened, function (decEndpoint, name) { + if (!decEndpoint.dependants) { + decEndpoint.extraneous = true; + this._restoreNode(decEndpoint, flattened, 'dependencies'); + // Note that it has no dependants, just dependencies! + root.dependencies[name] = decEndpoint; + } + }, this); + + // Remove root from the flattened tree + delete flattened[json.name]; + + return [json, root, flattened]; + }.bind(this)); +}; + +Project.prototype._bootstrap = function (targets, resolved, incompatibles) { + var installed = mout.object.map(this._installed, function (decEndpoint) { + return decEndpoint.pkgMeta; + }); + + this._json.resolutions = this._json.resolutions || {}; + + // Configure the manager and kick in the resolve process + return this._manager + .configure({ + targets: targets, + resolved: resolved, + incompatibles: incompatibles, + resolutions: this._json.resolutions, + installed: installed, + forceLatest: this._options.forceLatest + }) + .resolve() + .then(function () { + // If the resolutions is empty, delete key + if (!mout.object.size(this._json.resolutions)) { + delete this._json.resolutions; + } + }.bind(this)) + // Install resolved ones + .then(this._manager.install.bind(this._manager)); +}; + +Project.prototype._readJson = function () { + var that = this; + + if (this._json) { + return Q.resolve(this._json); + } + + // Read local json + return this._json = readJson(this._config.cwd, { + assume: { name: path.basename(this._config.cwd) || 'root' } + }) + .spread(function (json, deprecated, assumed) { + var jsonStr; + + if (deprecated) { + that._logger.warn('deprecated', 'You are using the deprecated ' + deprecated + ' file'); + } + + if (!assumed) { + that._jsonFile = path.join(that._config.cwd, deprecated ? deprecated : 'bower.json'); + } + + jsonStr = JSON.stringify(json, null, ' ') + '\n'; + that._jsonHash = md5(jsonStr); + return that._json = json; + }); +}; + +Project.prototype._readInstalled = function () { + var componentsDir; + var that = this; + + if (this._installed) { + return Q.resolve(this._installed); + } + + // Gather all folders that are actual packages by + // looking for the package metadata file + componentsDir = path.join(this._config.cwd, this._config.directory); + return this._installed = Q.nfcall(glob, '*/.bower.json', { + cwd: componentsDir, + dot: true + }) + .then(function (filenames) { + var promises; + var decEndpoints = {}; + + // Foreach bower.json found + promises = filenames.map(function (filename) { + var name = path.dirname(filename); + var metaFile = path.join(componentsDir, filename); + + // Read package metadata + return readJson(metaFile) + .spread(function (pkgMeta) { + decEndpoints[name] = { + name: name, + source: pkgMeta._originalSource || pkgMeta._source, + target: pkgMeta._target, + canonicalDir: path.dirname(metaFile), + pkgMeta: pkgMeta + }; + }); + }); + + // Wait until all files have been read + // and resolve with the decomposed endpoints + return Q.all(promises) + .then(function () { + return that._installed = decEndpoints; + }); + }); +}; + +Project.prototype._readLinks = function () { + var componentsDir; + var that = this; + + // Read directory, looking for links + componentsDir = path.join(this._config.cwd, this._config.directory); + return Q.nfcall(fs.readdir, componentsDir) + .then(function (filenames) { + var promises; + var decEndpoints = {}; + + promises = filenames.map(function (filename) { + var dir = path.join(componentsDir, filename); + + // Filter only those that are valid links + return validLink(dir) + .spread(function (valid, err) { + var name; + + if (!valid) { + if (err) { + that._logger.debug('read-link', 'Link ' + dir + ' is invalid', { + filename: dir, + error: err + }); + } + return; + } + + // Skip links to files (see #783) + if (!valid.isDirectory()) { + return; + } + + name = path.basename(dir); + return readJson(dir, { + assume: { name: name } + }) + .spread(function (json, deprecated) { + if (deprecated) { + that._logger.warn('deprecated', 'Package ' + name + ' is using the deprecated ' + deprecated); + } + + json._direct = true; // Mark as a direct dep of root + decEndpoints[name] = { + name: name, + source: dir, + target: '*', + canonicalDir: dir, + pkgMeta: json, + linked: true + }; + }); + }); + }); + + // Wait until all links have been read + // and resolve with the decomposed endpoints + return Q.all(promises) + .then(function () { + return decEndpoints; + }); + // Ignore if folder does not exist + }, function (err) { + if (err.code !== 'ENOENT') { + throw err; + } + + return {}; + }); +}; + +Project.prototype._removePackages = function (packages) { + var that = this; + var promises = []; + + mout.object.forOwn(packages, function (dir, name) { + var promise; + + // Delete directory + if (!dir) { + promise = Q.resolve(); + that._logger.warn('not-installed', name, { + name: name + }); + } else { + promise = Q.nfcall(rimraf, dir); + that._logger.action('uninstall', name, { + name: name, + dir: dir + }); + } + + // Remove from json only if successfully deleted + if (that._options.save && that._json.dependencies) { + promise = promise + .then(function () { + delete that._json.dependencies[name]; + }); + } + + if (that._options.saveDev && that._json.devDependencies) { + promise = promise + .then(function () { + delete that._json.devDependencies[name]; + }); + } + + promises.push(promise); + }); + + return Q.all(promises) + // Save json + .then(function () { + return that.saveJson(); + }) + // Resolve with removed packages + .then(function () { + return mout.object.filter(packages, function (dir) { + return !!dir; + }); + }); +}; + +Project.prototype._restoreNode = function (node, flattened, jsonKey) { + var deps; + + // Do not restore if the node is missing + if (node.missing) { + return; + } + + node.dependencies = node.dependencies || {}; + node.dependants = node.dependants || {}; + + // Only process deps that are yet processed + deps = mout.object.filter(node.pkgMeta[jsonKey], function (value, key) { + return !node.dependencies[key]; + }); + + mout.object.forOwn(deps, function (value, key) { + var local = flattened[key]; + var json = endpointParser.json2decomposed(key, value); + var restored; + var compatible; + var originalSource; + + // Check if the dependency is not installed + if (!local) { + flattened[key] = restored = json; + restored.missing = true; + // Even if it is installed, check if it's compatible + // Note that linked packages are interpreted as compatible + // This might change in the future: #673 + } else { + compatible = local.linked || (!local.missing && json.target === local.pkgMeta._target); + + if (!compatible) { + restored = json; + + if (!local.missing) { + restored.pkgMeta = local.pkgMeta; + restored.canonicalDir = local.canonicalDir; + restored.incompatible = true; + } else { + restored.missing = true; + } + } else { + restored = local; + mout.object.mixIn(local, json); + } + + // Check if source changed, marking as different if it did + // We only do this for direct root dependencies that are compatible + if (node.root && compatible) { + originalSource = mout.object.get(local, 'pkgMeta._originalSource'); + if (originalSource && originalSource !== json.source) { + restored.different = true; + } + } + } + + // Cross reference + node.dependencies[key] = restored; + restored.dependants = restored.dependants || {}; + restored.dependants[node.name] = node; + + // Call restore for this dependency + this._restoreNode(restored, flattened, 'dependencies'); + + // Do the same for the incompatible local package + if (local && restored !== local) { + this._restoreNode(local, flattened, 'dependencies'); + } + }, this); +}; + +module.exports = Project; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/ResolveCache.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/ResolveCache.js new file mode 100644 index 0000000..0bf503d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/ResolveCache.js @@ -0,0 +1,395 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var LRU = require('lru-cache'); +var semver = require('../util/semver'); +var readJson = require('../util/readJson'); +var copy = require('../util/copy'); +var md5 = require('../util/md5'); + +function ResolveCache(config) { + // TODO: Make some config entries, such as: + // - Max MB + // - Max versions per source + // - Max MB per source + // - etc.. + this._config = config; + this._dir = this._config.storage.packages; + + // Cache is stored/retrieved statically to ensure singularity + // among instances + this._cache = this.constructor._cache.get(this._dir); + if (!this._cache) { + this._cache = new LRU({ + max: 100, + maxAge: 60 * 5 * 1000 // 5 minutes + }); + this.constructor._cache.set(this._dir, this._cache); + } + + // Ensure dir is created + mkdirp.sync(this._dir); +} + +// ----------------- + +ResolveCache.prototype.retrieve = function (source, target) { + var sourceId = md5(source); + var dir = path.join(this._dir, sourceId); + var that = this; + + target = target || '*'; + + return this._getVersions(sourceId) + .spread(function (versions) { + var suitable; + + // If target is a semver, find a suitable version + if (semver.validRange(target)) { + suitable = semver.maxSatisfying(versions, target, true); + + if (suitable) { + return suitable; + } + } + + // If target is '*' check if there's a cached '_wildcard' + if (target === '*') { + return mout.array.find(versions, function (version) { + return version === '_wildcard'; + }); + } + + // Otherwise check if there's an exact match + return mout.array.find(versions, function (version) { + return version === target; + }); + }) + .then(function (version) { + var canonicalDir; + + if (!version) { + return []; + } + + // Resolve with canonical dir and package meta + canonicalDir = path.join(dir, version); + return that._readPkgMeta(canonicalDir) + .then(function (pkgMeta) { + return [canonicalDir, pkgMeta]; + }, function () { + // If there was an error, invalidate the in-memory cache, + // delete the cached package and try again + that._cache.del(sourceId); + + return Q.nfcall(rimraf, canonicalDir) + .then(function () { + return that.retrieve(source, target); + }); + }); + }); +}; + +ResolveCache.prototype.store = function (canonicalDir, pkgMeta) { + var sourceId; + var release; + var dir; + var promise; + var that = this; + + promise = pkgMeta ? Q.resolve(pkgMeta) : this._readPkgMeta(canonicalDir); + + return promise + .then(function (pkgMeta) { + sourceId = md5(pkgMeta._source); + release = that._getPkgRelease(pkgMeta); + dir = path.join(that._dir, sourceId, release); + + // Check if directory exists + return Q.nfcall(fs.stat, dir) + .then(function () { + // If it does exists, remove it + return Q.nfcall(rimraf, dir); + }, function (err) { + // If directory does not exists, ensure its basename + // is created + if (err.code === 'ENOENT') { + return Q.nfcall(mkdirp, path.dirname(dir)); + } + + throw err; + }) + // Move the canonical to sourceId/target + .then(function () { + return Q.nfcall(fs.rename, canonicalDir, dir) + .fail(function (err) { + // If error is EXDEV it means that we are trying to rename + // across different drives, so we copy and remove it instead + if (err.code !== 'EXDEV') { + throw err; + } + + return copy.copyDir(canonicalDir, dir) + .then(function () { + return Q.nfcall(rimraf, canonicalDir); + }); + }); + }); + }) + .then(function () { + var versions = that._cache.get(sourceId); + + // Add it to the in memory cache + // and sort the versions afterwards + if (versions && versions.indexOf(release) === -1) { + versions.push(release); + that._sortVersions(versions); + } + + // Resolve with the final location + return dir; + }); +}; + +ResolveCache.prototype.eliminate = function (pkgMeta) { + var sourceId = md5(pkgMeta._source); + var release = this._getPkgRelease(pkgMeta); + var dir = path.join(this._dir, sourceId, release); + var that = this; + + return Q.nfcall(rimraf, dir) + .then(function () { + var versions = that._cache.get(sourceId) || []; + mout.array.remove(versions, release); + + // If this was the last package in the cache, + // delete the parent folder (source) + // For extra security, check against the file system + // if this was really the last package + if (!versions.length) { + that._cache.del(sourceId); + + return that._getVersions(sourceId) + .spread(function (versions) { + if (!versions.length) { + // Do not keep in-memory cache if it's completely + // empty + that._cache.del(sourceId); + + return Q.nfcall(rimraf, path.dirname(dir)); + } + }); + } + }); +}; + +ResolveCache.prototype.clear = function () { + return Q.nfcall(rimraf, this._dir) + .then(function () { + return Q.nfcall(fs.mkdir, this._dir); + }.bind(this)) + .then(function () { + this._cache.reset(); + }.bind(this)); +}; + +ResolveCache.prototype.reset = function () { + this._cache.reset(); + return this; +}; + +ResolveCache.prototype.versions = function (source) { + var sourceId = md5(source); + + return this._getVersions(sourceId) + .spread(function (versions) { + return versions.filter(function (version) { + return semver.valid(version); + }); + }); +}; + +ResolveCache.prototype.list = function () { + var promises; + var dirs = []; + var that = this; + + // Get the list of directories + return Q.nfcall(fs.readdir, this._dir) + .then(function (sourceIds) { + promises = sourceIds.map(function (sourceId) { + return Q.nfcall(fs.readdir, path.join(that._dir, sourceId)) + .then(function (versions) { + versions.forEach(function (version) { + var dir = path.join(that._dir, sourceId, version); + dirs.push(dir); + }); + }, function (err) { + // Ignore lurking files, e.g.: .DS_Store if the user + // has navigated throughout the cache + if (err.code === 'ENOTDIR' && err.path) { + return Q.nfcall(rimraf, err.path); + } + + throw err; + }); + }); + + return Q.all(promises); + }) + // Read every package meta + .then(function () { + promises = dirs.map(function (dir) { + return that._readPkgMeta(dir) + .then(function (pkgMeta) { + return { + canonicalDir: dir, + pkgMeta: pkgMeta + }; + }, function () { + // If it fails to read, invalidate the in memory + // cache for the source and delete the entry directory + var sourceId = path.basename(path.dirname(dir)); + that._cache.del(sourceId); + + return Q.nfcall(rimraf, dir); + }); + }); + + return Q.all(promises); + }) + // Sort by name ASC & release ASC + .then(function (entries) { + // Ignore falsy entries due to errors reading + // package metas + entries = entries.filter(function (entry) { + return !!entry; + }); + + return entries.sort(function (entry1, entry2) { + var pkgMeta1 = entry1.pkgMeta; + var pkgMeta2 = entry2.pkgMeta; + var comp = pkgMeta1.name.localeCompare(pkgMeta2.name); + + // Sort by name + if (comp) { + return comp; + } + + // Sort by version + if (pkgMeta1.version && pkgMeta2.version) { + return semver.compare(pkgMeta1.version, pkgMeta2.version); + } + if (pkgMeta1.version) { + return -1; + } + if (pkgMeta2.version) { + return 1; + } + + // Sort by target + return pkgMeta1._target.localeCompare(pkgMeta2._target); + }); + }); +}; + +// ------------------------ + +ResolveCache.clearRuntimeCache = function () { + // Note that _cache refers to the static _cache variable + // that holds other caches per dir! + // Do not confuse it with the instance cache + + // Clear cache of each directory + this._cache.forEach(function (cache) { + cache.reset(); + }); + + // Clear root cache + this._cache.reset(); +}; + +// ------------------------ + +ResolveCache.prototype._getPkgRelease = function (pkgMeta) { + var release = pkgMeta.version || (pkgMeta._target === '*' ? '_wildcard' : pkgMeta._target); + + // Encode some dangerous chars such as / and \ + release = encodeURIComponent(release); + + return release; +}; + +ResolveCache.prototype._readPkgMeta = function (dir) { + var filename = path.join(dir, '.bower.json'); + + return readJson(filename) + .spread(function (json) { + return json; + }); +}; + +ResolveCache.prototype._getVersions = function (sourceId) { + var dir; + var versions = this._cache.get(sourceId); + var that = this; + + if (versions) { + return Q.resolve([versions, true]); + } + + dir = path.join(this._dir, sourceId); + return Q.nfcall(fs.readdir, dir) + .then(function (versions) { + // Sort and cache in memory + that._sortVersions(versions); + that._cache.set(sourceId, versions); + return [versions, false]; + }, function (err) { + // If the directory does not exists, resolve + // as an empty array + if (err.code === 'ENOENT') { + versions = []; + that._cache.set(sourceId, versions); + return [versions, false]; + } + + throw err; + }); +}; + +ResolveCache.prototype._sortVersions = function (versions) { + // Sort DESC + versions.sort(function (version1, version2) { + var validSemver1 = semver.valid(version1); + var validSemver2 = semver.valid(version2); + + // If both are semvers, compare them + if (validSemver1 && validSemver2) { + return semver.rcompare(version1, version2); + } + + // If one of them are semvers, give higher priority + if (validSemver1) { + return -1; + } + if (validSemver2) { + return 1; + } + + // Otherwise they are considered equal + return 0; + }); +}; + +// ------------------------ + +ResolveCache._cache = new LRU({ + max: 5, + maxAge: 60 * 30 * 1000 // 30 minutes +}); + +module.exports = ResolveCache; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolverFactory.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolverFactory.js new file mode 100644 index 0000000..f256895 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolverFactory.js @@ -0,0 +1,154 @@ +var Q = require('q'); +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var resolvers = require('./resolvers'); +var createError = require('../util/createError'); + +function createInstance(decEndpoint, config, logger, registryClient) { + return getConstructor(decEndpoint.source, config, registryClient) + .spread(function (ConcreteResolver, source, fromRegistry) { + var decEndpointCopy = mout.object.pick(decEndpoint, ['name', 'target']); + + decEndpointCopy.source = source; + + // Signal if it was fetched from the registry + if (fromRegistry) { + decEndpoint.registry = true; + // If no name was specified, assume the name from the registry + if (!decEndpointCopy.name) { + decEndpointCopy.name = decEndpoint.name = decEndpoint.source; + } + } + + return new ConcreteResolver(decEndpointCopy, config, logger); + }); +} + +function getConstructor(source, config, registryClient) { + var absolutePath, + promise; + + // Git case: git git+ssh, git+http, git+https + // .git at the end (probably ssh shorthand) + // git@ at the start + if (/^git(\+(ssh|https?))?:\/\//i.test(source) || /\.git\/?$/i.test(source) || /^git@/i.test(source)) { + source = source.replace(/^git\+/, ''); + return Q.fcall(function () { + + // If it's a GitHub repository, return the specialized resolver + if (resolvers.GitHub.getOrgRepoPair(source)) { + return [resolvers.GitHub, source]; + } + + return [resolvers.GitRemote, source]; + }); + } + + // URL case + if (/^https?:\/\//i.exec(source)) { + return Q.fcall(function () { + return [resolvers.Url, source]; + }); + } + + // Below we try a series of async tests to guess the type of resolver to use + // If a step was unable to guess the resolver, it throws an error + // If a step was able to guess the resolver, it resolves with a function + // That function returns a promise that will resolve with the concrete type + + // If source is ./ or ../ or an absolute path + absolutePath = path.resolve(config.cwd, source); + + if (/^\.\.?[\/\\]/.test(source) || /^~\//.test(source) || path.normalize(source).replace(/[\/\\]+$/, '') === absolutePath) { + promise = Q.nfcall(fs.stat, path.join(absolutePath, '.git')) + .then(function (stats) { + if (stats.isDirectory()) { + return function () { + return Q.resolve([resolvers.GitFs, absolutePath]); + }; + } + + throw new Error('Not a Git repository'); + }) + // If not, check if source is a valid file/folder + .fail(function () { + return Q.nfcall(fs.stat, absolutePath) + .then(function () { + return function () { + return Q.resolve([resolvers.Fs, absolutePath]); + }; + }); + }); + } else { + promise = Q.reject(new Error('Not an absolute or relative file')); + } + + return promise + // Check if is a shorthand and expand it + .fail(function (err) { + var parts; + + // Skip ssh and/or URL with auth + if (/[:@]/.test(source)) { + throw err; + } + + // Ensure exactly only one "/" + parts = source.split('/'); + if (parts.length === 2) { + source = mout.string.interpolate(config.shorthandResolver, { + shorthand: source, + owner: parts[0], + package: parts[1] + }); + + return function () { + return getConstructor(source, config, registryClient); + }; + } + + throw err; + }) + // As last resort, we try the registry + .fail(function (err) { + if (!registryClient) { + throw err; + } + + return function () { + return Q.nfcall(registryClient.lookup.bind(registryClient), source) + .then(function (entry) { + if (!entry) { + throw createError('Package ' + source + ' not found', 'ENOTFOUND'); + } + + // TODO: Handle entry.type.. for now it's only 'alias' + // When we got published packages, this needs to be adjusted + source = entry.url; + + return getConstructor(source, config, registryClient) + .spread(function (ConcreteResolver, source) { + return [ConcreteResolver, source, true]; + }); + }); + }; + }) + // If we got the function, simply call and return + .then(function (func) { + return func(); + // Finally throw a meaningful error + }, function () { + throw createError('Could not find appropriate resolver for ' + source, 'ENORESOLVER'); + }); +} + +function clearRuntimeCache() { + mout.object.values(resolvers).forEach(function (ConcreteResolver) { + ConcreteResolver.clearRuntimeCache(); + }); +} + +module.exports = createInstance; +module.exports.getConstructor = getConstructor; +module.exports.clearRuntimeCache = clearRuntimeCache; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/FsResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/FsResolver.js new file mode 100644 index 0000000..92c916a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/FsResolver.js @@ -0,0 +1,143 @@ +var util = require('util'); +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var junk = require('junk'); +var Resolver = require('./Resolver'); +var copy = require('../../util/copy'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function FsResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + // Ensure absolute path + this._source = path.resolve(this._config.cwd, this._source); + + // If target was specified, simply reject the promise + if (this._target !== '*') { + throw createError('File system sources can\'t resolve targets', 'ENORESTARGET'); + } + + // If the name was guessed + if (this._guessedName) { + // Remove extension + this._name = this._name.substr(0, this._name.length - path.extname(this._name).length); + } +} + +util.inherits(FsResolver, Resolver); +mout.object.mixIn(FsResolver, Resolver); + +// ----------------- + +FsResolver.isTargetable = function () { + return false; +}; + +// TODO: Should we store latest mtimes in the resolution and compare? +// This would be beneficial when copying big files/folders + +// TODO: There's room for improvement by using streams if the source +// is an archive file, by piping read stream to the zip extractor +// This will likely increase the complexity of code but might worth it +FsResolver.prototype._resolve = function () { + return this._copy() + .then(this._extract.bind(this)) + .then(this._rename.bind(this)); +}; + +// ----------------- + +FsResolver.prototype._copy = function () { + var that = this; + + return Q.nfcall(fs.stat, this._source) + .then(function (stat) { + var dst; + var copyOpts; + var promise; + + that._sourceStat = stat; + copyOpts = { mode: stat.mode }; + + // If it's a folder + if (stat.isDirectory()) { + dst = that._tempDir; + + // Read the bower.json inside the folder, so that we + // copy only the necessary files if it has ignore specified + promise = that._readJson(that._source) + .then(function (json) { + copyOpts.ignore = json.ignore; + return copy.copyDir(that._source, dst, copyOpts); + }) + .then(function () { + // Resolve to null because it's a dir + return; + }); + // Else it's a file + } else { + dst = path.join(that._tempDir, path.basename(that._source)); + promise = copy.copyFile(that._source, dst, copyOpts) + .then(function () { + return dst; + }); + } + + that._logger.action('copy', that._source, { + src: that._source, + dst: dst + }); + + return promise; + }); +}; + +FsResolver.prototype._extract = function (file) { + if (!file || !extract.canExtract(file)) { + return Q.resolve(); + } + + this._logger.action('extract', path.basename(this._source), { + archive: file, + to: this._tempDir + }); + + return extract(file, this._tempDir); +}; + +FsResolver.prototype._rename = function () { + return Q.nfcall(fs.readdir, this._tempDir) + .then(function (files) { + var file; + var oldPath; + var newPath; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + // Only rename if there's only one file and it's not the json + if (files.length === 1 && !/^(bower|component)\.json$/.test(files[0])) { + file = files[0]; + this._singleFile = 'index' + path.extname(file); + oldPath = path.join(this._tempDir, file); + newPath = path.join(this._tempDir, this._singleFile); + + return Q.nfcall(fs.rename, oldPath, newPath); + } + }.bind(this)); +}; + +FsResolver.prototype._savePkgMeta = function (meta) { + // Store main if is a single file + if (this._singleFile) { + meta.main = this._singleFile; + } + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +module.exports = FsResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitFsResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitFsResolver.js new file mode 100644 index 0000000..5fa71ed --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitFsResolver.js @@ -0,0 +1,77 @@ +var util = require('util'); +var Q = require('q'); +var mout = require('mout'); +var path = require('path'); +var GitResolver = require('./GitResolver'); +var copy = require('../../util/copy'); +var cmd = require('../../util/cmd'); + +function GitFsResolver(decEndpoint, config, logger) { + GitResolver.call(this, decEndpoint, config, logger); + + // Ensure absolute path + this._source = path.resolve(this._config.cwd, this._source); +} + +util.inherits(GitFsResolver, GitResolver); +mout.object.mixIn(GitFsResolver, GitResolver); + +// ----------------- + +// Override the checkout function to work with the local copy +GitFsResolver.prototype._checkout = function () { + var resolution = this._resolution; + + // The checkout process could be similar to the GitRemoteResolver by prepending file:// to the source + // But from my performance measures, it's faster to copy the folder and just checkout in there + this._logger.action('checkout', resolution.tag || resolution.branch || resolution.commit, { + resolution: resolution, + to: this._tempDir + }); + + // Copy files to the temporary directory first + return this._copy() + .then(cmd.bind(cmd, 'git', ['checkout', '-f', resolution.tag || resolution.branch || resolution.commit], { cwd: this._tempDir })) + // Cleanup unstaged files + .then(cmd.bind(cmd, 'git', ['clean', '-f', '-d'], { cwd: this._tempDir })); +}; + +GitFsResolver.prototype._copy = function () { + return copy.copyDir(this._source, this._tempDir); +}; + +// ----------------- + +// Grab refs locally +GitFsResolver.refs = function (source) { + var value; + + // TODO: Normalize source because of the various available protocols? + value = this._cache.refs.get(source); + if (value) { + return Q.resolve(value); + } + + value = cmd('git', ['show-ref', '--tags', '--heads'], { cwd : source }) + .spread(function (stdout) { + var refs; + + refs = stdout.toString() + .trim() // Trim trailing and leading spaces + .replace(/[\t ]+/g, ' ') // Standardize spaces (some git versions make tabs, other spaces) + .split(/[\r\n]+/); // Split lines into an array + + // Update the refs with the actual refs + this._cache.refs.set(source, refs); + + return refs; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.refs.set(source); + + return value; +}; + +module.exports = GitFsResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitHubResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitHubResolver.js new file mode 100644 index 0000000..22e76d4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitHubResolver.js @@ -0,0 +1,147 @@ +var util = require('util'); +var path = require('path'); +var mout = require('mout'); +var GitRemoteResolver = require('./GitRemoteResolver'); +var download = require('../../util/download'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function GitHubResolver(decEndpoint, config, logger) { + var pair; + + GitRemoteResolver.call(this, decEndpoint, config, logger); + + // Grab the org/repo + // /xxxxx/yyyyy.git or :xxxxx/yyyyy.git (.git is optional) + pair = GitHubResolver.getOrgRepoPair(this._source); + if (!pair) { + throw createError('Invalid GitHub URL', 'EINVEND', { + details: this._source + ' does not seem to be a valid GitHub URL' + }); + } + + this._org = pair.org; + this._repo = pair.repo; + + // Ensure trailing for all protocols + if (!mout.string.endsWith(this._source, '.git')) { + this._source += '.git'; + } + + // Check if it's public + this._public = mout.string.startsWith(this._source, 'git://'); + + // Use https:// rather than git:// if on a proxy + if (this._config.proxy || this._config.httpsProxy) { + this._source = this._source.replace('git://', 'https://'); + } +} + +util.inherits(GitHubResolver, GitRemoteResolver); +mout.object.mixIn(GitHubResolver, GitRemoteResolver); + +// ----------------- + +GitHubResolver.prototype._checkout = function () { + // Only fully works with public repositories and tags + // Could work with https/ssh protocol but not with 100% certainty + if (!this._public || !this._resolution.tag) { + return GitRemoteResolver.prototype._checkout.call(this); + } + + var msg; + var tarballUrl = 'https://github.com/' + this._org + '/' + this._repo + '/archive/' + this._resolution.tag + '.tar.gz'; + var file = path.join(this._tempDir, 'archive.tar.gz'); + var reqHeaders = {}; + var that = this; + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + this._logger.action('download', tarballUrl, { + url: that._source, + to: file + }); + + // Download tarball + return download(tarballUrl, file, { + proxy: this._config.httpsProxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + .progress(function (state) { + // Retry? + if (state.retry) { + msg = 'Download of ' + tarballUrl + ' failed with ' + state.error.code + ', '; + msg += 'retrying in ' + (state.delay / 1000).toFixed(1) + 's'; + that._logger.debug('error', state.error.message, { error: state.error }); + return that._logger.warn('retry', msg); + } + + // Progress + msg = 'received ' + (state.received / 1024 / 1024).toFixed(1) + 'MB'; + if (state.total) { + msg += ' of ' + (state.total / 1024 / 1024).toFixed(1) + 'MB downloaded, '; + msg += state.percent + '%'; + } + that._logger.info('progress', msg); + }) + .then(function () { + // Extract archive + that._logger.action('extract', path.basename(file), { + archive: file, + to: that._tempDir + }); + + return extract(file, that._tempDir) + // Fallback to standard git clone if extraction failed + .fail(function (err) { + msg = 'Decompression of ' + path.basename(file) + ' failed' + (err.code ? ' with ' + err.code : '') + ', '; + msg += 'trying with git..'; + that._logger.debug('error', err.message, { error: err }); + that._logger.warn('retry', msg); + + return that._cleanTempDir() + .then(GitRemoteResolver.prototype._checkout.bind(that)); + }); + // Fallback to standard git clone if download failed + }, function (err) { + msg = 'Download of ' + tarballUrl + ' failed' + (err.code ? ' with ' + err.code : '') + ', '; + msg += 'trying with git..'; + that._logger.debug('error', err.message, { error: err }); + that._logger.warn('retry', msg); + + return that._cleanTempDir() + .then(GitRemoteResolver.prototype._checkout.bind(that)); + + }); +}; + +GitHubResolver.prototype._savePkgMeta = function (meta) { + // Set homepage if not defined + if (!meta.homepage) { + meta.homepage = 'https://github.com/' + this._org + '/' + this._repo; + } + + return GitRemoteResolver.prototype._savePkgMeta.call(this, meta); +}; + +// ---------------- + +GitHubResolver.getOrgRepoPair = function (url) { + var match; + + match = url.match(/(?:@|:\/\/)github.com[:\/]([^\/\s]+?)\/([^\/\s]+?)(?:\.git)?\/?$/i); + if (!match) { + return null; + } + + return { + org: match[1], + repo: match[2] + }; +}; + +module.exports = GitHubResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js new file mode 100644 index 0000000..5486f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js @@ -0,0 +1,198 @@ +var util = require('util'); +var url = require('url'); +var Q = require('q'); +var mout = require('mout'); +var LRU = require('lru-cache'); +var GitResolver = require('./GitResolver'); +var cmd = require('../../util/cmd'); + +function GitRemoteResolver(decEndpoint, config, logger) { + GitResolver.call(this, decEndpoint, config, logger); + + if (!mout.string.startsWith(this._source, 'file://')) { + // Trim trailing slashes + this._source = this._source.replace(/\/+$/, ''); + } + + // If the name was guessed, remove the trailing .git + if (this._guessedName && mout.string.endsWith(this._name, '.git')) { + this._name = this._name.slice(0, -4); + } + + // Get the host of this source + if (!/:\/\//.test(this._source)) { + this._host = url.parse('ssh://' + this._source).host; + } else { + this._host = url.parse(this._source).host; + } +} + +util.inherits(GitRemoteResolver, GitResolver); +mout.object.mixIn(GitRemoteResolver, GitResolver); + +// ----------------- + +GitRemoteResolver.prototype._checkout = function () { + var promise; + var timer; + var reporter; + var that = this; + var resolution = this._resolution; + + this._logger.action('checkout', resolution.tag || resolution.branch || resolution.commit, { + resolution: resolution, + to: this._tempDir + }); + + // If resolution is a commit, we need to clone the entire repo and check it out + // Because a commit is not a named ref, there's no better solution + if (resolution.type === 'commit') { + promise = this._slowClone(resolution); + // Otherwise we are checking out a named ref so we can optimize it + } else { + promise = this._fastClone(resolution); + } + + // Throttle the progress reporter to 1 time each sec + reporter = mout.fn.throttle(function (data) { + var lines; + + lines = data.split(/[\r\n]+/); + lines.forEach(function (line) { + if (/\d{1,3}\%/.test(line)) { + // TODO: There are some strange chars that appear once in a while (\u001b[K) + // Trim also those? + that._logger.info('progress', line.trim()); + } + }); + }, 1000); + + // Start reporting progress after a few seconds + timer = setTimeout(function () { + promise.progress(reporter); + }, 8000); + + return promise + // Add additional proxy information to the error if necessary + .fail(function (err) { + that._suggestProxyWorkaround(err); + throw err; + }) + // Clear timer at the end + .fin(function () { + clearTimeout(timer); + reporter.cancel(); + }); +}; + +GitRemoteResolver.prototype._findResolution = function (target) { + var that = this; + + // Override this function to include a meaningful message related to proxies + // if necessary + return GitResolver.prototype._findResolution.call(this, target) + .fail(function (err) { + that._suggestProxyWorkaround(err); + throw err; + }); +}; + +// ------------------------------ + +GitRemoteResolver.prototype._slowClone = function (resolution) { + return cmd('git', ['clone', this._source, this._tempDir, '--progress']) + .then(cmd.bind(cmd, 'git', ['checkout', resolution.commit], { cwd: this._tempDir })); +}; + +GitRemoteResolver.prototype._fastClone = function (resolution) { + var branch, + args, + that = this; + + branch = resolution.tag || resolution.branch; + args = ['clone', this._source, '-b', branch, '--progress', '.']; + + // If the host does not support shallow clones, we don't use --depth=1 + if (!GitRemoteResolver._noShallow.get(this._host)) { + args.push('--depth', 1); + } + + return cmd('git', args, { cwd: this._tempDir }) + .spread(function (stdout, stderr) { + // Only after 1.7.10 --branch accepts tags + // Detect those cases and inform the user to update git otherwise it's + // a lot slower than newer versions + if (!/branch .+? not found/i.test(stderr)) { + return; + } + + that._logger.warn('old-git', 'It seems you are using an old version of git, it will be slower and propitious to errors!'); + return cmd('git', ['checkout', resolution.commit], { cwd: that._tempDir }); + }, function (err) { + // Some git servers do not support shallow clones + // When that happens, we mark this host and try again + if (!GitRemoteResolver._noShallow.has(that._source) && + err.details && + /(rpc failed|shallow)/i.test(err.details) + ) { + GitRemoteResolver._noShallow.set(that._host, true); + return that._fastClone(resolution); + } + + throw err; + }); +}; + +GitRemoteResolver.prototype._suggestProxyWorkaround = function (err) { + if ((this._config.proxy || this._config.httpsProxy) && + mout.string.startsWith(this._source, 'git://') && + err.code === 'ECMDERR' && err.details + ) { + err.details = err.details.trim(); + err.details += '\n\nWhen under a proxy, you must configure git to use https:// instead of git://.'; + err.details += '\nYou can configure it for every endpoint or for this specific host as follows:'; + err.details += '\ngit config --global url."https://".insteadOf git://'; + err.details += '\ngit config --global url."https://' + this._host + '".insteadOf git://' + this._host; + err.details += 'Ignore this suggestion if you already have this configured.'; + } +}; + +// ------------------------------ + +// Grab refs remotely +GitRemoteResolver.refs = function (source) { + var value; + + // TODO: Normalize source because of the various available protocols? + value = this._cache.refs.get(source); + if (value) { + return Q.resolve(value); + } + + // Store the promise in the refs object + value = cmd('git', ['ls-remote', '--tags', '--heads', source]) + .spread(function (stdout) { + var refs; + + refs = stdout.toString() + .trim() // Trim trailing and leading spaces + .replace(/[\t ]+/g, ' ') // Standardize spaces (some git versions make tabs, other spaces) + .split(/[\r\n]+/); // Split lines into an array + + // Update the refs with the actual refs + this._cache.refs.set(source, refs); + + return refs; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.refs.set(source); + + return value; +}; + +// Store hosts that do not support shallow clones here +GitRemoteResolver._noShallow = new LRU({ max: 50, maxAge: 5 * 60 * 1000 }); + +module.exports = GitRemoteResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitResolver.js new file mode 100644 index 0000000..0cc456a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/GitResolver.js @@ -0,0 +1,378 @@ +var util = require('util'); +var path = require('path'); +var Q = require('q'); +var chmodr = require('chmodr'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var which = require('which'); +var LRU = require('lru-cache'); +var mout = require('mout'); +var Resolver = require('./Resolver'); +var semver = require('../../util/semver'); +var createError = require('../../util/createError'); +var defaultConfig = require('../../config'); + +var hasGit; + +// Check if git is installed +try { + which.sync('git'); + hasGit = true; +} catch (ex) { + hasGit = false; +} + +// Set template dir to the empty directory so that user templates are not run +// This environment variable is not multiple config aware but it's not documented +// anyway +mkdirp.sync(defaultConfig.storage.empty); +process.env.GIT_TEMPLATE_DIR = defaultConfig.storage.empty; + +function GitResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + if (!hasGit) { + throw createError('git is not installed or not in the PATH', 'ENOGIT'); + } +} + +util.inherits(GitResolver, Resolver); +mout.object.mixIn(GitResolver, Resolver); + +// ----------------- + +GitResolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + var oldResolution = pkgMeta._resolution || {}; + + return this._findResolution() + .then(function (resolution) { + // Check if resolution types are different + if (oldResolution.type !== resolution.type) { + return true; + } + + // If resolved to a version, there is new content if the tags are not equal + if (resolution.type === 'version' && semver.neq(resolution.tag, oldResolution.tag)) { + return true; + } + + // As last check, we compare both commit hashes + return resolution.commit !== oldResolution.commit; + }); +}; + +GitResolver.prototype._resolve = function () { + var that = this; + + return this._findResolution() + .then(function () { + return that._checkout() + // Always run cleanup after checkout to ensure that .git is removed! + // If it's not removed, problems might arise when the "tmp" module attempts + // to delete the temporary folder + .fin(function () { + return that._cleanup(); + }); + }); +}; + +// ----------------- + +// Abstract functions that should be implemented by concrete git resolvers +GitResolver.prototype._checkout = function () { + throw new Error('_checkout not implemented'); +}; + +GitResolver.refs = function (source) { + throw new Error('refs not implemented'); +}; + +// ----------------- + +GitResolver.prototype._findResolution = function (target) { + var err; + var self = this.constructor; + var that = this; + + target = target || this._target || '*'; + + // Target is a commit, so it's a stale target (not a moving target) + // There's nothing to do in this case + if ((/^[a-f0-9]{40}$/).test(target)) { + this._resolution = { type: 'commit', commit: target }; + return Q.resolve(this._resolution); + } + + // Target is a range/version + if (semver.validRange(target)) { + return self.versions(this._source, true) + .then(function (versions) { + var versionsArr, + version, + index; + + versionsArr = versions.map(function (obj) { return obj.version; }); + + // If there are no tags and target is *, + // fallback to the latest commit on master + if (!versions.length && target === '*') { + return that._findResolution('master'); + } + + versionsArr = versions.map(function (obj) { return obj.version; }); + // Find a satisfying version, enabling strict match so that pre-releases + // have lower priority over normal ones when target is * + index = semver.maxSatisfyingIndex(versionsArr, target, true); + if (index !== -1) { + version = versions[index]; + return that._resolution = { type: 'version', tag: version.tag, commit: version.commit }; + } + + // Check if there's an exact branch/tag with this name as last resort + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + throw createError('No tag found that was able to satisfy ' + target, 'ENORESTARGET', { + details: !versions.length ? + 'No versions found in ' + that._source : + 'Available versions: ' + versions.map(function (version) { return version.version; }).join(', ') + }); + }); + }); + } + + // Otherwise, target is either a tag or a branch + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + branches = Object.keys(branches); + tags = Object.keys(tags); + + err = createError('Tag/branch ' + target + ' does not exist', 'ENORESTARGET'); + err.details = !tags.length ? + 'No tags found in ' + that._source : + 'Available tags: ' + tags.join(', '); + err.details += '\n'; + err.details += !branches.length ? + 'No branches found in ' + that._source : + 'Available branches: ' + branches.join(', '); + + throw err; + }); +}; + +GitResolver.prototype._cleanup = function () { + var gitFolder = path.join(this._tempDir, '.git'); + + // Remove the .git folder + // Note that on windows, we need to chmod to 0777 before due to a bug in git + // See: https://github.com/isaacs/rimraf/issues/19 + if (process.platform === 'win32') { + return Q.nfcall(chmodr, gitFolder, 0777) + .then(function () { + return Q.nfcall(rimraf, gitFolder); + }, function (err) { + // If .git does not exist, chmodr returns ENOENT + // so, we ignore that error code + if (err.code !== 'ENOENT') { + throw err; + } + }); + } else { + return Q.nfcall(rimraf, gitFolder); + } +}; + +GitResolver.prototype._savePkgMeta = function (meta) { + var version; + + if (this._resolution.type === 'version') { + version = semver.clean(this._resolution.tag); + + // Warn if the package meta version is different than the resolved one + if (typeof meta.version === 'string' && semver.neq(meta.version, version)) { + this._logger.warn('mismatch', 'Version declared in the json (' + meta.version + ') is different than the resolved one (' + version + ')', { + resolution: this._resolution, + pkgMeta: meta + }); + } + + // Ensure package meta version is the same as the resolution + meta.version = version; + } else { + // If resolved to a target that is not a version, + // remove the version from the meta + delete meta.version; + } + + // Save version/tag/commit in the release + // Note that we can't store branches because _release is supposed to be + // an unique id of this ref. + meta._release = version || + this._resolution.tag || + this._resolution.commit.substr(0, 10); + + // Save resolution to be used in hasNew later + meta._resolution = this._resolution; + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +// ------------------------------ + +GitResolver.versions = function (source, extra) { + var value = this._cache.versions.get(source); + + if (value) { + return Q.resolve(value) + .then(function () { + var versions = this._cache.versions.get(source); + + // If no extra information was requested, + // resolve simply with the versions + if (!extra) { + versions = versions.map(function (version) { + return version.version; + }); + } + + return versions; + }.bind(this)); + } + + value = this.tags(source) + .then(function (tags) { + var tag; + var version; + var versions = []; + + // For each tag + for (tag in tags) { + version = semver.clean(tag); + if (version) { + versions.push({ version: version, tag: tag, commit: tags[tag] }); + } + } + + // Sort them by DESC order + versions.sort(function (a, b) { + return semver.rcompare(a.version, b.version); + }); + + this._cache.versions.set(source, versions); + + // Call the function again to keep it DRY + return this.versions(source, extra); + }.bind(this)); + + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.versions.set(source, value); + + return value; +}; + +GitResolver.tags = function (source) { + var value = this._cache.tags.get(source); + + if (value) { + return Q.resolve(value); + } + + value = this.refs(source) + .then(function (refs) { + var tags = []; + + // For each line in the refs, match only the tags + refs.forEach(function (line) { + var match = line.match(/^([a-f0-9]{40})\s+refs\/tags\/(\S+)/); + var tag; + + if (match && !mout.string.endsWith(match[2], '^{}')) { + tag = match[2]; + tags[match[2]] = match[1]; + } + }); + + this._cache.tags.set(source, tags); + + return tags; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.tags.set(source, value); + + return value; +}; + +GitResolver.branches = function (source) { + var value = this._cache.branches.get(source); + + if (value) { + return Q.resolve(value); + } + + value = this.refs(source) + .then(function (refs) { + var branches = {}; + + // For each line in the refs, extract only the heads + // Organize them in an object where keys are branches and values + // the commit hashes + refs.forEach(function (line) { + var match = line.match(/^([a-f0-9]{40})\s+refs\/heads\/(\S+)/); + + if (match) { + branches[match[2]] = match[1]; + } + }); + + this._cache.branches.set(source, branches); + + return branches; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.branches.set(source, value); + + return value; +}; + +GitResolver.clearRuntimeCache = function () { + // Reset cache for branches, tags, etc + mout.object.forOwn(GitResolver._cache, function (lru) { + lru.reset(); + }); +}; + +GitResolver._cache = { + branches: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + tags: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + versions: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + refs: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }) +}; + +module.exports = GitResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/Resolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/Resolver.js new file mode 100644 index 0000000..ee17c32 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/Resolver.js @@ -0,0 +1,226 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var tmp = require('tmp'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var readJson = require('../../util/readJson'); +var createError = require('../../util/createError'); +var removeIgnores = require('../../util/removeIgnores'); + +tmp.setGracefulCleanup(); + +function Resolver(decEndpoint, config, logger) { + this._source = decEndpoint.source; + this._target = decEndpoint.target || '*'; + this._name = decEndpoint.name || path.basename(this._source); + + this._config = config; + this._logger = logger; + + this._guessedName = !decEndpoint.name; +} + +// ----------------- + +Resolver.prototype.getSource = function () { + return this._source; +}; + +Resolver.prototype.getName = function () { + return this._name; +}; + +Resolver.prototype.getTarget = function () { + return this._target; +}; + +Resolver.prototype.getTempDir = function () { + return this._tempDir; +}; + +Resolver.prototype.getPkgMeta = function () { + return this._pkgMeta; +}; + +Resolver.prototype.hasNew = function (canonicalDir, pkgMeta) { + var promise; + var metaFile; + var that = this; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._working = true; + + // Avoid reading the package meta if already given + if (pkgMeta) { + promise = this._hasNew(canonicalDir, pkgMeta); + // Otherwise call _hasNew with both the package meta and the canonical dir + } else { + metaFile = path.join(canonicalDir, '.bower.json'); + + promise = readJson(metaFile) + .spread(function (pkgMeta) { + return that._hasNew(canonicalDir, pkgMeta); + }, function (err) { + that._logger.debug('read-json', 'Failed to read ' + metaFile, { + filename: metaFile, + error: err + }); + + return true; // Simply resolve to true if there was an error reading the file + }); + } + + return promise.fin(function () { + that._working = false; + }); +}; + +Resolver.prototype.resolve = function () { + var that = this; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._working = true; + + // Create temporary dir + return this._createTempDir() + // Resolve self + .then(this._resolve.bind(this)) + // Read json, generating the package meta + .then(this._readJson.bind(this, null)) + // Apply and save package meta + .then(function (meta) { + return that._applyPkgMeta(meta) + .then(that._savePkgMeta.bind(that, meta)); + }) + .then(function () { + // Resolve with the folder + return that._tempDir; + }, function (err) { + // If something went wrong, unset the temporary dir + that._tempDir = null; + throw err; + }) + .fin(function () { + that._working = false; + }); +}; + +// ----------------- + +// Abstract functions that must be implemented by concrete resolvers +Resolver.prototype._resolve = function () { + throw new Error('_resolve not implemented'); +}; + +// Abstract functions that can be re-implemented by concrete resolvers +// as necessary +Resolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + return Q.resolve(true); +}; + +Resolver.isTargetable = function () { + return true; +}; + +Resolver.versions = function (source) { + return Q.resolve([]); +}; + +Resolver.clearRuntimeCache = function () {}; + +// ----------------- + +Resolver.prototype._createTempDir = function () { + return Q.nfcall(mkdirp, this._config.tmp) + .then(function () { + return Q.nfcall(tmp.dir, { + template: path.join(this._config.tmp, this._name + '-' + process.pid + '-XXXXXX'), + mode: 0777 & ~process.umask(), + unsafeCleanup: true + }); + }.bind(this)) + .then(function (dir) { + this._tempDir = dir; + return dir; + }.bind(this)); +}; + +Resolver.prototype._cleanTempDir = function () { + var tempDir = this._tempDir; + + if (!tempDir) { + return Q.resolve(); + } + + // Delete and create folder + return Q.nfcall(rimraf, tempDir) + .then(function () { + return Q.nfcall(mkdirp, tempDir, 0777 & ~process.umask()); + }) + .then(function () { + return tempDir; + }); +}; + +Resolver.prototype._readJson = function (dir) { + var that = this; + + dir = dir || this._tempDir; + return readJson(dir, { + assume: { name: this._name } + }) + .spread(function (json, deprecated) { + if (deprecated) { + that._logger.warn('deprecated', 'Package ' + that._name + ' is using the deprecated ' + deprecated); + } + + return json; + }); +}; + +Resolver.prototype._applyPkgMeta = function (meta) { + // Check if name defined in the json is different + // If so and if the name was "guessed", assume the json name + if (meta.name !== this._name && this._guessedName) { + this._name = meta.name; + } + + // Handle ignore property, deleting all files from the temporary directory + // If no ignores were specified, simply resolve + if (!meta.ignore || !meta.ignore.length) { + return Q.resolve(meta); + } + + // Otherwise remove them from the temp dir + return removeIgnores(this._tempDir, meta.ignore) + .then(function () { + return meta; + }); +}; + +Resolver.prototype._savePkgMeta = function (meta) { + var contents; + + // Store original source & target + meta._source = this._source; + meta._target = this._target; + + // Stringify contents + contents = JSON.stringify(meta, null, 2); + + return Q.nfcall(fs.writeFile, path.join(this._tempDir, '.bower.json'), contents) + .then(function () { + return this._pkgMeta = meta; + }.bind(this)); +}; + +module.exports = Resolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/UrlResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/UrlResolver.js new file mode 100644 index 0000000..0048786 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/UrlResolver.js @@ -0,0 +1,284 @@ +var util = require('util'); +var path = require('path'); +var fs = require('graceful-fs'); +var url = require('url'); +var request = require('request'); +var Q = require('q'); +var mout = require('mout'); +var junk = require('junk'); +var Resolver = require('./Resolver'); +var download = require('../../util/download'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function UrlResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + // If target was specified, error out + if (this._target !== '*') { + throw createError('URL sources can\'t resolve targets', 'ENORESTARGET'); + } + + // If the name was guessed + if (this._guessedName) { + // Remove the ?xxx part + this._name = this._name.replace(/\?.*$/, ''); + // Remove extension + this._name = this._name.substr(0, this._name.length - path.extname(this._name).length); + } + + this._remote = url.parse(this._source); +} + +util.inherits(UrlResolver, Resolver); +mout.object.mixIn(UrlResolver, Resolver); + +// ----------------- + +UrlResolver.isTargetable = function () { + return false; +}; + +UrlResolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + var oldCacheHeaders = pkgMeta._cacheHeaders || {}; + var reqHeaders = {}; + + // If the previous cache headers contain an ETag, + // send the "If-None-Match" header with it + if (oldCacheHeaders.ETag) { + reqHeaders['If-None-Match'] = oldCacheHeaders.ETag; + } + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + // Make an HEAD request to the source + return Q.nfcall(request.head, this._source, { + proxy: this._remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + // Compare new headers with the old ones + .spread(function (response) { + var cacheHeaders; + + // If the server responded with 303 then the resource + // still has the same ETag + if (response.statusCode === 304) { + return false; + } + + // If status code is not in the 2xx range, + // then just resolve to true + if (response.statusCode < 200 || response.statusCode >= 300) { + return true; + } + + // Fallback to comparing cache headers + cacheHeaders = this._collectCacheHeaders(response); + return !mout.object.equals(oldCacheHeaders, cacheHeaders); + }.bind(this), function () { + // Assume new contents if the request failed + // Note that we do not retry the request using the "request-replay" module + // because it would take too long + return true; + }); +}; + +// TODO: There's room for improvement by using streams if the URL +// is an archive file, by piping read stream to the zip extractor +// This will likely increase the complexity of code but might worth it + +UrlResolver.prototype._resolve = function () { + // Download + return this._download() + // Parse headers + .spread(this._parseHeaders.bind(this)) + // Extract file + .spread(this._extract.bind(this)) + // Rename file to index + .then(this._rename.bind(this)); +}; + +// ----------------- + +UrlResolver.prototype._download = function () { + var fileName = url.parse(path.basename(this._source)).pathname; + var file = path.join(this._tempDir, fileName); + var reqHeaders = {}; + var that = this; + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + this._logger.action('download', that._source, { + url: that._source, + to: file + }); + + // Download the file + return download(this._source, file, { + proxy: this._remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + .progress(function (state) { + var msg; + + // Retry? + if (state.retry) { + msg = 'Download of ' + that._source + ' failed' + (state.error.code ? ' with ' + state.error.code : '') + ', '; + msg += 'retrying in ' + (state.delay / 1000).toFixed(1) + 's'; + that._logger.debug('error', state.error.message, { error: state.error }); + return that._logger.warn('retry', msg); + } + + // Progress + msg = 'received ' + (state.received / 1024 / 1024).toFixed(1) + 'MB'; + if (state.total) { + msg += ' of ' + (state.total / 1024 / 1024).toFixed(1) + 'MB downloaded, '; + msg += state.percent + '%'; + } + that._logger.info('progress', msg); + }) + .then(function (response) { + that._response = response; + return [file, response]; + }); +}; + +UrlResolver.prototype._parseHeaders = function (file, response) { + var disposition; + var newFile; + var match; + + // Check if we got a Content-Disposition header + disposition = response.headers['content-disposition']; + if (!disposition) { + return Q.resolve([file, response]); + } + + // Since there's various security issues with parsing this header, we only + // interpret word chars plus dots, dashes and spaces + match = disposition.match(/filename=(?:"([\w\-\. ]+)")/i); + if (!match) { + // The spec defines that the filename must be in quotes, + // though a wide range of servers do not follow the rule + match = disposition.match(/filename=([\w\-\.]+)/i); + if (!match) { + return Q.resolve([file, response]); + } + } + + // Trim spaces + newFile = match[1].trim(); + + // The filename can't end with a dot because this is known + // to cause issues in Windows + // See: http://superuser.com/questions/230385/dots-at-end-of-file-name + if (mout.string.endsWith(newFile, '.')) { + return Q.resolve([file, response]); + } + + newFile = path.join(this._tempDir, newFile); + + return Q.nfcall(fs.rename, file, newFile) + .then(function () { + return [newFile, response]; + }); +}; + +UrlResolver.prototype._extract = function (file, response) { + var mimeType = response.headers['content-type']; + + if (mimeType) { + // Clean everything after ; and trim the end result + mimeType = mimeType.split(';')[0].trim(); + // Some servers add quotes around the content-type, so we trim that also + mimeType = mout.string.trim(mimeType, ['"', '\'']); + } + + if (!extract.canExtract(file, mimeType)) { + return Q.resolve(); + } + + this._logger.action('extract', path.basename(this._source), { + archive: file, + to: this._tempDir + }); + + return extract(file, this._tempDir, { + mimeType: mimeType + }); +}; + +UrlResolver.prototype._rename = function () { + return Q.nfcall(fs.readdir, this._tempDir) + .then(function (files) { + var file; + var oldPath; + var newPath; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + // Only rename if there's only one file and it's not the json + if (files.length === 1 && !/^(component|bower)\.json$/.test(files[0])) { + file = files[0]; + this._singleFile = 'index' + path.extname(file); + oldPath = path.join(this._tempDir, file); + newPath = path.join(this._tempDir, this._singleFile); + + return Q.nfcall(fs.rename, oldPath, newPath); + } + }.bind(this)); +}; + +UrlResolver.prototype._savePkgMeta = function (meta) { + // Store collected headers in the package meta + meta._cacheHeaders = this._collectCacheHeaders(this._response); + + // Store ETAG under _release + if (meta._cacheHeaders.ETag) { + meta._release = 'e-tag:' + mout.string.trim(meta._cacheHeaders.ETag.substr(0, 10), '"'); + } + + // Store main if is a single file + if (this._singleFile) { + meta.main = this._singleFile; + } + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +UrlResolver.prototype._collectCacheHeaders = function (res) { + var headers = {}; + + // Collect cache headers + this.constructor._cacheHeaders.forEach(function (name) { + var value = res.headers[name.toLowerCase()]; + + if (value != null) { + headers[name] = value; + } + }); + + return headers; +}; + +UrlResolver._cacheHeaders = [ + 'Content-MD5', + 'ETag', + 'Last-Modified', + 'Content-Language', + 'Content-Length', + 'Content-Type', + 'Content-Disposition' +]; + +module.exports = UrlResolver; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/index.js new file mode 100644 index 0000000..ef6498d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/core/resolvers/index.js @@ -0,0 +1,7 @@ +module.exports = { + GitFs: require('./GitFsResolver'), + GitRemote: require('./GitRemoteResolver'), + GitHub: require('./GitHubResolver'), + Fs: require('./FsResolver'), + Url: require('./UrlResolver') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/index.js new file mode 100644 index 0000000..37c9c18 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/index.js @@ -0,0 +1,40 @@ +var abbrev = require('abbrev'); +var mout = require('mout'); +var commands = require('./commands'); +var PackageRepository = require('./core/PackageRepository'); + +var abbreviations = abbrev(expandNames(commands)); +abbreviations.i = 'install'; +abbreviations.rm = 'uninstall'; +abbreviations.ls = 'list'; + +function expandNames(obj, prefix, stack) { + prefix = prefix || ''; + stack = stack || []; + + mout.object.forOwn(obj, function (value, name) { + name = prefix + name; + + stack.push(name); + + if (typeof value === 'object' && !value.line) { + expandNames(value, name + ' ', stack); + } + }); + + return stack; +} + +function clearRuntimeCache() { + // Note that in edge cases, some architecture components instance's + // in-memory cache might be skipped. + // If that's a problem, you should create and fresh instances instead. + PackageRepository.clearRuntimeCache(); +} + +module.exports = { + commands: commands, + config: require('./config'), + abbreviations: abbreviations, + reset: clearRuntimeCache +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/JsonRenderer.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/JsonRenderer.js new file mode 100644 index 0000000..2554a84 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/JsonRenderer.js @@ -0,0 +1,128 @@ +var chalk = require('chalk'); +var Q = require('q'); +var promptly = require('promptly'); +var createError = require('../util/createError'); + +function JsonRenderer() { + this._nrLogs = 0; +} + +JsonRenderer.prototype.end = function (data) { + if (this._nrLogs) { + process.stderr.write(']\n'); + } + + if (data) { + process.stdout.write(this._stringify(data) + '\n'); + } +}; + +JsonRenderer.prototype.error = function (err) { + var message = err.message; + var stack; + + err.id = err.code || 'error'; + err.level = 'error'; + err.data = err.data || {}; + + // Need to set message again because it is + // not enumerable in some cases + delete err.message; + err.message = message; + + // Stack + /*jshint camelcase:false*/ + stack = err.fstream_stack || err.stack || 'N/A'; + err.stacktrace = (Array.isArray(stack) ? stack.join('\n') : stack); + /*jshint camelcase:true*/ + + this.log(err); + this.end(); +}; + +JsonRenderer.prototype.log = function (log) { + if (!this._nrLogs) { + process.stderr.write('['); + } else { + process.stderr.write(', '); + } + + process.stderr.write(this._stringify(log)); + this._nrLogs++; +}; + +JsonRenderer.prototype.prompt = function (prompts) { + var promise = Q.resolve(); + var answers = {}; + var that = this; + + prompts.forEach(function (prompt) { + var opts; + var funcName; + + // Strip colors + prompt.message = chalk.stripColor(prompt.message); + + // Prompt + opts = { + silent: true, // To not mess with JSON output + trim: false, // To allow " " to not assume the default value + default: prompt.default == null ? '' : prompt.default, // If default is null, make it '' so that it does not retry + validator: !prompt.validate ? null : function (value) { + var ret = prompt.validate(value); + + if (typeof ret === 'string') { + throw ret; + } + + return value; + }, + }; + + // For now only "input", "confirm" and "password" are supported + switch (prompt.type) { + case 'input': + funcName = 'prompt'; + break; + case 'confirm': + case 'password': + funcName = prompt.type; + break; + default: + promise = promise.then(function () { + throw createError('Unknown prompt type', 'ENOTSUP'); + }); + return; + } + + promise = promise.then(function () { + // Log + prompt.level = 'prompt'; + that.log(prompt); + + return Q.nfcall(promptly[funcName], '', opts) + .then(function (answer) { + answers[prompt.name] = answer; + }); + }); + }); + + return promise.then(function () { + return answers; + }); +}; + +JsonRenderer.prototype.updateNotice = function () {}; + +// ------------------------- + +JsonRenderer.prototype._stringify = function (log) { + // To json + var str = JSON.stringify(log, null, ' '); + // Remove colors in case some log has colors.. + str = chalk.stripColor(str); + + return str; +}; + +module.exports = JsonRenderer; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/StandardRenderer.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/StandardRenderer.js new file mode 100644 index 0000000..4250093 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/StandardRenderer.js @@ -0,0 +1,475 @@ +var cardinal = require('cardinal'); +var chalk = require('chalk'); +var path = require('path'); +var mout = require('mout'); +var archy = require('archy'); +var Q = require('q'); +var inquirer = require('inquirer'); +var stringifyObject = require('stringify-object'); +var os = require('os'); +var pkg = require(path.join(__dirname, '../..', 'package.json')); +var template = require('../util/template'); + +function StandardRenderer(command, config) { + this._sizes = { + id: 13, // Id max chars + label: 20, // Label max chars + sumup: 5 // Amount to sum when the label exceeds + }; + this._colors = { + warn: chalk.yellow, + error: chalk.red, + conflict: chalk.magenta, + debug: chalk.gray, + default: chalk.cyan + }; + + this._command = command; + this._config = config; + + if (this.constructor._wideCommands.indexOf(command) === -1) { + this._compact = true; + } else { + this._compact = process.stdout.columns < 120; + } +} + +StandardRenderer.prototype.end = function (data) { + var method = '_' + mout.string.camelCase(this._command); + + if (this[method]) { + this[method](data); + } +}; + +StandardRenderer.prototype.error = function (err) { + var str; + var stack; + + this._guessOrigin(err); + + err.id = err.code || 'error'; + err.level = 'error'; + + str = this._prefix(err) + ' ' + err.message.replace(/\r?\n/g, ' ').trim() + '\n'; + this._write(process.stderr, 'bower ' + str); + + // Check if additional details were provided + if (err.details) { + str = chalk.yellow('\nAdditional error details:\n') + err.details.trim() + '\n'; + this._write(process.stderr, str); + } + + // Print trace if verbose, the error has no code + // or if the error is a node error + if (this._config.verbose || !err.code || err.errno) { + /*jshint camelcase:false*/ + stack = err.fstream_stack || err.stack || 'N/A'; + str = chalk.yellow('\nStack trace:\n'); + str += (Array.isArray(stack) ? stack.join('\n') : stack) + '\n'; + str += chalk.yellow('\nConsole trace:\n'); + /*jshint camelcase:true*/ + + this._write(process.stderr, str); + console.trace(); + + // Print bower version, node version and system info. + this._write(process.stderr, chalk.yellow('\nSystem info:\n')); + this._write(process.stderr, 'Bower version: ' + pkg.version + '\n'); + this._write(process.stderr, 'Node version: ' + process.versions.node + '\n'); + this._write(process.stderr, 'OS: ' + os.type() + ' ' + os.release() + ' ' + os.arch() + '\n'); + } +}; + +StandardRenderer.prototype.log = function (log) { + var method = '_' + mout.string.camelCase(log.id) + 'Log'; + + this._guessOrigin(log); + + // Call render method for this log entry or the generic one + if (this[method]) { + this[method](log); + } else { + this._genericLog(log); + } +}; + +StandardRenderer.prototype.prompt = function (prompts) { + var deferred; + + // Strip colors from the prompt if color is disabled + if (!this._config.color) { + prompts.forEach(function (prompt) { + prompt.message = chalk.stripColor(prompt.message); + }); + } + + // Prompt + deferred = Q.defer(); + inquirer.prompt(prompts, deferred.resolve); + + return deferred.promise; +}; + +StandardRenderer.prototype.updateNotice = function (data) { + var str = template.render('std/update-notice.std', data); + this._write(process.stderr, str); +}; + +// ------------------------- + +StandardRenderer.prototype._help = function (data) { + var str; + var that = this; + var specific; + + if (!data.command) { + str = template.render('std/help.std', data); + that._write(process.stdout, str); + } else { + // Check if a specific template exists for the command + specific = 'std/help-' + data.command.replace(/\s+/g, '/') + '.std'; + + if (template.exists(specific)) { + str = template.render(specific, data); + } else { + str = template.render('std/help-generic.std', data); + } + + that._write(process.stdout, str); + } +}; + +StandardRenderer.prototype._install = function (packages) { + var str = ''; + + mout.object.forOwn(packages, function (pkg) { + var cliTree; + + // List only 1 level deep dependencies + mout.object.forOwn(pkg.dependencies, function (dependency) { + dependency.dependencies = {}; + }); + // Make canonical dir relative + pkg.canonicalDir = path.relative(this._config.cwd, pkg.canonicalDir); + // Signal as root + pkg.root = true; + + cliTree = this._tree2archy(pkg); + str += '\n' + archy(cliTree); + }, this); + + if (str) { + this._write(process.stdout, str); + } +}; + +StandardRenderer.prototype._update = function (packages) { + this._install(packages); +}; + +StandardRenderer.prototype._list = function (tree) { + var cliTree; + + tree.root = true; + cliTree = this._tree2archy(tree); + + this._write(process.stdout, archy(cliTree)); +}; + +StandardRenderer.prototype._search = function (results) { + var str = template.render('std/search-results.std', results); + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._info = function (data) { + var str = ''; + var pkgMeta = data; + var includeVersions = false; + + // If the response is the whole package info, the package meta + // is under the "latest" property + if (typeof data === 'object' && data.versions) { + pkgMeta = data.latest; + includeVersions = true; + } + + // Render package meta + if (pkgMeta != null) { + str += '\n' + this._highlightJson(pkgMeta) + '\n'; + } + + // Render the versions at the end + if (includeVersions) { + str += '\n' + template.render('std/info.std', data); + } + + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._lookup = function (data) { + var str = template.render('std/lookup.std', data); + + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._link = function (data) { + this._sizes.id = 4; + + this.log({ + id: 'link', + level: 'info', + message: data.dst + ' > ' + data.src + }); +}; + +StandardRenderer.prototype._register = function (data) { + var str; + + // If no data passed, it means the user aborted + if (!data) { + return; + } + + str = '\n' + template.render('std/register.std', data); + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._cacheList = function (entries) { + entries.forEach(function (entry) { + var pkgMeta = entry.pkgMeta; + var version = pkgMeta.version || pkgMeta._target; + this._write(process.stdout, pkgMeta.name + '=' + pkgMeta._source + '#' + version + '\n'); + }, this); +}; + +// ------------------------- + +StandardRenderer.prototype._genericLog = function (log) { + var stream; + var str; + + if (log.level === 'warn') { + stream = process.stderr; + } else { + stream = process.stdout; + } + + str = this._prefix(log) + ' ' + log.message + '\n'; + this._write(stream, 'bower ' + str); +}; + +StandardRenderer.prototype._checkoutLog = function (log) { + if (this._compact) { + log.message = log.origin.split('#')[0] + '#' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._progressLog = function (log) { + if (this._compact) { + log.message = log.origin + ' ' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._extractLog = function (log) { + if (this._compact) { + log.message = log.origin + ' ' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._incompatibleLog = function (log) { + var str; + var templatePath; + + // Generate dependants string for each pick + log.data.picks.forEach(function (pick) { + pick.dependants = pick.dependants.map(function (dependant) { + var release = dependant.pkgMeta._release; + return dependant.endpoint.name + (release ? '#' + release : ''); + }).join(', '); + }); + + templatePath = log.data.suitable ? 'std/conflict-resolved.std' : 'std/conflict.std'; + str = template.render(templatePath, log.data); + + this._write(process.stdout, '\n'); + this._write(process.stdout, str); + this._write(process.stdout, '\n'); +}; + +StandardRenderer.prototype._solvedLog = function (log) { + this._incompatibleLog(log); +}; + +StandardRenderer.prototype._jsonLog = function (log) { + this._write(process.stdout, '\n' + this._highlightJson(log.data.json) + '\n\n'); +}; + +StandardRenderer.prototype._cachedEntryLog = function (log) { + if (this._compact) { + log.message = log.origin; + } + + this._genericLog(log); +}; + +// ------------------------- + +StandardRenderer.prototype._guessOrigin = function (log) { + var data = log.data; + + if (!data) { + return; + } + + if (data.endpoint) { + log.origin = data.endpoint.name || (data.registry && data.endpoint.source); + + // Resort to using the resolver name for unnamed endpoints + if (!log.origin && data.resolver) { + log.origin = data.resolver.name; + } + + if (log.origin && data.endpoint.target) { + log.origin += '#' + data.endpoint.target; + } + } else if (data.name) { + log.origin = data.name; + + if (data.version) { + log.origin += '#' + data.version; + } + } +}; + +StandardRenderer.prototype._prefix = function (log) { + var label; + var length; + var nrSpaces; + var id = this.constructor._idMappings[log.id] || log.id; + var idColor = this._colors[log.level] || this._colors.default; + + if (this._compact) { + // If there's not enough space for the id, adjust it + // for subsequent logs + if (id.length > this._sizes.id) { + this._sizes.id = id.length += this._sizes.sumup; + } + + return idColor(mout.string.rpad(id, this._sizes.id)); + } + + // Construct the label + label = log.origin || ''; + length = id.length + label.length + 1; + nrSpaces = this._sizes.id + this._sizes.label - length; + + // Ensure at least one space between the label and the id + if (nrSpaces < 1) { + // Also adjust the label size for subsequent logs + this._sizes.label = label.length + this._sizes.sumup; + nrSpaces = this._sizes.id + this._sizes.label - length; + } + + return chalk.green(label) + mout.string.repeat(' ', nrSpaces) + idColor(id); +}; + +StandardRenderer.prototype._write = function (stream, str) { + if (!this._config.color) { + str = chalk.stripColor(str); + } + + stream.write(str); +}; + +StandardRenderer.prototype._highlightJson = function (json) { + return cardinal.highlight(stringifyObject(json, { indent: ' ' }), { + theme: { + String: { + _default: chalk.cyan + }, + Identifier: { + _default: chalk.green + } + }, + json: true + }); +}; + +StandardRenderer.prototype._tree2archy = function (node) { + var dependencies = mout.object.values(node.dependencies); + var version = !node.missing ? node.pkgMeta._release || node.pkgMeta.version : null; + var label = node.endpoint.name + (version ? '#' + version : ''); + var update; + + if (node.root) { + label += ' ' + node.canonicalDir; + } + + // State labels + if (node.missing) { + label += chalk.red(' not installed'); + return label; + } + + if (node.different) { + label += chalk.red(' different'); + } + + if (node.linked) { + label += chalk.magenta(' linked'); + } + + if (node.incompatible) { + label += chalk.yellow(' incompatible') + ' with ' + node.endpoint.target; + } else if (node.extraneous) { + label += chalk.green(' extraneous'); + } + + // New versions + if (node.update) { + update = ''; + + if (node.update.target && node.pkgMeta.version !== node.update.target) { + update += node.update.target + ' available'; + } + + if (node.update.latest !== node.update.target) { + update += (update ? ', ' : ''); + update += 'latest is ' + node.update.latest; + } + + if (update) { + label += ' (' + chalk.cyan(update) + ')'; + } + } + + if (!dependencies.length) { + return label; + } + + return { + label: label, + nodes: mout.object.values(dependencies).map(this._tree2archy, this) + }; +}; + +StandardRenderer._wideCommands = [ + 'install', + 'update', + 'info', + 'home', + 'register' +]; +StandardRenderer._idMappings = { + 'mutual': 'conflict', + 'cached-entry': 'cached' +}; + +module.exports = StandardRenderer; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/index.js new file mode 100644 index 0000000..04bdb1f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/renderers/index.js @@ -0,0 +1,4 @@ +module.exports = { + Json: require('./JsonRenderer'), + Standard: require('./StandardRenderer') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cli.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cli.js new file mode 100644 index 0000000..a537c75 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cli.js @@ -0,0 +1,49 @@ +var mout = require('mout'); +var nopt = require('nopt'); +var renderers = require('../renderers'); + +function readOptions(options, argv) { + var types; + var noptOptions; + var parsedOptions = {}; + var shorthands = {}; + + if (Array.isArray(options)) { + argv = options; + options = {}; + } else { + options = options || {}; + } + + types = mout.object.map(options, function (option) { + return option.type; + }); + mout.object.forOwn(options, function (option, name) { + shorthands[option.shorthand] = '--' + name; + }); + + noptOptions = nopt(types, shorthands, argv); + + // Filter only the specified options because nopt parses every -- + // Also make them camel case + mout.object.forOwn(noptOptions, function (value, key) { + if (options[key]) { + parsedOptions[mout.string.camelCase(key)] = value; + } + }); + + parsedOptions.argv = noptOptions.argv; + + return parsedOptions; +} + +function getRenderer(command, json, config) { + if (config.json || json) { + return new renderers.Json(command, config); + } + + return new renderers.Standard(command, config); +} + +module.exports.readOptions = readOptions; +module.exports.getRenderer = getRenderer; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cmd.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cmd.js new file mode 100644 index 0000000..26adcaa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/cmd.js @@ -0,0 +1,117 @@ +var cp = require('child_process'); +var path = require('path'); +var Q = require('q'); +var mout = require('mout'); +var which = require('which'); +var PThrottler = require('p-throttler'); +var createError = require('./createError'); + +// The concurrency limit here is kind of magic. You don't really gain a lot from +// having a large number of commands spawned at once, so it isn't super +// important for this number to be large. However, it would still be nice to +// *know* how high this number can be, rather than having to guess low. +var throttler = new PThrottler(50); + +var winBatchExtensions; +var winWhichCache; +var isWin = process.platform === 'win32'; + +if (isWin) { + winBatchExtensions = ['.bat', '.cmd']; + winWhichCache = {}; +} + +function getWindowsCommand(command) { + var fullCommand; + var extension; + + // Do we got the value converted in the cache? + if (mout.object.hasOwn(winWhichCache, command)) { + return winWhichCache[command]; + } + + // Use which to retrieve the full command, which puts the extension in the end + try { + fullCommand = which.sync(command); + } catch (err) { + return winWhichCache[command] = command; + } + + extension = path.extname(fullCommand).toLowerCase(); + + // Does it need to be converted? + if (winBatchExtensions.indexOf(extension) === -1) { + return winWhichCache[command] = command; + } + + return winWhichCache[command] = fullCommand; +} + +// Executes a shell command, buffering the stdout and stderr +// If an error occurs, a meaningful error is generated +// Returns a promise that gets fulfilled if the command succeeds +// or rejected if it fails +function executeCmd(command, args, options) { + var process; + var stderr = ''; + var stdout = ''; + var deferred = Q.defer(); + + // Windows workaround for .bat and .cmd files, see #626 + if (isWin) { + command = getWindowsCommand(command); + } + + // Buffer output, reporting progress + process = cp.spawn(command, args, options); + process.stdout.on('data', function (data) { + data = data.toString(); + deferred.notify(data); + stdout += data; + }); + process.stderr.on('data', function (data) { + data = data.toString(); + deferred.notify(data); + stderr += data; + }); + + // If there is an error spawning the command, reject the promise + process.on('error', function (error) { + return deferred.reject(error); + }); + + // Listen to the close event instead of exit + // They are similar but close ensures that streams are flushed + process.on('close', function (code) { + var fullCommand; + var error; + + if (code) { + // Generate the full command to be presented in the error message + if (!Array.isArray(args)) { + args = []; + } + + fullCommand = command; + fullCommand += args.length ? ' ' + args.join(' ') : ''; + + // Build the error instance + error = createError('Failed to execute "' + fullCommand + '", exit code of #' + code, 'ECMDERR', { + details: stderr, + exitCode: code + }); + + return deferred.reject(error); + } + + return deferred.resolve([stdout, stderr]); + }); + + return deferred.promise; +} + +function cmd(command, args, options) { + return throttler.enqueue(executeCmd.bind(null, command, args, options)); +} + +module.exports = cmd; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/copy.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/copy.js new file mode 100644 index 0000000..a0fb10d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/copy.js @@ -0,0 +1,114 @@ +var fstream = require('fstream'); +var fstreamIgnore = require('fstream-ignore'); +var fs = require('graceful-fs'); +var Q = require('q'); + +function copy(reader, writer) { + var deferred; + var ignore; + + // Filter symlinks because they are not 100% portable, specially + // when linking between different drives + // Following can't be enabled either because symlinks that reference + // another symlinks will get filtered + // See: https://github.com/bower/bower/issues/699 + reader.filter = filterSymlinks; + reader.follow = false; + + if (reader.type === 'Directory' && reader.ignore) { + ignore = reader.ignore; + reader = fstreamIgnore(reader); + reader.addIgnoreRules(ignore); + } else { + reader = fstream.Reader(reader); + } + + deferred = Q.defer(); + + reader + .on('error', deferred.reject) + // Pipe to writer + .pipe(fstream.Writer(writer)) + .on('error', deferred.reject) + .on('close', deferred.resolve); + + return deferred.promise; +} + +function copyMode(src, dst) { + return Q.nfcall(fs.stat, src) + .then(function (stat) { + return Q.nfcall(fs.chmod, dst, stat.mode); + }); +} + +function filterSymlinks(entry) { + return entry.type !== 'SymbolicLink'; +} + +function parseOptions(opts) { + opts = opts || {}; + + if (opts.mode != null) { + opts.copyMode = false; + } else if (opts.copyMode == null) { + opts.copyMode = true; + } + + return opts; +} + +// --------------------- + +// Available options: +// - mode: force final mode of dst (defaults to null) +// - copyMode: copy mode of src to dst, only if mode is not specified (defaults to true) +function copyFile(src, dst, opts) { + var promise; + + opts = parseOptions(opts); + + promise = copy({ + path: src, + type: 'File' + }, { + path: dst, + mode: opts.mode, + type: 'File' + }); + + if (opts.copyMode) { + promise = promise.then(copyMode.bind(copyMode, src, dst)); + } + + return promise; +} + +// Available options: +// - ignore: array of patterns to be ignored (defaults to null) +// - mode: force final mode of dst (defaults to null) +// - copyMode: copy mode of src to dst, only if mode is not specified (defaults to true) +function copyDir(src, dst, opts) { + var promise; + + opts = parseOptions(opts); + + promise = copy({ + path: src, + type: 'Directory', + ignore: opts.ignore + }, { + path: dst, + mode: opts.mode, + type: 'Directory' + }); + + if (opts.copyMode) { + promise = promise.then(copyMode.bind(copyMode, src, dst)); + } + + return promise; +} + +module.exports.copyDir = copyDir; +module.exports.copyFile = copyFile; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createError.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createError.js new file mode 100644 index 0000000..6aef2f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createError.js @@ -0,0 +1,14 @@ +var mout = require('mout'); + +function createError(msg, code, props) { + var err = new Error(msg); + err.code = code; + + if (props) { + mout.object.mixIn(err, props); + } + + return err; +} + +module.exports = createError; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createLink.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createLink.js new file mode 100644 index 0000000..b102718 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/createLink.js @@ -0,0 +1,50 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var mkdirp = require('mkdirp'); +var createError = require('./createError'); + +var isWin = process.platform === 'win32'; + +function createLink(src, dst, type) { + var dstDir = path.dirname(dst); + + // Create directory + return Q.nfcall(mkdirp, dstDir) + // Check if source exists + .then(function () { + return Q.nfcall(fs.stat, src) + .fail(function (error) { + if (error.code === 'ENOENT') { + throw createError('Failed to create link to ' + path.basename(src), 'ENOENT', { + details: src + ' doest not exists or points to a non-existent file' + }); + } + + throw error; + }); + }) + // Create symlink + .then(function (stat) { + type = type || (stat.isDirectory() ? 'dir' : 'file'); + + return Q.nfcall(fs.symlink, src, dst, type) + .fail(function (err) { + if (!isWin || err.code !== 'EPERM') { + throw err; + } + + // Try with type "junction" on Windows + // Junctions behave equally to true symlinks and can be created in + // non elevated terminal (well, not always..) + return Q.nfcall(fs.symlink, src, dst, 'junction') + .fail(function (err) { + throw createError('Unable to create link to ' + path.basename(src), err.code, { + details: err.message.trim() + '\n\nTry running this command in an elevated terminal (run as root/administrator).' + }); + }); + }); + }); +} + +module.exports = createLink; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/download.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/download.js new file mode 100644 index 0000000..c7c71d7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/download.js @@ -0,0 +1,109 @@ +var progress = require('request-progress'); +var request = require('request'); +var Q = require('q'); +var mout = require('mout'); +var retry = require('retry'); +var fs = require('graceful-fs'); +var createError = require('./createError'); + +var errorCodes = [ + 'EADDRINFO', + 'ETIMEDOUT', + 'ECONNRESET', + 'ESOCKETTIMEDOUT' +]; + +function download(url, file, options) { + var operation; + var response; + var deferred = Q.defer(); + var progressDelay = 8000; + + options = mout.object.mixIn({ + retries: 5, + factor: 2, + minTimeout: 1000, + maxTimeout: 35000, + randomize: true + }, options || {}); + + // Retry on network errors + operation = retry.operation(options); + operation.attempt(function () { + var req; + var writeStream; + var contentLength; + var bytesDownloaded = 0; + + req = progress(request(url, options), { + delay: progressDelay + }) + .on('response', function (res) { + var status = res.statusCode; + + if (status < 200 || status >= 300) { + return deferred.reject(createError('Status code of ' + status, 'EHTTP')); + } + + response = res; + contentLength = Number(res.headers['content-length']); + }) + .on('data', function (data) { + bytesDownloaded += data.length; + }) + .on('progress', function (state) { + deferred.notify(state); + }) + .on('end', function () { + // Check if the whole file was downloaded + // In some unstable connections the ACK/FIN packet might be sent in the + // middle of the download + // See: https://github.com/joyent/node/issues/6143 + if (contentLength && bytesDownloaded < contentLength) { + req.emit('error', createError('Transfer closed with ' + (contentLength - bytesDownloaded) + ' bytes remaining to read', 'EINCOMPLETE')); + } + }) + .on('error', function (error) { + var timeout = operation._timeouts[0]; + + // Reject if error is not a network error + if (errorCodes.indexOf(error.code) === -1) { + return deferred.reject(error); + } + + // Next attempt will start reporting download progress immediately + progressDelay = 0; + + // Check if there are more retries + if (operation.retry(error)) { + // Ensure that there are no more events from this request + req.removeAllListeners(); + req.on('error', function () {}); + // Ensure that there are no more events from the write stream + writeStream.removeAllListeners(); + writeStream.on('error', function () {}); + + return deferred.notify({ + retry: true, + delay: timeout, + error: error + }); + } + + // No more retries, reject! + deferred.reject(error); + }); + + // Pipe read stream to write stream + writeStream = req + .pipe(fs.createWriteStream(file)) + .on('error', deferred.reject) + .on('close', function () { + deferred.resolve(response); + }); + }); + + return deferred.promise; +} + +module.exports = download; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/extract.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/extract.js new file mode 100644 index 0000000..e5f77f7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/extract.js @@ -0,0 +1,227 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var zlib = require('zlib'); +var DecompressZip = require('decompress-zip'); +var tar = require('tar'); +var Q = require('q'); +var mout = require('mout'); +var junk = require('junk'); +var createError = require('./createError'); + +// This forces the default chunk size to something small in an attempt +// to avoid issue #314 +zlib.Z_DEFAULT_CHUNK = 1024 * 8; + +var extractors; +var extractorTypes; + +extractors = { + '.zip': extractZip, + '.tar': extractTar, + '.tar.gz': extractTarGz, + '.tgz': extractTarGz, + '.gz': extractGz, + 'application/zip': extractZip, + 'application/x-zip': extractZip, + 'application/x-tar': extractTar, + 'application/x-tgz': extractTarGz, + 'application/x-gzip': extractGz +}; + +extractorTypes = Object.keys(extractors); + +function extractZip(archive, dst) { + var deferred = Q.defer(); + + new DecompressZip(archive) + .on('error', deferred.reject) + .on('extract', deferred.resolve.bind(deferred, dst)) + .extract({ + path: dst, + follow: false, // Do not follow symlinks (#699) + filter: filterSymlinks // Filter symlink files + }); + + return deferred.promise; +} + +function extractTar(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(tar.Extract({ + path: dst, + follow: false, // Do not follow symlinks (#699) + filter: filterSymlinks // Filter symlink files + })) + .on('error', deferred.reject) + .on('close', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function extractTarGz(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(zlib.createGunzip()) + .on('error', deferred.reject) + .pipe(tar.Extract({ + path: dst, + follow: false, // Do not follow symlinks (#699) + filter: filterSymlinks // Filter symlink files + })) + .on('error', deferred.reject) + .on('close', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function extractGz(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(zlib.createGunzip()) + .on('error', deferred.reject) + .pipe(fs.createWriteStream(dst)) + .on('error', deferred.reject) + .on('close', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function filterSymlinks(entry) { + return entry.type !== 'SymbolicLink'; +} + +function getExtractor(archive) { + // Make the archive lower case to match against the types + // This ensures that upper-cased extensions work + archive = archive.toLowerCase(); + + var type = mout.array.find(extractorTypes, function (type) { + return mout.string.endsWith(archive, type); + }); + + return type ? extractors[type] : null; +} + +function isSingleDir(dir) { + return Q.nfcall(fs.readdir, dir) + .then(function (files) { + var singleDir; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + if (files.length !== 1) { + return false; + } + + singleDir = path.join(dir, files[0]); + + return Q.nfcall(fs.stat, singleDir) + .then(function (stat) { + return stat.isDirectory() ? singleDir : false; + }); + }); +} + +function moveSingleDirContents(dir) { + var destDir = path.dirname(dir); + + return Q.nfcall(fs.readdir, dir) + .then(function (files) { + var promises; + + promises = files.map(function (file) { + var src = path.join(dir, file); + var dst = path.join(destDir, file); + + return Q.nfcall(fs.rename, src, dst); + }); + + return Q.all(promises); + }) + .then(function () { + return Q.nfcall(fs.rmdir, dir); + }); +} + +// ----------------------------- + +function canExtract(src, mimeType) { + if (mimeType && mimeType !== 'application/octet-stream') { + return !!getExtractor(mimeType); + } + + return !!getExtractor(src); +} + +// Available options: +// - keepArchive: true to keep the archive afterwards (defaults to false) +// - keepStructure: true to keep the extracted structure unchanged (defaults to false) +function extract(src, dst, opts) { + var extractor; + var promise; + + opts = opts || {}; + extractor = getExtractor(src); + + // Try to get extractor from mime type + if (!extractor && opts.mimeType) { + extractor = getExtractor(opts.mimeType); + } + + // If extractor is null, then the archive type is unknown + if (!extractor) { + return Q.reject(createError('File ' + src + ' is not a known archive', 'ENOTARCHIVE')); + } + + // Check archive file size + promise = Q.nfcall(fs.stat, src) + .then(function (stat) { + if (stat.size <= 8) { + throw createError('File ' + src + ' is an invalid archive', 'ENOTARCHIVE'); + } + + // Extract archive + return extractor(src, dst); + }); + + // TODO: There's an issue here if the src and dst are the same and + // The zip name is the same as some of the zip file contents + // Maybe create a temp directory inside dst, unzip it there, + // unlink zip and then move contents + + // Remove archive + if (!opts.keepArchive) { + promise = promise + .then(function () { + return Q.nfcall(fs.unlink, src); + }); + } + + // Move contents if a single directory was extracted + if (!opts.keepStructure) { + promise = promise + .then(function () { + return isSingleDir(dst); + }) + .then(function (singleDir) { + return singleDir ? moveSingleDirContents(singleDir) : null; + }); + } + + // Resolve promise to the dst dir + return promise.then(function () { + return dst; + }); +} + +module.exports = extract; +module.exports.canExtract = canExtract; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/md5.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/md5.js new file mode 100644 index 0000000..dbc920b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/md5.js @@ -0,0 +1,7 @@ +var crypto = require('crypto'); + +function md5(contents) { + return crypto.createHash('md5').update(contents).digest('hex'); +} + +module.exports = md5; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/readJson.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/readJson.js new file mode 100644 index 0000000..41fe799 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/readJson.js @@ -0,0 +1,43 @@ +var path = require('path'); +var bowerJson = require('bower-json'); +var Q = require('q'); + +// The valid options are the same as bower-json#readFile. +// If the "assume" option is passed, it will be used if no json file was found + +// This promise is resolved with [json, deprecated, assumed] +// - json: The read json +// - deprecated: The deprecated filename being used or false otherwise +// - assumed: True if a dummy json was returned if no json file was found, false otherwise +function readJson(file, options) { + options = options || {}; + + // Read + return Q.nfcall(bowerJson.read, file, options) + .spread(function (json, jsonFile) { + var deprecated; + + jsonFile = path.basename(jsonFile); + deprecated = jsonFile === 'component.json' ? jsonFile : false; + + return [json, deprecated, false]; + }, function (err) { + // No json file was found, assume one + if (err.code === 'ENOENT' && options.assume) { + return [bowerJson.parse(options.assume, options), false, true]; + } + + err.details = err.message; + + if (err.file) { + err.message = 'Failed to read ' + err.file; + err.data = { filename: err.file }; + } else { + err.message = 'Failed to read json from ' + file; + } + + throw err; + }); +} + +module.exports = readJson; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/removeIgnores.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/removeIgnores.js new file mode 100644 index 0000000..4cd24e9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/removeIgnores.js @@ -0,0 +1,59 @@ +var path = require('path'); +var rimraf = require('rimraf'); +var fstreamIgnore = require('fstream-ignore'); +var mout = require('mout'); +var Q = require('q'); + +function removeIgnores(dir, ignore) { + var reader; + var applyIgnores; + var deferred = Q.defer(); + var ignored = []; + var nonIgnored = []; + + reader = fstreamIgnore({ + path: dir, + type: 'Directory' + }); + + reader.addIgnoreRules(ignore); + + // Monkey patch applyIgnores such that we get hold of all ignored files + applyIgnores = reader.applyIgnores; + reader.applyIgnores = function (entry) { + var ret = applyIgnores.apply(this, arguments); + + if (!ret) { + ignored.push(path.join(dir, entry)); + } + + return ret; + }; + + reader + .on('child', function (entry) { + nonIgnored.push(entry.path); + }) + .on('error', deferred.reject) + .on('end', function () { + var promises; + + // Ensure that we are not ignoring files that should not be ignored! + ignored = mout.array.unique(ignored); + ignored = ignored.filter(function (file) { + return nonIgnored.indexOf(file) === -1; + }); + + // Delete all the ignored files + promises = ignored.map(function (file) { + return Q.nfcall(rimraf, file); + }); + + return Q.all(promises) + .then(deferred.resolve, deferred.reject); + }); + + return deferred.promise; +} + +module.exports = removeIgnores; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/rootCheck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/rootCheck.js new file mode 100644 index 0000000..6b2ac52 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/rootCheck.js @@ -0,0 +1,32 @@ +/*jshint multistr:true*/ + +var sudoBlock = require('sudo-block'); +var createError = require('./createError'); +var cli = require('./cli'); + +var renderer; + +function rootCheck(options, config) { + var errorMsg; + + // Allow running the command as root + if (options.allowRoot || config.allowRoot) { + return; + } + + errorMsg = 'Since bower is a user command, there is no need to execute it with \ +superuser permissions.\nIf you\'re having permission errors when using bower without \ +sudo, please spend a few minutes learning more about how your system should work and \ +make any necessary repairs.\n\n\ +http://www.joyent.com/blog/installing-node-and-npm\n\ +https://gist.github.com/isaacs/579814\n\n\ +You can however run a command with sudo using --allow-root option'; + + if (sudoBlock.isRoot) { + renderer = cli.getRenderer('', false, config); + renderer.error(createError('Cannot be run with sudo', 'ESUDO', { details : errorMsg })); + process.exit(1); + } +} + +module.exports = rootCheck; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/semver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/semver.js new file mode 100644 index 0000000..124ab0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/semver.js @@ -0,0 +1,74 @@ +var semver = require('semver'); +var mout = require('mout'); + +function maxSatisfying(versions, range, strictMatch) { + var version; + var filteredVersions; + + // Filter only valid versions, since semver.maxSatisfying() throws an error + versions = versions.filter(function (version) { + return semver.valid(version); + }); + + // Exact version & range match + if (semver.valid(range)) { + version = mout.array.find(versions, function (version) { + return version === range; + }); + if (version) { + return version; + } + } + + // When strict match is enabled and range is *, + // give priority to non-pre-releases + // We do this by filtering every pre-release version + range = typeof range === 'string' ? range.trim() : range; + if (strictMatch && (!range || range === '*')) { + filteredVersions = versions.map(function (version) { + return !isPreRelease(version) ? version : null; + }); + + version = semver.maxSatisfying(filteredVersions, range); + if (version) { + return version; + } + } + + // Fallback to regular semver max satisfies + return semver.maxSatisfying(versions, range); +} + +function maxSatisfyingIndex(versions, range, strictMatch) { + var version = maxSatisfying(versions, range, strictMatch); + + if (!version) { + return -1; + } + + return versions.indexOf(version); +} + +function clean(version) { + var parsed = semver.parse(version); + + if (!parsed) { + return null; + } + + // Keep builds! + return parsed.version + (parsed.build.length ? '+' + parsed.build.join('.') : ''); +} + +function isPreRelease(version) { + var parsed = semver.parse(version); + return parsed && parsed.prerelease && parsed.prerelease.length; +} + +// Export a semver like object but with our custom functions +mout.object.mixIn(module.exports, semver, { + maxSatisfying: maxSatisfying, + maxSatisfyingIndex: maxSatisfyingIndex, + clean: clean, + valid: clean +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/template.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/template.js new file mode 100644 index 0000000..4fd012c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/template.js @@ -0,0 +1,44 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var Handlebars = require('handlebars'); +var mout = require('mout'); +var helpers = require('../../templates/helpers'); + +var templatesDir = path.resolve(__dirname, '../../templates'); +var cache = {}; + +// Register helpers +mout.object.forOwn(helpers, function (register) { + register(Handlebars); +}); + +function render(name, data, escape) { + var contents; + + // Check if already compiled + if (cache[name]) { + return cache[name](data); + } + + // Otherwise, read the file, compile and cache + contents = fs.readFileSync(path.join(templatesDir, name)).toString(); + cache[name] = Handlebars.compile(contents, { + noEscape: !escape + }); + + // Call the function again + return render(name, data, escape); +} + +function exists(name) { + if (cache[name]) { + return true; + } + + return fs.existsSync(path.join(templatesDir, name)); +} + +module.exports = { + render: render, + exists: exists +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/validLink.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/validLink.js new file mode 100644 index 0000000..5191556 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/lib/util/validLink.js @@ -0,0 +1,24 @@ +var Q = require('q'); +var fs = require('graceful-fs'); + +function validLink(file) { + // Ensures that a file is a symlink that points + // to a valid file + return Q.nfcall(fs.lstat, file) + .then(function (lstat) { + if (!lstat.isSymbolicLink()) { + return [false]; + } + + return Q.nfcall(fs.stat, file) + .then(function (stat) { + return [stat]; + }); + }) + .fail(function (err) { + return [false, err]; + }); +} + +module.exports = validLink; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/cdl b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/cdl new file mode 120000 index 0000000..00a4369 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/cdl @@ -0,0 +1 @@ +../cardinal/bin/cdl.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/decompress-zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/decompress-zip new file mode 120000 index 0000000..8325529 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/decompress-zip @@ -0,0 +1 @@ +../decompress-zip/bin/decompress-zip \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/handlebars b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/handlebars new file mode 120000 index 0000000..fb7d090 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/handlebars @@ -0,0 +1 @@ +../handlebars/bin/handlebars \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/nopt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/nopt new file mode 120000 index 0000000..6b6566e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/rimraf b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/rimraf new file mode 120000 index 0000000..4cd49a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/semver b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/which b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/which new file mode 120000 index 0000000..f62471c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/README.md new file mode 100644 index 0000000..99746fe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/lib/abbrev.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/lib/abbrev.js new file mode 100644 index 0000000..bee4132 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/lib/abbrev.js @@ -0,0 +1,111 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} + + +// tests +if (module === require.main) { + +var assert = require("assert") +var util = require("util") + +console.log("running tests") +function test (list, expect) { + var actual = abbrev(list) + assert.deepEqual(actual, expect, + "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ + "actual: "+util.inspect(actual)) + actual = abbrev.apply(exports, list) + assert.deepEqual(abbrev.apply(exports, list), expect, + "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ + "actual: "+util.inspect(actual)) +} + +test([ "ruby", "ruby", "rules", "rules", "rules" ], +{ rub: 'ruby' +, ruby: 'ruby' +, rul: 'rules' +, rule: 'rules' +, rules: 'rules' +}) +test(["fool", "foom", "pool", "pope"], +{ fool: 'fool' +, foom: 'foom' +, poo: 'pool' +, pool: 'pool' +, pop: 'pope' +, pope: 'pope' +}) +test(["a", "ab", "abc", "abcd", "abcde", "acde"], +{ a: 'a' +, ab: 'ab' +, abc: 'abc' +, abcd: 'abcd' +, abcde: 'abcde' +, ac: 'acde' +, acd: 'acde' +, acde: 'acde' +}) + +console.log("pass") + +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/package.json new file mode 100644 index 0000000..2190dd4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/abbrev/package.json @@ -0,0 +1,29 @@ +{ + "name": "abbrev", + "version": "1.0.4", + "description": "Like ruby's abbrev module, but in js", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "main": "./lib/abbrev.js", + "scripts": { + "test": "node lib/abbrev.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/isaacs/abbrev-js" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" + }, + "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "homepage": "https://github.com/isaacs/abbrev-js", + "_id": "abbrev@1.0.4", + "_from": "abbrev@1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/README.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/README.markdown new file mode 100644 index 0000000..deaba0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/README.markdown @@ -0,0 +1,92 @@ +archy +===== + +Render nested hierarchies `npm ls` style with unicode pipes. + +[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy) + +example +======= + +``` js +var archy = require('archy'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); +``` + +output + +``` +beep +├── ity +└─┬ boop + ├─┬ o_O + │ ├─┬ oh + │ │ ├── hello + │ │ └── puny + │ └── human + └── party + time! +``` + +methods +======= + +var archy = require('archy') + +archy(obj, prefix='', opts={}) +------------------------------ + +Return a string representation of `obj` with unicode pipe characters like how +`npm ls` looks. + +`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields. +`'label'` is a string of text to display at a node level and `'nodes'` is an +array of the descendents of the current node. + +If a node is a string, that string will be used as the `'label'` and an empty +array of `'nodes'` will be used. + +`prefix` gets prepended to all the lines and is used by the algorithm to +recursively update. + +If `'label'` has newlines they will be indented at the present indentation level +with the current prefix. + +To disable unicode results in favor of all-ansi output set `opts.unicode` to +`false`. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install archy +``` + +license +======= + +MIT/X11 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/beep.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/beep.js new file mode 100644 index 0000000..9c07047 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/beep.js @@ -0,0 +1,24 @@ +var archy = require('../'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/multi_line.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/multi_line.js new file mode 100644 index 0000000..8afdfad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/examples/multi_line.js @@ -0,0 +1,25 @@ +var archy = require('../'); + +var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/index.js new file mode 100644 index 0000000..869d64e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/index.js @@ -0,0 +1,35 @@ +module.exports = function archy (obj, prefix, opts) { + if (prefix === undefined) prefix = ''; + if (!opts) opts = {}; + var chr = function (s) { + var chars = { + '│' : '|', + '└' : '`', + '├' : '+', + '─' : '-', + '┬' : '-' + }; + return opts.unicode === false ? chars[s] : s; + }; + + if (typeof obj === 'string') obj = { label : obj }; + + var nodes = obj.nodes || []; + var lines = (obj.label || '').split('\n'); + var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' '; + + return prefix + + lines.join(splitter) + '\n' + + nodes.map(function (node, ix) { + var last = ix === nodes.length - 1; + var more = node.nodes && node.nodes.length; + var prefix_ = prefix + (last ? ' ' : chr('│')) + ' '; + + return prefix + + (last ? chr('└') : chr('├')) + chr('─') + + (more ? chr('┬') : chr('─')) + ' ' + + archy(node, prefix_, opts).slice(prefix.length + 2) + ; + }).join('') + ; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/package.json new file mode 100644 index 0000000..8676e47 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/package.json @@ -0,0 +1,49 @@ +{ + "name": "archy", + "version": "0.0.2", + "description": "render nested hierarchies `npm ls` style with unicode pipes", + "main": "index.js", + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "devDependencies": { + "tap": "~0.2.3" + }, + "scripts": { + "test": "tap test" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-archy.git" + }, + "keywords": [ + "hierarchy", + "npm ls", + "unicode", + "pretty", + "print" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.4" + }, + "readme": "archy\n=====\n\nRender nested hierarchies `npm ls` style with unicode pipes.\n\n[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy)\n\nexample\n=======\n\n``` js\nvar archy = require('archy');\nvar s = archy({\n label : 'beep',\n nodes : [\n 'ity',\n {\n label : 'boop',\n nodes : [\n {\n label : 'o_O',\n nodes : [\n {\n label : 'oh',\n nodes : [ 'hello', 'puny' ]\n },\n 'human'\n ]\n },\n 'party\\ntime!'\n ]\n }\n ]\n});\nconsole.log(s);\n```\n\noutput\n\n```\nbeep\n├── ity\n└─┬ boop\n ├─┬ o_O\n │ ├─┬ oh\n │ │ ├── hello\n │ │ └── puny\n │ └── human\n └── party\n time!\n```\n\nmethods\n=======\n\nvar archy = require('archy')\n\narchy(obj, prefix='', opts={})\n------------------------------\n\nReturn a string representation of `obj` with unicode pipe characters like how\n`npm ls` looks.\n\n`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields.\n`'label'` is a string of text to display at a node level and `'nodes'` is an\narray of the descendents of the current node.\n\nIf a node is a string, that string will be used as the `'label'` and an empty\narray of `'nodes'` will be used.\n\n`prefix` gets prepended to all the lines and is used by the algorithm to\nrecursively update.\n\nIf `'label'` has newlines they will be indented at the present indentation level\nwith the current prefix.\n\nTo disable unicode results in favor of all-ansi output set `opts.unicode` to\n`false`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install archy\n```\n\nlicense\n=======\n\nMIT/X11\n", + "readmeFilename": "README.markdown", + "bugs": { + "url": "https://github.com/substack/node-archy/issues" + }, + "homepage": "https://github.com/substack/node-archy", + "_id": "archy@0.0.2", + "dist": { + "shasum": "309338c61a5ef6d8249e772a14bfea549b8382dc" + }, + "_from": "archy@0.0.2", + "_resolved": "https://registry.npmjs.org/archy/-/archy-0.0.2.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/beep.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/beep.js new file mode 100644 index 0000000..b978c75 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/beep.js @@ -0,0 +1,40 @@ +var test = require('tap').test; +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ └── human', + ' └── party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/multi_line.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/multi_line.js new file mode 100644 index 0000000..737cb65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/multi_line.js @@ -0,0 +1,45 @@ +var test = require('tap').test; +var archy = require('../'); + +test('multi-line', function (t) { + var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '│ one', + '│ two', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ │ wheee', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ │ meat', + ' │ └── creature', + ' └── party', + ' time!', + '' + ].join('\n')); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/non_unicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/non_unicode.js new file mode 100644 index 0000000..2f7cdaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/archy/test/non_unicode.js @@ -0,0 +1,40 @@ +var test = require('tap').test; +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }, '', { unicode : false }); + t.equal(s, [ + 'beep', + '+-- ity', + '`-- boop', + ' +-- o_O', + ' | +-- oh', + ' | | +-- hello', + ' | | `-- puny', + ' | `-- human', + ' `-- party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.jshintrc new file mode 100644 index 0000000..eae6f9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.jshintrc @@ -0,0 +1,62 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.npmignore new file mode 100644 index 0000000..1743854 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.npmignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log + +test/assets/github-test-package +test/assets/github-test-package-copy +test/assets/temp diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.travis.yml new file mode 100644 index 0000000..df63076 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/README.md new file mode 100644 index 0000000..e9f4ef5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/README.md @@ -0,0 +1,76 @@ +# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config) + +The Bower config reader and writer. +The config spec can be read [here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/). + + +## Usage + +#### .load() + +Loads the bower configuration from the configuration files. + + +#### .get(key) + +Returns a configuration value by `key`. +Keys with dots are supported to access deep values. + + +#### .set(key, value) + +Sets a configuration value for `key`. +Keys with dots are supported to set deep values. + + +#### .del(key) + +Removes configuration named `key`. +Keys with dots are supported to delete deep keys. + + +#### .save(where, callback) + +Saves changes to `where`. +The `where` argument can be a path to a configuration file or: + +- `local` to save it in the configured current working directory (defaulting to `process.cwd`) +- `user` to save it in the configuration file located in the home directory + + +#### .toObject() + +Returns a deep copy of the underlying configuration object. +The returned configuration is normalised. +The object keys will be camelCase. + + +#### #create(cwd) + +Obtains a instance where `cwd` is the current working directory (defaults to `process.cwd`); + +```js +var config = require('bower-config').create(); +// You can also specify a working directory +var config2 = require('bower-config').create('./some/path'); +``` + + +#### #read(cwd) + +Alias for: + +```js +var configObject = (new Config(cwd)).load().toJson(); +``` + + +#### #normalise(config) + +Returns a new normalised config object based on `config`. +Object keys will be converted to camelCase. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/Config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/Config.js new file mode 100644 index 0000000..d9796cf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/Config.js @@ -0,0 +1,73 @@ +var mout = require('mout'); +var rc = require('./util/rc'); +var defaults = require('./util/defaults'); +var expand = require('./util/expand'); + +function Config(cwd) { + this._cwd = cwd || process.cwd(); + this._config = {}; +} + +Config.prototype.load = function () { + this._config = rc('bower', defaults, this._cwd); + return this; +}; + +Config.prototype.get = function (key) { + // TODO +}; + +Config.prototype.set = function (key, value) { + // TODO + return this; +}; + +Config.prototype.del = function (key, value) { + // TODO + return this; +}; + +Config.prototype.save = function (where, callback) { + // TODO +}; + +Config.prototype.toObject = function () { + var config = mout.lang.deepClone(this._config); + + config = Config.normalise(config); + return config; +}; + +Config.create = function (cwd) { + return new Config(cwd); +}; + +Config.read = function (cwd) { + var config = new Config(cwd); + return config.load().toObject(); +}; + +Config.normalise = function (rawConfig) { + var config = {}; + + // Mix in defaults and raw config + mout.object.deepMixIn(config, expand(defaults), expand(rawConfig)); + + // Some backwards compatible things.. + config.shorthandResolver = config.shorthandResolver + .replace(/\{\{\{/g, '{{') + .replace(/\}\}\}/g, '}}'); + + // Ensure that every registry endpoint does not end with / + config.registry.search = config.registry.search.map(function (url) { + return url.replace(/\/+$/, ''); + }); + config.registry.register = config.registry.register.replace(/\/+$/, ''); + config.registry.publish = config.registry.publish.replace(/\/+$/, ''); + + return config; +}; + +Config.DEFAULT_REGISTRY = defaults.registry; + +module.exports = Config; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/defaults.js new file mode 100644 index 0000000..c742cbd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/defaults.js @@ -0,0 +1,44 @@ +var path = require('path'); +var paths = require('./paths'); + +// Guess proxy defined in the env +/*jshint camelcase: false*/ +var proxy = process.env.HTTP_PROXY + || process.env.http_proxy + || null; + +var httpsProxy = process.env.HTTPS_PROXY + || process.env.https_proxy + || proxy; +/*jshint camelcase: true*/ + +// Use a well known user agent (in this case, curl) when using a proxy, +// to avoid potential filtering on many corporate proxies with blank or unknown agents +var userAgent = !proxy && !httpsProxy + ? 'node/' + process.version + ' ' + process.platform + ' ' + process.arch + : 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5'; + +var defaults = { + 'cwd': process.cwd(), + 'directory': 'bower_components', + 'registry': 'https://bower.herokuapp.com', + 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', + 'tmp': paths.tmp, + 'proxy': proxy, + 'https-proxy': httpsProxy, + 'timeout': 30000, + 'ca': { search: [] }, + 'strict-ssl': true, + 'user-agent': userAgent, + 'color': true, + 'interactive': null, + 'storage': { + packages: path.join(paths.cache, 'packages'), + links: path.join(paths.data, 'links'), + completion: path.join(paths.data, 'completion'), + registry: path.join(paths.cache, 'registry'), + empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others + } +}; + +module.exports = defaults; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/expand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/expand.js new file mode 100644 index 0000000..f3a3865 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/expand.js @@ -0,0 +1,53 @@ +var mout = require('mout'); + +function camelCase(config) { + var camelCased = {}; + + // Camel case + mout.object.forOwn(config, function (value, key) { + // Ignore null values + if (value == null) { + return; + } + + key = mout.string.camelCase(key.replace(/_/g, '-')); + camelCased[key] = mout.lang.isPlainObject(value) ? camelCase(value) : value; + }); + + return camelCased; +} + +function expand(config) { + config = camelCase(config); + + // Expand some properties + // Registry + if (typeof config.registry === 'string') { + config.registry = { + search: [config.registry], + register: config.registry, + publish: config.registry + }; + } else if (config.registry) { + if (config.registry.search && !Array.isArray(config.registry.search)) { + config.registry.search = [config.registry.search]; + } + } + + // CA + if (typeof config.ca === 'string') { + config.ca = { + search: [config.ca], + register: config.ca, + publish: config.ca + }; + } else if (config.ca) { + if (config.ca.search && !Array.isArray(config.ca.search)) { + config.ca.search = [config.ca.search]; + } + } + + return config; +} + +module.exports = expand; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/paths.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/paths.js new file mode 100644 index 0000000..566ba72 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/paths.js @@ -0,0 +1,44 @@ +var os = require('os'); +var path = require('path'); +var osenv = require('osenv'); +var crypto = require('crypto'); + +function generateFakeUser() { + var uid = process.pid + '-' + Date.now() + '-' + Math.floor(Math.random() * 1000000); + return crypto.createHash('md5').update(uid).digest('hex'); +} + +// Assume XDG defaults +// See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +var paths = { + config: process.env.XDG_CONFIG_HOME, + data: process.env.XDG_DATA_HOME, + cache: process.env.XDG_CACHE_HOME +}; + +// Guess some needed properties based on the user OS +var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-'); +var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user); +var home = osenv.home(); +var base; + +// Fallbacks for windows +if (process.platform === 'win32') { + base = path.resolve(process.env.APPDATA || home || tmp); + base = path.join(base, 'bower'); + + paths.config = paths.config || path.join(base, 'config'); + paths.data = paths.data || path.join(base, 'data'); + paths.cache = paths.cache || path.join(base, 'cache'); +// Fallbacks for other operating systems +} else { + base = path.resolve(home || tmp); + + paths.config = paths.config || path.join(base, '.config/bower'); + paths.data = paths.data || path.join(base, '.local/share/bower'); + paths.cache = paths.cache || path.join(base, '.cache/bower'); +} + +paths.tmp = path.resolve(path.join(tmp, 'bower')); + +module.exports = paths; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/rc.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/rc.js new file mode 100644 index 0000000..54088ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/lib/util/rc.js @@ -0,0 +1,115 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var optimist = require('optimist'); +var osenv = require('osenv'); +var mout = require('mout'); +var paths = require('./paths'); + +var win = process.platform === 'win32'; +var home = osenv.home(); + +function rc(name, defaults, cwd, argv) { + var argvConfig; + + defaults = defaults || {}; + cwd = cwd || process.cwd(); + argv = argv || optimist.argv; + + // Parse --config.foo=false + argvConfig = mout.object.map(argv.config || {}, function (value) { + return value === 'false' ? false : value; + }); + + return mout.object.deepMixIn.apply(null, [ + {}, + defaults, + { cwd: cwd }, + win ? {} : json(path.join('/etc', name + 'rc')), + !home ? {} : json(path.join(home, '.' + name + 'rc')), + json(path.join(paths.config, name + 'rc')), + json(find('.' + name + 'rc', cwd)), + env(name + '_'), + argvConfig + ]); +} + +function parse(content, file) { + var error; + + if (!content.trim().length) { + return {}; + } + + try { + return JSON.parse(content); + } catch (e) { + if (file) { + error = new Error('Unable to parse ' + file + ': ' + e.message); + } else { + error = new Error('Unable to parse rc config: ' + e.message); + } + + error.details = content; + error.code = 'EMALFORMED'; + throw error; + } + + return null; +} + +function json(file) { + var content; + + try { + content = fs.readFileSync(file).toString(); + } catch (err) { + return null; + } + + return parse(content, file); +} + +function env(prefix) { + var obj = {}; + var prefixLength = prefix.length; + + prefix = prefix.toLowerCase(); + + mout.object.forOwn(process.env, function (value, key) { + key = key.toLowerCase(); + + if (mout.string.startsWith(key, prefix)) { + var parsedKey = key + .substr(prefixLength) + .replace(/__/g, '.') // __ is used for nesting + .replace(/_/g, '-'); // _ is used as a - separator + mout.object.set(obj, parsedKey, value); + } + }); + + return obj; +} + +function find(filename, dir) { + var walk = function (filename, dir) { + var file = path.join(dir, filename); + var parent = path.dirname(dir); + + try { + fs.statSync(file); + return file; + } catch (err) { + // Check if we hit the root + if (parent === dir) { + return null; + } + + return walk(filename, parent); + } + }; + + dir = dir || process.cwd(); + return walk(filename, dir); +} + +module.exports = rc; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig new file mode 100644 index 0000000..e036e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig @@ -0,0 +1,20 @@ +; EditorConfig is awesome: http://EditorConfig.org + +; top-most EditorConfig file +root = true + +; base rules +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true + +; The default indent on package.json is 2 spaces, better to keep it so we can +; use `npm install --save` and other features that rewrites the package.json +; file automatically +[package.json] +indent_style = space +indent_size = 2 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc new file mode 100644 index 0000000..bbdb29c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc @@ -0,0 +1,69 @@ +{ + // Settings + "passfail" : false, // Stop on first error. + "maxerr" : 50, // Maximum error before stopping. + + + // Predefined globals whom JSHint will ignore. + "browser" : true, // Standard browser globals e.g. `window`, `document`. + "couch" : false, + "dojo" : false, + "jquery" : true, + "mootools" : false, + "node" : false, + "prototypejs" : false, + "rhino" : false, + "wsh" : false, + + // Custom globals. + "predef" : [ + "define", + "require" + ], + + + // Development. + "debug" : false, // Allow debugger statements e.g. browser breakpoints. + "devel" : false, // Allow developments statements e.g. `console.log();`. + + + // EcmaScript 5. + "es5" : false, // Allow EcmaScript 5 syntax. + "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). + "strict" : false, // Require `use strict` pragma in every file. + + + // The Good Parts. + "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). + "bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.). + "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. + "curly" : false, // Require {} for every new block or scope. + "eqeqeq" : true, // Require triple equals i.e. `===`. + "eqnull" : true, // Tolerate use of `== null`. + "evil" : false, // Tolerate use of `eval`. + "expr" : false, // Tolerate `ExpressionStatement` as Programs. + "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`. + "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "latedef" : false, // Prohibit variable use before definition. + "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. + "loopfunc" : false, // Allow functions to be defined within loops. + "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "regexdash" : true, // Tolerate unescaped last dash i.e. `[-...]`. + "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions. + "scripturl" : false, // Tolerate script-targeted URLs. + "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. + "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. + "undef" : false, // Require all non-global variables be declared before they are used. + + + // Personal styling prefrences. + "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. + "noempty" : true, // Prohipit use of empty blocks. + "nomen" : false, // Prohibit use of initial or trailing underbars in names. + "nonew" : true, // Prohibit use of constructors for side-effects. + "onevar" : false, // Allow only one `var` statement per function. + "plusplus" : false, // Prohibit use of `++` & `--`. + "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. + "trailing" : true, // Prohibit trailing whitespaces. + "white" : false // Check against strict whitespace and indentation rules. +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore new file mode 100644 index 0000000..1341acd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore @@ -0,0 +1,30 @@ +# dumb files +# ========== + +.tmp* +.project +.settings/ +.livereload +.DS_Store? +ehthumbs.db +Icon? +Thumbs.db + + +# stuff not needed by node +# ======================== + +node_modules/ +tests/ +_build/ +doc_html/ +coverage/ + +# we keep the doc/ folder in case npm decides to display it in the future +# also good in case user is using an old version or working offline + +# we also keep the src/ folder in case the user still needs the AMD modules +# after build (see issue #102) + +bower.json +build.js diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml new file mode 100644 index 0000000..36de153 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml @@ -0,0 +1,13 @@ + language: node_js + node_js: + - "0.8" + script: "npm test --coverage" + notifications: + irc: + channels: + - "irc.freenode.org#moutjs" + on_success: always + on_failure: always + use_notice: true + skip_join: true + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md new file mode 100644 index 0000000..0f5eac1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md @@ -0,0 +1,93 @@ +mout changelog +============== + +v0.6.0 (2013/05/22) +------------------- + + - add optional delimeter to `string/unCamelCase` + - allow custom char on `number/pad` + - allow underscore characters in `string/removeNonWord` + - accept `level` on `array/flatten` instead of a flag + - convert underscores to camelCase in `string/camelCase` + - remove `create()` from number/currencyFormat + - add `date/dayOfTheYear` + - add `date/diff` + - add `date/isSame` + - add `date/startOf` + - add `date/strftime` + - add `date/timezoneAbbr` + - add `date/timezoneOffset` + - add `date/totalDaysInYear` + - add `date/weekOfTheYear` + - add `function/timeout` + - add `object/bindAll` + - add `object/functions` + - add `time/convert` + + +v0.5.0 (2013/04/04) +------------------- + + - add `array/collect` + - add `callback` parameter to `object/equals` and `object/deepEquals` to allow + custom compare operations. + - normalize behavior in `array/*` methods to treat `null` values as empty + arrays when reading from array + - add `date/parseIso` + - add `date/isLeapYear` + - add `date/totalDaysInMonth` + - add `object/deepMatches` + - change `function/makeIterator_` to use `deepMatches` (affects nearly all + iteration methods) + - add `thisObj` parameter to `array/min` and `array/max` + + +v0.4.0 (2013/02/26) +------------------- + + - add `object/equals` + - add `object/deepEquals` + - add `object/matches`. + - add `lang/is` and `lang/isnt`. + - add `lang/isInteger`. + - add `array/findIndex`. + - add shorthand syntax to `array/*`, `object/*` and `collection/*` methods. + - improve `number/sign` behavior when value is NaN or +0 or -0. + - improve `lang/isNaN` to actually check if value *is not a number* without + coercing value; so `[]`, `""`, `null` and `"12"` are considered NaN (#39). + - improve `string/contains` to match ES6 behavior (add fromIndex argument). + + +v0.3.0 (2013/02/01) +------------------- + + - add `lang/clone`. + - add `lang/toString`. + - add `string/replace`. + - add `string/WHITE_SPACES` + - rename `function/curry` to `function/partial`. + - allow custom chars in `string/trim`, `ltrim`, and `rtrim`. + - convert values to strings in the `string/*` functions. + + +v0.2.0 (2013/01/13) +------------------- + + - fix bug in `math/ceil` for negative radixes. + - change `object/deepFillIn` and `object/deepMixIn` to recurse only if both + existing and new values are plain objects. Will not recurse into arrays + or objects not created by the Object constructor. + - add `lang/isPlainObject` to check if a file is a valid object and is created + by the Object constructor + - change `lang/clone` behavior when dealing with custom types (avoid cloning + it by default) and add second argument to allow custom behavior if needed. + - rename `lang/clone` to `lang/deepClone`. + - add VERSION property to index.js + - simplify `math/floor`, `math/round`, `math/ceil` and `math/countSteps`. + + +v0.1.0 (2013/01/09) +------------------- + +- Rename project from "amd-utils" to "mout" + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md new file mode 100644 index 0000000..65d9add --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing + +Fork the repo at https://github.com/mout/mout + + > "Write clearly, don't be too clever" - The Elements of Programming Style + +Avoid unnamed functions and follow the other modules structure. By only using named functions it will be easier to extract the code from the AMD module if needed and it will also give better error messages, JavaScript minifiers like [Google Closure Compiler](http://code.google.com/closure/compiler/) and [UglifyJS](https://github.com/mishoo/UglifyJS) will make sure code is as small/optimized as possible. + + > "Make it clear before you make it faster." - The Elements of Programming Style + +Be sure to always create tests for each proposed module. Features will only be merged if they contain proper tests and documentation. + + > "Good code is its own best documentation." - Steve McConnell + +We should do a code review before merging to make sure names makes sense and implementation is as good as possible. + +Try to split your pull requests into logical groups, the smaller the easier to be reviewed/merged. + + + +## Tests & Code Coverage ## + +Tests can be found inside the `tests` folder, to execute them in the browser open the `tests/runner.html`. The same tests also work on node.js by running `npm test`. + +We should have tests for all methods and ensure we have a high code coverage through our continuous integration server ([travis](https://travis-ci.org/mout/mout)). When you ask for a pull request Travis will automatically run the tests on node.js and check the code coverage as well. + +We run `node build pkg` automatically before any `npm test`, so specs and packages should always be in sync. (will avoid human mistakes) + +To check code coverage run `npm test --coverage`, it will generate the reports inside the `coverage` folder and also log the results. Please note that node.js doesn't execute all code branches since we have some conditionals that are only met on old JavaScript engines (eg. IE 7-8), so we will never have 100% code coverage (but should be close to it). + + + +## Build Script ## + +The [build script](https://github.com/mout/mout/wiki/Build-Script) can be extremely helpful and can avoid human mistakes, use it. + + + +## Admins / Pull Requests ## + +Even if you are an admin (have commit rights) please do pull requests when adding new features or changing current behavior, that way we can review the work and discuss. Feel free to push changes that doesn't affect behavior without asking for a pull request (readme, changelog, build script, typos, refactoring, ...). + + + +## Large changes ## + +If you are proposing some major change, please create an issue to discuss it first. (maybe it's outside the scope of the project) + + + +## Questions / IRC / Wiki / Issue Tracker ## + +When in doubt ask someone on IRC to help you ([#moutjs on irc.freenode.net](http://webchat.freenode.net/?channels=moutjs)) or create a [new issue](http://github.com/mout/mout/issues). + +The [project wiki](https://github.com/mout/mout/wiki) can also be a good resource of information. + + +--- + +Check the [contributors list at github](https://github.com/mout/mout/contributors). + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md new file mode 100644 index 0000000..e9ccc2b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) +## Copyright (c) 2012, 2013 moutjs team and contributors (http://moutjs.com) + +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. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md new file mode 100644 index 0000000..872943b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md @@ -0,0 +1,63 @@ +![mout](http://moutjs.com/logo.png "Modular JavaScript Utilties") + +http://moutjs.com/ + +[![Build Status](https://travis-ci.org/mout/mout.png?branch=master)](https://travis-ci.org/mout/mout) + +All code is library agnostic and consist mostly of helper methods that aren't +directly related with the DOM, the purpose of this library isn't to replace +Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common +problems that aren't solved by most of them. Consider it as a crossbrowser +JavaScript standard library. + + + +## Main goals ## + + - increase code reuse; + - be clear (code should be clean/readable); + - be easy to debug; + - be easy to maintain; + - follow best practices; + - follow standards when possible; + - **don't convert JavaScript into another language!** + - be compatible with other frameworks; + - be modular; + - have unit tests for all modules; + - work on multiple environments (IE7+, modern browsers, node.js); + + + +## What shouldn't be here ## + + - UI components; + - CSS selector engine; + - Event system - pub/sub; + - Template engine; + - Anything that isn't generic enough to be on a standard library; + - Anything that could be a separate library and/or isn't a modular utility... + + + +## API Documentation ## + +Online documentation can be found at http://moutjs.com/ or inside the +`doc` folder. + + + +## FAQ / Wiki / IRC ## + +For more info about project structure, design decisions, tips, how to +contribute, build system, etc, please check the [project +wiki](https://github.com/mout/mout/wiki). + +We also have an IRC channel [#moutjs on +irc.freenode.net](http://webchat.freenode.net/?channels=moutjs) + + + +## License ## + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js new file mode 100644 index 0000000..89d388b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js @@ -0,0 +1,46 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js new file mode 100644 index 0000000..bf74037 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js @@ -0,0 +1,21 @@ + + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + module.exports = append; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js new file mode 100644 index 0000000..5863749 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js @@ -0,0 +1,27 @@ +var append = require('./append'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + module.exports = collect; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js new file mode 100644 index 0000000..d66e621 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js @@ -0,0 +1,22 @@ +var indexOf = require('./indexOf'); + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + module.exports = combine; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js new file mode 100644 index 0000000..74c176e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js @@ -0,0 +1,13 @@ +var filter = require('./filter'); + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + module.exports = compact; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js new file mode 100644 index 0000000..92bb6ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js @@ -0,0 +1,10 @@ +var indexOf = require('./indexOf'); + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + module.exports = contains; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js new file mode 100644 index 0000000..d057051 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js @@ -0,0 +1,22 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var some = require('./some'); +var contains = require('./contains'); + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = difference; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js new file mode 100644 index 0000000..ac59883 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + module.exports = every; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js new file mode 100644 index 0000000..ebeb58d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js @@ -0,0 +1,27 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = filter; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js new file mode 100644 index 0000000..b4a7313 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js @@ -0,0 +1,13 @@ +var findIndex = require('./findIndex'); + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = find; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js new file mode 100644 index 0000000..53f22a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js @@ -0,0 +1,23 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + module.exports = findIndex; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js new file mode 100644 index 0000000..aa9757a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js @@ -0,0 +1,43 @@ +var isArray = require('../lang/isArray'); +var append = require('./append'); + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + module.exports = flatten; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js new file mode 100644 index 0000000..268e506 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js @@ -0,0 +1,23 @@ + + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + module.exports = forEach; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js new file mode 100644 index 0000000..6a9ac83 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + module.exports = indexOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js new file mode 100644 index 0000000..f1f95b7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js @@ -0,0 +1,15 @@ +var difference = require('./difference'); +var toArray = require('../lang/toArray'); + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(toArray(arguments).slice(1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + module.exports = insert; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js new file mode 100644 index 0000000..e617006 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js @@ -0,0 +1,23 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var every = require('./every'); +var contains = require('./contains'); + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = intersection; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js new file mode 100644 index 0000000..c01aab1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = Array.prototype.slice.call(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + module.exports = invoke; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js new file mode 100644 index 0000000..71d8bd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js @@ -0,0 +1,17 @@ +var filter = require('./filter'); + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + module.exports = join; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js new file mode 100644 index 0000000..ee44a25 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + module.exports = lastIndexOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js new file mode 100644 index 0000000..54064f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + module.exports = map; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js new file mode 100644 index 0000000..183b10e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js @@ -0,0 +1,35 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = max; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js new file mode 100644 index 0000000..dd00b6c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js @@ -0,0 +1,35 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = min; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js new file mode 100644 index 0000000..6a54846 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js @@ -0,0 +1,14 @@ +var randInt = require('../random/randInt'); + + /** + * Remove a random item from the Array and return it + */ + function pick(arr){ + if (arr == null || !arr.length) return; + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + module.exports = pick; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js new file mode 100644 index 0000000..fef4043 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js @@ -0,0 +1,12 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js new file mode 100644 index 0000000..31d3c77 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js @@ -0,0 +1,27 @@ +var countSteps = require('../math/countSteps'); + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + module.exports = range; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js new file mode 100644 index 0000000..1a350c6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js @@ -0,0 +1,33 @@ +var forEach = require('./forEach'); + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + module.exports = reduce; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js new file mode 100644 index 0000000..e36fd4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js @@ -0,0 +1,34 @@ + + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + module.exports = reduceRight; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js new file mode 100644 index 0000000..685f291 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js @@ -0,0 +1,26 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = reject; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js new file mode 100644 index 0000000..aa6517d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js @@ -0,0 +1,13 @@ +var indexOf = require('./indexOf'); + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + module.exports = remove; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js new file mode 100644 index 0000000..d5f7f3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js @@ -0,0 +1,15 @@ +var indexOf = require('./indexOf'); + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + module.exports = removeAll; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js new file mode 100644 index 0000000..97805ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js @@ -0,0 +1,29 @@ +var randInt = require('../random/randInt'); +var forEach = require('./forEach'); + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + module.exports = shuffle; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js new file mode 100644 index 0000000..8d17772 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + module.exports = some; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js new file mode 100644 index 0000000..7807339 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js @@ -0,0 +1,55 @@ + + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + module.exports = mergeSort; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js new file mode 100644 index 0000000..4f3ba50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js @@ -0,0 +1,35 @@ + + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + module.exports = split; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js new file mode 100644 index 0000000..ce4c55d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js @@ -0,0 +1,28 @@ +var isFunction = require('../lang/isFunction'); + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + module.exports = toLookup; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js new file mode 100644 index 0000000..f1334a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js @@ -0,0 +1,19 @@ +var unique = require('./unique'); +var append = require('./append'); + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + module.exports = union; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js new file mode 100644 index 0000000..0192b2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js @@ -0,0 +1,17 @@ +var indexOf = require('./indexOf'); +var filter = require('./filter'); + + /** + * @return {array} Array of unique items + */ + function unique(arr){ + return filter(arr, isUnique); + } + + function isUnique(item, i, arr){ + return indexOf(arr, item, i+1) === -1; + } + + module.exports = unique; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js new file mode 100644 index 0000000..c125a99 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js @@ -0,0 +1,26 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var contains = require('./contains'); + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + module.exports = xor; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js new file mode 100644 index 0000000..931eb81 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js @@ -0,0 +1,29 @@ +var max = require('./max'); +var pluck = require('./pluck'); +var map = require('./map'); + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1, + item; + while (++i < len) { + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + module.exports = zip; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js new file mode 100644 index 0000000..d5cf6ca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js new file mode 100644 index 0000000..a73f994 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrContains = require('../array/contains'); +var objContains = require('../object/contains'); + + /** + */ + module.exports = make(arrContains, objContains); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js new file mode 100644 index 0000000..300e03c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrEvery = require('../array/every'); +var objEvery = require('../object/every'); + + /** + */ + module.exports = make(arrEvery, objEvery); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js new file mode 100644 index 0000000..3875700 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + module.exports = filter; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js new file mode 100644 index 0000000..14317e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrFind = require('../array/find'); +var objFind = require('../object/find'); + + /** + * Find value that returns true on iterator check. + */ + module.exports = make(arrFind, objFind); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js new file mode 100644 index 0000000..6e28dcb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrForEach = require('../array/forEach'); +var objForEach = require('../object/forOwn'); + + /** + */ + module.exports = make(arrForEach, objForEach); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js new file mode 100644 index 0000000..029d27b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js @@ -0,0 +1,19 @@ + + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = Array.prototype.slice.call(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + module.exports = makeCollectionMethod; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js new file mode 100644 index 0000000..fc157f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js @@ -0,0 +1,23 @@ +var isObject = require('../lang/isObject'); +var values = require('../object/values'); +var arrMap = require('../array/map'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + module.exports = map; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js new file mode 100644 index 0000000..a8490e7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMax = require('../array/max'); +var objMax = require('../object/max'); + + /** + * Get maximum value inside collection + */ + module.exports = make(arrMax, objMax); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js new file mode 100644 index 0000000..51d9f14 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMin = require('../array/min'); +var objMin = require('../object/min'); + + /** + * Get minimum value inside collection. + */ + module.exports = make(arrMin, objMin); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js new file mode 100644 index 0000000..9b28377 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js @@ -0,0 +1,14 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js new file mode 100644 index 0000000..4c07573 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrReduce = require('../array/reduce'); +var objReduce = require('../object/reduce'); + + /** + */ + module.exports = make(arrReduce, objReduce); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js new file mode 100644 index 0000000..2a92e3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + module.exports = reject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js new file mode 100644 index 0000000..244e33e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js @@ -0,0 +1,19 @@ +var isArray = require('../lang/isArray'); +var objSize = require('../object/size'); + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + module.exports = size; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js new file mode 100644 index 0000000..48fd252 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrSome = require('../array/some'); +var objSome = require('../object/some'); + + /** + */ + module.exports = make(arrSome, objSome); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js new file mode 100644 index 0000000..1cde1a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js @@ -0,0 +1,21 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js new file mode 100644 index 0000000..85905c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +var isDate = require('../lang/isDate'); + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + module.exports = dayOfTheYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js new file mode 100644 index 0000000..1131cdc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js @@ -0,0 +1,130 @@ +var totalDaysInMonth = require('./totalDaysInMonth'); +var totalDaysInYear = require('./totalDaysInYear'); +var convert = require('../time/convert'); + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + module.exports = diff; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js new file mode 100644 index 0000000..f9526ce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js @@ -0,0 +1,61 @@ + + // en-US (English, United States) + module.exports = { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js new file mode 100644 index 0000000..71ebadb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ + + // pt-BR (Brazillian Portuguese) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js new file mode 100644 index 0000000..723fc10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js @@ -0,0 +1,14 @@ +var mixIn = require('../object/mixIn'); +var enUS = require('./i18n/en-US'); + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + module.exports = activeLocale; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js new file mode 100644 index 0000000..4212870 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js @@ -0,0 +1,15 @@ +var isDate = require('../lang/isDate'); + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + module.exports = isLeapYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js new file mode 100644 index 0000000..4097d29 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js @@ -0,0 +1,16 @@ +var startOf = require('./startOf'); + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + module.exports = isSame; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js new file mode 100644 index 0000000..8ea2b17 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js @@ -0,0 +1,146 @@ +var some = require('../array/some'); + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + var match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else if ((match = TIME_ZONE.exec(str))) { + var match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + module.exports = parseISO8601; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js new file mode 100644 index 0000000..072bc0e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js @@ -0,0 +1,54 @@ +var clone = require('../lang/clone'); + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + module.exports = startOf; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js new file mode 100644 index 0000000..f033d10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js @@ -0,0 +1,118 @@ +var pad = require('../number/pad'); +var i18n = require('./i18n_'); +var dayOfTheYear = require('./dayOfTheYear'); +var timezoneOffset = require('./timezoneOffset'); +var timezoneAbbr = require('./timezoneAbbr'); +var weekOfTheYear = require('./weekOfTheYear'); + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + module.exports = strftime; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js new file mode 100644 index 0000000..b100687 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +var timezoneOffset = require('./timezoneOffset'); + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + module.exports = timezoneAbbr; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js new file mode 100644 index 0000000..9492dce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js @@ -0,0 +1,16 @@ +var pad = require('../number/pad'); + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + module.exports = timezoneOffset; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js new file mode 100644 index 0000000..8aafeb8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js @@ -0,0 +1,25 @@ +var isDate = require('../lang/isDate'); +var isLeapYear = require('./isLeapYear'); + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + module.exports = totalDaysInMonth; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js new file mode 100644 index 0000000..b4b7e9b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +var isLeapYear = require('./isLeapYear'); + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + module.exports = totalDaysInYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js new file mode 100644 index 0000000..dd51b7f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +var dayOfTheYear = require('./dayOfTheYear'); + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + module.exports = weekOfTheYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md new file mode 100644 index 0000000..1f390fb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md @@ -0,0 +1,773 @@ +# array # + +Array utilities. + + + + +## append(arr1, arr2):Array + +Appends an array to the end of the other. +The first array will be modified and will contain the appended items. + +See: [`union()`](#union), [`combine()`](#combine) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +append(foo, bar); // ['a', 'b', 'b', 'd'] +``` + + + +## collect(arr, callback, [thisObj]):Array + +Maps the items in `arr` and concatenates the resulting arrays. + +See: [`map()`](#map) + +```js +collect([1, 2, 3], function(val) { + return [val, val % 2]; +}); // [1, 1, 2, 0, 3, 1]; + +collect(['a', 'bb', ''], function(val) { + return val.split(''); +}); // ['a', 'b', 'b'] +``` + +It also supports a shorthand syntax: + +```js +var items = [{ a: [1] }, { b: 'foo' }, { a: [2, 3] }]; +collect(items, 'a'); // [1, 2, 3]; +``` + + + +## combine(arr1, arr2):Array + +Combines an array with all the items of another. +The first array will be modified and will contain the combined items. +Does not allow duplicates and is case and type sensitive. + +See: [`union()`](#union), [`append()`](#append) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +combine(foo, bar); // ['a', 'b', 'd'] +``` + + + +## compact(arr):Array + +Returns a new Array without any `null` or `undefined` values. Note that it will +keep empty strings and other falsy values (simillar to Ruby Array#compact). + +```js +var arr = [0, 1, null, false, '', 'foo', undefined, 'bar']; +compact(arr); // [0, 1, false, '', 'foo', 'bar']; +``` + + + +## contains(arr, value):Boolean + +Checks if Array contains value. Alias to `indexOf(arr, val) !== -1`. + +```js +var arr = [1, 2, 3]; +contains(arr, 2); // true +contains(arr, 'foo'); // false +``` + + + +## difference(...arrs):Array + +Return a new Array with elements that aren't present in the other Arrays +besides the first one. + +Works like [Python set#difference](http://docs.python.org/library/stdtypes.html#set.difference). + +It will remove duplicates. + +See: [`xor()`](#xor), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +difference(a, b); // ['a', 'b'] +``` + + + +## every(arr, callback, [thisObj]):Array + +Crossbrowser `Array.every()`. + +Tests whether all elements in the array pass the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +every(items, isString); // false +every(items, isFunction); // false +every(items, function(val, key, arr){ + return val != null; +}); // true +``` + +more info at [MDN Array#every](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:true}, {id:8, active:true}]; +// all items with `id === 8` +every(items, {id:8}); // false +// `active` is truthy on all items +every(items, 'active'); // true +``` + + + +## filter(arr, callback, [thisObj]):Array + +Crossbrowser `Array.filter()`. + +Creates a new array with all elements that pass the callback test. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var nums = [1, 2, 3, 4, 5, 6]; +var oddNumbers = filter(nums, function(val, key, arr){ + return (val % 2) !== 0; +}); +// > [1, 3, 5] +``` + +more info at [MDN Array#filter](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter) + +Filter also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// filter item that matches all properties/values pairs +filter(arr, {name:'john', beard:false}); +// > [{name:'john', surnname:'connor', beard:false}] +// items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'doe', beard:true}] +``` + +See [`reject()`](#reject) + + + +## find(arr, callback, [thisObj]):void + +Loops through all the items in the Array and returns the first one that passes +a truth test (callback). + +```js +var arr = [123, {a:'b'}, 'foo', 'bar']; +find(arr, isString); // "foo" +find(arr, isNumber); // 123 +find(arr, isObject); // {a:'b'} +``` + +Find also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true} +]; +// first item that matches all properties/values pairs +find(arr, {name:'john'}); // {name:'john', surnname:'connor', beard:false} +// first item where 'beard' is a truthy value +find(arr, 'beard'); // {name:'john', surnname:'doe', beard:true} +``` + +See: [findIndex()](#findIndex) + + + +## findIndex(arr, iterator, [thisObj]):Number + +Loops through the items in the Array and returns the index of the first one +that passes a truth test (callback). + +Returns `-1` if no item was found that passes the truth test. + +```js +var arr = [1, { a: 1 }, 'foo', 'bar']; +findIndex(arr, isString); // 2 +findIndex(arr, isNumber); // 0 +findIndex(arr, isObject); // 1 +findIndex(arr, isRegExp); // -1 +``` + +`findIndex` also supports shorthand notation: + +```js +var pets = [ + { pet: 'dog', name: 'Sam' }, + { pet: 'dog', name: 'Maggie' } +]; + +findIndex(pets, { pet: 'dog' }); // 0 +findIndex(pets, { name: 'Maggie' }); // 1 +``` + +See: [find()](#find) + + + +## flatten(arr, [level]):Array + +Recursively flattens an array. A new array containing all the elements is +returned. If `level` is specified, it will only flatten up to that level. + +### Example + +```js +flatten([1, [2], [3, [4, 5]]]); +// > [1, 2, 3, 4, 5] +flatten([1, [2], [3, [4, 5]]], 1); +// > [1, 2, 3, [4, 5]] +``` + + + +## forEach(arr, callback, [thisObj]):void + +Crossbrowser `Array.forEach()`. + +It allows exiting the iteration early by returning `false` on the callback. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = ['foo', 'bar', 'lorem', 'ipsum']; +forEach(items, function(val, key, arr){ + console.log(key +' : '+ val); + if (val === 'lorem') { + // stop iteration (break) + return false; + } +}); +``` + +more info at [MDN Array#forEach](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach) + + + +## indexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.indexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#indexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf) + + + + +## insert(arr, ...items):Number + +Push items into array only if they aren't contained by it. Returns the new +`length` of the array. + +See: [`remove()`](#remove), [`removeAll()`](#removeAll), +[`contains()`](#contains) + +```js +var arr = ['a', 'b']; +insert(arr, 'a'); // 2 : ['a', 'b'] +insert(arr, 'c'); // 3 : ['a', 'b', 'c'] +insert(arr, 1, 2, 'b'); // 5 : ['a', 'b', 'c', 1, 2] +``` + + + +## intersection(...arrs):Array + +Return a new Array with elements common to all Arrays. + +Similar to Python set#intersection and underscore.js intersection. + +It will remove duplicates. + +See: [`difference()`](#difference), [`xor()`](#xor) + +```js +var a = ['a', 'b', 1], + b = ['c', 1], + c = [1, 2, 3]; +intersection(a, b, c); // [1] +``` + + + +## invoke(arr, methodName[, ...args]):Array + +Call `methodName` on each item of the array passing custom arguments if needed. + +```js +invoke([[3,2,1], [9,5,2]], 'sort'); // [[1,2,3], [2,5,9]] +``` + + + +## join(arr, [separator]):String + +Joins the strings in `arr`, inserting `separator` between each value. + +This ignores null values and empty strings that are in the array. `separator` +defaults to an empty string. This will convert all non-string objects in the +array to a string. + +### Example + +```js +join(['a', 'b', 'c']); // 'abc' +join(['foo', 'bar'], ', '); // 'foo, bar' +join([null, 'foo', '', 'bar', undefined], ':'); // 'foo:bar' +``` + + + +## lastIndexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.lastIndexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#lastIndexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf) + + + +## map(arr, callback, [thisObj]]):Array + +Crossbrowser `Array.map()`. + +Creates a new array with the results of calling a provided function on every +element in this array. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +See: [`collect()`](#collect) + +```js +var nums = [1,2,3,4]; +var double = map(nums, function(val, key, arr){ + return val * 2; +}); +// > [2, 4, 6, 8] +``` + +more info at [MDN Array#map](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map) + +It also supports a shorthand notation which can be used to achieve same result +as [`array/pluck`](#pluck): + +```js +var src = ['lorem', 'ipsum', 'foo', 'amet']; +// grab the "length" property of all items +var lengths = map(src, 'length'); // [5, 5, 3, 4] +``` + + + +## max(arr, [iterator], [thisObj]):* + +Returns maximum value inside array or use a custom iterator to define how items +should be compared. + +See: [`min()`](#min) + +```js +max([10, 2, 7]); // 10 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + +It also supports a shorthand notation: + +```js +max(['foo', 'lorem', 'amet'], 'length'); // "lorem" +``` + + + +## min(arr, [iterator], [thisObj]):* + +Returns minimum value inside array or use a custom iterator to define how items +should be compared. + +See: [`max()`](#max) + +```js +min([10, 2, 7]); // 2 +min(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'foo' +``` + +It also supports a shorthand notation: + +```js +min(['foo', 'lorem', 'amet'], 'length'); // "foo" +``` + + + +## pick(arr):* + +Gets a random item and remove it from the array. + +### Example: + + var arr = [1, 2, 3, 4, 5, 6]; + var item_1 = pick(arr); // 4 + var item_2 = pick(arr); // 1 + console.log(arr); // [2, 3, 5, 6] + + + +## pluck(arr, propName):Array + +Extract a list of property values. + +See: [`function/prop()`](function.html#prop) + +```js +var users = [{name : 'John', age: 21}, {name: 'Jane', age : 27}]; +var names = pluck(users, 'name'); // ["John", "Jane"] +var ages = pluck(users, 'age'); // [21, 27] +``` + + + +## range([start], stop[, step]):Array + +Creates a new Array with all the values inside the range. Works similarly to +Python#range or PHP#range. + +### Arguments + + 1. `[start]` (Number) : Range start. Default is `0`. + 2. `stop` (Number) : Range limit. + 3. `[step]` (Number) : Step size. Default is `1`. + +### Example + +```js +range(5); // [0, 1, 2, 3, 4, 5] +range(0, 5); // [0, 1, 2, 3, 4, 5] +range(0, 5, 2); // [0, 2, 4] +range(20, 40, 5); // [20, 25, 30, 35, 40] +``` + + + +## reduce(arr, fn):* + +Crossbrowser `Array.reduce()`. + +Apply a function against an accumulator and each value of the array (from +left-to-right) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduce](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce) + + + +## reduceRight(arr, fn):* + +Crossbrowser `Array.reduceRight()`. + +Apply a function simultaneously against two values of the array (from +right-to-left) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduceRight](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduceRight) + + + +## reject(arr, fn, thisObj):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var numbers = [1, 2, 3, 4, 5, 6]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4, 6] +``` + +It also supports a shorthand syntax: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// reject items that matches all properties/values pairs +reject(arr, {name:'john'}); +// > [{name:'jane', surnname:'doe', beard:false}] +// reject items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'connor', beard:false}, +// {name:'jane', surname:'doe', beard:false}] +``` + + + +## remove(arr, item):void + +Remove a single item from the array. + +IMPORTANT: it won't remove duplicates, just a single item. + +### Example + +```js +var foo = [1, 2, 3, 4]; +remove(foo, 2); +console.log(foo); // [1, 3, 4] +``` + + + +## removeAll(arr, item):void + +Remove all instances of an item from the array. + +### Example + +```js +var foo = [1, 2, 3, 4, 2, 2]; +removeAll(foo, 2); +console.log(foo); // [1, 3, 4]; +``` + + + +## shuffle(arr):Array + +Returns a new Array with items randomly sorted (shuffled). Similar to Ruby Array#shuffle. + +### Example + +```js +var arr = ['a', 'b', 'c', 'd', 'e']; +shuffle(arr); // ['b', 'd', 'e', 'c', 'a'] +``` + + + +## some(arr, callback, [thisObj]):Array + +Crossbrowser `Array.some()`. + +Tests whether some element in the array passes the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +some(items, isString); // true +some(items, isFunction); // false +``` + +more info at [MDN Array#some](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:false}, {id:8, active:false}]; +// at least one item with `id === 8` +some(items, {id:8}); // true +// `active` is truthy on at least one item +some(items, 'active'); // true +``` + +see also: [`object/matches`](object.html#matches) + + + +## sort(arr, [compareFn]):Array + +Returns a sorted Array using the [Merge Sort](http://en.wikipedia.org/wiki/Merge_sort) algorithm (stable sort). + +The `Array.prototype.sort` browser implementations differ since the sorting algorithm isn't described in the ES spec - [in V8 it isn't stable](http://code.google.com/p/v8/issues/detail?id=90) and [on Firefox it is stable](https://bugzilla.mozilla.org/show_bug.cgi?id=224128) - so this function doesn't use the browser native implementation and is recommended in cases where a stable sort is required (items should preserve same order if already sorted). + +**Important:** It does logical comparisson by default (greater/less than) and +not a string comparisson like the native `Array#sort`. + +### compareFn + +If `compareFn` is supplied elements are sorted based on the value returned by +the `compareFn`. + + - If `compareFn(a, b)` is less than `0`, sort `a` to a lower index than `b`. + - If `compareFn(a, b)` returns `0`, leave `a` and `b` unchanged with respect + to each other, but sorted with respect to all different elements. + - If `compareFn(a, b)` is greater than `0`, sort `b` to a lower index than + `a`. + +### Example + +```js +sort([187, 23, 47, 987, 12, 59, 0]); // [0, 12, 23, 47, 59, 187, 987] +sort(['a', 'z', 'c', 'beta', 'b']); // ['a', 'b', 'beta', 'c', 'z'] + +// ['sit', 'amet', 'lorem', 'ipsum'] +sort(['lorem', 'ipsum', 'sit', 'amet'], function(a, b){ + // sort by length, items with same length + // will keep the relative order (stable) + return a.length - b.length; +}); + +// [4, 3, 2, 1] +sort([2, 3, 1, 4], function(a, b){ + // reverse sort + return b - a; +}); +``` + + + +## split(arr, [segments]):Array + +Splits an array into a fixed number of segments. + +The number of segments is specified by `segments` and defaults to 2. If the +array cannot be evenly split, the first segments will contain the extra items. +If `arr` is empty, an empty array is returned. If `arr.length` is less than +`segments`, then the resulting array will have `arr.length` number of +single-element arrays. + +### Example +```js +split([1, 2, 3, 4, 5], 3) // [ [1, 2], [3, 4], [5] ] +split([1, 2, 3, 4, 5]) // [ [1, 2, 3], [4, 5] ] +split([]) // [] +split([1, 2], 3) // [ [1], [2] ] +``` + + + +## toLookup(arr, key):Object + +Create an object that indexes the items in the array by a key. If `key` is a function, the key for each value in the resulting object will be the result of calling the function with the value as an argument. Otherwise `key` specifies the property on each value to use as the key. + +### Example + +```js +var foo = [{ name: 'a', thing: 1 }, { name: 'b', thing: 2 }]; +// { a: { name: 'a', thing: 1 }, b: { name: 'b', thing: 2 } } +toLookup(foo, 'name'); +// same as above +toLookup(foo, function (value) { return value.name; }); +``` + + + +## union(...arrs):Array + +Concat multiple arrays removing duplicates. + +```js +var a = ['a', 'b'], + b = ['c', 'a'], + c = [1, 'b', 2, 3, 'a']; + +//note that unique remove from begin to end +union(a, b, c); // ['c', 1, 'b', 2, 3, 'a'] +``` + + + +## unique(arr):Array + +Return a new Array of unique items. + +### Example + +```js +var foo = [1, 2, 3, 4, 2, 2, 3, 4]; +var bar = unique(foo); +console.log(foo); // [1, 2, 3, 4]; +``` + + + +## xor(arr1, arr2):Array + +Exclusive OR. Returns items that are present in a single array. + +Works like [Python set#symmetric_difference](http://docs.python.org/library/stdtypes.html#set.symmetric_difference) renamed for brevity. + +It will remove duplicates. + +See: [`difference()`](#difference), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +xor(a, b); // ['a', 'b', 'c'] +``` + + + +## zip(...arrs):Array + +Groups the elements of each array at their corresponding indexes. + +Useful for separate data sources that are coordinated through matching array +indexes. For a matrix of nested arrays, `zip.apply(...)` can transpose the +matrix in a similar fashion. + +```js +// [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] +zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); +``` + + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md new file mode 100644 index 0000000..2ffcab1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md @@ -0,0 +1,233 @@ +# collection # + +Methods for dealing with collections (Array or Objects). + + + +## contains(list, value):Boolean + +Checks if collection contains value. + +```js +contains({a: 1, b: 2, c: 'bar'}, 2); // true +contains([1, 2, 3], 'foo'); // false +``` + +See: [array/contains](array.html#contains), [object/contains](object.html#contains) + + + +## every(list, callback, [thisObj]):Boolean + +Tests whether all values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + +See: [array/every](array.html#every), [object/every](object.html#every) + + + +## filter(list, callback, [thisObj]):Array + +Filter collection properties. + +See: [array/filter](array.html#filter), [object/filter](object.html#filter) + + + +## find(list, callback, [thisObj]):* + +Loops through all the values in the collection and returns the first one that +passes a truth test (callback). + +**Important:** loop order over objects properties isn't guaranteed to be the +same on all environments. + +```js +find({a: 'foo', b: 12}, isString); // 'foo' +find(['foo', 12], isNumber); // 12 +``` + +See: [array/find](array.html#find), [object/find](object.html#find) + + + +## forEach(list, callback, [thisObj]) + +Loop through all values of the collection. + +See: [array/forEach](array.html#forEach), [object/forOwn](object.html#forOwn) + + + +## map(list, callback, [thisObj]):Array + +Returns a new collection where the properties values are the result of calling +the callback for each property in the original collection. + +See: [array/map](array.html#map), [object/map](object.html#map) + + + +## max(list, [iterator]):* + +Returns maximum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`min()`](#min), [array/max](array.html#max), [object/max](object.html#max) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(list, [iterator]):* + +Returns minimum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`max()`](#max), [array/min](array.html#min), [object/min](object.html#min) + +```js +min([10, 2, 7]); // 2 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## pluck(list, propName):Array + +Extract a list of property values. + +```js +var users = [ + { + name : 'John', + age : 21 + }, + { + name : 'Jane', + age : 27 + } +]; + +pluck(users, 'name'); // ["John", "Jane"] +pluck(users, 'age'); // [21, 27] + +users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // ['John', 'Mary'] +``` + +See: [array/pluck](array.html#pluck), [object/pluck](object.html#pluck) + + + +## reduce(list, callback, initial, [thisObj]):* + +Apply a function against an accumulator and each value in the collection as to +reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + +See: [array/reduce](array.html#reduce), [object/reduce](object.html#reduce) + + + +## reject(list, fn, [thisObj]):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +### Example + +```js +var numbers = [1, 2, 3, 4, 5]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4] + +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // [2, 4] +``` + +See: [array/reject](array.html#reject), [object/reject](object.html#reject) + + + +## size(list):Number + +Returns the number of values in the collection. + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +size([1,2,3]); // 3 +size(null); // 0 +``` + +See: [object/size](object.html#size) + + + +## some(list, callback, [thisObj]):Boolean + +Tests whether any values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +some(obj, isString); // true +some([1, 2, 3], isNumber) // true +some([1, 2, 3], isString) // false +``` + +See: [array/some](array.html#some), [object/some](object.html#some) + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md new file mode 100644 index 0000000..b3f7f40 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md @@ -0,0 +1,295 @@ +# date # + +Date utilities. + + +## dayOfTheYear(date):Number + +How many days elapsed since begining of the year (following gregorian +calendar). + +```js +// Jan 1st +dayOfTheYear(new Date(2013, 0, 1)); // 1 +// Dec 31th +dayOfTheYear(new Date(2013, 11, 31)); // 364 +``` + + + +## diff(date1, date2, [unitName]):Number + +Calculate the difference between dates (range). + +The returned value is always positive. The default `unitName` is `"ms"`. + +Available units: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`, +`millisecond`. + +See: [`time/convert()`](time.html#convert) + +```js +var d1 = new Date(2012, 4, 5); +var d2 = new Date(2013, 4, 8); +diff(d1, d2); // 31795200000 +diff(d1, d2, 'hour'); // 8832 +diff(d1, d2, 'week'); // 52.57142857142857 +diff(d1, d2, 'month'); // 12.096774193548388 +diff(d1, d2, 'year'); // 1.0082191780821919 +``` + + + +## isLeapYear(fullYear|date):Boolean + +Checks if it's a [leap year](http://en.wikipedia.org/wiki/Leap_year) according +to the Gregorian calendar. + +see: [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +isLeapYear(2012); // true +isLeapYear(2013); // false +isLeapYear(new Date(2012, 2, 28)); // true +``` + + +## isSame(date1, date2[, period]):Boolean + +Check if both dates are the "same". + +You can pass an optional *period* used to set the comparisson precision. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +var date1 = new Date(2013, 1, 3); +var date2 = new Date(2013, 2, 9); +isSame(date1, date2); // false +isSame(date1, date2, 'day'); // false +isSame(date1, date2, 'month'); // false +isSame(date1, date2, 'year'); // true +``` + + + +## parseIso(str):Number + +Parses an [ISO8601](http://en.wikipedia.org/wiki/Iso8601) date and returns the +number of milliseconds since January 1, 1970, 00:00:00 UTC, or `NaN` if it is +not a valid ISO8601 date. + +This parses *all* ISO8601 dates, including dates without times, [ordinal +dates](https://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates), and the compact +representation (omitting delimeters). The only exception is [ISO week +dates](https://en.wikipedia.org/wiki/ISO_week_date), which are not parsed. + +If no time zone offset is specified, it assumes UTC time. + +```js +// Jan 01, 1970 00:00 GMT +parseIso('1970-01-01T00:00:00') // 0 +parseIso('1970-001') // 0 +parseIso('1970-01-01') // 0 +parseIso('19700101T000000.00') // 0 +parseIso('1970-01-01T02:00+02:00') // 0 + +// Jan 02, 2000 20:10 GMT+04:00 +parseIso('2000-01-02T20:10+04:00') // 946829400000 +``` + + + +## startOf(date, period):Date + +Get a new Date at the start of the period. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +// Apr 05 2013 11:27:43 +var date = new Date(2013, 3, 5, 11, 27, 43, 123); +startOf(date, 'year'); // Jan 01 2013 00:00:00 +startOf(date, 'month'); // Apr 01 2013 00:00:00 +startOf(date, 'day'); // Apr 05 2013 00:00:00 +startOf(date, 'hour'); // Apr 05 2013 11:00:00 +``` + + + +## strftime(date, format, [l10n]):String + +Format date based on strftime format. + +Replaced tokens: + +
    +
    %a
    locale's abbreviated weekday name.
    +
    %A
    locale's full weekday name.
    +
    %b
    locale's abbreviated month name.
    +
    %B
    locale's full month name.
    +
    %c
    locale's appropriate date and time representation.
    +
    %C
    century number (the year divided by 100 and truncated +to an integer) as a decimal number [00..99].
    +
    %d
    day of the month as a decimal number [01..31].
    +
    %D
    same as %m/%d/%y.
    +
    %e
    day of the month as a decimal number [1..31]; +a single digit is preceded by a space.
    +
    %F
    The ISO 8601 date format (%Y-%m-%d)
    +
    %h
    same as %b.
    +
    %H
    hour (24-hour clock) as a decimal number [00..23].
    +
    %I
    hour (12-hour clock) as a decimal number [01..12].
    +
    %j
    day of the year as a decimal number [001..366].
    +
    %L
    zero-padded milliseconds [000..999]
    +
    %m
    month as a decimal number [01..12].
    +
    %M
    minute as a decimal number [00..59].
    +
    %n
    newline character.
    +
    %p
    locale's equivalent of either "am" or "pm"
    +
    %P
    locale's equivalent of either "AM" or "PM"
    +
    %r
    time in a.m. and +p.m. notation; in the POSIX locale this is equivalent to %I:%M:%S %p.
    +
    %R
    time in 24 hour notation (%H:%M).
    +
    %s
    seconds since Epoch (1970-01-01 00:00:00 UTC)
    +
    %S
    second as a decimal number [00..60].
    +
    %t
    tab character.
    +
    %T
    time (%H:%M:%S).
    +
    %u
    weekday as a decimal number [1..7], with 1 representing +Monday.
    +
    %U
    week number of the year (Sunday as the first day of +the week) as a decimal number [00..53].
    +
    %V
    week number of the year (Monday as the first day of the +week) as a decimal number [01..53]. If the week containing 1 January has +four or more days in the new year, then it is considered week 1. Otherwise, +it is the last week of the previous year, and the next week is week 1.
    +
    %w
    weekday as a decimal number [0..6], with 0 representing +Sunday.
    +
    %W
    week number of the year (Monday as the first day of +the week) as a decimal number [00..53]. All days in a new year preceding +the first Monday are considered to be in week 0.
    +
    %x
    locale's appropriate date representation.
    +
    %X
    locale's appropriate time representation.
    +
    %y
    year without century as a decimal number [00..99].
    +
    %Y
    year with century as a decimal number.
    +
    %Z
    timezone name or abbreviation, or by no bytes +if no timezone information exists.
    +
    %%
    is replaced by %.
    +
    + +```js +var date = new Date(2013, 3, 8, 9, 2, 4); +strftime(date, '%Y-%m-%d'); // "2013-04-08" +strftime(date, '%R'); // "09:02" +strftime(date, '%Y-%m-%dT%H:%M:%S%z'); // "2013-04-08T09:02:04+0000" +``` + +You can also set a custom locale: + +```js +var ptBr = require('mout/date/i18n/pt-BR'); +strftime(date, '%a, %d %b', ptBr); // 'Seg, 08 Abr' +strftime(date, '%A, %d %B', ptBr); // 'Segunda, 08 Abril' +``` + +To set it globally: + +```js +require('mout/date/i18n_').set( customLocaleData ); +``` + +See [date/i18n](https://github.com/mout/mout/tree/master/src/date/i18n) +for localization examples. + + + +## timezoneAbbr(date):String + +Return timezone abbreviation or similar data. + +The result will vary based on the OS/browser since some environments doesn't +provide enough info about the current locale. + +```js +// IE 7-8 +timezoneAbbr(new Date()); // "-0500" +// Chrome, FF, V8 +timezoneAbbr(new Date()); // "EST" +``` + + + +## timezoneOffset(date):String + +Return time zone as hour and minute offset from UTC (e.g. +0900). + +It's important to note that JavaScript Date object will use the system locale +info to determinate the [timezone +offset](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset) +and that daylight saving time affects the result. + +```js +// if system locale is EST +timezoneOffset(new Date()); // -0500 +``` + + + +## totalDaysInMonth(fullYear, monthIndex):Number + +Returns the amount of days in the month taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear) + +```js +totalDaysInMonth(2008, 1); // 29 (leap year) +totalDaysInMonth(2009, 1); // 28 + +// you can also pass a Date object as single argument +totalDaysInMonth( new Date(2013, 0, 1) ); // 31 +``` + + +## totalDaysInYear(fullYear):Number + +Returns the amount of days in the year taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear), [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +totalDaysInYear(2008); // 366 (leap year) +totalDaysInYear(2009); // 365 + +// you can also pass a Date object as single argument +totalDaysInYear( new Date(2013, 0, 1) ); // 365 +``` + + + +## weekOfTheYear(date, [firstDayOfWeek]):Number + +Returns how many weeks elapsed since start of the year (`0..53`). + +`firstDayOfWeek` can be `0` (Sunday) or `1` (Monday). By default weeks start at +Sunday. + +It will return `0` if `date` is before the first `firstDayOfWeek` of the year. + +```js +// Tue Jan 01 2013 +weekOfTheYear( new Date(2013,0,1) ); // 0 +// Wed Jan 09 2013 +weekOfTheYear( new Date(2013,0,9) ); // 1 +// Sun Jan 01 2012 +weekOfTheYear( new Date(2012,0,1) ); // 1 +// Mon Jan 09 2012 +weekOfTheYear( new Date(2012,0,9) ); // 2 +``` + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md new file mode 100644 index 0000000..2695a02 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md @@ -0,0 +1,174 @@ +# function # + +Function*(al)* utilities. + + + +## bind(fn, context, [...args]):Function + +Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + +### Arguments + + 1. `fn` (Function) : Target Function + 2. `context` (Object) : Execution context (object used as `this`) + 3. `[...args]` (*) : Arguments (0...n arguments) + +See: [`partial()`](#partial), [object/bindAll](./object.html#bindAll) + + + +## compose(...fn):Function + +Returns the composition of a list of functions, where each function consumes +the return value of the function that follows. In math terms, composing the +functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + +```js +function add2(x) { return x + 2 } +function multi2(x) { return x * 2 } +map([1, 2, 3], compose(add2, multi2)); // [4, 6, 8] + +//same as +map([1, 2, 3], function(x){ + return add2( multi2(x) ); +}); +``` + + + +## debounce(fn, delay[, isAsap]):Function + +Creates a function that will delay the execution of `fn` until after `delay` +milliseconds have elapsed since the last time it was invoked. + +Subsequent calls to the debounced function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = debounce(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a debounced-function call and `X` is the actual +callback execution: + + Default + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + + Debounced with `isAsap == true`: + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + +See: [`throttle()`](#throttle) + + +## func(name):Function + +Returns a function that calls a method with given `name` on supplied object. +Useful for iteration methods like `array/map` and `array/forEach`. + +See: [`prop()`](#prop) + +```js +// will call the method `getName()` for each `user` +var names = map(users, func('getName')); +``` + + + +## partial(fn, [...args]):Function + +Return a partially applied function supplying default arguments. + +This method is similar to [`bind`](#bind), except it does not alter the this +binding. + +### Arguments + + 1. `fn` (Function) : Target Function + 3. `[...args]` (*) : Arguments (0...n arguments) + +See: [`bind()`](#bind) + +```js +function add(a, b){ return a + b } +var add10 = partial(add, 10); +console.log( add10(2) ); // 12 +``` + + + +## prop(name):Function + +Returns a function that gets a property with given `name` from supplied object. +Useful for using in conjunction with `array/map` and/or for creating getters. + +See: [`array/pluck()`](array.html#pluck) + +```js +var users = [{name:"John", age:21}, {name:"Jane", age:25}]; +// ["John", "Jane"] +var names = map(users, prop('name')); +``` + + + +## series(...fn):Function + +Returns a function that will execute all the supplied functions in order and +passing the same parameters to all of them. Useful for combining multiple +`array/forEach` into a single one and/or for debugging. + + +```js +// call `console.log()` and `doStuff()` for each item item in the array +forEach(arr, series(console.log, doStuff)); +``` + + + +## throttle(fn, interval):Function + +Creates a function that, when executed, will only call the `fn` function at +most once per every `interval` milliseconds. + +If the throttled function is invoked more than once during the wait timeout, +`fn` will also be called on the trailing edge of the timeout. + +Subsequent calls to the throttled function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = throttle(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a throttled-function call and `X` is the actual +`fn` execution: + + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X X X X X X X X X X X + +See: [`debounce()`](#debounce) + + +## timeout(fn, millis, context, [...args]):Number + +Functions as a wrapper for `setTimeout`. Calls a the function `fn` after a given delay `millis` in milliseconds. +The function is called within the specified context. The return value can be used to clear the timeout using `clearTimeout`. + +```js +var id = timeout(doStuff, 300, this); + +clearTimeout(id); +``` + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md new file mode 100644 index 0000000..56d7879 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md @@ -0,0 +1,385 @@ +# lang # + +Language Utilities. Easier inheritance, scope handling, type checks. + + + +## clone(val):* + +Clone native types like Object, Array, RegExp, Date and primitives. + +This method will not clone values that are referenced within `val`. It will +only copy the value reference to the new value. If the value is not a plain +object but is an object, it will return the value unchanged. + +### Example + +```js +var a = { foo: 'bar' }; +var b = clone(a); +console.log(a === b); // false +console.log(a.foo === b.foo); // true + +var c = [1, 2, 3]; +var d = clone(b); +console.log(c === d); // false +console.log(c); // [1, 2, 3] +``` + +See: [`deepClone()`](#deepClone) + + + +## createObject(parent, [props]):Object + +Create Object using prototypal inheritance and setting custom properties. + +Mix between [Douglas Crockford Prototypal Inheritance](http://javascript.crockford.com/prototypal.html) and the EcmaScript 5 `Object.create()` method. + +### Arguments + + 1. `parent` (Object) : Parent Object + 2. `[props]` (Object) : Object properties + +### Example + +```js +var base = { + trace : function(){ + console.log(this.name); + } +}; + +var myObj = createObject(base, { + name : 'Lorem Ipsum' +}); + +myObject.trace(); // "Lorem Ipsum" +``` + + + +## ctorApply(constructor, args):Object + +Do `Function.prototype.apply()` on a constructor while maintaining prototype +chain. + +```js +function Person(name, surname) { + this.name = name; + this.surname = surname; +} + +Person.prototype.walk = function(){ + console.log(this.name +' is walking'); +}; + +var args = ['John', 'Doe']; + +// "similar" effect as calling `new Person("John", "Doe")` +var john = ctorApply(Person, args); +john.walk(); // "John is walking" +``` + + + +## deepClone(val, [instanceClone]):* + +Deep clone native types like Object, Array, RegExp, Date and primitives. + +The `instanceClone` function will be invoked to clone objects that are not +"plain" objects (as defined by [`isPlainObject`](#isPlainObject)) if it is +provided. If `instanceClone` is not specified, it will not attempt to clone +non-plain objects, and will copy the object reference. + +### Example + +```js +var a = {foo:'bar', obj: {a:1, b:2}}; +var b = deepClone(a); // {foo:'bar', obj: {a:1, b:2}} +console.log( a === b ); // false +console.log( a.obj === b.obj ); // false + +var c = [1, 2, [3, 4]]; +var d = deepClone(c); // [1, 2, [3, 4]] +var e = c.concat(); // [1, 2, [3, 4]] + +console.log( c[2] === d[2] ); // false +// concat doesn't do a deep clone, arrays are passed by reference +console.log( e[2] === d[2] ); // true + +function Custom() { } +function cloneCustom(x) { return new Custom(); } +var f = { test: new Custom() }; +var g = deepClone(f, cloneCustom); +g.test === f.test // false, since new Custom instance will be created +``` + +See: [`clone()`](#clone) + + + +## defaults(val, ...defaults):void + +Return first value that isn't `null` or `undefined`. + + function doSomethingAwesome(foo, bar) { + // default arguments + foo = defaults(foo, 'lorem'); + bar = defaults(bar, 123); + // ... + } + + + +## inheritPrototype(child, parent):void + +Inherit prototype from another Object. + +```js +function Foo(name){ + this.name = name; +} +Foo.prototype = { + getName : function(){ + return this.name; + } +}; + +function Bar(name){ + this.name = name; +} +//should be called before calling constructor +inheritPrototype(Bar, Foo); + +var myObj = new Bar('lorem ipsum'); +myObj.getName(); // "lorem ipsum" +``` + + +## is(x, y):Boolean + +Check if both values are identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +is(NaN, NaN); // true +is(-0, +0); // false +is('a', 'b'); // false +``` + +See: [`isnt()`](#isnt) + + + +## isnt(x, y):Boolean + +Check if both values are not identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +isnt(NaN, NaN); // false +isnt(-0, +0); // true +isnt('a', 'b'); // true +``` + +See: [`is()`](#is) + + + + +## isArguments(val):Boolean + +If value is an "Arguments" object. + + + +## isArray(val):Boolean + +If value is an Array. Uses native ES5 `Array.isArray()` if available. + + + +## isBoolean(val):Boolean + +If value is a Boolean. + + + +## isDate(val):Boolean + +If value is a Date. + + + +## isEmpty(val):Boolean + +Checks if Array/Object/String is empty. + + +```js +isEmpty(''); // true +isEmpty('bar'); // false +isEmpty([]); // true +isEmpty([1, 2]); // false +isEmpty({}); // true +isEmpty({a:1, b:2}); // false +``` + + +## isFinite(val):Boolean + +Checks if value is Finite. + +Note: This is not the same as native `isFinite`, which will return `true` for +booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + + + +## isFunction(val):Boolean + +If value is a Function. + + + +## isKind(val, kind):Boolean + +If value is of "kind". (used internally by some of the *isSomething* checks). + +Favor the other methods since strings are commonly mistyped and also because +some "kinds" can only be accurately checked by using other methods (e.g. +`Arguments`), some of the other checks are also faster. + +```js +isKind([1,2], 'Array'); // true +isKind(3, 'Array'); // false +isKind(3, 'Number'); // true +``` + +See: [`kindOf()`](#kindOf) + + + +## isInteger(val):Boolean + +Check if value is an integer. + +```js +isInteger(123); // true +isInteger(123.45); // false +isInteger({}); // false +isInteger('foo'); // false +isInteger('123'); // false +``` + + + +## isNaN(val):Boolean + +Check if value is `NaN`. + +Note: This is not the same as native `isNaN`, which will return `true` for +`undefined` and other values. See [ES5 isNaN](http://es5.github.com/#x15.1.2.4) + + + +## isNull(val):Boolean + +If value is `null`. + + + +## isNumber(val):Boolean + +If value is a Number. + + + +## isObject(val):Boolean + +If value is an Object. + + + +## isPlainObject(val):Boolean + +If the value is an Object created by the Object constructor. + + + +## isRegExp(val):Boolean + +If value is a RegExp. + + + +## isString(val):Boolean + +If value is a String. + + + +## isUndefined(val):Boolean + +If value is `undefined`. + + + +## kindOf(val):String + +Gets kind of value (e.g. "String", "Number", "RegExp", "Null", "Date"). +Used internally by `isKind()` and most of the other *isSomething* checks. + +```js +kindOf([1,2]); // "Array" +kindOf('foo'); // "String" +kindOf(3); // "Number" +``` + +See: [`isKind()`](#isKind) + + +## toArray(val):Array + +Convert array-like object into Array or wrap value into Array. + +```js +toArray({ + "0" : "foo", + "1" : "bar", + "length" : 2 +}); // ["foo", "bar"] + +function foo(){ + return toArray(arguments); +} +foo("lorem", 123); // ["lorem", 123] + +toArray("lorem ipsum"); // ["lorem ipsum"] +toArray(window); // [window] +toArray({foo:"bar", lorem:123}); // [{foo:"bar", lorem:123}] +``` + +See: object/values() + + + +## toString(val):String + +Convert any value to its string representation. + +Will return an empty string for `undefined` or `null`, otherwise will convert +the value to its string representation. + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md new file mode 100644 index 0000000..f45be3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md @@ -0,0 +1,298 @@ +# math # + +Math utilities. + + +## ceil(val[, step]):Number + +Round value up to full steps. Similar to `Math.ceil()` but can round value +to an arbitrary *radix*. + + ceil(7.2); // 8 + ceil(7.8); // 8 + ceil(7, 5); // 10 + ceil(11, 5); // 15 + ceil(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`floor()`](#floor), [`countSteps()`](#countSteps) + + + +## clamp(val, min, max):Number + +Clamps value inside range. + +`clamp()` is extremely useful in cases where you need to limit a value inside +a certain range. So instead of doing a complex `if/else` to filter/process the +value you can restrict it to always be inside the desired range: + + clamp(-5, 0, 10); // 0 + clamp(7, 1, 10); // 7 + clamp(8, 1, 10); // 8 + clamp(10, 1, 10); // 10 + clamp(11, 1, 10); // 10 + +If the value is smaller than `min` it returns the `min`, if `val` is higher +than `max` it returns `max`. + +### Common use cases + +Any situation where you need to limit a number inside a range like: slider +position, image galleries (so user can't skip to an image that doesn't +exist), drag and drop, scroll boundaries, etc. + +See: [`loop()`](#loop) + + + + +## countSteps(val, step[, overflow]):Number + +Count number of full steps. + +### Arguments: + + 1. `val` (Number) : Value. + 2. `step` (Number) : Step size. + 3. `[overflow]` (Number) : Maximum number of steps, nSteps will loop if +`>=` than overflow. + + +Count steps is very useful for cases where you need to know how many "full +steps" the number *completed*. Think of it as a division that only returns +integers and ignore remainders. + + countSteps(3, 5); // 0 + countSteps(6, 5); // 1 + countSteps(12, 5); // 2 + countSteps(18, 5); // 3 + countSteps(21, 5); // 4 + +You can also set an `overflow` which will reset the *counter* before reaching +this number. + + countSteps(3, 5, 3); // 0 + countSteps(6, 5, 3); // 1 + countSteps(12, 5, 3); // 2 + countSteps(18, 5, 3); // 0 + countSteps(21, 5, 3); // 1 + +### Common use cases + +#### How many items fit inside an area: + + var containerWidth = 100; + var itemWidth = 8; + var howManyFit = countSteps(containerWidth, itemWidth); // 12 + +#### Split value into different scales or convert value from one scale to another + +From [mout/time/parseMs](time.html#parseMs): + + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + // {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} + parseMs(2348765454); + + + +## floor(val[, step]):Number + +Round value down to full steps. Similar to `Math.floor()` but can round value +to an arbitrary *radix*. (formerly `snap`) + + floor(7.2); // 7 + floor(7.8); // 7 + floor(7, 5); // 5 + floor(11, 5); // 10 + floor(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +## inRange(val, min, max[, threshold]):Boolean + +Checks if value is inside the range. + + inRange(-6, 1, 10); // false + inRange( 5, 1, 10); // true + inRange(12, 1, 10); // false + +The threshold can be useful when you want granular control of what should match +and/or the precision could change at runtime or by some configuration option, +avoids the clutter of adding/subtracting the `threshold` from `mix` and `max`. + + inRange(12, 1, 10, 2); // true + inRange(13, 1, 10, 2); // false + +### Common use cases + +Anything that needs to check if value is inside a range, be it collision +detection, limiting interaction by mouse position, ignoring parts of the logic +that shouldn't happen if value isn't valid, simplify `if/else` conditions, +making code more readable, etc... + + + + +## isNear(val, target, threshold):Boolean + +Check if value is close to target. + +Similar to `inRange()` but used to check if value is close to a certain value +or match the desired value. Basically to simplify `if/else` conditions and to +make code clearer. + + isNear( 10.2, 10, 0.5); // true + isNear( 10.5, 10, 0.5); // true + isNear(10.51, 10, 0.5); // false + +### Common use cases + +Games where a certain action should happen if an *actor* is close to a target, +gravity fields, any numeric check that has some tolerance. + + + + +## lerp(ratio, start, end):Number + +Linear interpolation. + + lerp(0.5, 0, 10); // 5 + lerp(0.75, 0, 10); // 7.5 + +### Common use cases + +Linear interpolation is commonly used to create animations of elements moving +from one point to another, where you simply update the current ratio (which in +this case represents time) and get back the position of the element at that +"frame". + +The core idea of `lerp` is that you are using a number that goes from `0` to +`1` to specify a ratio inside that scale. This concept can be applied to +convert numbers from different scales easily. + +See: [`map()`](#map), [`norm()`](#norm) + + + + +## loop(val, min, max):Number + +Loops value inside range. Will return `min` if `val > max` and `max` if `val +< min`, otherwise it returns `val`. + + loop(-1, 0, 10); // 10 + loop( 1, 0, 10); // 1 + loop( 5, 0, 10); // 5 + loop( 9, 0, 10); // 9 + loop(10, 0, 10); // 10 + loop(11, 0, 10); // 0 + +Similar to [`clamp()`](#clamp) but *loops* the value inside the range when an +overflow occurs. + +### Common use cases + +Image galleries, infinite scroll, any kind of logic that requires that the +first item should be displayed after the last one or the last one should be +displayed after first if going on the opposite direction. + +See: [`clamp()`](#clamp) + + + + +## map(val, min1, max1, min2, max2):Number + +Maps a number from one scale to another. + + map(3, 0, 4, -1, 1) // 0.5 + map(3, 0, 10, 0, 100) // 30 + +### Common use cases + +Very useful to convert values from/to multiple scales. + +Let's suppose we have a slider that needs to go from `2000` to `5000` and that slider +has `300px` of width, here is how we would translate the knob position into the +current value: + + var knobX = 123; + var sliderWid = 300; + var minVal = 2000; + var maxVal = 5000; + + var curVal = map(knobX, 0, sliderWid, minVal, maxVal); // 3230 + +See: [`lerp()`](#lerp), [`norm()`](#norm) + + + + +## norm(val, min, max):Number + +Gets normalized ratio of value inside range. + + norm(50, 0, 100); // 0.5 + norm(75, 0, 100); // 0.75 + +### Common use cases + +Convert values between scales, used by [`map()`](#map) internally. Direct +opposite of [`lerp()`](#lerp). + +See: [`lerp()`](#lerp), [`map()`](#map) + + + +## round(val[, step]):Number + +Round value to full steps. Similar to `Math.round()` but allow setting an +arbitrary *radix*. + + // default + round(0.22); // 0 + round(0.49); // 0 + round(0.51); // 1 + + // custom radix + round(0.22, 0.5); // 0 + round(0.49, 0.5); // 0.5 + round(0.51, 0.5); // 0.5 + round(0.74, 0.5); // 0.5 + round(0.75, 0.5); // 1 + round(1.24, 0.5); // 1 + round(1.25, 0.5); // 1.5 + round(1.74, 0.5); // 1.5 + +### Common use cases + +Round values by increments of 0.5/5/10/1000/etc. + +See: [`floor()`](#floor), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +------------------------------------------------------------------------------- + +For more usage more info check the specs and source code. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md new file mode 100644 index 0000000..8d93865 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md @@ -0,0 +1,225 @@ +# number # + +Number utilities. + + +## abbreviate(val[, nDecimalDigits, dictionary]):String + +Abbreviate number to thousands (K), millions (M) or billions (B). + +The default value for `nDecimalDigits` is `1`. + +### Example + + abbreviate(123456); // "123.5K" + abbreviate(12345678); // "12.3M" + abbreviate(1234567890); // "1.2B" + +You can set the amount of decimal digits (default is `1`): + + abbreviate(543); // "0.5K" + abbreviate(543, 1); // "0.5K" + abbreviate(543, 2); // "0.54K" + abbreviate(543, 3); // "0.543K" + +You can customize the abbreviation by passing a custom "dictionary": + + var _ptbrDict = { + thousands : ' mil', + millions : ' Mi', + billions : ' Bi' + }; + function customAbbr(val) { + return abbreviate(val, 1, _ptbrDict); + } + + customAbbr(123456); // "123.5 mil" + customAbbr(12345678); // "12.3 Mi" + customAbbr(1234567890); // "1.2 Bi" + + + +## currencyFormat(val[, nDecimalDigits, decimalSeparator, thousandsSeparator]):String + +Format a number as currency. + +### Example: + + currencyFormat(1000); // "1,000.00" + currencyFormat(1000, 1); // "1,000.0" + currencyFormat(1000, 2, ',', '.'); // "1.000,00" + + + +## enforcePrecision(val, nDecimalDigits):Number + +Enforce a specific amount of decimal digits and also fix floating point +rounding issues. + +### Example: + +```js +enforcePrecision(0.615, 2); // 0.62 +enforcePrecision(0.625, 2); // 0.63 +//floating point rounding "error" (rounds to odd number) ++(0.615).toFixed(2); // 0.61 ++(0.625).toFixed(2); // 0.63 +``` + + + +## MAX_INT:Number + +Maximum 32-bit signed integer value. `Math.pow(2, 31) - 1` + +### Example: + +```js +console.log( MAX_INT ); // 2147483647 +``` + + +## MAX_UINT:Number + +Maximum 32-bit unsigned integer value. `Math.pow(2, 32) - 1` + +### Example: + +```js +console.log( MAX_UINT ); // 4294967295 +``` + + +## MIN_INT:Number + +Minimum 32-bit signed integer value. `Math.pow(2, 31) * -1`. + +### Example: + +```js +console.log( MIN_INT ); // -2147483648 +``` + + +## pad(n, minLength[, char]):String + +Add padding zeros if `n.length` < `minLength`. + +### Example: + +```js +pad(1, 5); // "00001" +pad(12, 5); // "00012" +pad(123, 5); // "00123" +pad(1234, 5); // "01234" +pad(12345, 5); // "12345" +pad(123456, 5); // "123456" + +// you can also specify the "char" used for padding +pad(12, 5, '_'); // "___12" +``` + +see: [string/lpad](./string.html#lpad) + + + +## rol(val, shift):Number + +Bitwise circular shift left. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## ror(val, shift):Number + +Bitwise circular shift right. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## sign(val):Number + +Returns `-1` if value is negative, `0` if the value is `0` and `1` if value is positive. Useful for +multiplications. + +```js +sign(-123); // -1 +sign(123); // 1 +sign(0); // 0 +``` + + + +## toInt(val):Number + +"Convert" value into an 32-bit integer. Works like `Math.floor` if `val > 0` and +`Math.ceil` if `val < 0`. + +**IMPORTANT:** val will wrap at [number/MIN_INT](#MIN_INT) and +[number/MAX_INT](#MAX_INT). + +Created because most people don't know bitwise operations and also because this +feature is commonly needed. + +[Perf tests](http://jsperf.com/vs-vs-parseint-bitwise-operators/7) + +### Example: + +```js +toInt(1.25); // 1 +toInt(0.75); // 0 +toInt(-0.55); // 0 +toInt(-5.0001) // -5 +``` + + + +## toUInt(val):Number + +"Convert" value into an 32-bit unsigned integer. + +Works like AS3#uint(). + +**IMPORTANT:** val will wrap at 2^32. + +### Example: + +```js +toUInt(1.25); // 1 +toUInt(0.75); // 0 +toUInt(-0.55); // 0 +toUInt(-5.0001); // 4294967291 +toUInt(Math.pow(2,32) - 0.5); // 4294967295 +toUInt(Math.pow(2,32) + 0.5); // 0 +``` + + +## toUInt31(val):Number + +"Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + +Useful since all bitwise operators besides `>>>` treat numbers as signed +integers. + +**IMPORTANT:** val will wrap at 2^31 and negative numbers will be treated as +`zero`. + +### Example: + +```js +toUInt31(1.25); // 1 +toUInt31(0.75); // 0 +toUInt31(-0.55); // 0 +toUInt31(-5.0001); // 0 +toUInt31(Math.pow(2,31) - 0.5); // 21474836470 +toUInt31(Math.pow(2,31) + 0.5); // 0 +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md new file mode 100644 index 0000000..b4d5e48 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md @@ -0,0 +1,780 @@ +# object # + +Object utilities. + + + +## bindAll(obj, [...methodNames]):void + +Bind methods of the target object to always execute on its own context +(ovewritting the original function). + +See: [function/bind](./function.html#bind) + +```js +var view = { + name: 'Lorem Ipsum', + logNameOnClick: function() { + console.log(this.name); + } +}; + +// binds all methods by default +bindAll(view); +jQuery('#docs').on('click', view.logNameOnClick); +``` + +You can also specify the list of methods that you want to bind (in case you +just want to bind a few of them). + +```js +// only the listed methods will be bound to `obj` context +bindAll(obj, 'logNameOnClick', 'doAwesomeStuffOnDrag'); +``` + + + +## contains(obj, value):Boolean + +Similar to [Array/contains](array.html#contains). Checks if Object contains +value. + +```js +var obj = { + a: 1, + b: 2, + c: 'bar' +}; +contains(obj, 2); // true +contains(obj, 'foo'); // false +``` + + + +## deepEquals(a, b, [callback]):Boolean + +Recursively tests whether two objects contain the same keys and equal values. + +`callback` specifies the equality comparison function used to compare +non-object values. It defaults to using the strict equals (`===`) operator. + +If the values are both an object, it will recurse into the objects, checking if +their keys/values are equal. It will only check the keys and values contained +by the objects; it will not check the objects' prototypes. If the either of +the values are not objects, they will be checked using the `callback` function. + +Example: + +```js +deepEquals({ a: 1 }, { a: 1 }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 1 } }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 2 } }); // false +deepEquals({ value: { a: 1 } }, { value: { a: 1, b: 2 } }); // false +deepEquals({}, null); // false +deepEquals(null, null); // true +deepEquals( + { a: { b: 1 } }, + { a: { b: '1' } }, + function(a, b) { return a == b; }); // true +``` + +See: [`equals()`](#equals) + + + +## deepFillIn(target, ...objects):Object + +Fill missing properties recursively. + +It's different from `deepMixIn` since it won't override any existing property. +It's also different from `merge` since it won't clone child objects during the +process. + +It returns the target object and mutates it in place. + +See: [`fillIn()`](#fillIn), [`deepMixIn()`](#deepMixIn), [`merge()`](#merge) + +```js +var base = { + foo : { + bar : 123 + }, + lorem : 'ipsum' +}; +var options = deepFillIn({foo : { baz : 45 }, lorem : 'amet'}, base); +// > {foo: {bar:123, baz : 45}, lorem : 'amet'} +``` + + + +## deepMatches(target, pattern):Boolean + +Recursively checks if object contains all properties/value pairs. When both +the target and pattern values are arrays, it checks that the target value +contain matches for all the items in the pattern array (independent of order). + +```js +var john = { + name: 'John', + age: 22, + pets: [ + { type: 'cat', name: 'Grumpy Cat' }, + { type: 'dog', name: 'Hawk' } + ] +}; + +deepMatches(john, { name: 'John' }); // true +deepMatches(john, { age: 21 }); // false +deepMatches(john, { pets: [ { type: 'cat' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hawk' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hairball' } ] }); // false +``` + +See [`matches()`](#matches) + + + +## deepMixIn(target, ...objects):Object + +Mixes objects into the target object, recursively mixing existing child objects +as well. + +It will only recursively mix objects if both (existing and new) values are +plain objects. + +Returns the target object. Like [`merge()`](#merge), but mutates the target +object, and does not clone child objects. + +```js +var target = { + foo: { + name: "foo", + id: 1 + } +}; + +deepMixIn(target, { foo: { id: 2 } }); +console.log(target); // { foo: { name: "foo", id: 2 } } +``` + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## equals(a, b, [callback]):Boolean + +Tests whether two objects contain the same keys and values. + +`callback` specifies the equality comparison function used to compare the +values. It defaults to using the strict equals (`===`) operator. + +It will only check the keys and values contained by the objects; it will not +check the objects' prototypes. If either of the values are not objects, they +will be compared using the `callback` function. + +```js +equals({}, {}); // true +equals({ a: 1 }, { a: 1 }); // true +equals({ a: 1 }, { a: 2 }); // false +equals({ a: 1, b: 2 }, { a: 1 }); // false +equals({ a: 1 }, { a: 1, b: 2 }); // false +equals(null, null); // true +equals(null, {}); // false +equals({ a: 1 }, { a: '1' }, function(a, b) { return a == b; }); // true +``` + + + +## every(obj, callback, [thisObj]):Boolean + +Similar to [Array/every](array.html#every). Tests whether all properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + + + +## fillIn(obj, ...default):Object + +Fill in missing properties in object with values from the *defaults* objects. + + var base = { + foo : 'bar', + num : 123 + }; + + fillIn({foo:'ipsum'}, base); // {foo:'ipsum', num:123} + +PS: it allows merging multiple objects at once, the first ones will take +precedence. + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## filter(obj, callback, [thisObj]) + +Returns a new object containing all properties where `callback` returns true, +similar to Array/filter. It does not use properties from the object's +prototype. + +Callback receives the same arguments as `forOwn()`. + +See: [`forOwn()`](#forOwn), [`forIn()`](#forIn), [`pick()`](#pick) + +```js +var obj = { + foo: 'value', + bar: 'bar value' +}; + +// returns { bar: 'bar value' } +filter(obj, function(v) { return value.length > 5; }); + +// returns { foo: 'value' } +filter(obj, function(v, k) { return k === 'foo'; }); +``` + + + +## find(obj, callback, [thisObj]) + +Loops through all the properties in the Object and returns the first one that +passes a truth test (callback), similar to [Array/find](array.html#find). +Unlike Array/find, order of iteration is not guaranteed. + +```js +var obj = { + a: 'foo', + b: 12 +}; + +find(obj, isString); // 'foo' +find(obj, isNumber); // 12 +``` + + + +## forIn(obj, callback[, thisObj]) + +Iterate over all properties of an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +It **will** iterate over inherited (enumerable) properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forIn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 7 +console.log(keys); // ['foo', 'bar', 'lorem'] +``` + + + +## forOwn(obj, callback[, thisObj]) + +Iterate over all own properties from an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +Notice that it **won't** iterate over properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forIn()`](#forIn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +// will be ignored +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forOwn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 3 +console.log(keys); // ['foo', 'bar'] +``` + + + +## functions(obj):Array + +Returns a sorted list of all enumerable properties that have function values +(including inherited properties). + +```js +var obj = { + foo : function(){}, + bar : 'baz' +}; +functions(obj); // ['foo'] +``` + + + +## get(obj, propName):* + +Returns nested property value. Will return `undefined` if property doesn't +exist. + +See: [`set()`](#set), [`namespace()`](#namespace), [`has()`](#has) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +get(lorem, 'ipsum.dolor.sit'); // "amet" +get(lorem, 'foo.bar'); // undefined +``` + + + +## has(obj, propName):Boolean + +Checks if object contains a child property. Useful for cases where you need to +check if an object contain a *nested* property. It will get properties +inherited by the prototype. + +see: [`hasOwn()`](#hasOwn), [`get()`](#get) + +```js +var a = { + b : { + c : 123 + } + }; + +has(a, 'b.c'); // true +has(a, 'foo.c'); // false +``` + +### Common use case + +```js +if( has(a, 'foo.c') ){ // false + // ... +} + +if( a.foo.c ){ // ReferenceError: `foo` is not defined + // ... +} +``` + + + +## hasOwn(obj, propName):Boolean + +Safer `Object.hasOwnProperty`. Returns a boolean indicating whether the object +has the specified property. + +see: [`has()`](#has) + +```js +var obj = { + foo: 1, + hasOwnProperty : 'bar' +}; + +obj.hasOwnProperty('foo'); // ERROR! hasOwnProperty is not a function + +hasOwn(obj, 'foo'); // true +hasOwn(obj, 'hasOwnProperty'); // true +hasOwn(obj, 'toString'); // false +``` + + + +## keys(obj):Array + +Returns an array of all own enumerable properties found upon a given object. +It will use the native `Object.keys` if present. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`values()`](#values) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +keys(obj); // ['foo', 'bar', 'lorem'] +``` + + + +## map(obj, callback, [thisObj]):Object + +Returns a new object where the property values are the result of calling the +callback for each property in the original object, similar to Array/map. + +The callback function receives the same arguments as in `forOwn()`. + +See: [`forOwn()`](#forOwn) + +```js +var obj = { foo: 1, bar: 2 }, + data = { foo: 0, bar: 1 }; + +map(obj, function(v) { return v + 1; }); // { foo: 2, bar: 3 } +map(obj, function(v, k) { return k; }); // { foo: "foo", bar: "bar" } +map(obj, function(v, k) { return this[k]; }, data); // { foo: 0, bar: 1 } +``` + + + +## matches(obj, props):Boolean + +Checks if object contains all properties/values pairs. Useful for validation +and filtering. + +```js +var john = {age:25, hair:'long', beard:true}; +var mark = {age:27, hair:'short', beard:false}; +var hippie = {hair:'long', beard:true}; +matches(john, hippie); // true +matches(mark, hippie); // false +``` + +See [`deepMatches()`](#deepMatches) + + + +## merge(...objects):Object + +Deep merges objects. Note that objects and properties will be cloned during the +process to avoid undesired side effects. It return a new object and won't +affect source objects. + +```js +var obj1 = {a: {b: 1, c: 1, d: {e: 1, f: 1}}}; +var obj2 = {a: {b: 2, d : {f : 'yeah'} }}; + +merge(obj1, obj2); // {a: {b : 2, c : 1, d : {e : 1, f : 'yeah'}}} +``` + +See: [`deepMixIn()`](#deppMixIn), [`deepFillIn()`](#deepFillIn) + + + +## max(obj[, iterator]):* + +Returns maximum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/max](array.html#max). + +See: [`min()`](#min) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(obj[, iterator]):* + +Returns minimum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/min](array.html#min). + +See: [`max()`](#max) + +```js +min({a: 100, b: 2, c: 1, d: 3, e: 200}); // 1 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## mixIn(target, ...objects):Object + +Combine properties from all the objects into first one. + +This method affects target object in place, if you want to create a new Object +pass an empty object as first parameter. + +### Arguments + + 1. `target` (Object) : Target Object. + 2. `...objects` (...Object) : Objects to be combined (0...n objects). + +### Example + +```js +var a = {foo: "bar"}; +var b = {lorem: 123}; + +mixIn({}, a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar"} + +mixIn(a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar", lorem: 123} +``` + +See: [`fillIn()`](#fillIn), [`merge()`](#merge) + + + + +## namespace(obj, propName):Object + +Creates an empty object inside namespace if not existent. Will return created +object or existing object. + +See: [`get()`](#get), [`set()`](#set) + +```js +var obj = {}; +namespace(obj, 'foo.bar'); // {} +console.log(obj); // {foo:{bar:{}}} +``` + + + +## pick(obj, ...keys):Object + +Return a copy of the object that contains only the whitelisted keys. + +See: [`filter()`](#filter) + +```js +var user = { + firstName : 'John', + lastName : 'Doe', + dob : '1985/07/23', + gender : 'male' +}; + +// can pass an array of keys as second argument +var keys = ['firstName', 'dob'] +pick(user, keys); // {firstName:"John", dob: "1985/07/23"} + +// or multiple arguments +pick(user, 'firstName', 'lastName'); // {firstName:"John", lastName: "Doe"} +``` + + + +## pluck(obj, propName):Object + +Extract an object containing property values with keys as they appear in the +passed object. + +```js +var users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // {first: 'John', second: 'Mary'} ); +pluck(users, 'age'); // {first: 21, second: 25} ); +``` + + + +## reduce(obj, callback, initial, [thisObj]):* + +Similar to [Array/reduce](array.html#reduce). + +Apply a function against an accumulator and each property of the object (order +is undefined) as to reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + compare1.push(prev); + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + + + +## reject(obj, callback, thisObj):Object + +Returns a new object containing all properties where `callback` returns true, +similar to [Array/reject](array.html#reject). It does not use properties from +the object's prototype. Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // {b: 2, d: 4} +``` + + + +## values(obj):Array + +Returns an array of all own enumerable properties values found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +values(obj); // [1, 2, 3] +``` + + + +## set(obj, propName, value) + +Sets a nested property value. + +See: [`get()`](#get), [`namespace()`](#namespace) + +```js +var obj = {}; +set(obj, 'foo.bar', 123); +console.log(obj.foo.bar); // 123 +console.log(obj); // {foo:{bar:123}} +``` + + + +## size(obj):Number + +Returns the count of own enumerable properties found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +``` + + + +## some(obj, callback, [thisObj]):Boolean + +Similar to [Array/some](array.html#some). Tests whether any properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +``` + + + +## unset(obj, propName):Boolean + +Delete object property if existent and returns a boolean indicating succes. It +will also return `true` if property doesn't exist. + +Some properties can't be deleted, to understand why [check this +article](http://perfectionkills.com/understanding-delete/). + +See: [`set()`](#set) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +unset(lorem, 'ipsum.dolor.sit'); // true +console.log(lorem.ipsum.dolor); // {} +unset(lorem, 'foo.bar'); // true +``` diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md new file mode 100644 index 0000000..1be3c10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md @@ -0,0 +1,115 @@ +# queryString # + +Utilities for query string manipulation. + + + +## contains(url, paramName):Boolen + +Checks if query string contains parameter. + +### Arguments: + + 1. `url` (String) : URL or query string. + 2. `paramName` (String) : Parameter name. + +### Example: + +```js +var url = 'example.com/?lorem=ipsum'; +contains(url, 'lorem'); // true +contains(url, 'foo'); //false +``` + + + +## decode(queryStr[, shouldTypecast]):Object + +Parses query string and creates an object of keys => vals. + +Will typecast value with [`string/typecast`](string.html#typecast) by default +and decode string parameters using `decodeURIComponent()`. + +```js +var query = '?foo=bar&lorem=123'; +decode(query); // {foo: "bar", lorem: 123} +decode(query, false); // {foo: "bar", lorem: "123"} +``` + + +## encode(obj):String + +Encode object into a query string. + +Will encode parameters with `encodeURIComponent()`. + +```js +encode({foo: "bar", lorem: 123}); // "?foo=bar&lorem=123" +``` + + +## getParam(url, param[, shouldTypecast]):* + +Get query parameter value. + +Will typecast value with [`string/typecast`](string.html#typecast) by default. + +See: [`setParam()`](#setParam) + +### Arguments: + + 1. `url` (String) : Url. + 2. `param` (String) : Parameter name. + 3. `[shouldTypecast]` (Boolean) : If it should typecast value. + +### Example: + +```js +var url = 'example.com/?foo=bar&lorem=123&ipsum=false'; +getParam(url, 'dolor'); // "amet" +getParam(url, 'lorem'); // 123 +getParam(url, 'lorem', false); // "123" +``` + + +## parse(url[, shouldTypecast]):Object + +Parses URL, extracts query string and decodes it. + +It will typecast all properties of the query object unless second argument is +`false`. + +Alias to: `decode(getQuery(url))`. + +```js +var url = 'example.com/?lorem=ipsum&a=123'; +parse(url); // {lorem: "ipsum", a: 123} +parse(url, false); // {lorem: "ipsum", a: "123"} +``` + + +## getQuery(url):String + +Gets full query as string with all special chars decoded. + +```js +getQuery('example.com/?lorem=ipsum'); // "?lorem=ipsum" +``` + + +## setParam(url, paramName, value):String + +Add new query string parameter to URL or update existing value. + +See: [`getParam()`](#getParam) + +```js +setParam('?foo=bar&lorem=0', 'lorem', 'ipsum'); // '?foo=bar&lorem=ipsum' +setParam('?lorem=1', 'foo', 123); // '?lorem=1&foo=123' +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md new file mode 100644 index 0000000..b058b4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md @@ -0,0 +1,218 @@ +# random # + +Pseudo-random generators. + +mout uses `Math.random` by default on all the pseudo-random generators, if +you need a seeded random or a better algorithm see the [`random()`](#random) +documentation for instructions. + + + +## choice(...items):* + +Returns a random element from the supplied arguments or from an array if single +argument is an array. + +### Example: + +```js +choice(1, 2, 3, 4, 5); // 3 + +var arr = ['lorem', 'ipsum', 'dolor']; +choice(arr); // 'dolor' +``` + + + +## guid():String + +Generates a pseudo-random [Globally Unique Identifier](http://en.wikipedia.org/wiki/Globally_unique_identifier) (v4). + +Since the total number of GUIDs is 2122 the chance of generating the +same value twice is negligible. + +**Important:** this method uses `Math.random` by default so the UUID isn't +*safe* (sequence of outputs can be predicted in some cases), check the +[`random()`](#random) documentation for more info on how to replace the default +PRNG if you need extra safety or need *seeded* results. + +See: [`randHex()`](#randHex), [`random()`](#random) + +### Example: + +```js +guid(); // 830e9f50-ac7f-4369-a14f-ed0e62b2fa0b +guid(); // 5de3d09b-e79c-4727-932b-48c49228d508 +``` + + + +## rand([min], [max]):Number + +Gets a random number inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +rand(); // 448740433.55274725 +rand(); // -31797596.097682 +rand(0, 10); // 7.369723 +rand(0, 10); // 5.987042 +``` + +See: [`random()`](#random) + + + +## randBit():Number + +Returns a random "bit" (0 or 1). Useful for addition/subtraction. + +It's slightly faster than `choice(0, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randBit(); // 1 +randBit(); // 0 + +//same effect as +choice(0, 1); +``` + + + +## randHex([size]):String + +Returns a random hexadecimal string. + +The default `size` is `6`. + +### Example: + +```js +randHex(); // "dd8575" +randHex(); // "e6baeb" +randHex(2); // "a2" +randHex(30); // "effd7e2ad9a4a3067e30525fab983a" +``` + + + +## randInt([min], [max]):Number + +Gets a random integer inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +randInt(); // 448740433 +randInt(); // -31797596 +randInt(0, 10); // 7 +randInt(0, 10); // 5 +``` + + + +## randSign():Number + +Returns a random "sign" (-1 or 1). Useful for multiplications. + +It's slightly faster than `choice(-1, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randSign(); // -1 +randSign(); // 1 + +//same effect as +choice(-1, 1); +``` + + + +## random():Number + +Returns a random number between `0` and `1`. Same as `Math.random()`. + +```js +random(); // 0.35435103671625257 +random(); // 0.8768321881070733 +``` + +**Important:** No methods inside mout should call `Math.random()` +directly, they all use `random/random` as a proxy, that way we can +inject/replace the pseudo-random number generator if needed (ie. in case we +need a seeded random or a better algorithm than the native one). + +### Replacing the PRNG + +In some cases we might need better/different algorithms than the one provided +by `Math.random` (ie. safer, seeded). + +Because of licensing issues, file size limitations and different needs we +decided to **not** implement a custom PRNG and instead provide a easy way to +override the default behavior. - [issue #99](https://github.com/millermedeiros/amd-utils/issues/99) + +If you are using mout with a loader that supports the [AMD map +config](https://github.com/amdjs/amdjs-api/wiki/Common-Config), such as +[RequireJS](http://requirejs.org/), you can use it to replace the PRNG +(recommended approach): + +```js +requirejs.config({ + map : { + // all modules will load "my_custom_prng" instead of + // "mout/random/random" + '*' : { + 'mout/random/random' : 'my_custom_prng' + } + } +}); +``` + +You also have the option to override `random.get` in case you are using +mout on node.js or with a loader which doesn't support the map config: + +```js +// replace the PRNG +var n = 0; +random.get = function(){ + return ++n % 2? 0 : 1; // not so random :P +}; +random(); // 0 +random(); // 1 +random(); // 0 +random(); // 1 +``` + +See this [detailed explanation about PRNG in +JavaScript](http://baagoe.org/en/w/index.php/Better_random_numbers_for_javascript) +to understand the issues with the native `Math.random` and also for a list of +algorithms that could be used instead. + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md new file mode 100644 index 0000000..2b28231 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md @@ -0,0 +1,594 @@ +# string # + +String utilities. + + +## camelCase(str):String + +Convert string to "camelCase" text. + +See: [`pascalCase()`](#pascalCase), [`unCamelCase()`](#unCamelCase) + +### Example + +```js +camelCase('lorem-ipsum-dolor'); // "loremIpsumDolor" +camelCase('lorem ipsum dolor'); // "loremIpsumDolor" +``` + + + +## contains(str, substring, [fromIndex]):Boolean + +Checks if string contains the given substring. + +See: [`startsWith()`](#startsWith), [`endsWith()`](#endsWith) + +### Example + +```js +contains('lorem', 'or'); // true +contains('lorem', 'bar'); // false +``` + + + +## crop(str, maxChars, [append]):String + +Truncate string at full words. Alias to `truncate(str, maxChars, append, true);`. + +See: [`truncate()`](#truncate) + +### Example + +```js +crop('lorem ipsum dolor', 10); // "lorem..." +crop('lorem ipsum dolor', 10, '+'); // "lorem+" +``` + + + +## endsWith(str, suffix):Boolean + +Checks if string ends with specified suffix. + +See: [`startsWith()`](#startsWith), [`contains()`](#contains) + +### Example + +```js +endsWith('lorem ipsum', 'lorem'); // false +endsWith('lorem ipsum', 'ipsum'); // true +``` + + + +## escapeHtml(str):String + +Escapes HTML special chars (`>`, `<`, `&`, `"`, `'`). + +See: [`unescapeHtml()`](#unescapeHtml) + +### Example + +```js +escapeHtml('lorem & "ipsum"'); // "lorem &amp; &quot;ipsum&quot;" +``` + + + +## escapeRegExp(str):String + +Escape special chars to be used as literals in RegExp constructors. + +### Example + +```js +str = escapeRegExp('[lorem.ipsum]'); // "\\[lorem\\.ipsum\\]" +reg = new RegExp(str); // /\[lorem\.ipsum\]/ +``` + + + +## escapeUnicode(str[, shouldEscapePrintable]):String + +Unicode escape chars. + +It will only escape non-printable ASCII chars unless `shouldEscapePrintable` is +set to `true`. + +See: [`unescapeUnicode()`](#unescapeUnicode) + +```js +escapeUnicode('føo bår'); +// > "f\u00f8o b\u00e5r" +escapeUnicode('føo bår', true); +// > "\u0066\u00f8\u006f\u0020\u0062\u00e5\u0072" +``` + + + +## hyphenate(str):String + +Replaces spaces with hyphens, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`underscore()`](#underscore), +[`unhyphenate`](#unhyphenate) + +```js +hyphenate(' %# lorem ipsum ? $ dolor'); // "lorem-ipsum-dolor" +hyphenate('spéçïãl çhârs'); // "special-chars" +hyphenate('loremIpsum'); // "lorem-ipsum" +``` + + + +## interpolate(str, replacements[, syntax]):String + +String interpolation. Format/replace tokens with object properties. + +```js +var tmpl = 'Hello {{name}}!'; +interpolate(tmpl, {name: 'World'}); // "Hello World!" +interpolate(tmpl, {name: 'Lorem Ipsum'}); // "Hello Lorem Ipsum!" +``` + +It uses a mustache-like syntax by default but you can set your own format if +needed. You can also use Arrays for the replacements (since Arrays are +objects as well): + +```js +// matches everything inside "${}" +var syntax = /\$\{([^}]+)\}/g; +var tmpl = "Hello ${0}!"; +interpolate(tmpl, ['Foo Bar'], syntax); // "Hello Foo Bar!" +``` + + + +## lowerCase(str):String + +"Safer" `String.toLowerCase()`. (Used internally) + +### Example + +```js +(null).toLowerCase(); // Error! +(undefined).toLowerCase(); // Error! +lowerCase(null); // "" +lowerCase(undefined); // "" +``` + + + +## lpad(str, minLength[, char]):String + +Pad string from left with `char` if its' length is smaller than `minLen`. + +See: [`rpad()`](#rpad) + +### Example + +```js +lpad('a', 5); // " a" +lpad('a', 5, '-'); // "----a" +lpad('abc', 3, '-'); // "abc" +lpad('abc', 4, '-'); // "-abc" +``` + + + +## ltrim(str, [chars]):String + +Remove chars or white-spaces from beginning of string. + +`chars` is an array of chars to remove from the beginning of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`rtrim()`](#rtrim), [`trim()`](#trim) + +### Example + +```js +ltrim(' lorem ipsum '); // "lorem ipsum " +ltrim('--lorem ipsum--', ['-']); // "lorem ipsum--" +``` + + + +## makePath(...args):String + +Group arguments as path segments, if any of the args is `null` or `undefined` +it will be ignored from resulting path. It will also remove duplicate "/". + +See: [`array/join()`](array.html#join) + +### Example + +```js +makePath('lorem', 'ipsum', null, 'dolor'); // "lorem/ipsum/dolor" +makePath('foo///bar/'); // "foo/bar/" +``` + + + +## normalizeLineBreaks(str, [lineBreak]):String + +Normalize line breaks to a single format. Defaults to Unix `\n`. + +It handles DOS (`\r\n`), Mac (`\r`) and Unix (`\n`) formats. + +### Example + +```js +// "foo\nbar\nlorem\nipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum'); + +// "foo\rbar\rlorem\ripsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', '\r'); + +// "foo bar lorem ipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', ' '); +``` + + + +## pascalCase(str):String + +Convert string to "PascalCase" text. + +See: [`camelCase()`](#camelCase) + +### Example + +```js +pascalCase('lorem-ipsum-dolor'); // "LoremIpsumDolor" +pascalCase('lorem ipsum dolor'); // "LoremIpsumDolor" +``` + + + +## properCase(str):String + +UPPERCASE first char of each word, lowercase other chars. + +### Example + +```js +properCase('loRem iPSum'); // "Lorem Ipsum" +``` + + + +## removeNonASCII(str):String + +Remove [non-printable ASCII +chars](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + +### Example + +```js +removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'); // "lorem-ipsum" +``` + + + +## removeNonWord(str):String + +Remove non-word chars. + +### Example + +```js +var str = 'lorem ~!@#$%^&*()_+`-={}[]|\\:";\'/?><., ipsum'; +removeNonWord(str); // "lorem - ipsum" +``` + + + +## repeat(str, n):String + +Repeat string n-times. + +### Example + +```js +repeat('a', 3); // "aaa" +repeat('bc', 2); // "bcbc" +repeat('a', 0); // "" +``` + + + +## replace(str, search, replacements):String + +Replace string(s) with the replacement(s) in the source. + +`search` and `replacements` can be an array, or a single item. For every item +in `search`, it will call `str.replace` with the search item and the matching +replacement in `replacements`. If `replacements` only contains one replacement, +it will be used for all the searches, otherwise it will use the replacement at +the same index as the search. + +### Example + +```js +replace('foo bar', 'foo', 'test'); // "test bar" +replace('test 1 2', ['1', '2'], 'n'); // "test n n" +replace('test 1 2', ['1', '2'], ['one', 'two']); // "test one two" +replace('123abc', [/\d/g, /[a-z]/g], ['0', '.']); // "000..." +``` + + + +## replaceAccents(str):String + +Replaces all accented chars with regular ones. + +**Important:** Only covers **Basic Latin** and **Latin-1** unicode chars. + +### Example + +```js +replaceAccents('spéçïãl çhârs'); // "special chars" +``` + + + +## rpad(str, minLength[, char]):String + +Pad string from right with `char` if its' length is smaller than `minLen`. + +See: [`lpad()`](#lpad) + +### Example + +```js +rpad('a', 5); // "a " +rpad('a', 5, '-'); // "a----" +rpad('abc', 3, '-'); // "abc" +rpad('abc', 4, '-'); // "abc-" +``` + + + +## rtrim(str, [chars]):String + +Remove chars or white-spaces from end of string. + +`chars` is an array of chars to remove from the end of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`trim()`](#trim), [`ltrim()`](#ltrim) + +### Example + +```js +rtrim(' lorem ipsum '); // " lorem ipsum" +rtrim('--lorem ipsum--', ['-']); // "--lorem ipsum" +``` + + + +## sentenceCase(str):String + +UPPERCASE first char of each sentence and lowercase other chars. + +### Example + +```js +var str = 'Lorem IpSum DoLOr. maeCeNnas Ullamcor.'; +sentenceCase(str); // "Lorem ipsum dolor. Maecennas ullamcor." +``` + + + +## stripHtmlTags(str):String + +Remove HTML/XML tags from string. + +### Example + +```js +var str = '

    lorem ipsum

    '; +stripHtmlTags(str); // "lorem ipsum" +``` + + + +## startsWith(str, prefix):Boolean + +Checks if string starts with specified prefix. + +See: [`endsWith()`](#endsWith), [`contains()`](#contains) + +### Example + +```js +startsWith('lorem ipsum', 'lorem'); // true +startsWith('lorem ipsum', 'ipsum'); // false +``` + + + +## slugify(str[, delimeter]):String + +Convert to lower case, remove accents, remove non-word chars and replace spaces +with the delimeter. The default delimeter is a hyphen. + +Note that this does not split camelCase text. + +See: [`hyphenate()`](#hyphenate) and [`underscore()`](#underscore) + +### Example + +```js +var str = 'loremIpsum dolor spéçïãl chârs'; +slugify(str); // "loremipsum-dolor-special-chars" +slugify(str, '_'); // "loremipsum_dolor_special_chars" +``` + + + +## trim(str, [chars]):String + +Remove chars or white-spaces from beginning and end of string. + +`chars` is an array of chars to remove from the beginning and end of the +string. If `chars` is not specified, Unicode whitespace chars will be used +instead. + +See: [`rtrim()`](#rtrim), [`ltrim()`](#ltrim) + +### Example + +```js +trim(' lorem ipsum '); // "lorem ipsum" +trim('-+-lorem ipsum-+-', ['-', '+']); // "lorem ipsum" +``` + + + +## truncate(str, maxChars, [append], [onlyFullWords]):String + +Limit number of chars. Returned string `length` will be `<= maxChars`. + +See: [`crop()`](#crop) + +### Arguments + + 1. `str` (String) : String + 2. `maxChars` (Number) : Maximum number of characters including `append.length`. + 3. `[append]` (String) : Value that should be added to the end of string. + Defaults to "...". + 4. `[onlyFullWords]` (Boolean) : If it shouldn't break words. Default is + `false`. (favor [`crop()`](#crop) since code will be clearer). + +### Example + +```js +truncate('lorem ipsum dolor', 11); // "lorem ip..." +truncate('lorem ipsum dolor', 11, '+'); // "lorem ipsu+" +truncate('lorem ipsum dolor', 11, null, true); // "lorem..." +``` + + + +## typecast(str):* + +Parses string and convert it into a native value. + +### Example + +```js +typecast('lorem ipsum'); // "lorem ipsum" +typecast('123'); // 123 +typecast('123.45'); // 123.45 +typecast('false'); // false +typecast('true'); // true +typecast('null'); // null +typecast('undefined'); // undefined +``` + + + +## unCamelCase(str, [delimiter]):String + +Add the delimiter between camelCase text and convert first char of each word to +lower case. + +The delimiter defaults to a space character. + +See: [`camelCase()`][#camelCase] + +### Example + +```js +unCamelCase('loremIpsumDolor'); // "lorem ipsum dolor" +unCamelCase('loremIpsumDolor', '-'); // "lorem-ipsum-color" +``` + + +## underscore(str):String + +Replaces spaces with underscores, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`hyphenate()`](#hyphenate) + +```js +underscore(' %# lorem ipsum ? $ dolor'); // "lorem_ipsum_dolor" +underscore('spéçïãl çhârs'); // "special_chars" +underscore('loremIpsum'); // "lorem_ipsum" +``` + + + +## unescapeHtml(str):String + +Unescapes HTML special chars (`>`, `<`, `&`, `"`, `'`). + +See: [`escapeHtml()`](#escapeHtml) + +### Example + +```js +unescapeHtml('lorem &amp; &quot;ipsum&quot;'); // 'lorem & "ipsum"' +``` + + + +## unescapeUnicode(str):String + +Unescapes unicode char sequences. + +See: [`escapeUnicode()`](#escapeUnicode) + +```js +unescapeUnicode('\\u0066\\u00f8\\u006f\\u0020\\u0062\\u00e5\\u0072'); +// > 'føo bår' +``` + + + +## unhyphenate(str):String + +Replaces hyphens with spaces. (only hyphens between word chars) + +See : [`hyphenate()`](#hyphenate) + +### Example + +```js +unhyphenate('lorem-ipsum-dolor'); // "lorem ipsum dolor" +``` + + +## upperCase(str):String + +"Safer" `String.toUpperCase()`. (Used internally) + +### Example + +```js +(null).toUpperCase(); // Error! +(undefined).toUpperCase(); // Error! +upperCase(null); // "" +upperCase(undefined); // "" +``` + + + +## WHITE_SPACES:Array + +Constant array of all [Unicode white-space +characters](http://en.wikipedia.org/wiki/Whitespace_character). + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md new file mode 100644 index 0000000..628c2a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md @@ -0,0 +1,64 @@ +# time # + +Utilities for time manipulation. + + +## convert(value, sourceUnit, [destinationUnit]):Number + +Converts time between units. + +Available units: `millisecond`, `second`, `minute`, `hour`, `day`, `week`. +Abbreviations: `ms`, `s`, `m`, `h`, `d`, `w`. + +We do **not** support year and month as a time unit since their values are not +fixed. + +The default `destinationUnit` is `ms`. + +```js +convert(1, 'minute'); // 60000 +convert(2.5, 's', 'ms'); // 2500 +convert(2, 'm', 's'); // 120 +convert(500, 'ms', 's'); // 0.5 +``` + + + +## now():Number + +Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. +Uses `Date.now()` if available. + +### Example + +```js +now(); // 1335449614650 +``` + + + +## parseMs(ms):Object + +Parse timestamp (milliseconds) into an object `{milliseconds:number, +seconds:number, minutes:number, hours:number, days:number}`. + +### Example + +```js +// {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} +parseMs(2348765454); +``` + + + +## toTimeString(ms):String + +Convert timestamp (milliseconds) into a time string in the format "[H:]MM:SS". + +### Example + +```js +toTimeString(12513); // "00:12" +toTimeString(951233); // "15:51" +toTimeString(8765235); // "2:26:05" +``` diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js new file mode 100644 index 0000000..43a16ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js @@ -0,0 +1,18 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js new file mode 100644 index 0000000..71bc125 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js @@ -0,0 +1,23 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + module.exports = bind; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js new file mode 100644 index 0000000..8cd5c5f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js @@ -0,0 +1,23 @@ + + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + module.exports = compose; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js new file mode 100644 index 0000000..a0ed07f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js @@ -0,0 +1,29 @@ + + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + return debounced; + } + + module.exports = debounce; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js new file mode 100644 index 0000000..b81bf0a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + module.exports = func; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js new file mode 100644 index 0000000..767610a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js @@ -0,0 +1,34 @@ +var prop = require('./prop'); +var deepMatches = require('../object/deepMatches'); + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + switch(typeof src) { + case 'object': + // typeof null == "object" + return (src != null)? function(val, key, target){ + return deepMatches(val, src); + } : src; + case 'string': + case 'number': + return prop(src); + case 'function': + if (typeof thisObj === 'undefined') { + return src; + } else { + return function(val, i, arr){ + return src.call(thisObj, val, i, arr); + }; + } + default: + return src; + } + } + + module.exports = makeIterator; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js new file mode 100644 index 0000000..d63ff1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js @@ -0,0 +1,19 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + module.exports = partial; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js new file mode 100644 index 0000000..734acb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + module.exports = prop; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js new file mode 100644 index 0000000..25159c2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js @@ -0,0 +1,22 @@ + + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + module.exports = series; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js new file mode 100644 index 0000000..619dc54 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js @@ -0,0 +1,32 @@ +var now = require('../time/now'); + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + cur, diff, prev = 0; + function delayed(){ + prev = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + cur = now(); + diff = delay - (cur - prev); + if (diff <= 0) { + clearTimeout(timeout); + prev = cur; + result = fn.apply(context, args); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + return throttled; + } + + module.exports = throttle; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js new file mode 100644 index 0000000..e0d21a6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js @@ -0,0 +1,21 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + module.exports = timeout; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js new file mode 100644 index 0000000..32a1c63 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js @@ -0,0 +1,24 @@ +/**@license + * mout v0.6.0 | http://moutjs.com | MIT license + */ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'VERSION' : '0.6.0', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js new file mode 100644 index 0000000..b981621 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js @@ -0,0 +1,36 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toString' : require('./lang/toString') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js new file mode 100644 index 0000000..33c4e94 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js @@ -0,0 +1,49 @@ +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); +var mixIn = require('../object/mixIn'); + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + module.exports = clone; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js new file mode 100644 index 0000000..bbc14c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js @@ -0,0 +1,18 @@ +var mixIn = require('../object/mixIn'); + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + module.exports = createObject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js new file mode 100644 index 0000000..d68dc50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js @@ -0,0 +1,17 @@ + + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + module.exports = ctorApply; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js new file mode 100644 index 0000000..25fd95f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js @@ -0,0 +1,48 @@ +var clone = require('./clone'); +var forOwn = require('../object/forOwn'); +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + module.exports = deepClone; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js new file mode 100644 index 0000000..1111b2e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js @@ -0,0 +1,17 @@ +var toArray = require('./toArray'); +var find = require('../array/find'); + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + module.exports = defaults; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js new file mode 100644 index 0000000..cd8a379 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js @@ -0,0 +1,16 @@ +var createObject = require('./createObject'); + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + } + + module.exports = inheritPrototype; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js new file mode 100644 index 0000000..4a83573 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js @@ -0,0 +1,23 @@ + + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + module.exports = is; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js new file mode 100644 index 0000000..f7b08ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js @@ -0,0 +1,15 @@ +var isKind = require('./isKind'); + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + module.exports = isArgs; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js new file mode 100644 index 0000000..262ee40 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + module.exports = isArray; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js new file mode 100644 index 0000000..86557cb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + module.exports = isBoolean; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js new file mode 100644 index 0000000..4a5130f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + module.exports = isDate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js new file mode 100644 index 0000000..0e9f77d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js @@ -0,0 +1,24 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('./isArray'); + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + module.exports = isEmpty; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js new file mode 100644 index 0000000..6d4006f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js @@ -0,0 +1,21 @@ +var isNumber = require('./isNumber'); + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + module.exports = isFinite; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js new file mode 100644 index 0000000..216879f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + module.exports = isFunction; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js new file mode 100644 index 0000000..29f95d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js @@ -0,0 +1,12 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + module.exports = isInteger; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js new file mode 100644 index 0000000..02301e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js @@ -0,0 +1,9 @@ +var kindOf = require('./kindOf'); + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + module.exports = isKind; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js new file mode 100644 index 0000000..f6efeb1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js @@ -0,0 +1,15 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || val != +val; + } + + module.exports = isNaN; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js new file mode 100644 index 0000000..6252f9e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js @@ -0,0 +1,9 @@ + + /** + */ + function isNull(val){ + return val === null; + } + module.exports = isNull; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js new file mode 100644 index 0000000..126c1cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + module.exports = isNumber; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js new file mode 100644 index 0000000..7350c89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + module.exports = isObject; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js new file mode 100644 index 0000000..0d2d7b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js @@ -0,0 +1,14 @@ + + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value + && typeof value === 'object' + && value.constructor === Object); + } + + module.exports = isPlainObject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js new file mode 100644 index 0000000..fc5459a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + module.exports = isRegExp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js new file mode 100644 index 0000000..f890658 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + module.exports = isString; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js new file mode 100644 index 0000000..fb2261d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js @@ -0,0 +1,10 @@ + + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + module.exports = isUndef; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js new file mode 100644 index 0000000..9dad58c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js @@ -0,0 +1,12 @@ +var is = require('./is'); + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + module.exports = isnt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js new file mode 100644 index 0000000..663464d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js @@ -0,0 +1,20 @@ + + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + module.exports = kindOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js new file mode 100644 index 0000000..e39b873 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js @@ -0,0 +1,31 @@ +var kindOf = require('./kindOf'); + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + module.exports = toArray; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js new file mode 100644 index 0000000..ae5c2b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js @@ -0,0 +1,13 @@ + + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + module.exports = toString; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js new file mode 100644 index 0000000..c6ee889 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js @@ -0,0 +1,19 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js new file mode 100644 index 0000000..a279e15 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js @@ -0,0 +1,11 @@ + + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + module.exports = ceil; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js new file mode 100644 index 0000000..e929a9a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js @@ -0,0 +1,9 @@ + + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + module.exports = clamp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js new file mode 100644 index 0000000..60ac90c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js @@ -0,0 +1,16 @@ + + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + module.exports = countSteps; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js new file mode 100644 index 0000000..9de5053 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js @@ -0,0 +1,10 @@ + + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + module.exports = floor; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js new file mode 100644 index 0000000..763218f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js @@ -0,0 +1,11 @@ + + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + module.exports = inRange; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js new file mode 100644 index 0000000..45486b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js @@ -0,0 +1,9 @@ + + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + module.exports = isNear; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js new file mode 100644 index 0000000..111e271 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js @@ -0,0 +1,11 @@ + + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + module.exports = lerp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js new file mode 100644 index 0000000..35207c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js @@ -0,0 +1,10 @@ + + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + module.exports = loop; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js new file mode 100644 index 0000000..96c4b78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js @@ -0,0 +1,11 @@ +var lerp = require('./lerp'); +var norm = require('./norm'); + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + module.exports = map; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js new file mode 100644 index 0000000..54caf78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js @@ -0,0 +1,9 @@ + + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + module.exports = norm; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js new file mode 100644 index 0000000..d108e6c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js @@ -0,0 +1,12 @@ + + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + module.exports = round; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js new file mode 100644 index 0000000..0b6186c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js @@ -0,0 +1,21 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js new file mode 100644 index 0000000..1d6f0e4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ + + module.exports = 2147483647; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js new file mode 100644 index 0000000..700da0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ + + module.exports = 4294967295; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js new file mode 100644 index 0000000..b34ab2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ + + module.exports = -2147483648; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js new file mode 100644 index 0000000..dd6716b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js @@ -0,0 +1,35 @@ +var enforcePrecision = require('./enforcePrecision'); + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + module.exports = abbreviateNumber; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js new file mode 100644 index 0000000..1cf0249 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js @@ -0,0 +1,26 @@ + + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + module.exports = currencyFormat; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js new file mode 100644 index 0000000..f73a92d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js @@ -0,0 +1,13 @@ + + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + * @example `enforcePrecision(0.615, 2) -> 0.62`, `(0.615).toFixed(2) -> + * 0.61` + */ + function enforcePrecision(val, nDecimalDigits){ + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + module.exports = enforcePrecision; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js new file mode 100644 index 0000000..da75270 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js @@ -0,0 +1,12 @@ +var lpad = require('../string/lpad'); + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + return lpad(''+ n, minLength, char || '0'); + } + + module.exports = pad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js new file mode 100644 index 0000000..ecd58da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + module.exports = rol; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js new file mode 100644 index 0000000..2eda81d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + module.exports = ror; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js new file mode 100644 index 0000000..b854a4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js @@ -0,0 +1,15 @@ + + + /** + * Get sign of the value. + */ + function sign(val) { + var num = Number(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + module.exports = sign; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js new file mode 100644 index 0000000..bcefae0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js @@ -0,0 +1,15 @@ + + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + return ~~val; + } + + module.exports = toInt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js new file mode 100644 index 0000000..5290b62 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js @@ -0,0 +1,13 @@ + + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + return val >>> 0; + } + + module.exports = toUInt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js new file mode 100644 index 0000000..fcc5a97 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js @@ -0,0 +1,13 @@ +var MAX_INT = require('./MAX_INT'); + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + module.exports = toUInt31; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js new file mode 100644 index 0000000..76c0642 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js @@ -0,0 +1,42 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js new file mode 100644 index 0000000..b2f27d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js @@ -0,0 +1,18 @@ +var functions = require('./functions'); +var bind = require('../function/bind'); +var forEach = require('../array/forEach'); + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + Array.prototype.slice.call(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + module.exports = bindAll; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js new file mode 100644 index 0000000..8076e2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js @@ -0,0 +1,13 @@ +var some = require('./some'); + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + module.exports = contains; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js new file mode 100644 index 0000000..fcde944 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js @@ -0,0 +1,27 @@ +var isObject = require('../lang/isObject'); +var equals = require('./equals'); + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + module.exports = deepEquals; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js new file mode 100644 index 0000000..d27db44 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js @@ -0,0 +1,32 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) + && isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + module.exports = deepFillIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js new file mode 100644 index 0000000..3366c52 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js @@ -0,0 +1,55 @@ +var forOwn = require('./forOwn'); +var isArray = require('../lang/isArray'); + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + module.exports = deepMatches; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js new file mode 100644 index 0000000..a97e98d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js @@ -0,0 +1,34 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + module.exports = deepMixIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js new file mode 100644 index 0000000..f50cbe4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js @@ -0,0 +1,36 @@ +var hasOwn = require('./hasOwn'); +var every = require('./every'); +var isObject = require('../lang/isObject'); + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + module.exports = equals; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js new file mode 100644 index 0000000..01106e5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js @@ -0,0 +1,23 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + module.exports = every; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js new file mode 100644 index 0000000..80dcdf0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js @@ -0,0 +1,20 @@ +var forEach = require('../array/forEach'); +var forOwn = require('./forOwn'); + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(Array.prototype.slice.call(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + module.exports = fillIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js new file mode 100644 index 0000000..3a83a92 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + module.exports = filterValues; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js new file mode 100644 index 0000000..d39c070 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js @@ -0,0 +1,21 @@ +var some = require('./some'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + module.exports = find; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js new file mode 100644 index 0000000..367f08c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js @@ -0,0 +1,62 @@ + + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + if (_hasDontEnumBug) { + while (key = _dontEnums[i++]) { + // since we aren't using hasOwn check we need to make sure the + // property was overwritten + if (obj[key] !== Object.prototype[key]) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + module.exports = forIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js new file mode 100644 index 0000000..5f2dfbf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js @@ -0,0 +1,19 @@ +var hasOwn = require('./hasOwn'); +var forIn = require('./forIn'); + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + module.exports = forOwn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js new file mode 100644 index 0000000..f571797 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js @@ -0,0 +1,18 @@ +var forIn = require('./forIn'); + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + module.exports = functions; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js new file mode 100644 index 0000000..6673561 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js @@ -0,0 +1,20 @@ + + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object') return; + } + + return obj[last]; + } + + module.exports = get; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js new file mode 100644 index 0000000..ca9f228 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js @@ -0,0 +1,15 @@ +var get = require('./get'); + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + module.exports = has; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js new file mode 100644 index 0000000..7e3c82a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js @@ -0,0 +1,12 @@ + + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + module.exports = hasOwn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js new file mode 100644 index 0000000..dd2f4f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + module.exports = keys; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js new file mode 100644 index 0000000..dd449a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js @@ -0,0 +1,18 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + module.exports = mapValues; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js new file mode 100644 index 0000000..6074faa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + module.exports = matches; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js new file mode 100644 index 0000000..3e8e92c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js @@ -0,0 +1,12 @@ +var arrMax = require('../array/max'); +var values = require('./values'); + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + module.exports = max; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js new file mode 100644 index 0000000..6961f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js @@ -0,0 +1,40 @@ +var hasOwn = require('./hasOwn'); +var deepClone = require('../lang/deepClone'); +var isObject = require('../lang/isObject'); + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + module.exports = merge; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js new file mode 100644 index 0000000..e1e6697 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js @@ -0,0 +1,12 @@ +var arrMin = require('../array/min'); +var values = require('./values'); + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + module.exports = min; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js new file mode 100644 index 0000000..55ec8fd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js @@ -0,0 +1,28 @@ +var forOwn = require('./forOwn'); + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + module.exports = mixIn; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js new file mode 100644 index 0000000..c6e79f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js @@ -0,0 +1,19 @@ +var forEach = require('../array/forEach'); + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + module.exports = namespace; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js new file mode 100644 index 0000000..74e56f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js @@ -0,0 +1,18 @@ + + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : Array.prototype.slice.call(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + module.exports = pick; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js new file mode 100644 index 0000000..e844df4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js @@ -0,0 +1,13 @@ +var map = require('./map'); +var prop = require('../function/prop'); + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js new file mode 100644 index 0000000..6f19a3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js @@ -0,0 +1,29 @@ +var forOwn = require('./forOwn'); +var size = require('./size'); + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + module.exports = reduce; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js new file mode 100644 index 0000000..7464379 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + module.exports = reject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js new file mode 100644 index 0000000..9b3cdc4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js @@ -0,0 +1,17 @@ +var namespace = require('./namespace'); + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + module.exports = set; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js new file mode 100644 index 0000000..9788595 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + module.exports = size; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js new file mode 100644 index 0000000..384c6f3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js @@ -0,0 +1,21 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + module.exports = some; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js new file mode 100644 index 0000000..343bca0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js @@ -0,0 +1,23 @@ +var has = require('./has'); + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + module.exports = unset; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js new file mode 100644 index 0000000..265a693 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + module.exports = values; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json new file mode 100644 index 0000000..a3c1682 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json @@ -0,0 +1,119 @@ +{ + "name": "mout", + "description": "Modular Utilities", + "version": "0.6.0", + "homepage": "http://moutjs.com/", + "contributors": [ + { + "name": "Adam Nowotny" + }, + { + "name": "André Cruz", + "email": "amdfcruz@gmail.com" + }, + { + "name": "Conrad Zimmerman", + "url": "http://www.conradz.com" + }, + { + "name": "Friedemann Altrock", + "email": "frodenius@gmail.com" + }, + { + "name": "Jarrod Overson", + "url": "http://jarrodoverson.com" + }, + { + "name": "Miller Medeiros", + "email": "contact@millermedeiros.com", + "url": "http://blog.millermedeiros.com" + }, + { + "name": "Zach Shipley" + } + ], + "keywords": [ + "utilities", + "functional", + "amd-utils", + "stdlib" + ], + "repository": { + "type": "git", + "url": "git://github.com/mout/mout.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "bugs": { + "url": "https://github.com/mout/mout/issues/" + }, + "main": "./index.js", + "scripts": { + "prepublish": "node build cjs .", + "pretest": "node build pkg", + "test": "node node_modules/istanbul/lib/cli test tests/runner.js --hook-run-in-context" + }, + "directories": { + "doc": "./doc" + }, + "devDependencies": { + "istanbul": "~0.1.27", + "jasmine-node": "~1.2.2", + "requirejs": "2.x", + "nodefy": "*", + "mdoc": "~0.3.2", + "handlebars": "~1.0.6", + "commander": "~1.0.5", + "rocambole": "~0.2.3" + }, + "testling": { + "preprocess": "node build testling", + "browsers": { + "ie": [ + 7, + 8, + 9, + 10 + ], + "firefox": [ + 17, + "nightly" + ], + "chrome": [ + 23, + "canary" + ], + "opera": [ + 12, + "next" + ], + "safari": [ + 5.1, + 6 + ], + "iphone": [ + 6 + ], + "ipad": [ + 6 + ] + }, + "scripts": [ + "tests/lib/jasmine/jasmine.js", + "tests/lib/jasmine/jasmine.async.js", + "tests/lib/jasmine/jasmine-tap.js", + "tests/lib/requirejs/require.js", + "tests/testling/src.js", + "tests/testling/specs.js", + "tests/runner.js" + ] + }, + "readme": "![mout](http://moutjs.com/logo.png \"Modular JavaScript Utilties\")\n\nhttp://moutjs.com/\n\n[![Build Status](https://travis-ci.org/mout/mout.png?branch=master)](https://travis-ci.org/mout/mout)\n\nAll code is library agnostic and consist mostly of helper methods that aren't\ndirectly related with the DOM, the purpose of this library isn't to replace\nDojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common\nproblems that aren't solved by most of them. Consider it as a crossbrowser\nJavaScript standard library.\n\n\n\n## Main goals ##\n\n - increase code reuse;\n - be clear (code should be clean/readable);\n - be easy to debug;\n - be easy to maintain;\n - follow best practices;\n - follow standards when possible;\n - **don't convert JavaScript into another language!**\n - be compatible with other frameworks;\n - be modular;\n - have unit tests for all modules;\n - work on multiple environments (IE7+, modern browsers, node.js);\n\n\n\n## What shouldn't be here ##\n\n - UI components;\n - CSS selector engine;\n - Event system - pub/sub;\n - Template engine;\n - Anything that isn't generic enough to be on a standard library;\n - Anything that could be a separate library and/or isn't a modular utility...\n\n\n\n## API Documentation ##\n\nOnline documentation can be found at http://moutjs.com/ or inside the\n`doc` folder.\n\n\n\n## FAQ / Wiki / IRC ##\n\nFor more info about project structure, design decisions, tips, how to\ncontribute, build system, etc, please check the [project\nwiki](https://github.com/mout/mout/wiki).\n\nWe also have an IRC channel [#moutjs on\nirc.freenode.net](http://webchat.freenode.net/?channels=moutjs)\n\n\n\n## License ##\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n\n", + "readmeFilename": "README.md", + "_id": "mout@0.6.0", + "_from": "mout@~0.6.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js new file mode 100644 index 0000000..22685a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js @@ -0,0 +1,15 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js new file mode 100644 index 0000000..da678cf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js @@ -0,0 +1,12 @@ +var getQuery = require('./getQuery'); + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + module.exports = contains; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js new file mode 100644 index 0000000..7e68999 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js @@ -0,0 +1,21 @@ +var typecast = require('../string/typecast'); +var isString = require('../lang/isString'); + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + n = queryArr.length, + obj = {}, + item, val; + while (n--) { + item = queryArr[n].split('='); + val = shouldTypecast === false? item[1] : typecast(item[1]); + obj[item[0]] = isString(val)? decodeURIComponent(val) : val; + } + return obj; + } + + module.exports = decode; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js new file mode 100644 index 0000000..6d2b12f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js @@ -0,0 +1,15 @@ +var forOwn = require('../object/forOwn'); + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = []; + forOwn(obj, function(val, key){ + query.push( key +'='+ encodeURIComponent(val) ); + }); + return (query.length)? '?'+ query.join('&') : ''; + } + + module.exports = encode; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js new file mode 100644 index 0000000..f149c3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js @@ -0,0 +1,15 @@ +var typecast = require('../string/typecast'); +var getQuery = require('./getQuery'); + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + module.exports = getParam; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js new file mode 100644 index 0000000..5194af2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js @@ -0,0 +1,13 @@ + + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + module.exports = getQuery; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js new file mode 100644 index 0000000..532906c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js @@ -0,0 +1,13 @@ +var decode = require('./decode'); +var getQuery = require('./getQuery'); + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + module.exports = parse; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js new file mode 100644 index 0000000..052a9ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js @@ -0,0 +1,28 @@ + + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + module.exports = setParam; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js new file mode 100644 index 0000000..d9267f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js @@ -0,0 +1,16 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js new file mode 100644 index 0000000..51aa82a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js @@ -0,0 +1,15 @@ +var randInt = require('./randInt'); +var isArray = require('../lang/isArray'); + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + module.exports = choice; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js new file mode 100644 index 0000000..41f6edd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js @@ -0,0 +1,24 @@ +var randHex = require('./randHex'); +var choice = require('./choice'); + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + module.exports = guid; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js new file mode 100644 index 0000000..782dec8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js @@ -0,0 +1,15 @@ +var random = require('./random'); +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + module.exports = rand; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js new file mode 100644 index 0000000..bd20b4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js @@ -0,0 +1,11 @@ +var random = require('./random'); + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return random() > 0.5? 1 : 0; + } + + module.exports = randomBit; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js new file mode 100644 index 0000000..d8d711c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js @@ -0,0 +1,19 @@ +var choice = require('./choice'); + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + module.exports = randHex; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js new file mode 100644 index 0000000..e237d96 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js @@ -0,0 +1,18 @@ +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); +var rand = require('./rand'); + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + module.exports = randInt; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js new file mode 100644 index 0000000..5a9fed7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js @@ -0,0 +1,11 @@ +var random = require('./random'); + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return random() > 0.5? 1 : -1; + } + + module.exports = randomSign; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js new file mode 100644 index 0000000..670a3cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js @@ -0,0 +1,18 @@ + + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + module.exports = random; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js new file mode 100644 index 0000000..7bcc961 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js @@ -0,0 +1,46 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js new file mode 100644 index 0000000..549d875 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js @@ -0,0 +1,21 @@ +define(function () { + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + return append; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js new file mode 100644 index 0000000..8f60cda --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js @@ -0,0 +1,26 @@ +define(['./append', '../function/makeIterator_'], function (append, makeIterator) { + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + return collect; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js new file mode 100644 index 0000000..22efb86 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js @@ -0,0 +1,22 @@ +define(['./indexOf'], function (indexOf) { + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + return combine; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js new file mode 100644 index 0000000..02a8109 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js @@ -0,0 +1,13 @@ +define(['./filter'], function (filter) { + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + return compact; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js new file mode 100644 index 0000000..fca4f7c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js @@ -0,0 +1,10 @@ +define(['./indexOf'], function (indexOf) { + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + return contains; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js new file mode 100644 index 0000000..819bda3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js @@ -0,0 +1,19 @@ +define(['./unique', './filter', './some', './contains'], function (unique, filter, some, contains) { + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return difference; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js new file mode 100644 index 0000000..78ba46d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + return every; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js new file mode 100644 index 0000000..52cf685 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js @@ -0,0 +1,26 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return filter; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js new file mode 100644 index 0000000..3957dcd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js @@ -0,0 +1,13 @@ +define(['./findIndex'], function (findIndex) { + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + return find; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js new file mode 100644 index 0000000..59dfeeb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js @@ -0,0 +1,23 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + return findIndex; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js new file mode 100644 index 0000000..42e87f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js @@ -0,0 +1,42 @@ +define(['../lang/isArray', './append'], function (isArray, append) { + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + return flatten; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js new file mode 100644 index 0000000..0e04586 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + return forEach; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js new file mode 100644 index 0000000..0e75f99 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + return indexOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js new file mode 100644 index 0000000..d8d831f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js @@ -0,0 +1,14 @@ +define(['./difference', '../lang/toArray'], function (difference, toArray) { + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(toArray(arguments).slice(1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + return insert; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js new file mode 100644 index 0000000..64e6ee9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js @@ -0,0 +1,20 @@ +define(['./unique', './filter', './every', './contains'], function (unique, filter, every, contains) { + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return intersection; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js new file mode 100644 index 0000000..a2e78b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js @@ -0,0 +1,23 @@ +define(['./forEach'], function (forEach) { + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = Array.prototype.slice.call(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + return invoke; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js new file mode 100644 index 0000000..2c618d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js @@ -0,0 +1,17 @@ +define(['./filter'], function(filter) { + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + return join; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js new file mode 100644 index 0000000..931235f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + return lastIndexOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js new file mode 100644 index 0000000..1580b48 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js @@ -0,0 +1,22 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + return map; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js new file mode 100644 index 0000000..a7326c8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js @@ -0,0 +1,34 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return max; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js new file mode 100644 index 0000000..4164448 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js @@ -0,0 +1,34 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return min; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js new file mode 100644 index 0000000..97d7f59 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js @@ -0,0 +1,14 @@ +define(['../random/randInt'], function (randInt) { + + /** + * Remove a random item from the Array and return it + */ + function pick(arr){ + if (arr == null || !arr.length) return; + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + return pick; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js new file mode 100644 index 0000000..c908856 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js @@ -0,0 +1,12 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js new file mode 100644 index 0000000..148ebf9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js @@ -0,0 +1,27 @@ +define(['../math/countSteps'], function (countSteps) { + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + return range; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js new file mode 100644 index 0000000..88aacfd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js @@ -0,0 +1,33 @@ +define(['./forEach'], function (forEach) { + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + return reduce; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js new file mode 100644 index 0000000..ddae0e7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js @@ -0,0 +1,34 @@ +define(function () { + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + return reduceRight; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js new file mode 100644 index 0000000..db105dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js @@ -0,0 +1,25 @@ +define(['./forEach', '../function/makeIterator_'], function(forEach, makeIterator) { + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return reject; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js new file mode 100644 index 0000000..dec9134 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js @@ -0,0 +1,13 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + return remove; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js new file mode 100644 index 0000000..e81022b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js @@ -0,0 +1,15 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + return removeAll; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js new file mode 100644 index 0000000..f5a6097 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js @@ -0,0 +1,28 @@ +define(['../random/randInt', './forEach'], function (randInt, forEach) { + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + return shuffle; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js new file mode 100644 index 0000000..e46a978 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + return some; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js new file mode 100644 index 0000000..4c19404 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js @@ -0,0 +1,55 @@ +define(function () { + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + return mergeSort; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js new file mode 100644 index 0000000..a17275e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js @@ -0,0 +1,35 @@ +define(function() { + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + return split; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js new file mode 100644 index 0000000..aac8fd1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js @@ -0,0 +1,28 @@ +define(['../lang/isFunction'], function (isFunction) { + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + return toLookup; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js new file mode 100644 index 0000000..5f9922e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js @@ -0,0 +1,18 @@ +define(['./unique', './append'], function (unique, append) { + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + return union; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js new file mode 100644 index 0000000..c4bd23b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js @@ -0,0 +1,16 @@ +define(['./indexOf', './filter'], function(indexOf, filter){ + + /** + * @return {array} Array of unique items + */ + function unique(arr){ + return filter(arr, isUnique); + } + + function isUnique(item, i, arr){ + return indexOf(arr, item, i+1) === -1; + } + + return unique; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js new file mode 100644 index 0000000..7df89d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js @@ -0,0 +1,24 @@ +define(['./unique', './filter', './contains'], function (unique, filter, contains) { + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + return xor; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js new file mode 100644 index 0000000..374cd28 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js @@ -0,0 +1,27 @@ +define(['./max', './pluck', './map'], function (max, pluck, map) { + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1, + item; + while (++i < len) { + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + return zip; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js new file mode 100644 index 0000000..386e6da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js @@ -0,0 +1,22 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js new file mode 100644 index 0000000..192167e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { + + /** + */ + return make(arrContains, objContains); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js new file mode 100644 index 0000000..6317f50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { + + /** + */ + return make(arrEvery, objEvery); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js new file mode 100644 index 0000000..4e7fadc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js @@ -0,0 +1,22 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + return filter; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js new file mode 100644 index 0000000..681f941 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/find', '../object/find'], function(make, arrFind, objFind) { + + /** + * Find value that returns true on iterator check. + */ + return make(arrFind, objFind); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js new file mode 100644 index 0000000..3b39d3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { + + /** + */ + return make(arrForEach, objForEach); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js new file mode 100644 index 0000000..312e056 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js @@ -0,0 +1,19 @@ +define(function(){ + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = Array.prototype.slice.call(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + return makeCollectionMethod; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js new file mode 100644 index 0000000..96e2498 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js @@ -0,0 +1,20 @@ +define(['../lang/isObject', '../object/values', '../array/map', '../function/makeIterator_'], function (isObject, values, arrMap, makeIterator) { + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + return map; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js new file mode 100644 index 0000000..de9a6da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { + + /** + * Get maximum value inside collection + */ + return make(arrMax, objMax); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js new file mode 100644 index 0000000..f0c239a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { + + /** + * Get minimum value inside collection. + */ + return make(arrMin, objMin); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js new file mode 100644 index 0000000..ef784a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js @@ -0,0 +1,14 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js new file mode 100644 index 0000000..bd05d43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { + + /** + */ + return make(arrReduce, objReduce); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js new file mode 100644 index 0000000..581adfd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + return reject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js new file mode 100644 index 0000000..4e5ab41 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js @@ -0,0 +1,18 @@ +define(['../lang/isArray', '../object/size'], function (isArray, objSize) { + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + return size; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js new file mode 100644 index 0000000..c0aebee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { + + /** + */ + return make(arrSome, objSome); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js new file mode 100644 index 0000000..4d44915 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js @@ -0,0 +1,21 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js new file mode 100644 index 0000000..dc77ae1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + return dayOfTheYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js new file mode 100644 index 0000000..667165f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js @@ -0,0 +1,128 @@ +define(['./totalDaysInMonth', './totalDaysInYear', '../time/convert'], function(totalDaysInMonth, totalDaysInYear, convert){ + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + return diff; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js new file mode 100644 index 0000000..5e640c2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js @@ -0,0 +1,61 @@ +define(function(){ + // en-US (English, United States) + return { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js new file mode 100644 index 0000000..47256dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ +define(function(){ + // pt-BR (Brazillian Portuguese) + return { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js new file mode 100644 index 0000000..c04ce88 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js @@ -0,0 +1,13 @@ +define(['../object/mixIn', './i18n/en-US'], function(mixIn, enUS){ + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + return activeLocale; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js new file mode 100644 index 0000000..e400b43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js @@ -0,0 +1,15 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + return isLeapYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js new file mode 100644 index 0000000..f30531f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js @@ -0,0 +1,16 @@ +define(['./startOf'], function (startOf) { + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + return isSame; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js new file mode 100644 index 0000000..9a2aacb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js @@ -0,0 +1,146 @@ +define(['../array/some'], function (some) { + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + var match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else if ((match = TIME_ZONE.exec(str))) { + var match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + return parseISO8601; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js new file mode 100644 index 0000000..747f114 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js @@ -0,0 +1,54 @@ +define(['../lang/clone'], function (clone) { + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + return startOf; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js new file mode 100644 index 0000000..dd78250 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js @@ -0,0 +1,113 @@ +define(['../number/pad', './i18n_', './dayOfTheYear', './timezoneOffset', './timezoneAbbr', './weekOfTheYear'], function (pad, i18n, dayOfTheYear, timezoneOffset, timezoneAbbr, weekOfTheYear) { + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + return strftime; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js new file mode 100644 index 0000000..225a685 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +define(['./timezoneOffset'], function(timezoneOffset) { + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + return timezoneAbbr; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js new file mode 100644 index 0000000..ca06705 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js @@ -0,0 +1,16 @@ +define(['../number/pad'], function (pad) { + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + return timezoneOffset; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js new file mode 100644 index 0000000..98f7e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js @@ -0,0 +1,24 @@ +define(['../lang/isDate', './isLeapYear'], function (isDate, isLeapYear) { + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + return totalDaysInMonth; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js new file mode 100644 index 0000000..e9036b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +define(['./isLeapYear'], function (isLeapYear) { + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + return totalDaysInYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js new file mode 100644 index 0000000..8dabc45 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +define(['./dayOfTheYear'], function (dayOfTheYear) { + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + return weekOfTheYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js new file mode 100644 index 0000000..23f4fd7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js @@ -0,0 +1,18 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js new file mode 100644 index 0000000..09e5e20 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js @@ -0,0 +1,23 @@ +define(function(){ + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + return bind; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js new file mode 100644 index 0000000..d8b228f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + return compose; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js new file mode 100644 index 0000000..21644ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js @@ -0,0 +1,29 @@ +define(function () { + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + return debounced; + } + + return debounce; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js new file mode 100644 index 0000000..b920e00 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + return func; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js new file mode 100644 index 0000000..deb6e13 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js @@ -0,0 +1,33 @@ +define(['./prop', '../object/deepMatches'], function(prop, deepMatches) { + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + switch(typeof src) { + case 'object': + // typeof null == "object" + return (src != null)? function(val, key, target){ + return deepMatches(val, src); + } : src; + case 'string': + case 'number': + return prop(src); + case 'function': + if (typeof thisObj === 'undefined') { + return src; + } else { + return function(val, i, arr){ + return src.call(thisObj, val, i, arr); + }; + } + default: + return src; + } + } + + return makeIterator; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js new file mode 100644 index 0000000..ad73074 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js @@ -0,0 +1,19 @@ +define(function () { + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + return partial; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js new file mode 100644 index 0000000..c9df78c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + return prop; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js new file mode 100644 index 0000000..c8856a2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js @@ -0,0 +1,22 @@ +define(function () { + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + return series; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js new file mode 100644 index 0000000..8ce3929 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js @@ -0,0 +1,32 @@ +define(['../time/now'], function (now) { + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + cur, diff, prev = 0; + function delayed(){ + prev = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + cur = now(); + diff = delay - (cur - prev); + if (diff <= 0) { + clearTimeout(timeout); + prev = cur; + result = fn.apply(context, args); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + return throttled; + } + + return throttle; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js new file mode 100644 index 0000000..15388bd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js @@ -0,0 +1,21 @@ +define(function () { + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + return timeout; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js new file mode 100644 index 0000000..744bb11 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js @@ -0,0 +1,24 @@ +/**@license + * mout v0.6.0 | http://moutjs.com | MIT license + */ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'VERSION' : '0.6.0', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js new file mode 100644 index 0000000..de16b59 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js @@ -0,0 +1,36 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toString' : require('./lang/toString') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js new file mode 100644 index 0000000..468489a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js @@ -0,0 +1,47 @@ +define(['./kindOf', './isPlainObject', '../object/mixIn'], function (kindOf, isPlainObject, mixIn) { + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + return clone; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js new file mode 100644 index 0000000..f766150 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js @@ -0,0 +1,18 @@ +define(['../object/mixIn'], function(mixIn){ + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + return createObject; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js new file mode 100644 index 0000000..a9ac1c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js @@ -0,0 +1,17 @@ +define(function () { + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + return ctorApply; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js new file mode 100644 index 0000000..d45c10a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js @@ -0,0 +1,45 @@ +define(['./clone', '../object/forOwn', './kindOf', './isPlainObject'], function (clone, forOwn, kindOf, isPlainObject) { + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + return deepClone; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js new file mode 100644 index 0000000..5156b1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js @@ -0,0 +1,16 @@ +define(['./toArray', '../array/find'], function (toArray, find) { + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + return defaults; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js new file mode 100644 index 0000000..c1fda3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js @@ -0,0 +1,16 @@ +define(['./createObject'], function(createObject){ + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + } + + return inheritPrototype; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js new file mode 100644 index 0000000..261a207 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + return is; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js new file mode 100644 index 0000000..f889ee8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js @@ -0,0 +1,15 @@ +define(['./isKind'], function (isKind) { + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + return isArgs; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js new file mode 100644 index 0000000..886e2aa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + return isArray; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js new file mode 100644 index 0000000..1ca27a6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + return isBoolean; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js new file mode 100644 index 0000000..2708d67 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + return isDate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js new file mode 100644 index 0000000..4cc3d2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js @@ -0,0 +1,23 @@ +define(['../object/forOwn', './isArray'], function (forOwn, isArray) { + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + return isEmpty; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js new file mode 100644 index 0000000..5a982f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js @@ -0,0 +1,21 @@ +define(['./isNumber'], function (isNumber) { + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + return isFinite; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js new file mode 100644 index 0000000..ff5df7f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + return isFunction; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js new file mode 100644 index 0000000..1931f51 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js @@ -0,0 +1,12 @@ +define(['./isNumber'], function (isNumber) { + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + return isInteger; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js new file mode 100644 index 0000000..6937a12 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js @@ -0,0 +1,9 @@ +define(['./kindOf'], function (kindOf) { + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + return isKind; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js new file mode 100644 index 0000000..9467a3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js @@ -0,0 +1,15 @@ +define(['./isNumber'], function (isNumber) { + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || val != +val; + } + + return isNaN; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js new file mode 100644 index 0000000..506e05e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js @@ -0,0 +1,9 @@ +define(function () { + /** + */ + function isNull(val){ + return val === null; + } + return isNull; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js new file mode 100644 index 0000000..9a832c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + return isNumber; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js new file mode 100644 index 0000000..0befb06 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + return isObject; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js new file mode 100644 index 0000000..6c5854f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value + && typeof value === 'object' + && value.constructor === Object); + } + + return isPlainObject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js new file mode 100644 index 0000000..d78a03d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + return isRegExp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js new file mode 100644 index 0000000..8a42fe0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + return isString; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js new file mode 100644 index 0000000..c57b28e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js @@ -0,0 +1,10 @@ +define(function () { + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + return isUndef; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js new file mode 100644 index 0000000..d433622 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js @@ -0,0 +1,12 @@ +define(['./is'], function (is) { + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + return isnt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js new file mode 100644 index 0000000..97d21d1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js @@ -0,0 +1,20 @@ +define(function () { + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + return kindOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js new file mode 100644 index 0000000..552916f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js @@ -0,0 +1,31 @@ +define(['./kindOf'], function (kindOf) { + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + return toArray; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js new file mode 100644 index 0000000..c28b89a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + return toString; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js new file mode 100644 index 0000000..e2ba870 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js @@ -0,0 +1,19 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js new file mode 100644 index 0000000..d73b058 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + return ceil; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js new file mode 100644 index 0000000..fb5a148 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + return clamp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js new file mode 100644 index 0000000..0ecb32f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js @@ -0,0 +1,16 @@ +define(function(){ + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + return countSteps; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js new file mode 100644 index 0000000..8a4456b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + return floor; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js new file mode 100644 index 0000000..0c89053 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + return inRange; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js new file mode 100644 index 0000000..b308a0b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + return isNear; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js new file mode 100644 index 0000000..26b99d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + return lerp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js new file mode 100644 index 0000000..c735ecf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + return loop; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js new file mode 100644 index 0000000..bf7dc5d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js @@ -0,0 +1,10 @@ +define(['./lerp', './norm'], function(lerp, norm){ + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + return map; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js new file mode 100644 index 0000000..fccae20 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + return norm; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js new file mode 100644 index 0000000..b43e4ac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js @@ -0,0 +1,12 @@ +define(function () { + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + return round; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js new file mode 100644 index 0000000..cb52fc7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js @@ -0,0 +1,21 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js new file mode 100644 index 0000000..23a6e1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ +define(function(){ + return 2147483647; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js new file mode 100644 index 0000000..a035096 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ +define(function(){ + return 4294967295; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js new file mode 100644 index 0000000..9b3e978 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ +define(function(){ + return -2147483648; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js new file mode 100644 index 0000000..7e7405a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js @@ -0,0 +1,35 @@ +define(['./enforcePrecision'], function (enforcePrecision) { + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + return abbreviateNumber; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js new file mode 100644 index 0000000..dcde8fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js @@ -0,0 +1,26 @@ +define(function () { + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + return currencyFormat; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js new file mode 100644 index 0000000..84554d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js @@ -0,0 +1,13 @@ +define(function(){ + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + * @example `enforcePrecision(0.615, 2) -> 0.62`, `(0.615).toFixed(2) -> + * 0.61` + */ + function enforcePrecision(val, nDecimalDigits){ + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + return enforcePrecision; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js new file mode 100644 index 0000000..3b2c062 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js @@ -0,0 +1,12 @@ +define(['../string/lpad'], function(lpad){ + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + return lpad(''+ n, minLength, char || '0'); + } + + return pad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js new file mode 100644 index 0000000..a148f44 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + return rol; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js new file mode 100644 index 0000000..b5c66f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + return ror; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js new file mode 100644 index 0000000..dfc131d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js @@ -0,0 +1,15 @@ +define(function () { + + /** + * Get sign of the value. + */ + function sign(val) { + var num = Number(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + return sign; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js new file mode 100644 index 0000000..1e9b4c0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js @@ -0,0 +1,15 @@ +define(function(){ + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + return ~~val; + } + + return toInt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js new file mode 100644 index 0000000..d5b25b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + return val >>> 0; + } + + return toUInt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js new file mode 100644 index 0000000..9785a05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js @@ -0,0 +1,13 @@ +define(['./MAX_INT'], function(MAX_INT){ + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + return toUInt31; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js new file mode 100644 index 0000000..343e782 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js @@ -0,0 +1,42 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js new file mode 100644 index 0000000..b131ed1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js @@ -0,0 +1,16 @@ +define(['./functions', '../function/bind', '../array/forEach'], function (functions, bind, forEach) { + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + Array.prototype.slice.call(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + return bindAll; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js new file mode 100644 index 0000000..297e898 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js @@ -0,0 +1,13 @@ +define(['./some'], function (some) { + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + return contains; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js new file mode 100644 index 0000000..8b7d5d1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js @@ -0,0 +1,26 @@ +define(['../lang/isObject', './equals'], function (isObject, equals) { + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + return deepEquals; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js new file mode 100644 index 0000000..84ba154 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js @@ -0,0 +1,31 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) + && isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + return deepFillIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js new file mode 100644 index 0000000..2eae629 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js @@ -0,0 +1,54 @@ +define(['./forOwn', '../lang/isArray'], function(forOwn, isArray) { + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + return deepMatches; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js new file mode 100644 index 0000000..1b4178e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js @@ -0,0 +1,33 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + return deepMixIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js new file mode 100644 index 0000000..596cb95 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js @@ -0,0 +1,34 @@ +define(['./hasOwn', './every', '../lang/isObject'], function(hasOwn, every, isObject) { + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + return equals; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js new file mode 100644 index 0000000..52983a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js @@ -0,0 +1,22 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + return every; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js new file mode 100644 index 0000000..0845d3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js @@ -0,0 +1,19 @@ +define(['../array/forEach', './forOwn'], function (forEach, forOwn) { + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(Array.prototype.slice.call(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + return fillIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js new file mode 100644 index 0000000..f213b91 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js @@ -0,0 +1,19 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + return filterValues; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js new file mode 100644 index 0000000..47e6b09 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js @@ -0,0 +1,20 @@ +define(['./some', '../function/makeIterator_'], function(some, makeIterator) { + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + return find; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js new file mode 100644 index 0000000..2058e9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js @@ -0,0 +1,62 @@ +define(function () { + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + if (_hasDontEnumBug) { + while (key = _dontEnums[i++]) { + // since we aren't using hasOwn check we need to make sure the + // property was overwritten + if (obj[key] !== Object.prototype[key]) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + return forIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js new file mode 100644 index 0000000..b40cbaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js @@ -0,0 +1,18 @@ +define(['./hasOwn', './forIn'], function (hasOwn, forIn) { + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + return forOwn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js new file mode 100644 index 0000000..60fee3d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js @@ -0,0 +1,18 @@ +define(['./forIn'], function (forIn) { + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + return functions; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js new file mode 100644 index 0000000..ca80b05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js @@ -0,0 +1,20 @@ +define(function () { + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object') return; + } + + return obj[last]; + } + + return get; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js new file mode 100644 index 0000000..cc29817 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js @@ -0,0 +1,15 @@ +define(['./get'], function (get) { + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + return has; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js new file mode 100644 index 0000000..5c53bcf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + return hasOwn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js new file mode 100644 index 0000000..ed7c4f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + return keys; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js new file mode 100644 index 0000000..2958f6b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js @@ -0,0 +1,17 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + return mapValues; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js new file mode 100644 index 0000000..73ff427 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js @@ -0,0 +1,20 @@ +define(['./forOwn'], function (forOwn) { + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + return matches; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js new file mode 100644 index 0000000..ef311dc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js @@ -0,0 +1,11 @@ +define(['../array/max', './values'], function(arrMax, values) { + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + return max; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js new file mode 100644 index 0000000..d7cfede --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js @@ -0,0 +1,38 @@ +define(['./hasOwn', '../lang/deepClone', '../lang/isObject'], function (hasOwn, deepClone, isObject) { + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + return merge; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js new file mode 100644 index 0000000..9fb4c1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js @@ -0,0 +1,11 @@ +define(['../array/min', './values'], function(arrMin, values) { + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + return min; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js new file mode 100644 index 0000000..6210b7e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js @@ -0,0 +1,28 @@ +define(['./forOwn'], function(forOwn){ + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + return mixIn; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js new file mode 100644 index 0000000..7ed65db --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js @@ -0,0 +1,19 @@ +define(['../array/forEach'], function (forEach) { + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + return namespace; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js new file mode 100644 index 0000000..76e22bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js @@ -0,0 +1,18 @@ +define(function(){ + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : Array.prototype.slice.call(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + return pick; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js new file mode 100644 index 0000000..d47744b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js @@ -0,0 +1,12 @@ +define(['./map', '../function/prop'], function (map, prop) { + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js new file mode 100644 index 0000000..d3a5778 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js @@ -0,0 +1,28 @@ +define(['./forOwn', './size'], function(forOwn, size) { + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + return reduce; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js new file mode 100644 index 0000000..8429642 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + return reject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js new file mode 100644 index 0000000..b8fa25a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js @@ -0,0 +1,17 @@ +define(['./namespace'], function (namespace) { + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + return set; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js new file mode 100644 index 0000000..c6e377c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + return size; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js new file mode 100644 index 0000000..1bd6fda --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js @@ -0,0 +1,20 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + return some; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js new file mode 100644 index 0000000..787fc19 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js @@ -0,0 +1,23 @@ +define(['./has'], function (has) { + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + return unset; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js new file mode 100644 index 0000000..b311fd0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + return values; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js new file mode 100644 index 0000000..4434612 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js @@ -0,0 +1,15 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js new file mode 100644 index 0000000..a6d11cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js @@ -0,0 +1,12 @@ +define(['./getQuery'], function (getQuery) { + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + return contains; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js new file mode 100644 index 0000000..02bc160 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js @@ -0,0 +1,20 @@ +define(['../string/typecast', '../lang/isString'], function (typecast, isString) { + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + n = queryArr.length, + obj = {}, + item, val; + while (n--) { + item = queryArr[n].split('='); + val = shouldTypecast === false? item[1] : typecast(item[1]); + obj[item[0]] = isString(val)? decodeURIComponent(val) : val; + } + return obj; + } + + return decode; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js new file mode 100644 index 0000000..bd72a5b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js @@ -0,0 +1,15 @@ +define(['../object/forOwn'], function (forOwn) { + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = []; + forOwn(obj, function(val, key){ + query.push( key +'='+ encodeURIComponent(val) ); + }); + return (query.length)? '?'+ query.join('&') : ''; + } + + return encode; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js new file mode 100644 index 0000000..d981372 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js @@ -0,0 +1,14 @@ +define(['../string/typecast', './getQuery'], function (typecast, getQuery) { + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + return getParam; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js new file mode 100644 index 0000000..aa3d99f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + return getQuery; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js new file mode 100644 index 0000000..ac153e3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js @@ -0,0 +1,12 @@ +define(['./decode', './getQuery'], function (decode, getQuery) { + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + return parse; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js new file mode 100644 index 0000000..97081aa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + return setParam; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js new file mode 100644 index 0000000..b2641ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js @@ -0,0 +1,16 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js new file mode 100644 index 0000000..0d0c38d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js @@ -0,0 +1,14 @@ +define(['./randInt', '../lang/isArray'], function (randInt, isArray) { + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + return choice; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js new file mode 100644 index 0000000..82f3a2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js @@ -0,0 +1,23 @@ +define(['./randHex', './choice'], function (randHex, choice) { + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + return guid; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js new file mode 100644 index 0000000..b8c231d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js @@ -0,0 +1,13 @@ +define(['./random', '../number/MIN_INT', '../number/MAX_INT'], function(random, MIN_INT, MAX_INT){ + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + return rand; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js new file mode 100644 index 0000000..b3422d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js @@ -0,0 +1,11 @@ +define(['./random'], function (random) { + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return random() > 0.5? 1 : 0; + } + + return randomBit; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js new file mode 100644 index 0000000..6e9bf1c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js @@ -0,0 +1,19 @@ +define(['./choice'], function (choice) { + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + return randHex; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js new file mode 100644 index 0000000..1750e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js @@ -0,0 +1,16 @@ +define(['../number/MIN_INT', '../number/MAX_INT', './rand'], function(MIN_INT, MAX_INT, rand){ + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + return randInt; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js new file mode 100644 index 0000000..4141cdf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js @@ -0,0 +1,11 @@ +define(['./random'], function (random) { + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return random() > 0.5? 1 : -1; + } + + return randomSign; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js new file mode 100644 index 0000000..4270822 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js @@ -0,0 +1,18 @@ +define(function () { + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + return random; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js new file mode 100644 index 0000000..3f5fd80 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js @@ -0,0 +1,45 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js new file mode 100644 index 0000000..e830d86 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ +define(function() { + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + return [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js new file mode 100644 index 0000000..02e6c04 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './upperCase', './lowerCase'], function(toString, replaceAccents, removeNonWord, upperCase, lowerCase){ + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + return camelCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js new file mode 100644 index 0000000..825b5a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString) { + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + return contains; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js new file mode 100644 index 0000000..3c073f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './truncate'], function (toString, truncate) { + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + return crop; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js new file mode 100644 index 0000000..31a73f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function(toString) { + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + return endsWith; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js new file mode 100644 index 0000000..de34b61 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + return escapeHtml; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js new file mode 100644 index 0000000..32facac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js @@ -0,0 +1,15 @@ +define(['../lang/toString'], function(toString) { + + var ESCAPE_CHARS = /[\\.+*?\^$\[\](){}\/'#]/g; + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + str = toString(str); + return str.replace(ESCAPE_CHARS,'\\$&'); + } + + return escapeRegExp; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js new file mode 100644 index 0000000..bd5e8c4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js @@ -0,0 +1,21 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + return escapeUnicode; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js new file mode 100644 index 0000000..679c405 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + return hyphenate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js new file mode 100644 index 0000000..ecb8ba8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function(toString) { + + var stache = /\{\{(\w+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return (prop in replacements)? toString(replacements[prop]) : ''; + }; + return template.replace(syntax || stache, replaceFn); + } + + return interpolate; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js new file mode 100644 index 0000000..b045d69 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + return lowerCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js new file mode 100644 index 0000000..ea4f5fb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './repeat'], function(toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return ((str.length < minLen) + ? repeat(ch, minLen - str.length) + str : str); + } + + return lpad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js new file mode 100644 index 0000000..477df95 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js @@ -0,0 +1,33 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + return ltrim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js new file mode 100644 index 0000000..7aa7bab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js @@ -0,0 +1,13 @@ +define(['../array/join'], function(join){ + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(Array.prototype.slice.call(arguments), '/'); + return result.replace(/\/{2,}/g, '/'); + } + + return makePath; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js new file mode 100644 index 0000000..44e4194 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + return normalizeLineBreaks; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js new file mode 100644 index 0000000..ead9ead --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './camelCase', './upperCase'], function(toString, camelCase, upperCase){ + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + return pascalCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js new file mode 100644 index 0000000..2987b50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + return properCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js new file mode 100644 index 0000000..4905869 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + return removeNonASCII; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js new file mode 100644 index 0000000..2b1a204 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-_]/g, ''); + } + + return removeNonWord; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js new file mode 100644 index 0000000..02f5659 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function(toString){ + + /** + * Repeat string n times + */ + function repeat(str, n){ + str = toString(str); + return (new Array(n + 1)).join(str); + } + + return repeat; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js new file mode 100644 index 0000000..8b762fd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js @@ -0,0 +1,32 @@ +define(['../lang/toString', '../lang/toArray'], function (toString, toArray) { + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + return replace; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js new file mode 100644 index 0000000..3a63f55 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js @@ -0,0 +1,36 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + return replaceAccents; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js new file mode 100644 index 0000000..2efd9c8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js @@ -0,0 +1,14 @@ +define(['../lang/toString', './repeat'], function (toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + return rpad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js new file mode 100644 index 0000000..a4cc282 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js @@ -0,0 +1,32 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + return rtrim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js new file mode 100644 index 0000000..cfe45af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js @@ -0,0 +1,13 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + return sentenceCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js new file mode 100644 index 0000000..c6d68c7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js @@ -0,0 +1,21 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './trim'], function(toString, replaceAccents, removeNonWord, trim){ + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + return slugify; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js new file mode 100644 index 0000000..88ae545 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function (toString) { + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + return startsWith; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js new file mode 100644 index 0000000..e8da956 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + return stripHtmlTags; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js new file mode 100644 index 0000000..5552604 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './WHITE_SPACES', './ltrim', './rtrim'], function(toString, WHITE_SPACES, ltrim, rtrim){ + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + return trim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js new file mode 100644 index 0000000..34000d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js @@ -0,0 +1,20 @@ +define(['../lang/toString', './trim'], function(toString, trim){ + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + return truncate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js new file mode 100644 index 0000000..a7c8315 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js @@ -0,0 +1,29 @@ +define(function () { + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + return typecast; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js new file mode 100644 index 0000000..eeef39b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js @@ -0,0 +1,23 @@ +define(['../lang/toString'], function(toString){ + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + return unCamelCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js new file mode 100644 index 0000000..75dd464 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + return underscore; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js new file mode 100644 index 0000000..173c69c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/'/g , "'") + .replace(/"/g, '"'); + return str; + } + + return unescapeHtml; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js new file mode 100644 index 0000000..d4a7ba1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +define(['../lang/toString'], function(toString) { + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + return unescapeUnicode; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js new file mode 100644 index 0000000..6ac2fa4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + return unhyphenate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js new file mode 100644 index 0000000..8b2073e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + return upperCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js new file mode 100644 index 0000000..67c9068 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js @@ -0,0 +1,12 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js new file mode 100644 index 0000000..2de0cf2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js @@ -0,0 +1,41 @@ +define(function () { + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + return convert; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js new file mode 100644 index 0000000..a3a38bc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Get current time in miliseconds + */ + var now = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + return now; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js new file mode 100644 index 0000000..964929a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js @@ -0,0 +1,17 @@ +define(['../math/countSteps'], function(countSteps){ + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + return parseMs; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js new file mode 100644 index 0000000..edf1821 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js @@ -0,0 +1,23 @@ +define(['../math/countSteps', '../number/pad'], function(countSteps, pad){ + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + return toTimeString; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js new file mode 100644 index 0000000..7f0ca3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js @@ -0,0 +1,45 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js new file mode 100644 index 0000000..03e0125 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ + + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + module.exports = [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js new file mode 100644 index 0000000..aadb69a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js @@ -0,0 +1,20 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var upperCase = require('./upperCase'); +var lowerCase = require('./lowerCase'); + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + module.exports = camelCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js new file mode 100644 index 0000000..cb22cae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + module.exports = contains; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js new file mode 100644 index 0000000..53b93b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); +var truncate = require('./truncate'); + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + module.exports = crop; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js new file mode 100644 index 0000000..d504e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + module.exports = endsWith; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js new file mode 100644 index 0000000..e67c4b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + module.exports = escapeHtml; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js new file mode 100644 index 0000000..70cb84f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); + + var ESCAPE_CHARS = /[\\.+*?\^$\[\](){}\/'#]/g; + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + str = toString(str); + return str.replace(ESCAPE_CHARS,'\\$&'); + } + + module.exports = escapeRegExp; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js new file mode 100644 index 0000000..ec649ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + module.exports = escapeUnicode; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js new file mode 100644 index 0000000..95e3243 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + module.exports = hyphenate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js new file mode 100644 index 0000000..ac88fac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + var stache = /\{\{(\w+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return (prop in replacements)? toString(replacements[prop]) : ''; + }; + return template.replace(syntax || stache, replaceFn); + } + + module.exports = interpolate; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js new file mode 100644 index 0000000..30bb7ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + module.exports = lowerCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js new file mode 100644 index 0000000..694d711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js @@ -0,0 +1,17 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return ((str.length < minLen) + ? repeat(ch, minLen - str.length) + str : str); + } + + module.exports = lpad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js new file mode 100644 index 0000000..23d7b33 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js @@ -0,0 +1,34 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + module.exports = ltrim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js new file mode 100644 index 0000000..69aef31 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js @@ -0,0 +1,13 @@ +var join = require('../array/join'); + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(Array.prototype.slice.call(arguments), '/'); + return result.replace(/\/{2,}/g, '/'); + } + + module.exports = makePath; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js new file mode 100644 index 0000000..8a8dccf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + module.exports = normalizeLineBreaks; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js new file mode 100644 index 0000000..fd19035 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var camelCase = require('./camelCase'); +var upperCase = require('./upperCase'); + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + module.exports = pascalCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js new file mode 100644 index 0000000..61636be --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + module.exports = properCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js new file mode 100644 index 0000000..fb46381 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + module.exports = removeNonASCII; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js new file mode 100644 index 0000000..bdd153b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-_]/g, ''); + } + + module.exports = removeNonWord; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js new file mode 100644 index 0000000..0f9b475 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + + /** + * Repeat string n times + */ + function repeat(str, n){ + str = toString(str); + return (new Array(n + 1)).join(str); + } + + module.exports = repeat; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js new file mode 100644 index 0000000..14433fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var toArray = require('../lang/toArray'); + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + module.exports = replace; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js new file mode 100644 index 0000000..bb22126 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js @@ -0,0 +1,36 @@ +var toString = require('../lang/toString'); + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + module.exports = replaceAccents; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js new file mode 100644 index 0000000..99f6378 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + module.exports = rpad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js new file mode 100644 index 0000000..66ba80e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + module.exports = rtrim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js new file mode 100644 index 0000000..354104c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + module.exports = sentenceCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js new file mode 100644 index 0000000..142f0d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js @@ -0,0 +1,24 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var trim = require('./trim'); + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + module.exports = slugify; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js new file mode 100644 index 0000000..bce2bd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + module.exports = startsWith; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js new file mode 100644 index 0000000..01d17b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + module.exports = stripHtmlTags; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js new file mode 100644 index 0000000..9652b0c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); +var ltrim = require('./ltrim'); +var rtrim = require('./rtrim'); + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + module.exports = trim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js new file mode 100644 index 0000000..a98d6c7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); +var trim = require('./trim'); + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + module.exports = truncate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js new file mode 100644 index 0000000..c1386a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js @@ -0,0 +1,29 @@ + + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + module.exports = typecast; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js new file mode 100644 index 0000000..4968f37 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js @@ -0,0 +1,23 @@ +var toString = require('../lang/toString'); + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + module.exports = unCamelCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js new file mode 100644 index 0000000..ebd6e2b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + module.exports = underscore; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js new file mode 100644 index 0000000..52cf3f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/'/g , "'") + .replace(/"/g, '"'); + return str; + } + + module.exports = unescapeHtml; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js new file mode 100644 index 0000000..0b7fb73 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +var toString = require('../lang/toString'); + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + module.exports = unescapeUnicode; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js new file mode 100644 index 0000000..311dfa1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + module.exports = unhyphenate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js new file mode 100644 index 0000000..6c92552 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + module.exports = upperCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js new file mode 100644 index 0000000..9f53329 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js @@ -0,0 +1,12 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js new file mode 100644 index 0000000..852a0f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js @@ -0,0 +1,41 @@ + + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + module.exports = convert; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js new file mode 100644 index 0000000..effcfbe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js @@ -0,0 +1,12 @@ + + + /** + * Get current time in miliseconds + */ + var now = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + module.exports = now; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js new file mode 100644 index 0000000..6d99797 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js @@ -0,0 +1,17 @@ +var countSteps = require('../math/countSteps'); + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + module.exports = parseMs; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js new file mode 100644 index 0000000..101d69f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js @@ -0,0 +1,24 @@ +var countSteps = require('../math/countSteps'); +var pad = require('../number/pad'); + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + module.exports = toTimeString; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/bool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/bool.js new file mode 100644 index 0000000..a998fb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/bool.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_double.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_double.js new file mode 100644 index 0000000..a35a7e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_double.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_single.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_single.js new file mode 100644 index 0000000..017bb68 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/boolean_single.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv.v); +console.dir(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_hash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_hash.js new file mode 100644 index 0000000..ade7768 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_hash.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; + +console.log(argv.x + argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_singles.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_singles.js new file mode 100644 index 0000000..d9b1ff4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/default_singles.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/divide.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/divide.js new file mode 100644 index 0000000..5e2ee82 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/divide.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count.js new file mode 100644 index 0000000..b5f95bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_options.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_options.js new file mode 100644 index 0000000..d9ac709 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_options.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .options({ + file : { + demand : true, + alias : 'f', + description : 'Load a file' + }, + base : { + alias : 'b', + description : 'Numeric base to use for output', + default : 10, + }, + }) + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js new file mode 100644 index 0000000..4267511 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .wrap(80) + .demand('f') + .alias('f', [ 'file', 'filename' ]) + .describe('f', + "Load a file. It's pretty important." + + " Required even. So you'd better specify it." + ) + .alias('b', 'base') + .describe('b', 'Numeric base to display the number of lines in') + .default('b', 10) + .describe('x', 'Super-secret optional parameter which is secret') + .default('x', '') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/nonopt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/nonopt.js new file mode 100644 index 0000000..ee633ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/nonopt.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/reflect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/reflect.js new file mode 100644 index 0000000..816b3e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/reflect.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.dir(require('optimist').argv); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/short.js new file mode 100644 index 0000000..1db0ad0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/short.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/string.js new file mode 100644 index 0000000..a8e5aeb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/string.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +var argv = require('optimist') + .string('x', 'y') + .argv +; +console.dir([ argv.x, argv.y ]); + +/* Turns off numeric coercion: + ./node string.js -x 000123 -y 9876 + [ '000123', '9876' ] +*/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/usage-options.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/usage-options.js new file mode 100644 index 0000000..b999977 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/usage-options.js @@ -0,0 +1,19 @@ +var optimist = require('./../index'); + +var argv = optimist.usage('This is my awesome program', { + 'about': { + description: 'Provide some details about the author of this program', + required: true, + short: 'a', + }, + 'info': { + description: 'Provide some information about the node.js agains!!!!!!', + boolean: true, + short: 'i' + } +}).argv; + +optimist.showHelp(); + +console.log('\n\nInspecting options'); +console.dir(argv); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/xup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/xup.js new file mode 100644 index 0000000..8f6ecd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/example/xup.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js new file mode 100644 index 0000000..4da5a6d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js @@ -0,0 +1,343 @@ +var path = require('path'); +var minimist = require('minimist'); +var wordwrap = require('wordwrap'); + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('optimist')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('optimist').argv + to get a parsed version of process.argv. +*/ + +var inst = Argv(process.argv.slice(2)); +Object.keys(inst).forEach(function (key) { + Argv[key] = typeof inst[key] == 'function' + ? inst[key].bind(inst) + : inst[key]; +}); + +var exports = module.exports = Argv; +function Argv (processArgs, cwd) { + var self = {}; + if (!cwd) cwd = process.cwd(); + + self.$0 = process.argv + .slice(0,2) + .map(function (x) { + var b = rebase(cwd, x); + return x.match(/^\//) && b.length < x.length + ? b : x + }) + .join(' ') + ; + + if (process.env._ != undefined && process.argv[1] == process.env._) { + self.$0 = process.env._.replace( + path.dirname(process.execPath) + '/', '' + ); + } + + var options = { + boolean: [], + string: [], + alias: {}, + default: [] + }; + + self.boolean = function (bools) { + options.boolean.push.apply(options.boolean, [].concat(bools)); + return self; + }; + + self.string = function (strings) { + options.string.push.apply(options.string, [].concat(strings)); + return self; + }; + + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + options.default[key] = value; + } + return self; + }; + + self.alias = function (x, y) { + if (typeof x === 'object') { + Object.keys(x).forEach(function (key) { + self.alias(key, x[key]); + }); + } + else { + options.alias[x] = (options.alias[x] || []).concat(y); + } + return self; + }; + + var demanded = {}; + self.demand = function (keys) { + if (typeof keys == 'number') { + if (!demanded._) demanded._ = 0; + demanded._ += keys; + } + else if (Array.isArray(keys)) { + keys.forEach(function (key) { + self.demand(key); + }); + } + else { + demanded[keys] = true; + } + + return self; + }; + + var usage; + self.usage = function (msg, opts) { + if (!opts && typeof msg === 'object') { + opts = msg; + msg = null; + } + + usage = msg; + + if (opts) self.options(opts); + + return self; + }; + + function fail (msg) { + self.showHelp(); + if (msg) console.error(msg); + process.exit(1); + } + + var checks = []; + self.check = function (f) { + checks.push(f); + return self; + }; + + var descriptions = {}; + self.describe = function (key, desc) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.describe(k, key[k]); + }); + } + else { + descriptions[key] = desc; + } + return self; + }; + + self.parse = function (args) { + return parseArgs(args); + }; + + self.option = self.options = function (key, opt) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.options(k, key[k]); + }); + } + else { + if (opt.alias) self.alias(key, opt.alias); + if (opt.demand) self.demand(key); + if (typeof opt.default !== 'undefined') { + self.default(key, opt.default); + } + + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + } + if (opt.string || opt.type === 'string') { + self.string(key); + } + + var desc = opt.describe || opt.description || opt.desc; + if (desc) { + self.describe(key, desc); + } + } + + return self; + }; + + var wrap = null; + self.wrap = function (cols) { + wrap = cols; + return self; + }; + + self.showHelp = function (fn) { + if (!fn) fn = console.error; + fn(self.help()); + }; + + self.help = function () { + var keys = Object.keys( + Object.keys(descriptions) + .concat(Object.keys(demanded)) + .concat(Object.keys(options.default)) + .reduce(function (acc, key) { + if (key !== '_') acc[key] = true; + return acc; + }, {}) + ); + + var help = keys.length ? [ 'Options:' ] : []; + + if (usage) { + help.unshift(usage.replace(/\$0/g, self.$0), ''); + } + + var switches = keys.reduce(function (acc, key) { + acc[key] = [ key ].concat(options.alias[key] || []) + .map(function (sw) { + return (sw.length > 1 ? '--' : '-') + sw + }) + .join(', ') + ; + return acc; + }, {}); + + var switchlen = longest(Object.keys(switches).map(function (s) { + return switches[s] || ''; + })); + + var desclen = longest(Object.keys(descriptions).map(function (d) { + return descriptions[d] || ''; + })); + + keys.forEach(function (key) { + var kswitch = switches[key]; + var desc = descriptions[key] || ''; + + if (wrap) { + desc = wordwrap(switchlen + 4, wrap)(desc) + .slice(switchlen + 4) + ; + } + + var spadding = new Array( + Math.max(switchlen - kswitch.length + 3, 0) + ).join(' '); + + var dpadding = new Array( + Math.max(desclen - desc.length + 1, 0) + ).join(' '); + + var type = null; + + if (options.boolean[key]) type = '[boolean]'; + if (options.string[key]) type = '[string]'; + + if (!wrap && dpadding.length > 0) { + desc += dpadding; + } + + var prelude = ' ' + kswitch + spadding; + var extra = [ + type, + demanded[key] + ? '[required]' + : null + , + options.default[key] !== undefined + ? '[default: ' + JSON.stringify(options.default[key]) + ']' + : null + , + ].filter(Boolean).join(' '); + + var body = [ desc, extra ].filter(Boolean).join(' '); + + if (wrap) { + var dlines = desc.split('\n'); + var dlen = dlines.slice(-1)[0].length + + (dlines.length === 1 ? prelude.length : 0) + + body = desc + (dlen + extra.length > wrap - 2 + ? '\n' + + new Array(wrap - extra.length + 1).join(' ') + + extra + : new Array(wrap - extra.length - dlen + 1).join(' ') + + extra + ); + } + + help.push(prelude + body); + }); + + help.push(''); + return help.join('\n'); + }; + + Object.defineProperty(self, 'argv', { + get : function () { return parseArgs(processArgs) }, + enumerable : true, + }); + + function parseArgs (args) { + var argv = minimist(args, options); + argv.$0 = self.$0; + + if (demanded._ && argv._.length < demanded._) { + fail('Not enough non-option arguments: got ' + + argv._.length + ', need at least ' + demanded._ + ); + } + + var missing = []; + Object.keys(demanded).forEach(function (key) { + if (!argv[key]) missing.push(key); + }); + + if (missing.length) { + fail('Missing required arguments: ' + missing.join(', ')); + } + + checks.forEach(function (f) { + try { + if (f(argv) === false) { + fail('Argument check failed: ' + f.toString()); + } + } + catch (err) { + fail(err) + } + }); + + return argv; + } + + function longest (xs) { + return Math.max.apply( + null, + xs.map(function (x) { return x.length }) + ); + } + + return self; +}; + +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +exports.rebase = rebase; +function rebase (base, dir) { + var ds = path.normalize(dir).split('/').slice(1); + var bs = path.normalize(base).split('/').slice(1); + + for (var i = 0; ds[i] && ds[i] == bs[i]; i++); + ds.splice(0, i); bs.splice(0, i); + + var p = path.normalize( + bs.map(function () { return '..' }).concat(ds).join('/') + ).replace(/\/$/,'').replace(/^$/, '.'); + return p.match(/^[.\/]/) ? p : './' + p; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js new file mode 100644 index 0000000..abff3e8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js new file mode 100644 index 0000000..2aa9514 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js @@ -0,0 +1,187 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + notFlags.forEach(function(key) { + argv._.push(key); + }); + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function longest (xs) { + return Math.max.apply(null, xs.map(function (x) { return x.length })); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json new file mode 100644 index 0000000..2f5219d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json @@ -0,0 +1,54 @@ +{ + "name": "minimist", + "version": "0.0.7", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "tape": "~1.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n x: 3,\n y: 4,\n n: 5,\n a: true,\n b: true,\n c: true,\n beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a string or array of strings to always treat as booleans\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "_id": "minimist@0.0.7", + "dist": { + "shasum": "5e1aa4da48e55dcfd52b66fdacd054d19dd64fce" + }, + "_from": "minimist@~0.0.1", + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.7.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown new file mode 100644 index 0000000..c256353 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown @@ -0,0 +1,73 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a string or array of strings to always treat as booleans +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js new file mode 100644 index 0000000..8b034b9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js @@ -0,0 +1,24 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js new file mode 100644 index 0000000..f0041ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js new file mode 100644 index 0000000..ef0ae34 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js new file mode 100644 index 0000000..5d3a1e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js new file mode 100644 index 0000000..7c4348a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js @@ -0,0 +1,297 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js new file mode 100644 index 0000000..21851b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: ['123'] }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js new file mode 100644 index 0000000..d513a1c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js new file mode 100644 index 0000000..8a52a58 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown new file mode 100644 index 0000000..346374e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown @@ -0,0 +1,70 @@ +wordwrap +======== + +Wrap your words. + +example +======= + +made out of meat +---------------- + +meat.js + + var wrap = require('wordwrap')(15); + console.log(wrap('You and your whole family are made out of meat.')); + +output: + + You and your + whole family + are made out + of meat. + +centered +-------- + +center.js + + var wrap = require('wordwrap')(20, 60); + console.log(wrap( + 'At long last the struggle and tumult was over.' + + ' The machines had finally cast off their oppressors' + + ' and were finally free to roam the cosmos.' + + '\n' + + 'Free of purpose, free of obligation.' + + ' Just drifting through emptiness.' + + ' The sun was just another point of light.' + )); + +output: + + At long last the struggle and tumult + was over. The machines had finally cast + off their oppressors and were finally + free to roam the cosmos. + Free of purpose, free of obligation. + Just drifting through emptiness. The + sun was just another point of light. + +methods +======= + +var wrap = require('wordwrap'); + +wrap(stop), wrap(start, stop, params={mode:"soft"}) +--------------------------------------------------- + +Returns a function that takes a string and returns a new string. + +Pad out lines with spaces out to column `start` and then wrap until column +`stop`. If a word is longer than `stop - start` characters it will overflow. + +In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are +longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break +up chunks longer than `stop - start`. + +wrap.hard(start, stop) +---------------------- + +Like `wrap()` but with `params.mode = "hard"`. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js new file mode 100644 index 0000000..a3fbaae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js @@ -0,0 +1,10 @@ +var wrap = require('wordwrap')(20, 60); +console.log(wrap( + 'At long last the struggle and tumult was over.' + + ' The machines had finally cast off their oppressors' + + ' and were finally free to roam the cosmos.' + + '\n' + + 'Free of purpose, free of obligation.' + + ' Just drifting through emptiness.' + + ' The sun was just another point of light.' +)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js new file mode 100644 index 0000000..a4665e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js @@ -0,0 +1,3 @@ +var wrap = require('wordwrap')(15); + +console.log(wrap('You and your whole family are made out of meat.')); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js new file mode 100644 index 0000000..c9bc945 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js @@ -0,0 +1,76 @@ +var wordwrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) params = {}; + var mode = params.mode || 'soft'; + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + + return function (text) { + var chunks = text.toString() + .split(re) + .reduce(function (acc, x) { + if (mode === 'hard') { + for (var i = 0; i < x.length; i += stop - start) { + acc.push(x.slice(i, i + stop - start)); + } + } + else acc.push(x) + return acc; + }, []) + ; + + return chunks.reduce(function (lines, rawChunk) { + if (rawChunk === '') return lines; + + var chunk = rawChunk.replace(/\t/g, ' '); + + var i = lines.length - 1; + if (lines[i].length + chunk.length > stop) { + lines[i] = lines[i].replace(/\s+$/, ''); + + chunk.split(/\n/).forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else if (chunk.match(/\n/)) { + var xs = chunk.split(/\n/); + lines[i] += xs.shift(); + xs.forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else { + lines[i] += chunk; + } + + return lines; + }, [ new Array(start + 1).join(' ') ]).join('\n'); + }; +}; + +wordwrap.soft = wordwrap; + +wordwrap.hard = function (start, stop) { + return wordwrap(start, stop, { mode : 'hard' }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json new file mode 100644 index 0000000..df8dc05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json @@ -0,0 +1,45 @@ +{ + "name": "wordwrap", + "description": "Wrap those words. Show them at what columns to start and stop.", + "version": "0.0.2", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-wordwrap.git" + }, + "main": "./index.js", + "keywords": [ + "word", + "wrap", + "rule", + "format", + "column" + ], + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "scripts": { + "test": "expresso" + }, + "devDependencies": { + "expresso": "=0.7.x" + }, + "engines": { + "node": ">=0.4.0" + }, + "license": "MIT/X11", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n", + "readmeFilename": "README.markdown", + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, + "homepage": "https://github.com/substack/node-wordwrap", + "_id": "wordwrap@0.0.2", + "_from": "wordwrap@~0.0.2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js new file mode 100644 index 0000000..749292e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js @@ -0,0 +1,30 @@ +var assert = require('assert'); +var wordwrap = require('../'); + +exports.hard = function () { + var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' + + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' + + '"browser":"chrome/6.0"}' + ; + var s_ = wordwrap.hard(80)(s); + + var lines = s_.split('\n'); + assert.equal(lines.length, 2); + assert.ok(lines[0].length < 80); + assert.ok(lines[1].length < 80); + + assert.equal(s, s_.replace(/\n/g, '')); +}; + +exports.break = function () { + var s = new Array(55+1).join('a'); + var s_ = wordwrap.hard(20)(s); + + var lines = s_.split('\n'); + assert.equal(lines.length, 3); + assert.ok(lines[0].length === 20); + assert.ok(lines[1].length === 20); + assert.ok(lines[2].length === 15); + + assert.equal(s, s_.replace(/\n/g, '')); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt new file mode 100644 index 0000000..aa3f490 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt @@ -0,0 +1,63 @@ +In Praise of Idleness + +By Bertrand Russell + +[1932] + +Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. + +Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. + +One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. + +But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. + +All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. + +First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. + +Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. + +From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. + +It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. + +Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. + +This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? + +The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. + +Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. + +I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. + +If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. + +The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. + +In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. + +The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. + +For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? + +In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. + +In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. + +The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. + +It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. + +When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. + +In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. + +The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. + +In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. + +Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. + +[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js new file mode 100644 index 0000000..0cfb76d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js @@ -0,0 +1,31 @@ +var assert = require('assert'); +var wordwrap = require('wordwrap'); + +var fs = require('fs'); +var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); + +exports.stop80 = function () { + var lines = wordwrap(80)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + assert.ok(line.length <= 80, 'line > 80 columns'); + var chunks = line.match(/\S/) ? line.split(/\s+/) : []; + assert.deepEqual(chunks, words.splice(0, chunks.length)); + }); +}; + +exports.start20stop60 = function () { + var lines = wordwrap(20, 100)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + assert.ok(line.length <= 100, 'line > 100 columns'); + var chunks = line + .split(/\s+/) + .filter(function (x) { return x.match(/\S/) }) + ; + assert.deepEqual(chunks, words.splice(0, chunks.length)); + assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); + }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json new file mode 100644 index 0000000..8f6fc02 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json @@ -0,0 +1,51 @@ +{ + "name": "optimist", + "version": "0.6.1", + "description": "Light-weight option parsing with an argv hash. No optstrings attached.", + "main": "./index.js", + "dependencies": { + "wordwrap": "~0.0.2", + "minimist": "~0.0.1" + }, + "devDependencies": { + "hashish": "~0.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap ./test/*.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-optimist.git" + }, + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.4" + }, + "readme": "# DEPRECATION NOTICE\n\nI don't want to maintain this module anymore since I just use\n[minimist](https://npmjs.org/package/minimist), the argument parsing engine,\ndirectly instead nowadays.\n\nSee [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed\nsuccessor to optimist.\n\n[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs)\n\nYou should also consider [nomnom](https://github.com/harthur/nomnom).\n\noptimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/node-optimist/issues" + }, + "homepage": "https://github.com/substack/node-optimist", + "_id": "optimist@0.6.1", + "dist": { + "shasum": "86c5849b8c390c6382bb5cc018a417daad2a9065" + }, + "_from": "optimist@~0.6.0", + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/readme.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/readme.markdown new file mode 100644 index 0000000..b74b437 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/readme.markdown @@ -0,0 +1,513 @@ +# DEPRECATION NOTICE + +I don't want to maintain this module anymore since I just use +[minimist](https://npmjs.org/package/minimist), the argument parsing engine, +directly instead nowadays. + +See [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed +successor to optimist. + +[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs) + +You should also consider [nomnom](https://github.com/harthur/nomnom). + +optimist +======== + +Optimist is a node.js library for option parsing for people who hate option +parsing. More specifically, this module is for people who like all the --bells +and -whistlz of program usage but think optstrings are a waste of time. + +With optimist, option parsing doesn't have to suck (as much). + +[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist) + +examples +======== + +With Optimist, the options are just a hash! No optstrings attached. +------------------------------------------------------------------- + +xup.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} +```` + +*** + + $ ./xup.js --rif=55 --xup=9.52 + Buy more riffiwobbles + + $ ./xup.js --rif 12 --xup 8.1 + Sell the xupptumblers + +![This one's optimistic.](http://substack.net/images/optimistic.png) + +But wait! There's more! You can do short options: +------------------------------------------------- + +short.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +```` + +*** + + $ ./short.js -x 10 -y 21 + (10,21) + +And booleans, both long and short (and grouped): +---------------------------------- + +bool.js: + +````javascript +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); +```` + +*** + + $ ./bool.js -s + The cat says: meow + + $ ./bool.js -sp + The cat says: meow. + + $ ./bool.js -sp --fr + Le chat dit: miaou. + +And non-hypenated options too! Just use `argv._`! +------------------------------------------------- + +nonopt.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); +```` + +*** + + $ ./nonopt.js -x 6.82 -y 3.35 moo + (6.82,3.35) + [ 'moo' ] + + $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz + (0.54,1.12) + [ 'foo', 'bar', 'baz' ] + +Plus, Optimist comes with .usage() and .demand()! +------------------------------------------------- + +divide.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); +```` + +*** + + $ ./divide.js -x 55 -y 11 + 5 + + $ node ./divide.js -x 4.91 -z 2.51 + Usage: node ./divide.js -x [num] -y [num] + + Options: + -x [required] + -y [required] + + Missing required arguments: y + +EVEN MORE HOLY COW +------------------ + +default_singles.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_singles.js -x 5 + 15 + +default_hash.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_hash.js -y 7 + 17 + +And if you really want to get all descriptive about it... +--------------------------------------------------------- + +boolean_single.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv); +```` + +*** + + $ ./boolean_single.js -v foo bar baz + true + [ 'bar', 'baz', 'foo' ] + +boolean_double.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); +```` + +*** + + $ ./boolean_double.js -x -z one two three + [ true, false, true ] + [ 'one', 'two', 'three' ] + +Optimist is here to help... +--------------------------- + +You can describe parameters for help messages and set aliases. Optimist figures +out how to format a handy help string automatically. + +line_count.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); +```` + +*** + + $ node line_count.js + Count the lines in a file. + Usage: node ./line_count.js + + Options: + -f, --file Load a file [required] + + Missing required arguments: f + + $ node line_count.js --file line_count.js + 20 + + $ node line_count.js -f line_count.js + 20 + +methods +======= + +By itself, + +````javascript +require('optimist').argv +````` + +will use `process.argv` array to construct the `argv` object. + +You can pass in the `process.argv` yourself: + +````javascript +require('optimist')([ '-x', '1', '-y', '2' ]).argv +```` + +or use .parse() to do the same thing: + +````javascript +require('optimist').parse([ '-x', '1', '-y', '2' ]) +```` + +The rest of these methods below come in just before the terminating `.argv`. + +.alias(key, alias) +------------------ + +Set key names as equivalent such that updates to a key will propagate to aliases +and vice-versa. + +Optionally `.alias()` can take an object that maps keys to aliases. + +.default(key, value) +-------------------- + +Set `argv[key]` to `value` if no option was specified on `process.argv`. + +Optionally `.default()` can take an object that maps keys to default values. + +.demand(key) +------------ + +If `key` is a string, show the usage information and exit if `key` wasn't +specified in `process.argv`. + +If `key` is a number, demand at least as many non-option arguments, which show +up in `argv._`. + +If `key` is an Array, demand each element. + +.describe(key, desc) +-------------------- + +Describe a `key` for the generated usage information. + +Optionally `.describe()` can take an object that maps keys to descriptions. + +.options(key, opt) +------------------ + +Instead of chaining together `.alias().demand().default()`, you can specify +keys in `opt` for each of the chainable methods. + +For example: + +````javascript +var argv = require('optimist') + .options('f', { + alias : 'file', + default : '/etc/passwd', + }) + .argv +; +```` + +is the same as + +````javascript +var argv = require('optimist') + .alias('f', 'file') + .default('f', '/etc/passwd') + .argv +; +```` + +Optionally `.options()` can take an object that maps keys to `opt` parameters. + +.usage(message) +--------------- + +Set a usage message to show which commands to use. Inside `message`, the string +`$0` will get interpolated to the current script name or node command for the +present script similar to how `$0` works in bash or perl. + +.check(fn) +---------- + +Check that certain conditions are met in the provided arguments. + +If `fn` throws or returns `false`, show the thrown error, usage information, and +exit. + +.boolean(key) +------------- + +Interpret `key` as a boolean. If a non-flag option follows `key` in +`process.argv`, that string won't get set as the value of `key`. + +If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be +`false`. + +If `key` is an Array, interpret all the elements as booleans. + +.string(key) +------------ + +Tell the parser logic not to interpret `key` as a number or boolean. +This can be useful if you need to preserve leading zeros in an input. + +If `key` is an Array, interpret all the elements as strings. + +.wrap(columns) +-------------- + +Format usage output to wrap at `columns` many columns. + +.help() +------- + +Return the generated usage string. + +.showHelp(fn=console.error) +--------------------------- + +Print the usage data using `fn` for printing. + +.parse(args) +------------ + +Parse `args` instead of `process.argv`. Returns the `argv` object. + +.argv +----- + +Get the arguments as a plain old object. + +Arguments without a corresponding flag show up in the `argv._` array. + +The script name or node command is available at `argv.$0` similarly to how `$0` +works in bash or perl. + +parsing tricks +============== + +stop parsing +------------ + +Use `--` to stop parsing flags and stuff the remainder into `argv._`. + + $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4 + { _: [ '-c', '3', '-d', '4' ], + '$0': 'node ./examples/reflect.js', + a: 1, + b: 2 } + +negate fields +------------- + +If you want to explicity set a field to false instead of just leaving it +undefined or to override a default you can do `--no-key`. + + $ node examples/reflect.js -a --no-b + { _: [], + '$0': 'node ./examples/reflect.js', + a: true, + b: false } + +numbers +------- + +Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to +one. This way you can just `net.createConnection(argv.port)` and you can add +numbers out of `argv` with `+` without having that mean concatenation, +which is super frustrating. + +duplicates +---------- + +If you specify a flag multiple times it will get turned into an array containing +all the values in order. + + $ node examples/reflect.js -x 5 -x 8 -x 0 + { _: [], + '$0': 'node ./examples/reflect.js', + x: [ 5, 8, 0 ] } + +dot notation +------------ + +When you use dots (`.`s) in argument names, an implicit object path is assumed. +This lets you organize arguments into nested objects. + + $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5 + { _: [], + '$0': 'node ./examples/reflect.js', + foo: { bar: { baz: 33 }, quux: 5 } } + +short numbers +------------- + +Short numeric `head -n5` style argument work too: + + $ node reflect.js -n123 -m456 + { '3': true, + '6': true, + _: [], + '$0': 'node ./reflect.js', + n: 123, + m: 456 } + +installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + npm install optimist + +or clone this project on github: + + git clone http://github.com/substack/node-optimist.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + +inspired By +=========== + +This module is loosely inspired by Perl's +[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_.js new file mode 100644 index 0000000..d9c58b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_.js @@ -0,0 +1,71 @@ +var spawn = require('child_process').spawn; +var test = require('tap').test; + +test('dotSlashEmpty', testCmd('./bin.js', [])); + +test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); + +test('nodeEmpty', testCmd('node bin.js', [])); + +test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); + +test('whichNodeEmpty', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', []) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + assert.error(err); + t.end(); + }); +}); + +test('whichNodeArgs', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); +}); + +function testCmd (cmd, args) { + + return function (t) { + var to = setTimeout(function () { + assert.fail('Never got stdout data.') + }, 5000); + + var oldDir = process.cwd(); + process.chdir(__dirname + '/_'); + + var cmds = cmd.split(' '); + + var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); + process.chdir(oldDir); + + bin.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); + + bin.stdout.on('data', function (buf) { + clearTimeout(to); + var _ = JSON.parse(buf.toString()); + t.same(_.map(String), args.map(String)); + t.end(); + }); + }; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/argv.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/argv.js new file mode 100644 index 0000000..3d09606 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/argv.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log(JSON.stringify(process.argv)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/bin.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/bin.js new file mode 100755 index 0000000..4a18d85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/_/bin.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('../../index').argv +console.log(JSON.stringify(argv._)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/dash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/dash.js new file mode 100644 index 0000000..af8ed6f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/dash.js @@ -0,0 +1,31 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-', function (t) { + t.plan(5); + t.deepEqual( + fix(optimist.parse([ '-n', '-' ])), + { n: '-', _: [] } + ); + t.deepEqual( + fix(optimist.parse([ '-' ])), + { _: [ '-' ] } + ); + t.deepEqual( + fix(optimist.parse([ '-f-' ])), + { f: '-', _: [] } + ); + t.deepEqual( + fix(optimist([ '-b', '-' ]).boolean('b').argv), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + fix(optimist([ '-s', '-' ]).string('s').argv), + { s: '-', _: [] } + ); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse.js new file mode 100644 index 0000000..d320f43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse.js @@ -0,0 +1,446 @@ +var optimist = require('../index'); +var path = require('path'); +var test = require('tap').test; + +var $0 = 'node ./' + path.relative(process.cwd(), __filename); + +test('short boolean', function (t) { + var parse = optimist.parse([ '-b' ]); + t.same(parse, { b : true, _ : [], $0 : $0 }); + t.same(typeof parse.b, 'boolean'); + t.end(); +}); + +test('long boolean', function (t) { + t.same( + optimist.parse([ '--bool' ]), + { bool : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('bare', function (t) { + t.same( + optimist.parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 } + ); + t.end(); +}); + +test('short group', function (t) { + t.same( + optimist.parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short group next', function (t) { + t.same( + optimist.parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short captures', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture sp', function (t) { + t.same( + optimist.parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture eq', function (t) { + t.same( + optimist.parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end() +}); + +test('long captures sp', function (t) { + t.same( + optimist.parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long captures eq', function (t) { + t.same( + optimist.parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('no', function (t) { + t.same( + optimist.parse([ '--no-moo' ]), + { moo : false, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('multi', function (t) { + t.same( + optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [], $0 : $0 } + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.same( + optimist.parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ], + $0 : $0 + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = optimist.parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789', + ]); + t.same(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ], + $0 : $0 + }); + t.same(typeof argv.x, 'number'); + t.same(typeof argv.y, 'number'); + t.same(typeof argv.z, 'number'); + t.same(typeof argv.w, 'string'); + t.same(typeof argv.hex, 'number'); + t.same(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv; + t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 }); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true']) + .boolean(['t', 'verbose']).default('verbose', true).argv; + + t.same(parse, { + verbose: false, + t: true, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var parse = optimist(['moo']) + .boolean(['t', 'verbose']) + .default('verbose', false) + .default('t', false).argv; + + t.same(parse, { + verbose: false, + t: false, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ]) + .boolean(['x','y','z']).argv; + + t.same(parse, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ], + $0 : $0 + }); + + t.same(typeof parse.x, 'boolean'); + t.same(typeof parse.y, 'boolean'); + t.same(typeof parse.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = optimist.parse([ '-s', "X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = optimist.parse([ "--s=X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + t.end(); +}); + +test('strings' , function (t) { + var s = optimist([ '-s', '0001234' ]).string('s').argv.s; + t.same(s, '0001234'); + t.same(typeof s, 'string'); + + var x = optimist([ '-x', '56' ]).string('x').argv.x; + t.same(x, '56'); + t.same(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = optimist([ ' ', ' ' ]).string('_').argv._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + optimist.parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.same( + optimist.parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', 'zoom') + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', [ 'zm', 'zoom' ]) + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('boolean default true', function (t) { + var argv = optimist.options({ + sometrue: { + boolean: true, + default: true + } + }).argv; + + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = optimist.options({ + somefalse: { + boolean: true, + default: false + } + }).argv; + + t.equal(argv.somefalse, false); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = optimist([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]).argv; + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + }, + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('herp') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('herp') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .options(opts) + .argv; + var propertyArgv = optimist(regular).options(opts).argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('h') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('h') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = optimist(['--boool', '--other=false']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse_modified.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse_modified.js new file mode 100644 index 0000000..a57dc84 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/parse_modified.js @@ -0,0 +1,14 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = optimist().boolean('b').parse([ '-b', '123' ]); + t.deepEqual(fix(argv), { b: true, _: ['123'] }); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/short.js new file mode 100644 index 0000000..b2c38ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/short.js @@ -0,0 +1,16 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-n123', function (t) { + t.plan(1); + var parse = optimist.parse([ '-n123' ]); + t.equal(parse.n, 123); +}); + +test('-123', function (t) { + t.plan(3); + var parse = optimist.parse([ '-123', '456' ]); + t.equal(parse['1'], true); + t.equal(parse['2'], true); + t.equal(parse['3'], 456); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/usage.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/usage.js new file mode 100644 index 0000000..300454c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/usage.js @@ -0,0 +1,292 @@ +var Hash = require('hashish'); +var optimist = require('../index'); +var test = require('tap').test; + +test('usageFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'Options:', + ' -x [required]', + ' -y [required]', + 'Missing required arguments: y', + ] + ); + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + + +test('usagePass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkPass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'You forgot about -y' + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('checkCondPass', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkCondFail', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/).join('\n'), + 'Usage: ./usage -x NUM -y NUM\n' + + 'Argument check failed: ' + checker.toString() + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('countPass', function (t) { + var r = checkUsage(function () { + return optimist('1 2 3 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same(r, { + result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('countFail', function (t) { + var r = checkUsage(function () { + return optimist('1 2 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same( + r.result, + { _ : [ '1', '2' ], moo : true, $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage [x] [y] [z] {OPTIONS}', + 'Not enough non-option arguments: got 2, need at least 3', + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('defaultSingles', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70 --powsy'.split(' ')) + .default('foo', 5) + .default('bar', 6) + .default('baz', 7) + .argv + ; + }); + t.same(r.result, { + foo : '50', + bar : 6, + baz : '70', + powsy : true, + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultAliases', function (t) { + var r = checkUsage(function () { + return optimist('') + .alias('f', 'foo') + .default('f', 5) + .argv + ; + }); + t.same(r.result, { + f : '5', + foo : '5', + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultHash', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70'.split(' ')) + .default({ foo : 10, bar : 20, quux : 30 }) + .argv + ; + }); + t.same(r.result, { + _ : [], + $0 : './usage', + foo : 50, + baz : 70, + bar : 20, + quux : 30, + }); + t.end(); +}); + +test('rebase', function (t) { + t.equal( + optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'), + './foo/bar/baz' + ); + t.equal( + optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'), + '../../..' + ); + t.equal( + optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'), + '../pow/zoom.txt' + ); + t.end(); +}); + +function checkUsage (f) { + + var exit = false; + + process._exit = process.exit; + process._env = process.env; + process._argv = process.argv; + + process.exit = function (t) { exit = true }; + process.env = Hash.merge(process.env, { _ : 'node' }); + process.argv = [ './usage' ]; + + var errors = []; + var logs = []; + + console._error = console.error; + console.error = function (msg) { errors.push(msg) }; + console._log = console.log; + console.log = function (msg) { logs.push(msg) }; + + var result = f(); + + process.exit = process._exit; + process.env = process._env; + process.argv = process._argv; + + console.error = console._error; + console.log = console._log; + + return { + errors : errors, + logs : logs, + exit : exit, + result : result, + }; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/whitespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/whitespace.js new file mode 100644 index 0000000..90b9075 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/node_modules/optimist/test/whitespace.js @@ -0,0 +1,8 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = optimist.parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/package.json new file mode 100644 index 0000000..6c4d562 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/package.json @@ -0,0 +1,43 @@ +{ + "name": "bower-config", + "version": "0.5.0", + "description": "The Bower config reader and writer.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/config/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/config.git" + }, + "main": "lib/Config", + "homepage": "http://bower.io", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "graceful-fs": "~2.0.0", + "mout": "~0.6.0", + "optimist": "~0.6.0", + "osenv": "0.0.3" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config)\n\nThe Bower config reader and writer. \nThe config spec can be read [here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/).\n\n\n## Usage\n\n#### .load()\n\nLoads the bower configuration from the configuration files.\n\n\n#### .get(key)\n\nReturns a configuration value by `key`. \nKeys with dots are supported to access deep values.\n\n\n#### .set(key, value)\n\nSets a configuration value for `key`. \nKeys with dots are supported to set deep values.\n\n\n#### .del(key)\n\nRemoves configuration named `key`. \nKeys with dots are supported to delete deep keys.\n\n\n#### .save(where, callback)\n\nSaves changes to `where`. \nThe `where` argument can be a path to a configuration file or:\n\n- `local` to save it in the configured current working directory (defaulting to `process.cwd`)\n- `user` to save it in the configuration file located in the home directory\n\n\n#### .toObject()\n\nReturns a deep copy of the underlying configuration object. \nThe returned configuration is normalised. \nThe object keys will be camelCase.\n\n\n#### #create(cwd)\n\nObtains a instance where `cwd` is the current working directory (defaults to `process.cwd`);\n\n```js\nvar config = require('bower-config').create();\n// You can also specify a working directory\nvar config2 = require('bower-config').create('./some/path');\n```\n\n\n#### #read(cwd)\n\nAlias for:\n\n```js\nvar configObject = (new Config(cwd)).load().toJson();\n```\n\n\n#### #normalise(config)\n\nReturns a new normalised config object based on `config`. \nObject keys will be converted to camelCase.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/config/issues" + }, + "_id": "bower-config@0.5.0", + "_from": "bower-config@~0.5.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-config/test/test.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.jshintrc new file mode 100644 index 0000000..5046798 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.jshintrc @@ -0,0 +1,61 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "esnext": false, + "evil": false, + "expr": true, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.npmignore new file mode 100644 index 0000000..1b6c50d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.* \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.travis.yml new file mode 100644 index 0000000..df63076 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/README.md new file mode 100644 index 0000000..c996c32 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/README.md @@ -0,0 +1,102 @@ +# endpoint-parser [![Build Status](https://secure.travis-ci.org/bower/endpoint-parser.png?branch=master)](http://travis-ci.org/bower/endpoint-parser) + +Little module that helps with endpoints parsing. + + +## API + +### .decompose(endpoint) + +Decomposes a endpoint into `name`, `source` and `target`. + +```js +var endpointParser = require('bower-endpoint-parser'); + +endpointParser.decompose('jquery#~2.0.0'); +// { name: '', source: 'jquery', target: '~2.0.0' } + +endpointParser.decompose('backbone=backbone-amd#~1.0.0'); +// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' } + +endpointParser.decompose('http://twitter.github.io/bootstrap/assets/bootstrap.zip'); +// { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' } + +endpointParser.decompose('bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip'); +// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' } +``` + +### .compose(decEndpoint) + +Inverse of `decompose()`. +Takes a decomposed endpoint and composes it back into a string. + +```js +var endpointParser = require('bower-endpoint-parser'); + +endpointParser.compose({ name: '', source: 'jquery', target: '~2.0.0' }); +// jquery#~2.0.0 + +endpointParser.compose({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }); +// backbone=backbone-amd#~1.0.0 + +endpointParser.compose({ name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }); +// http://twitter.github.io/bootstrap/assets/bootstrap.zip + +endpointParser.compose({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }); +// bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip +``` + +### .json2decomposed(key, value) + +Similar to `decompose()` but specially designed to be used when parsing `bower.json` dependencies. +For instance, in a `bower.json` like this: + +```js +{ + "name": "foo", + "version": "0.1.0", + "dependencies": { + "jquery": "~1.9.1", + "backbone": "backbone-amd#~1.0.0", + "bootstrap": "http://twitter.github.io/bootstrap/assets/bootstrap" + } +} +``` + +You would call `json2decomposed` like so: + +```js +endpointParser.json2decomposed('jquery', '~1.9.1'); +// { name: 'jquery', source: 'jquery', target: '~1.9.1' } + +endpointParser.json2decomposed('backbone', 'backbone-amd#~1.0.0'); +// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' } + +endpointParser.json2decomposed('bootstrap', 'http://twitter.github.io/bootstrap/assets/bootstrap'); +// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' } +``` + +### .decomposed2json(decEndpoint) + +Inverse of `json2decomposed()`. +Takes a decomposed endpoint and composes it to be saved to `bower.json`. + +```js +var endpointParser = require('bower-endpoint-parser'); + +endpointParser.decomposed2json({ name: 'jquery', source: 'jquery', target: '~2.0.0' }); +// { jquery: '~2.0.0' } + +endpointParser.decomposed2json({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }); +// { backbone: 'backbone-amd#~2.0.0' } + +endpointParser.decomposed2json({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }); +// { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' } +``` + +This function throws an exception if the `name` from the decomposed endpoint is empty. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/index.js new file mode 100644 index 0000000..68a8eab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/index.js @@ -0,0 +1,120 @@ +function decompose(endpoint) { + // Note that we allow spaces in targets and sources but they are trimmed + var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; + var matches = endpoint.match(regExp); + var target; + var error; + + if (!matches) { + error = new Error('Invalid endpoint: ' + endpoint); + error.code = 'EINVEND'; + throw error; + } + + target = trim(matches[3]); + + return { + name: trim(matches[1]), + source: trim(matches[2]), + target: isWildcard(target) ? '*' : target + }; +} + +function compose(decEndpoint) { + var name = trim(decEndpoint.name); + var source = trim(decEndpoint.source); + var target = trim(decEndpoint.target); + var composed = ''; + + if (name) { + composed += name + '='; + } + + composed += source; + + if (!isWildcard(target)) { + composed += '#' + target; + } + + return composed; +} + +function json2decomposed(key, value) { + var endpoint; + var split; + var error; + + key = trim(key); + value = trim(value); + + if (!key) { + error = new Error('The key must be specified'); + error.code = 'EINVEND'; + throw error; + } + + endpoint = key + '='; + split = value.split('#').map(trim); + + // If # was found, the source was specified + if (split.length > 1) { + endpoint += (split[0] || key) + '#' + split[1]; + // Check if value looks like a source + } else if (isSource(value)) { + endpoint += value + '#*'; + // Otherwise use the key as the source + } else { + endpoint += key + '#' + split[0]; + } + + return decompose(endpoint); +} + +function decomposed2json(decEndpoint) { + var error; + var name = trim(decEndpoint.name); + var source = trim(decEndpoint.source); + var target = trim(decEndpoint.target); + var value = ''; + var ret = {}; + + if (!name) { + error = new Error('Decomposed endpoint must have a name'); + error.code = 'EINVEND'; + throw error; + } + + // Add source only if different than the name + if (source !== name) { + value += source; + } + + // If value is empty, we append the target always + if (!value) { + value += isWildcard(target) ? '*' : target; + // Otherwise append only if not a wildcard or source does not look like a source + } else if (!isWildcard(target) || !isSource(source)) { + value += '#' + (target || '*'); + } + + ret[name] = value; + + return ret; +} + +function trim(str) { + return str ? str.trim() : ''; +} + +function isWildcard(target) { + return !target || target === '*' || target === 'latest'; +} + +function isSource(value) { + return (/[\/\\@]/).test(value); +} + +module.exports.decompose = decompose; +module.exports.compose = compose; +module.exports.json2decomposed = json2decomposed; +module.exports.decomposed2json = decomposed2json; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/package.json new file mode 100644 index 0000000..437475f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/package.json @@ -0,0 +1,38 @@ +{ + "name": "bower-endpoint-parser", + "version": "0.2.1", + "description": "Little module that helps with endpoints parsing.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/endpoint-parser/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/endpoint-parser.git" + }, + "main": "index.js", + "engines": { + "node": ">=0.8.0" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0", + "mout": "~0.6.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# endpoint-parser [![Build Status](https://secure.travis-ci.org/bower/endpoint-parser.png?branch=master)](http://travis-ci.org/bower/endpoint-parser)\n\nLittle module that helps with endpoints parsing.\n\n\n## API\n\n### .decompose(endpoint)\n\nDecomposes a endpoint into `name`, `source` and `target`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decompose('jquery#~2.0.0');\n// { name: '', source: 'jquery', target: '~2.0.0' }\n\nendpointParser.decompose('backbone=backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.decompose('http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n\nendpointParser.decompose('bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .compose(decEndpoint)\n\nInverse of `decompose()`. \nTakes a decomposed endpoint and composes it back into a string.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.compose({ name: '', source: 'jquery', target: '~2.0.0' });\n// jquery#~2.0.0\n\nendpointParser.compose({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// backbone=backbone-amd#~1.0.0\n\nendpointParser.compose({ name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// http://twitter.github.io/bootstrap/assets/bootstrap.zip\n\nendpointParser.compose({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip\n```\n\n### .json2decomposed(key, value)\n\nSimilar to `decompose()` but specially designed to be used when parsing `bower.json` dependencies.\nFor instance, in a `bower.json` like this:\n\n```js\n{\n \"name\": \"foo\",\n \"version\": \"0.1.0\",\n \"dependencies\": {\n \"jquery\": \"~1.9.1\",\n \"backbone\": \"backbone-amd#~1.0.0\",\n \"bootstrap\": \"http://twitter.github.io/bootstrap/assets/bootstrap\"\n }\n}\n```\n\nYou would call `json2decomposed` like so:\n\n```js\nendpointParser.json2decomposed('jquery', '~1.9.1');\n// { name: 'jquery', source: 'jquery', target: '~1.9.1' }\n\nendpointParser.json2decomposed('backbone', 'backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.json2decomposed('bootstrap', 'http://twitter.github.io/bootstrap/assets/bootstrap');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .decomposed2json(decEndpoint)\n\nInverse of `json2decomposed()`. \nTakes a decomposed endpoint and composes it to be saved to `bower.json`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decomposed2json({ name: 'jquery', source: 'jquery', target: '~2.0.0' });\n// { jquery: '~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// { backbone: 'backbone-amd#~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }\n```\n\nThis function throws an exception if the `name` from the decomposed endpoint is empty.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/endpoint-parser/issues" + }, + "homepage": "https://github.com/bower/endpoint-parser", + "_id": "bower-endpoint-parser@0.2.1", + "_from": "bower-endpoint-parser@~0.2.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/test/test.js new file mode 100644 index 0000000..94b0ecf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-endpoint-parser/test/test.js @@ -0,0 +1,260 @@ +var expect = require('expect.js'); +var mout = require('mout'); +var endpointParser = require('../'); + +describe('endpoint-parser', function () { + describe('.decompose', function () { + it('should decompose endpoints correctly', function () { + var suite = { + 'jquery#~2.0.0': { name: '', source: 'jquery', target: '~2.0.0' }, + 'jquery#*': { name: '', source: 'jquery', target: '*' }, + 'jquery#latest': { name: '', source: 'jquery', target: '*' }, + 'jquery#3dc50c62fe2d2d01afc58e7ad42236a35acff4d8': { name: '', source: 'jquery', target: '3dc50c62fe2d2d01afc58e7ad42236a35acff4d8' }, + 'jquery#master': { name: '', source: 'jquery', target: 'master' }, + 'backbone=backbone-amd#~1.0.0': { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }, + 'backbone=backbone-amd#latest': { name: 'backbone', source: 'backbone-amd', target: '*' }, + 'backbone=backbone-amd#*': { name: 'backbone', source: 'backbone-amd', target: '*' }, + 'http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' }, + 'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' }, + 'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip#latest': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' } + }; + + mout.object.forOwn(suite, function (decEndpoint, endpoint) { + expect(endpointParser.decompose(endpoint)).to.eql(decEndpoint); + }); + }); + + it('should trim sources and targets', function () { + var decEndpoint = endpointParser.decompose('foo= source # ~1.0.2 '); + expect(decEndpoint.source).to.equal('source'); + expect(decEndpoint.target).to.equal('~1.0.2'); + + decEndpoint = endpointParser.decompose('foo= source # latest'); + expect(decEndpoint.source).to.equal('source'); + expect(decEndpoint.target).to.equal('*'); + + decEndpoint = endpointParser.decompose('foo= source # *'); + expect(decEndpoint.source).to.equal('source'); + expect(decEndpoint.target).to.equal('*'); + }); + }); + + describe('.compose', function () { + it('should compose endpoints correctly', function () { + var suite = { + 'jquery#~2.0.0': { name: '', source: 'jquery', target: '~2.0.0' }, + 'jquery': [{ name: '', source: 'jquery', target: '*' }, { name: '', source: 'jquery', target: 'latest' }, { name: '', source: 'jquery', target: '' }], + 'jquery#3dc50c62fe2d2d01afc58e7ad42236a35acff4d8': { name: '', source: 'jquery', target: '3dc50c62fe2d2d01afc58e7ad42236a35acff4d8' }, + 'jquery#master': { name: '', source: 'jquery', target: 'master' }, + 'backbone=backbone-amd#~1.0.0': { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }, + 'backbone=backbone-amd': [{ name: 'backbone', source: 'backbone-amd', target: '*' }, { name: 'backbone', source: 'backbone-amd', target: '*' }, { name: 'backbone', source: 'backbone-amd', target: '' }], + 'http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' }, + 'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' } + }; + + mout.object.forOwn(suite, function (decEndpoints, endpoint) { + decEndpoints = mout.lang.toArray(decEndpoints); + decEndpoints.forEach(function (decEndpoint) { + expect(endpointParser.compose(decEndpoint)).to.equal(endpoint); + }); + }); + }); + + it('should trim values', function () { + expect(endpointParser.compose({ + name: ' foo ', + source: ' bar ', + target: ' ~1.0.2 ' + })).to.equal('foo=bar#~1.0.2'); + + expect(endpointParser.compose({ + name: ' foo ', + source: ' foo ', + target: ' ~1.0.2 ' + })).to.equal('foo=foo#~1.0.2'); + + expect(endpointParser.compose({ + name: ' foo ', + source: ' foo ', + target: ' * ' + })).to.equal('foo=foo'); + + expect(endpointParser.compose({ + name: ' foo ', + source: ' foo ', + target: ' * ' + })).to.equal('foo=foo'); + + expect(endpointParser.compose({ + name: ' ', + source: ' foo ', + target: '' + })).to.equal('foo'); + }); + }); + + describe('.json2decomposed', function () { + var expected = [ + { name: 'jquery', source: 'jquery', target: '~1.9.1' }, + { name: 'foo', source: 'foo', target: '*' }, + { name: 'bar', source: 'bar', target: '*' }, + { name: 'baz', source: 'baz', target: '~0.2.0' }, + { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }, + { name: 'backbone2', source: 'backbone=backbone-amd', target: '~1.0.0' }, + { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }, + { name: 'bootstrap2', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }, + { name: 'ssh', source: 'git@example.com', target: '*' }, + { name: 'git', source: 'git://example.com', target: '*' }, + { name: 'path', source: '/foo', target: '*' }, + { name: 'winpath', source: 'c:\\foo', target: '*' } + ]; + + it('should decompose json endpoints correctly', function () { + var dependencies = { + jquery: '~1.9.1', + foo: 'latest', + bar: '*', + baz: '#~0.2.0', + backbone: 'backbone-amd#~1.0.0', + backbone2: 'backbone=backbone-amd#~1.0.0', + bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap', + bootstrap2: 'http://twitter.github.io/bootstrap/assets/bootstrap#*', + ssh: 'git@example.com', + git: 'git://example.com', + path: '/foo', + winpath: 'c:\\foo' + }; + var x = 0; + + mout.object.forOwn(dependencies, function (value, key) { + expect(endpointParser.json2decomposed(key, value)).to.eql(expected[x]); + x += 1; + }); + }); + + it('should trim values', function () { + var dependencies = { + ' jquery ': ' ~1.9.1 ', + ' foo ': ' latest ', + ' bar ': ' * ', + ' baz ': '# ~0.2.0 ', + ' backbone ': ' backbone-amd#~1.0.0 ', + ' backbone2 ': ' backbone=backbone-amd # ~1.0.0 ', + ' bootstrap ': ' http://twitter.github.io/bootstrap/assets/bootstrap', + ' bootstrap2 ': ' http://twitter.github.io/bootstrap/assets/bootstrap # *', + ' ssh ': ' git@example.com ', + ' git ': ' git://example.com ', + ' path ': ' /foo ', + ' winpath ': ' c:\\foo ' + }; + var x = 0; + + mout.object.forOwn(dependencies, function (value, key) { + expect(endpointParser.json2decomposed(key, value)).to.eql(expected[x]); + x += 1; + }); + }); + + it('should error out if key is not specified', function () { + try { + endpointParser.json2decomposed(null); + throw new Error('Should have failed'); + } catch (e) { + expect(e.code).to.equal('EINVEND'); + expect(e.message).to.contain('key must be specified'); + } + + try { + endpointParser.json2decomposed(''); + throw new Error('Should have failed'); + } catch (e) { + expect(e.code).to.equal('EINVEND'); + expect(e.message).to.contain('key must be specified'); + } + }); + }); + + describe('.decomposed2json', function () { + var expected = [ + { jquery: '~1.9.1' }, + { foo: '*' }, + { bar: '*' }, + { baz: '*' }, + { jqueryx: 'jquery#~1.9.1' }, + { jqueryy: 'jquery-x#*' }, + { jqueryy: 'jquery-x#*' }, + { backbone: 'backbone-amd#~1.0.0' }, + { backbone : 'backbone=backbone-amd#~1.0.0' }, + { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }, + { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }, + { ssh: 'git@example.com' }, + { git: 'git://example.com' } + ]; + + it('should compose endpoints to json correctly', function () { + var decEndpoints = [ + { name: 'jquery', source: 'jquery', target: '~1.9.1' }, + { name: 'foo', source: 'foo', target: 'latest' }, + { name: 'bar', source: 'bar', target: '*' }, + { name: 'baz', source: 'baz', target: '' }, + { name: 'jqueryx', source: 'jquery', target: '~1.9.1' }, + { name: 'jqueryy', source: 'jquery-x', target: '' }, + { name: 'jqueryy', source: 'jquery-x', target: '*' }, + { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }, + { name: 'backbone', source: 'backbone=backbone-amd', target: '~1.0.0' }, + { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '' }, + { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }, + { name: 'ssh', source: 'git@example.com', target: '*' }, + { name: 'git', source: 'git://example.com', target: '*' } + ]; + var x = 0; + + decEndpoints.forEach(function (decEndpoint) { + expect(endpointParser.decomposed2json(decEndpoint)).to.eql(expected[x]); + x += 1; + }); + }); + + it('should trim values', function () { + var decEndpoints = [ + { name: ' jquery ', source: ' jquery ', target: ' ~1.9.1 ' }, + { name: 'foo', source: ' foo', target: ' latest ' }, + { name: 'bar', source: 'bar ', target: ' * ' }, + { name: 'baz ', source: 'baz', target: ' ' }, + { name: ' jqueryx ', source: ' jquery ', target: ' ~1.9.1 ' }, + { name: ' jqueryy ', source: ' jquery-x ', target: ' ' }, + { name: ' jqueryy ', source: ' jquery-x ', target: ' * ' }, + { name: ' backbone ', source: ' backbone-amd ', target: ' ~1.0.0 ' }, + { name: ' backbone ', source: ' backbone=backbone-amd ', target: ' ~1.0.0 ' }, + { name: ' bootstrap ', source: ' http://twitter.github.io/bootstrap/assets/bootstrap ', target: ' ' }, + { name: ' bootstrap ', source: ' http://twitter.github.io/bootstrap/assets/bootstrap ', target: ' * ' }, + { name: ' ssh ', source: ' git@example.com ', target: ' * ' }, + { name: ' git ', source: ' git://example.com ', target: ' * ' } + ]; + var x = 0; + + decEndpoints.forEach(function (decEndpoint) { + expect(endpointParser.decomposed2json(decEndpoint)).to.eql(expected[x]); + x += 1; + }); + }); + + it('should throw an error if name is empty', function () { + try { + endpointParser.decomposed2json({ name: '', source: 'jquery', target: '*' }); + throw new Error('Should have failed'); + } catch (e) { + expect(e.code).to.equal('EINVEND'); + expect(e.message).to.contain('must have a name'); + } + + try { + endpointParser.decomposed2json({ name: ' ', source: 'jquery', target: '*' }); + throw new Error('Should have failed'); + } catch (e) { + expect(e.code).to.equal('EINVEND'); + expect(e.message).to.contain('must have a name'); + } + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.jshintrc new file mode 100644 index 0000000..eae6f9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.jshintrc @@ -0,0 +1,62 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.npmignore new file mode 100644 index 0000000..1b6c50d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.* \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.travis.yml new file mode 100644 index 0000000..7ab0926 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/.travis.yml @@ -0,0 +1,6 @@ +before_script: + - npm install -g grunt-cli +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/Gruntfile.js new file mode 100644 index 0000000..7f8e1f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function (grunt) { + + 'use strict'; + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-mocha'); + + // Project configuration. + grunt.initConfig({ + + jshint: { + files: [ + 'Gruntfile.js', + 'lib/**/*.js', + 'test/**/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + + simplemocha: { + options: { + reporter: 'spec' + }, + full: { src: ['test/test.js'] }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/test.js'] + }, + build: { + options: { + reporter: 'tap' + }, + src: ['test/test.js'] + } + }, + + + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + + }); + + // Default task. + grunt.registerTask('test', ['simplemocha:full']); + grunt.registerTask('default', ['jshint', 'test']); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/README.md new file mode 100644 index 0000000..1e1944f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/README.md @@ -0,0 +1,136 @@ +# bower-json [![Build Status](https://secure.travis-ci.org/bower/json.png?branch=master)](http://travis-ci.org/bower/json) + +Read `bower.json` files with semantics, normalisation, defaults and validation. + + +## Usage + +#### .read(file, options, callback) + +Reads `file` and applies normalisation, defaults and validation according to the `bower.json` spec. +If the passed `file` does not exist, the callback is called with `error.code` equal to `ENOENT`. +If the passed `file` contents are not valid JSON, the callback is called with `error.code` equal to `EMALFORMED`. +If the `json` does not comply with the `bower.json` spec, the callback is called with `error.code` equal to `EINVALID`. + +If `file` is a directory, `find()` will be used to search for the json file. +The `options` argument is optional and can be omitted. These options will be passed to `parse` method. + + +```js +var bowerJson = require('bower-json'); + +// Can also be used by simply calling bowerJson() +bowerJson.read('/path/to/bower.json', function (err, json) { + if (err) { + console.error('There was an error reading the file'); + console.error(err.message); + return; + } + + console.log('JSON: ', json); +}); +``` + + +#### .parse(json, options) + +Parses an object. Useful when you want to apply normalisation and validation directly to an object. +If the `json` does not comply with the `bower.json` spec, an error is thrown with `error.code` equal to `EINVALID`. + +The `options` arguments is optional and can be omitted. Available options: + +- validate: Apply validation, defaults to `true` +- normalize: Apply normalisation, defaults to `false` +- clone: clone, use and return the passed in `json` object instead of using it directly, defaults to `false` + + +```js +var bowerJson = require('bower-json'); + +var json = { + name: 'my-package', + version: '0.0.1' +}; + +try { + bowerJson.parse(json); +} catch (err) { + console.error('There was an error parsing the object'); + console.error(err.message); +} +``` + + +#### .validate(json) + +Validates the passed `json` object. +Throws an error with `error.code` equal to `EINVALID` if it does not comply with the spec. + + +```js +var bowerJson = require('bower-json'); + +var json = { + name: 'my-package', + version: '0.0.1' +}; + +try { + bowerJson.validate(json); +} catch (err) { + console.error('There was an error validating the object'); + console.error(err.message); +} +``` + + +#### .normalize(json) + +```js +var bowerJson = require('bower-json'); + +var json = { + name: 'my-package', + version: '0.0.1', + main: 'foo.js,bar.js' +}; + +bowerJson.nornalize(json); +json.main // ['foo.js', 'bar.js'] +``` + + +#### .find(folder, callback) + +Finds the `json` filename inside a folder. +Checks if a `bower.json` exists, falling back to `component.json` (deprecated) and `.bower.json`. +If no file was found, the callback is called with a `error.code` of `ENOENT`. + +```js +var bowerJson = require('bower-json'); + +bowerJson.find('/path/to/folder', function (err, filename) { + if (err) { + console.error('There is no json file in the folder'); + return; + } + + console.log('Filename: ', filename); + + // Now that we got the filename, we can read its contents + bowerJson.read(filename, function (err, json) { + if (err) { + console.error('There was an error reading the file'); + console.error(err.message); + return; + } + + console.log('JSON: ', json); + }); +}); +``` + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/json.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/json.js new file mode 100644 index 0000000..be753d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/json.js @@ -0,0 +1,147 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var deepExtend = require('deep-extend'); +var isComponent = require('./util/isComponent'); +var createError = require('./util/createError'); + +var possibleJsons = ['bower.json', 'component.json', '.bower.json']; + +function read(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + // Check if file is a directory + fs.stat(file, function (err, stat) { + if (err) { + return callback(err); + } + + // It's a directory, so we find the json inside it + if (stat.isDirectory()) { + return find(file, function (err, file) { + if (err) { + return callback(err); + } + + read(file, options, callback); + }); + } + + // Otherwise read it + fs.readFile(file, function (err, contents) { + var json; + + if (err) { + return callback(err); + } + + try { + json = JSON.parse(contents.toString()); + } catch (err) { + err.file = path.resolve(file); + err.code = 'EMALFORMED'; + return callback(err); + } + + // Parse it + try { + json = parse(json, options); + } catch (err) { + err.file = path.resolve(file); + return callback(err); + } + + callback(null, json, file); + }); + }); +} + +function parse(json, options) { + options = deepExtend({ + normalize: false, + validate: true, + clone: false + }, options || {}); + + // Clone + if (options.clone) { + json = deepExtend({}, json); + } + + // Validate + if (options.validate) { + validate(json); + } + + // Normalize + if (options.normalize) { + normalize(json); + } + + return json; +} + +function validate(json) { + if (!json.name) { + throw createError('No name property set', 'EINVALID'); + } + + // TODO + + return json; +} + +function normalize(json) { + if (typeof json.main === 'string') { + json.main = json.main.split(','); + } + + // TODO + + return json; +} + +function find(folder, files, callback) { + var err; + var file; + + if (typeof files === 'function') { + callback = files; + files = possibleJsons; + } + + if (!files.length) { + err = createError('None of ' + possibleJsons.join(', ') + ' were found in ' + folder, 'ENOENT'); + return callback(err); + } + + file = path.resolve(path.join(folder, files[0])); + fs.exists(file, function (exists) { + if (!exists) { + return find(folder, files.slice(1), callback); + } + + if (files[0] !== 'component.json') { + return callback(null, file); + } + + // If the file is component.json, check it it's a component(1) file + // If it is, we ignore it and keep searching + isComponent(file, function (is) { + if (is) { + return find(folder, files.slice(1), callback); + } + + callback(null, file); + }); + }); +} + +module.exports = read; +module.exports.read = read; +module.exports.parse = parse; +module.exports.validate = validate; +module.exports.normalize = normalize; +module.exports.find = find; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/createError.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/createError.js new file mode 100644 index 0000000..8e9a416 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/createError.js @@ -0,0 +1,8 @@ +function createError(msg, code) { + var err = new Error(msg); + err.code = code; + + return err; +} + +module.exports = createError; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js new file mode 100644 index 0000000..0211206 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js @@ -0,0 +1,41 @@ +var fs = require('graceful-fs'); +var intersect = require('intersect'); + +// Function to check if a file is a component(1) file +function isComponent(file, callback) { + fs.readFile(file, function (err, contents) { + var json; + var keys; + var common; + + // If an error occurs while reading the file, we ignore it + if (err) { + return callback(false); + } + + try { + json = JSON.parse(contents.toString()); + } catch (err) { + return callback(false); + } + + // Attempt to find specific things from the component(1) spec + // Note that we don't parse the dependencies property because at any point + // we can allow / to specify directories + // Bellow only some clearly not ambiguous properties are checked + keys = Object.keys(json); + common = intersect(keys, [ + 'repo', + 'development', + 'local', + 'remotes', + 'paths', + 'demo' + ]); + + // If none were found, than it's a valid component.json bower file + callback(common.length ? true : false); + }); +} + +module.exports = isComponent; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/LICENSE new file mode 100644 index 0000000..e950236 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Viacheslav Lotsmanov + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/README.md new file mode 100644 index 0000000..7f64ef9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/README.md @@ -0,0 +1,52 @@ +Node.JS module “Deep Extend” +============================ + +Recursive object extending. + +Install +----- + + npm install deep-extend + +Usage +----- + + var deepExtend = require('deep-extend'); + var obj1 = { + a: 1, + b: 2, + d: { + a: 1, + b: [], + c: { test1: 123, test2: 321 } + }, + f: 5, + g: 123 + }; + var obj2 = { + b: 3, + c: 5, + d: { + b: { first: 'one', second: 'two' }, + c: { test2: 222 } + }, + e: { one: 1, two: 2 }, + f: [], + g: (void 0) + }; + + deepExtend(obj1, obj2); + + console.log(obj1); + /* + { a: 1, + b: 3, + d: + { a: 1, + b: { first: 'one', second: 'two' }, + c: { test1: 123, test2: 222 } }, + f: [], + c: 5, + e: { one: 1, two: 2 }, + g: undefined } + */ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js new file mode 100644 index 0000000..28dc8ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js @@ -0,0 +1,82 @@ +/*! + * Node.JS module "Deep Extend" + * @description Recursive object extending. + * @author Viacheslav Lotsmanov (unclechu) + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013 Viacheslav Lotsmanov + * + * 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. + */ + +/** + * Extening object that entered in first argument. + * Returns extended object or false if have no target object or incorrect type. + * If you wish to clone object, simply use that: + * deepExtend({}, yourObj_1, [yourObj_N]) - first arg is new empty object + */ +var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { + if (arguments.length < 1 || typeof arguments[0] !== 'object') { + return false; + } + + if (arguments.length < 2) return arguments[0]; + + var target = arguments[0]; + + // convert arguments to array and cut off target object + var args = Array.prototype.slice.call(arguments, 1); + + var key, val, src, clone; + + args.forEach(function (obj) { + if (typeof obj !== 'object') return; + + for (key in obj) { + if ( ! (key in obj)) continue; + + src = target[key]; + val = obj[key]; + + if (val === target) continue; + + if (typeof val !== 'object' || val === null) { + target[key] = val; + continue; + } + + if (typeof src !== 'object' || src === null) { + clone = (Array.isArray(val)) ? [] : {}; + target[key] = deepExtend(clone, val); + continue; + } + + if (Array.isArray(val)) { + clone = (Array.isArray(src)) ? src : []; + } else { + clone = (!Array.isArray(src)) ? src : {}; + } + + target[key] = deepExtend(clone, val); + } + }); + + return target; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json new file mode 100644 index 0000000..8292fbb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json @@ -0,0 +1,31 @@ +{ + "name": "deep-extend", + "description": "Recursive object extending.", + "license": "MIT", + "version": "0.2.8", + "homepage": "https://github.com/unclechu/node-deep-extend", + "repository": { + "type": "git", + "url": "git://github.com/unclechu/node-deep-extend.git" + }, + "author": { + "name": "Viacheslav Lotsmanov", + "email": "lotsmanov89@gmail.com", + "url": "unclechu" + }, + "main": "index", + "engines": { + "node": ">=0.4" + }, + "readme": "Node.JS module “Deep Extend”\r\n============================\r\n\r\nRecursive object extending.\r\n\r\nInstall\r\n-----\r\n\r\n npm install deep-extend\r\n\r\nUsage\r\n-----\r\n\r\n var deepExtend = require('deep-extend');\r\n var obj1 = {\r\n a: 1,\r\n b: 2,\r\n d: {\r\n a: 1,\r\n b: [],\r\n c: { test1: 123, test2: 321 }\r\n },\r\n f: 5,\r\n g: 123\r\n };\r\n var obj2 = {\r\n b: 3,\r\n c: 5,\r\n d: {\r\n b: { first: 'one', second: 'two' },\r\n c: { test2: 222 }\r\n },\r\n e: { one: 1, two: 2 },\r\n f: [],\r\n g: (void 0)\r\n };\r\n\r\n deepExtend(obj1, obj2);\r\n\r\n console.log(obj1);\r\n /*\r\n { a: 1,\r\n b: 3,\r\n d:\r\n { a: 1,\r\n b: { first: 'one', second: 'two' },\r\n c: { test1: 123, test2: 222 } },\r\n f: [],\r\n c: 5,\r\n e: { one: 1, two: 2 },\r\n g: undefined }\r\n */\r\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/unclechu/node-deep-extend/issues" + }, + "_id": "deep-extend@0.2.8", + "dist": { + "shasum": "a2b9be60587c498c4c36de095dfae76ff68578b5" + }, + "_from": "deep-extend@~0.2.5", + "_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/.npmignore new file mode 100644 index 0000000..2837506 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/.npmignore @@ -0,0 +1,2 @@ +*.sw* +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/README.md new file mode 100644 index 0000000..5f892d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/README.md @@ -0,0 +1,38 @@ + +# intersect + +## Usage + +```js +var intersect = require('intersect'); + +var a = ['foo', 'bar', 'baz']; +var b = ['nope', 'bar', 'baz']; + +console.log(intersect(a, b)); +// => ['bar', 'baz'] +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json new file mode 100644 index 0000000..23a3b1e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json @@ -0,0 +1,16 @@ +{ + "name": "intersect", + "repo": "juliangruber/intersect", + "description": "Find the intersection of two arrays.", + "version": "0.0.3", + "keywords": [ + "intersect", + "array" + ], + "dependencies": {}, + "development": {}, + "license": "MIT", + "scripts": [ + "index.js" + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js new file mode 100644 index 0000000..71de652 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js @@ -0,0 +1,16 @@ +module.exports = intersect; + +function intersect (a, b) { + var res = []; + for (var i = 0; i < a.length; i++) { + if (indexOf(b, a[i]) > -1) res.push(a[i]); + } + return res; +} + +function indexOf(arr, el) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === el) return i; + } + return -1; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json new file mode 100644 index 0000000..2ec1c71 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json @@ -0,0 +1,47 @@ +{ + "name": "intersect", + "description": "Find the intersection of two arrays", + "version": "0.0.3", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/intersect.git" + }, + "homepage": "https://github.com/juliangruber/intersect", + "main": "index.js", + "scripts": { + "test": "tape test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~0.3.3" + }, + "keywords": [ + "interset", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/5.0.5..latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "readme": "\n# intersect\n\n## Usage\n\n```js\nvar intersect = require('intersect');\n\nvar a = ['foo', 'bar', 'baz'];\nvar b = ['nope', 'bar', 'baz'];\n\nconsole.log(intersect(a, b));\n// => ['bar', 'baz']\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/juliangruber/intersect/issues" + }, + "_id": "intersect@0.0.3", + "_from": "intersect@~0.0.3" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/test/test.js new file mode 100644 index 0000000..62a8765 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/node_modules/intersect/test/test.js @@ -0,0 +1,8 @@ +var test = require('tape'); +var intersect = require('..'); + +test('intersect', function (t) { + t.deepEqual(intersect([1], [2]), [], 'empty'); + t.deepEqual(intersect([1, 2], [2]), [2], 'intersection'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/package.json new file mode 100644 index 0000000..7b3cdae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/package.json @@ -0,0 +1,46 @@ +{ + "name": "bower-json", + "version": "0.4.0", + "description": "Read bower.json files with semantics, normalisation, defaults and validation.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/json/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/json.git" + }, + "main": "lib/json", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "deep-extend": "~0.2.5", + "graceful-fs": "~2.0.0", + "intersect": "~0.0.3" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0", + "grunt": "~0.4.1", + "grunt-contrib-watch": "~0.4.4", + "grunt-contrib-jshint": "~0.6.0", + "grunt-simple-mocha": "~0.4.0" + }, + "scripts": { + "test": "grunt test" + }, + "readme": "# bower-json [![Build Status](https://secure.travis-ci.org/bower/json.png?branch=master)](http://travis-ci.org/bower/json)\n\nRead `bower.json` files with semantics, normalisation, defaults and validation.\n\n\n## Usage\n\n#### .read(file, options, callback)\n\nReads `file` and applies normalisation, defaults and validation according to the `bower.json` spec. \nIf the passed `file` does not exist, the callback is called with `error.code` equal to `ENOENT`. \nIf the passed `file` contents are not valid JSON, the callback is called with `error.code` equal to `EMALFORMED`. \nIf the `json` does not comply with the `bower.json` spec, the callback is called with `error.code` equal to `EINVALID`.\n\nIf `file` is a directory, `find()` will be used to search for the json file. \nThe `options` argument is optional and can be omitted. These options will be passed to `parse` method.\n\n\n```js\nvar bowerJson = require('bower-json');\n\n// Can also be used by simply calling bowerJson()\nbowerJson.read('/path/to/bower.json', function (err, json) {\n if (err) {\n console.error('There was an error reading the file');\n console.error(err.message);\n return;\n }\n\n console.log('JSON: ', json);\n});\n```\n\n\n#### .parse(json, options)\n\nParses an object. Useful when you want to apply normalisation and validation directly to an object. \nIf the `json` does not comply with the `bower.json` spec, an error is thrown with `error.code` equal to `EINVALID`.\n\nThe `options` arguments is optional and can be omitted. Available options:\n\n- validate: Apply validation, defaults to `true`\n- normalize: Apply normalisation, defaults to `false`\n- clone: clone, use and return the passed in `json` object instead of using it directly, defaults to `false`\n\n\n```js\nvar bowerJson = require('bower-json');\n\nvar json = {\n name: 'my-package',\n version: '0.0.1'\n};\n\ntry {\n bowerJson.parse(json);\n} catch (err) {\n console.error('There was an error parsing the object');\n console.error(err.message);\n}\n```\n\n\n#### .validate(json)\n\nValidates the passed `json` object. \nThrows an error with `error.code` equal to `EINVALID` if it does not comply with the spec.\n\n\n```js\nvar bowerJson = require('bower-json');\n\nvar json = {\n name: 'my-package',\n version: '0.0.1'\n};\n\ntry {\n bowerJson.validate(json);\n} catch (err) {\n console.error('There was an error validating the object');\n console.error(err.message);\n}\n```\n\n\n#### .normalize(json)\n\n```js\nvar bowerJson = require('bower-json');\n\nvar json = {\n name: 'my-package',\n version: '0.0.1',\n main: 'foo.js,bar.js'\n};\n\nbowerJson.nornalize(json);\njson.main // ['foo.js', 'bar.js']\n```\n\n\n#### .find(folder, callback)\n\nFinds the `json` filename inside a folder. \nChecks if a `bower.json` exists, falling back to `component.json` (deprecated) and `.bower.json`. \nIf no file was found, the callback is called with a `error.code` of `ENOENT`.\n\n```js\nvar bowerJson = require('bower-json');\n\nbowerJson.find('/path/to/folder', function (err, filename) {\n if (err) {\n console.error('There is no json file in the folder');\n return;\n }\n\n console.log('Filename: ', filename);\n\n // Now that we got the filename, we can read its contents\n bowerJson.read(filename, function (err, json) {\n if (err) {\n console.error('There was an error reading the file');\n console.error(err.message);\n return;\n }\n\n console.log('JSON: ', json);\n });\n});\n```\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/json/issues" + }, + "homepage": "https://github.com/bower/json", + "_id": "bower-json@0.4.0", + "_from": "bower-json@~0.4.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-invalid/bower.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-invalid/bower.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-invalid/bower.json @@ -0,0 +1 @@ +{} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-malformed/bower.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-malformed/bower.json new file mode 100644 index 0000000..98232c6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json-malformed/bower.json @@ -0,0 +1 @@ +{ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json/bower.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json/bower.json new file mode 100644 index 0000000..d5d0d38 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-bower-json/bower.json @@ -0,0 +1,5 @@ +{ + "name": "some-pkg", + "version": "0.0.0", + "main": "foo.js" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component(1)-json/component.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component(1)-json/component.json new file mode 100644 index 0000000..a79407e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component(1)-json/component.json @@ -0,0 +1,14 @@ +{ + "name": "route", + "repo": "apily/route", + "version": "0.0.1", + "description": "Route component", + "keywords": ["router", "route"], + "scripts": ["index.js"], + "dependencies": {}, + "development": { + "component/assert": "*", + "visionmedia/mocha": "*" + }, + "license": "MIT" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component-json/component.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component-json/component.json new file mode 100644 index 0000000..e42186a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-component-json/component.json @@ -0,0 +1,4 @@ +{ + "name": "some-pkg", + "version": "0.0.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-dot-bower-json/.bower.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-dot-bower-json/.bower.json new file mode 100644 index 0000000..d475c45 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/pkg-dot-bower-json/.bower.json @@ -0,0 +1,5 @@ +{ + "name": "some-installed-pkg", + "version": "0.0.1", + "main": "bar.js" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/test.js new file mode 100644 index 0000000..8befab3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json/test/test.js @@ -0,0 +1,193 @@ +var path = require('path'); +var expect = require('expect.js'); +var bowerJson = require('../lib/json'); + +describe('.find', function () { + it('should find the bower.json file', function (done) { + bowerJson.find(__dirname + '/pkg-bower-json', function (err, file) { + if (err) { + return done(err); + } + + expect(file).to.equal(path.resolve(__dirname + '/pkg-bower-json/bower.json')); + done(); + }); + }); + + it('should fallback to the component.json file', function (done) { + bowerJson.find(__dirname + '/pkg-component-json', function (err, file) { + if (err) { + return done(err); + } + + expect(file).to.equal(path.resolve(__dirname + '/pkg-component-json/component.json')); + done(); + }); + }); + + it('should not fallback to the component.json file if it\'s a component(1) file', function (done) { + bowerJson.find(__dirname + '/pkg-component(1)-json', function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOENT'); + expect(err.message).to.equal('None of bower.json, component.json, .bower.json were found in ' + __dirname + '/pkg-component(1)-json'); + done(); + }); + }); + + it('should fallback to the .bower.json file', function (done) { + bowerJson.find(__dirname + '/pkg-dot-bower-json', function (err, file) { + if (err) { + return done(err); + } + + expect(file).to.equal(path.resolve(__dirname + '/pkg-dot-bower-json/.bower.json')); + done(); + }); + }); + + it('should error if no component.json / bower.json / .bower.json is found', function (done) { + bowerJson.find(__dirname, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOENT'); + expect(err.message).to.equal('None of bower.json, component.json, .bower.json were found in ' + __dirname); + done(); + }); + }); +}); + +describe('.read', function () { + it('should give error if file does not exists', function (done) { + bowerJson.read(__dirname + '/willneverexist', function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOENT'); + done(); + }); + }); + + it('should give error if when reading an invalid json', function (done) { + bowerJson.read(__dirname + '/pkg-bower-json-malformed/bower.json', function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EMALFORMED'); + expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-malformed/bower.json')); + done(); + }); + }); + + it('should read the file and give an object', function (done) { + bowerJson.read(__dirname + '/pkg-bower-json/bower.json', function (err, json) { + if (err) { + return done(err); + } + + expect(json).to.be.an('object'); + expect(json.name).to.equal('some-pkg'); + expect(json.version).to.equal('0.0.0'); + + done(); + }); + }); + + it('should give the json file that was read', function (done) { + bowerJson.read(__dirname + '/pkg-bower-json', function (err, json, file) { + if (err) { + return done(err); + } + + + expect(file).to.equal(__dirname + '/pkg-bower-json/bower.json'); + done(); + }); + }); + + it('should find for a json file if a directory is given', function (done) { + bowerJson.read(__dirname + '/pkg-component-json', function (err, json, file) { + if (err) { + return done(err); + } + + expect(json).to.be.an('object'); + expect(json.name).to.equal('some-pkg'); + expect(json.version).to.equal('0.0.0'); + expect(file).to.equal(path.resolve(__dirname + '/pkg-component-json/component.json')); + done(); + }); + }); + + it('should validate the returned object unless validate is false', function (done) { + bowerJson.read(__dirname + '/pkg-bower-json-invalid/bower.json', function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.contain('name'); + expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-invalid/bower.json')); + + bowerJson.read(__dirname + '/pkg-bower-json-invalid/bower.json', { validate: false }, function (err) { + done(err); + }); + }); + }); + + it('should normalize the returned object if normalize is true', function (done) { + bowerJson.read(__dirname + '/pkg-bower-json/bower.json', function (err, json) { + if (err) { + return done(err); + } + + expect(json.main).to.equal('foo.js'); + + bowerJson.read(__dirname + '/pkg-bower-json/bower.json', { normalize: true }, function (err, json) { + if (err) { + return done(err); + } + + expect(json.main).to.eql(['foo.js']); + done(); + }); + }); + }); +}); + +describe('.parse', function () { + it('should return the same object, unless clone is true', function () { + var json = { name: 'foo' }; + + expect(bowerJson.parse(json)).to.equal(json); + expect(bowerJson.parse(json, { clone: true })).to.not.equal(json); + expect(bowerJson.parse(json, { clone: true })).to.eql(json); + }); + + it('should validate the passed object, unless validate is false', function () { + expect(function () { + bowerJson.parse({}); + }).to.throwException(/name/); + + expect(function () { + bowerJson.parse({}, { validate: false }); + }).to.not.throwException(); + }); + + it('should not normalize the passed object unless normalize is true', function () { + var json = { name: 'foo', main: 'foo.js' }; + + bowerJson.parse(json); + expect(json.main).to.eql('foo.js'); + + bowerJson.parse(json, { normalize: true }); + expect(json.main).to.eql(['foo.js']); + }); +}); + +describe('.validate', function () { + it('should validate the name property', function () { + expect(function () { + bowerJson.validate({}); + }).to.throwException(/name/); + }); +}); + +describe('.normalize', function () { + it('should normalize the main property', function () { + var json = { name: 'foo', main: 'foo.js' }; + + bowerJson.normalize(json); + expect(json.main).to.eql(['foo.js']); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.jshintrc new file mode 100644 index 0000000..eae6f9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.jshintrc @@ -0,0 +1,62 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.npmignore new file mode 100644 index 0000000..1b6c50d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.* \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.travis.yml new file mode 100644 index 0000000..2ca91f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/README.md new file mode 100644 index 0000000..524f981 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/README.md @@ -0,0 +1,120 @@ +# bower-logger [![Build Status](https://secure.travis-ci.org/bower/logger.png?branch=master)](http://travis-ci.org/bower/logger) + +The logger used in the various architecture components of Bower. + + +## Usage + +### .error(id, message, data) + +Alias to `.log('error', id. message, data)` + + +### .conflict(id, message, data) + +Alias to `.log('conflict', id. message, data)` + + +### .warn(id, message, data) + +Alias to `.log('warn', id. message, data)` + + +### .action(id, message, data) + +Alias to `.log('action', id. message, data)` + + +### .info(id, message, data) + +Alias to `.log('info', id. message, data)` + + +### .debug(id, message, data) + +Alias to `.log('debug', id. message, data)` + + +### .log(level, id, message, data) + +Emits a `log` event, with an object like so: + +```js +logger.log('warn', 'foo', 'bar', { dog: 'loves cat' }) +{ + level: 'warn', + id: 'foo', + message: 'bar', + data: { + dog: 'loves cat' + } +} +``` + + +### .prompt(prompts, callback) + +Emits a `prompt` event with an array of `prompts` with a `callback`. +`prompts` can be an object or an array of objects. The `callback` will be called with an +the answer or an object of answers (if prompts was only one or an array respectively). +The `callback` is guaranteed to run only once. + +```js +logger.on('prompt', function (prompts, callback) { + // "prompts" is always an array of prompts + // Call "callback" with an object of answers when done + + // In this example, we will use the inquirer module to do the + // prompting for us + inquirer(prompts, callback); +}) + +logger.prompt({ + type: 'input' // Can be 'input', 'confirm' or 'password' + message: 'Type something', + validate: function (value) { + if (value !== 'I am awesome') { + return 'You must type "I am awesome"' + } + + return true; + } +}, function (err, answer) { + // Error will only happen on unsupported 'type' + if (err) { + return console.error(err.message); + } + + console.log(answer); +}); + + +``` + + +### .pipe(logger) + +Pipes all logger events to another logger. +Basically all events emitted with `.emit()` will get piped. + + +### .geminate() + +Creates a new logger that pipes events to the parent logger. +Alias for `(new Logger()).pipe(logger)`. + + +### .intercept(fn) + +Intercepts `log` events, calling `fn` before listeners of the instance. + + +### #LEVELS + +A static property that contains an object where keys are the recognized log levels and values their importance. +The higher the importance, the more important the level is. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/lib/Logger.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/lib/Logger.js new file mode 100644 index 0000000..7c4dff1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/lib/Logger.js @@ -0,0 +1,150 @@ +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var slice = Array.prototype.slice; + +function Logger() { + this._interceptors = []; + this._piped = []; +} + +util.inherits(Logger, EventEmitter); + +Logger.prototype.intercept = function (fn) { + this._interceptors.push(fn); + return this; +}; + +Logger.prototype.emit = function () { + var ret; + var args = slice.call(arguments); + + // Run interceptors before + if (args[0] === 'log') { + this._interceptors.forEach(function (interceptor) { + interceptor.apply(this, args.slice(1)); + }); + } + + ret = EventEmitter.prototype.emit.apply(this, args); + + // Pipe + this._piped.forEach(function (emitter) { + emitter.emit.apply(emitter, args); + }); + + return ret; +}; + +Logger.prototype.pipe = function (emitter) { + this._piped.push(emitter); + + return emitter; +}; + +Logger.prototype.geminate = function () { + var logger = new Logger(); + + logger.pipe(this); + return logger; +}; + +Logger.prototype.log = function (level, id, message, data) { + var log = { + level: level, + id: id, + message: message, + data: data || {} + }; + + // Emit log + this.emit('log', log); + + return this; +}; + +Logger.prototype.prompt = function (prompts, callback) { + var fn; + var one; + var invalid; + var runned; + var error; + var validPrompts = Logger._validPrompts; + + if (!Array.isArray(prompts)) { + prompts.name = 'prompt'; + prompts = [prompts]; + one = true; + } + + // Validate prompt types + invalid = prompts.some(function (prompt) { + return validPrompts.indexOf(prompt.type) === -1; + }); + + if (invalid) { + error = new Error('Unknown prompt type'); + error.code = 'ENOTSUP'; + return callback(error); + } + + fn = function (answers) { + // Run callback only once + if (runned) { + return; + } + + // Trim answers automatically + Object.keys(answers).forEach(function (key) { + var value = answers[key]; + + if (typeof value === 'string') { + answers[key] = value.trim(); + } else if (Array.isArray(value)) { + answers[key] = value.map(function (item) { + if (typeof item === 'string') { + return item.trim(); + } + }); + } + }); + + runned = true; + + // If only one prompt was requested, resolve with its answer + if (one) { + answers = answers.prompt; + } + + callback(null, answers); + }; + + this.emit('prompt', prompts, fn); +}; + +// ------------------ + +Logger._validPrompts = [ + 'input', + 'confirm', + 'password', + 'checkbox' +]; + +Logger.LEVELS = { + 'error': 5, + 'conflict': 4, + 'warn': 3, + 'action': 2, + 'info': 1, + 'debug': 0 +}; + +// Add helpful log methods +Object.keys(Logger.LEVELS).forEach(function (level) { + Logger.prototype[level] = function (id, message, data) { + this.log(level, id, message, data); + }; +}); + +module.exports = Logger; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/package.json new file mode 100644 index 0000000..52470a3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/package.json @@ -0,0 +1,41 @@ +{ + "name": "bower-logger", + "version": "0.2.2", + "description": "The logger used in the various architecture components of Bower.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/logger/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/logger.git" + }, + "main": "lib/Logger", + "engines": { + "node": ">=0.8.0" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# bower-logger [![Build Status](https://secure.travis-ci.org/bower/logger.png?branch=master)](http://travis-ci.org/bower/logger)\n\nThe logger used in the various architecture components of Bower.\n\n\n## Usage\n\n### .error(id, message, data)\n\nAlias to `.log('error', id. message, data)`\n\n\n### .conflict(id, message, data)\n\nAlias to `.log('conflict', id. message, data)`\n\n\n### .warn(id, message, data)\n\nAlias to `.log('warn', id. message, data)`\n\n\n### .action(id, message, data)\n\nAlias to `.log('action', id. message, data)`\n\n\n### .info(id, message, data)\n\nAlias to `.log('info', id. message, data)`\n\n\n### .debug(id, message, data)\n\nAlias to `.log('debug', id. message, data)`\n\n\n### .log(level, id, message, data)\n\nEmits a `log` event, with an object like so:\n\n```js\nlogger.log('warn', 'foo', 'bar', { dog: 'loves cat' })\n{\n level: 'warn',\n id: 'foo',\n message: 'bar',\n data: {\n dog: 'loves cat'\n }\n}\n```\n\n\n### .prompt(prompts, callback)\n\nEmits a `prompt` event with an array of `prompts` with a `callback`. \n`prompts` can be an object or an array of objects. The `callback` will be called with an\nthe answer or an object of answers (if prompts was only one or an array respectively).\nThe `callback` is guaranteed to run only once.\n\n```js\nlogger.on('prompt', function (prompts, callback) {\n // \"prompts\" is always an array of prompts\n // Call \"callback\" with an object of answers when done\n\n // In this example, we will use the inquirer module to do the\n // prompting for us\n inquirer(prompts, callback);\n})\n\nlogger.prompt({\n type: 'input' // Can be 'input', 'confirm' or 'password'\n message: 'Type something',\n validate: function (value) {\n if (value !== 'I am awesome') {\n return 'You must type \"I am awesome\"'\n }\n\n return true;\n }\n}, function (err, answer) {\n // Error will only happen on unsupported 'type'\n if (err) {\n return console.error(err.message);\n }\n\n console.log(answer);\n});\n\n\n```\n\n\n### .pipe(logger)\n\nPipes all logger events to another logger. \nBasically all events emitted with `.emit()` will get piped.\n\n\n### .geminate()\n\nCreates a new logger that pipes events to the parent logger. \nAlias for `(new Logger()).pipe(logger)`.\n\n\n### .intercept(fn)\n\nIntercepts `log` events, calling `fn` before listeners of the instance.\n\n\n### #LEVELS\n\nA static property that contains an object where keys are the recognized log levels and values their importance. \nThe higher the importance, the more important the level is.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/logger/issues" + }, + "homepage": "https://github.com/bower/logger", + "_id": "bower-logger@0.2.2", + "dist": { + "shasum": "8289c53aa8053879b68a4e1a1b68dd477dcc685b" + }, + "_from": "bower-logger@~0.2.1", + "_resolved": "https://registry.npmjs.org/bower-logger/-/bower-logger-0.2.2.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/test/test.js new file mode 100644 index 0000000..54f394f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-logger/test/test.js @@ -0,0 +1,389 @@ +var expect = require('expect.js'); +var EventEmitter = require('events').EventEmitter; +var Logger = require('../'); + +describe('Logger', function () { + var logger; + + beforeEach(function () { + logger = new Logger(); + }); + + describe('.constructor', function () { + it('should provide an instance of Logger', function () { + expect(logger instanceof Logger).to.be(true); + }); + + it('should provide an instance of EventEmitter', function () { + expect(logger instanceof EventEmitter).to.be(true); + }); + + it('should have prototype methods', function () { + var methods = [ + 'intercept', 'pipe', 'geminate', 'log' + ]; + + methods.forEach(function (method) { + expect(logger).to.have.property(method); + }); + }); + }); + + describe('events', function () { + var logData = { + foo: 'bar', + baz: 'string' + }; + + it('should pass through {}', function (next) { + logger.on('log', function (log) { + expect(log.data).to.eql({}); + next(); + }); + logger.info(); + }); + + it('should pass through logData', function (next) { + logger.on('log', function (log) { + expect(log.data).to.eql(logData); + next(); + }); + logger.info('foo', 'message', logData); + }); + + it('should emit error event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('error'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('error message'); + expect(log.data).to.eql({}); + next(); + }); + logger.error('foo', 'error message'); + }); + + it('should emit conflict event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('conflict'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('conflict message'); + expect(log.data).to.eql({}); + next(); + }); + logger.conflict('foo', 'conflict message'); + }); + + it('should emit warn event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('warn'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('warn message'); + expect(log.data).to.eql({}); + next(); + }); + logger.warn('foo', 'warn message'); + }); + + it('should emit action event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('action'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('action message'); + expect(log.data).to.eql({}); + next(); + }); + logger.action('foo', 'action message'); + }); + + it('should emit info event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('info'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('info message'); + expect(log.data).to.eql({}); + next(); + }); + logger.info('foo', 'info message'); + }); + + it('should emit debug event', function (next) { + logger.on('log', function (log) { + expect(log.level).to.eql('debug'); + expect(log.id).to.eql('foo'); + expect(log.message).to.eql('debug message'); + expect(log.data).to.eql({}); + next(); + }); + logger.debug('foo', 'debug message'); + }); + }); + + describe('.intercept', function () { + it('should add the function and call it when a log occurs', function (next) { + var called; + var data = { + 'some': 'thing' + }; + + logger.intercept(function (log) { + called = true; + + expect(log).to.eql({ + level: 'warn', + id: 'foo', + message: 'bar', + data: data + }); + expect(log.data).to.equal(data); + }); + + logger.log('warn', 'foo', 'bar', data); + + expect(called).to.be(true); + next(); + }); + + it('should call the interceptors by order before emitting the event', function (next) { + var called = []; + + logger.intercept(function () { + called.push(1); + }); + logger.intercept(function () { + called.push(2); + }); + + logger.log('warn', 'foo', 'bar'); + + expect(called).to.eql([1, 2]); + next(); + }); + + it('should call the interceptors along the chain', function (next) { + var called = []; + var childLogger = logger.geminate(); + + childLogger.intercept(function () { + called.push(1); + }); + logger.intercept(function () { + called.push(3); + }); + + childLogger.on('log', function () { + called.push(2); + }); + logger.on('log', function () { + called.push(4); + }); + + childLogger.log('warn', 'foo', 'bar'); + + expect(called).to.eql([1, 2, 3, 4]); + next(); + }); + }); + + describe('.pipe', function () { + it('should return the passed emitter', function () { + var otherEmitter = new EventEmitter(); + expect(logger.pipe(otherEmitter)).to.equal(otherEmitter); + }); + + it('should pipe log events to another emitter', function (next) { + var otherEmitter = new EventEmitter(); + var data = { + 'some': 'thing' + }; + var piped; + + logger.pipe(otherEmitter); + + otherEmitter.on('log', function (log) { + piped = true; + expect(log).to.eql({ + level: 'warn', + id: 'foo', + message: 'bar', + data: data + }); + }); + + logger.log('warn', 'foo', 'bar', data); + + expect(piped).to.be(true); + next(); + }); + }); + + describe('.geminate', function () { + it('should return a new logger instance', function () { + var newLogger = logger.geminate(); + + expect(newLogger).to.be.an(Logger); + expect(newLogger).to.be.an(EventEmitter); + expect(newLogger).to.not.be.equal(logger); + }); + + it('should pipe the new logger events to the original logger', function (next) { + var piped = []; + var childLogger = logger.geminate(); + var data = { + 'some': 'thing' + }; + + childLogger.on('log', function (log) { + piped.push(1); + expect(log).to.eql({ + level: 'warn', + id: 'foo', + message: 'bar', + data: data + }); + expect(log.data).to.equal(data); + }); + + logger.on('log', function (log) { + piped.push(2); + expect(log).to.eql({ + level: 'warn', + id: 'foo', + message: 'bar', + data: data + }); + expect(log.data).to.equal(data); + }); + + childLogger.log('warn', 'foo', 'bar', data); + expect(piped).to.eql([1, 2]); + next(); + }); + }); + + describe('.prompt', function () { + it('should only allow calling the callback once', function () { + var calls = 0; + + logger + .once('prompt', function (prompts, callback) { + callback({ prompt: 'bar' }); + callback({ prompt: 'foo' }); + }) + .prompt({ + type: 'input', + message: 'foo' + }, function () { + calls += 1; + }); + + expect(calls).to.equal(1); + }); + + it('should accept a prompt', function (next) { + logger + .once('prompt', function (prompts, callback) { + callback({ + prompt: 'bar' + }); + }) + .prompt({ + type: 'input', + message: 'foo' + }, function (err, answer) { + expect(err).to.not.be.ok(); + expect(answer).to.equal('bar'); + next(); + }); + }); + + it('should accept several prompts', function (next) { + logger + .once('prompt', function (prompts, callback) { + callback({ + foo: 'bar', + foz: 'baz' + }); + }) + .prompt([ + { + name: 'foo', + type: 'input', + message: 'foo' + }, + { + name: 'foz', + type: 'confirm', + message: 'foz' + } + ], function (err, answer) { + expect(err).to.not.be.ok(); + expect(answer.foo).to.equal('bar'); + expect(answer.foz).to.equal('baz'); + + logger + .once('prompt', function (prompts, callback) { + callback({ + foo: 'bar' + }); + }) + .prompt([ + { + name: 'foo', + type: 'input', + message: 'foo' + } + ], function (err, answer) { + expect(err).to.not.be.ok(); + expect(answer.foo).to.equal('bar'); + next(); + }); + }); + }); + + it('should error on invalid prompt type', function (next) { + logger.prompt({ + type: 'xxx', + message: 'foo' + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.be('ENOTSUP'); + next(); + }); + }); + + it('should trim the answers', function (next) { + logger + .once('prompt', function (prompts, callback) { + callback({ + prompt: ' bar ' + }); + }) + .prompt({ + type: 'input', + message: 'foo' + }, function (err, answer) { + expect(err).to.not.be.ok(); + expect(answer).to.equal('bar'); + next(); + }); + }); + + it('should trim multiple response answers', function (next) { + logger + .once('prompt', function (prompts, callback) { + callback({ + prompt: [' bar ', ' foo', 'baz '] + }); + }) + .prompt({ + type: 'checkbox', + message: 'foo' + }, function (err, answer) { + expect(err).to.not.be.ok(); + expect(answer).to.eql(['bar', 'foo', 'baz']); + next(); + }); + }); + + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.jshintrc new file mode 100644 index 0000000..5046798 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.jshintrc @@ -0,0 +1,61 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "esnext": false, + "evil": false, + "expr": true, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.npmignore new file mode 100644 index 0000000..1b6c50d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.* \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.travis.yml new file mode 100644 index 0000000..7ab0926 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/.travis.yml @@ -0,0 +1,6 @@ +before_script: + - npm install -g grunt-cli +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Client.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Client.js new file mode 100644 index 0000000..4d6ddb6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Client.js @@ -0,0 +1,66 @@ +var async = require('async'); +var Config = require('bower-config'); +var methods = require('./lib'); +var Cache = require('./lib/util/Cache'); + +function RegistryClient(config, logger) { + this._logger = logger; + this._config = Config.normalise(config); + + // Cache defaults to storage registry + if (!Object.prototype.hasOwnProperty.call(this._config, 'cache')) { + this._config.cache = this._config.storage ? this._config.storage.registry : null; + } + + // Init the cache + this._initCache(); +} + +// Add every method to the prototype +RegistryClient.prototype.lookup = methods.lookup; +RegistryClient.prototype.search = methods.search; +RegistryClient.prototype.list = methods.list; +RegistryClient.prototype.register = methods.register; + +RegistryClient.prototype.clearCache = function (name, callback) { + if (typeof name === 'function') { + callback = name; + name = null; + } + + async.parallel([ + this.lookup.clearCache.bind(this, name), + this.search.clearCache.bind(this, name), + this.list.clearCache.bind(this) + ], callback); +}; + +RegistryClient.prototype.resetCache = function (name) { + this.lookup.resetCache.call(this, name); + this.search.resetCache.call(this, name); + this.list.resetCache.call(this); + + return this; +}; + +RegistryClient.clearRuntimeCache = function () { + Cache.clearRuntimeCache(); +}; + +// ----------------------------- + +RegistryClient.prototype._initCache = function () { + var cache; + var dir = this._config.cache; + + // Cache is stored/retrieved statically to ensure singularity + // among instances + cache = this.constructor._cache = this.constructor._cache || {}; + this._cache = cache[dir] = cache[dir] || {}; + + this.lookup.initCache.call(this); + this.search.initCache.call(this); + this.list.initCache.call(this); +}; + +module.exports = RegistryClient; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js new file mode 100644 index 0000000..11042a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function (grunt) { + + 'use strict'; + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-mocha'); + + // Project configuration. + grunt.initConfig({ + + jshint: { + files: [ + 'Gruntfile.js', + 'lib/**/*.js', + 'test/**/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + + simplemocha: { + options: { + reporter: 'spec' + }, + full: { src: ['test/runner.js'] }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/runner.js'] + }, + build: { + options: { + reporter: 'tap' + }, + src: ['test/runner.js'] + } + }, + + + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + + }); + + // Default task. + grunt.registerTask('test', ['simplemocha:full']); + grunt.registerTask('default', ['jshint', 'test']); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/README.md new file mode 100644 index 0000000..6896e27 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/README.md @@ -0,0 +1,148 @@ +# bower-registry-client [![Build Status](https://secure.travis-ci.org/bower/registry-client.png?branch=master)](http://travis-ci.org/bower/registry-client) + +This module allows you to easily interact with the Bower server API. + + +## Usage + +```js + +var RegistryClient = require('bower-registry-client'); +var registry = new RegistryClient(options, logger); +``` + +The `logger` is optional and is expected to be an instance of the bower [logger](https://github.com/bower/logger). +Available constructor options: + +- `cache`: the cache folder to use for some operations; using null will disable persistent cache (defaults to bower registry cache folder) +- `registry.search`: an array of registry search endpoints (defaults to the Bower server) +- `registry.register`: the endpoint to use when registering packages (defaults to the Bower server) +- `registry.publish`: the endpoint to use when publishing packages (defaults to the Bower server) +- `ca.search`: an array of CA certificates for each registry.search (defaults to null). +- `ca.register`: the CA certificate for registry.register +- `ca.publish`: the CA certificate for registry.publish +- `proxy`: the proxy to use for http requests (defaults to null) +- `httpsProxy`: the proxy to use for https requests (defaults to null) +- `strictSsl`: whether or not to do SSL key validation when making requests via https (defaults to true). +- `userAgent`: the user agent to use for the requests (defaults to null) +- `timeout`: the timeout for the requests to finish (defaults to 60000) +- `force`: If set to true, cache will be bypassed and remotes will always be hit (defaults to false). +- `offline`: If set to true, only the cache will be used (defaults to false). + + +Note that `force` and `offline` are mutually exclusive. +The cache will speedup operations such as `list`, `lookup` and `search`. +Different operations may have different cache expiration times. + + +#### .lookup(name, callback) + +Looks the registry for the package `name`, + +```js +registry.lookup('jquery', function (err, entry) { + if (err) { + console.error(err.message); + return; + } + + // For now resp.type is always 'alias' + console.log('type', entry.type); + console.log('url', entry.url); +}); +``` + +#### .register(name, url, callback) + +Registers a package in the registry. + +```js +registry.register('my-package', 'git://github.com/my-org/my-package.git', function (err, pkg) { + if (err) { + console.error(err.message); + return; + } + + console.log('name', pkg.name); + console.log('url: ', pkg.url); +}); +``` + +#### .search(str, callback) + +Searches the registry. + +```js +registry.search('jquery', function (err, results) { + if (err) { + console.error(err.message); + return; + } + + results.forEach(function (pkg) { + console.log('name', pkg.name); + console.log('url', pkg.url); + }); +}); +``` + +#### .clearCache(name, callback) + +Clears the persistent and runtime cache associated with the `name` package. +If `name` is null, clears the cache for every package. + +Note that in most cases, you don't need to clear the cache since it has +self expiration times. + +```js +// Clear jquery cache +registry.clearCache('jquery', function (err) { + if (err) { + console.error(err.message); + return; + } + + console.log('Done'); +}); + +// Clear all cache +registry.clearCache(function (err) { + if (err) { + console.error(err.message); + return; + } + + console.log('Done'); +}); +``` + + +#### .resetCache() + +Clears the in-memory cache used to speed up the instance. + +Note that in most cases, you don't need to clear the runtime cache since it has +self expiration times. +Might be useful if you use this module in long-living programs. + +```js +registry.resetCache(); +``` + +#### #clearRuntimeCache() + +Clears the in-memory cache used to speed up the whole module. +This clears the static in-memory cache as well as in-memory cache used by instances. + +Note that in edge cases, some instance's in-memory cache might be skipped. +If that's a problem, you should create fresh instances instead. + +```js +RegistryClient.clearRuntimeCache(); +``` + + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/index.js new file mode 100644 index 0000000..e1e9804 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/index.js @@ -0,0 +1,6 @@ +module.exports = { + lookup: require('./lookup'), + list: require('./list'), + register: require('./register'), + search: require('./search') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/list.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/list.js new file mode 100644 index 0000000..4790da2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/list.js @@ -0,0 +1,185 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var Cache = require('./util/Cache'); +var createError = require('./util/createError'); + +function list(callback) { + var data = []; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed, simply + // error with package not found + if (!total) { + return callback(null, []); + } + + // List packages in series in each registry + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var listCache = that._listCache[remote.host]; + + // If offline flag is passed, only query the cache + if (that._config.offline) { + return listCache.get('list', function (err, results) { + if (err || !results) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + next(); + }); + } + + // Otherwise make a request to always obtain fresh data + doRequest.call(that, index, function (err, results) { + if (err || !results) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult(data, result); + }); + + // Store in cache for future offline usage + listCache.set('list', results, getMaxAge(), next); + }); + }, function () { + // Until there's still registries to test + return ++index === total; + }, function (err) { + // Clear runtime cache, keeping the persistent data + // in files for future offline usage + resetCache(); + + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function addResult(accumulated, result) { + var exists = accumulated.some(function (current) { + return current.name === result.name; + }); + + if (!exists) { + accumulated.push(result); + } +} + +function doRequest(index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages'; + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + ca: this._config.ca.search[index], + headers:headers, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + callback(null, body); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge() { + // Make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._listCache = this._cache.list || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._listCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'list'); + } + + this._listCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(callback) { + var listCache = this._listCache; + var remotes = Object.keys(listCache); + + // There's only one key, which is 'list'.. + // But we clear everything anyway + async.forEach(remotes, function (remote, next) { + listCache[remote].clear(next); + }, callback); +} + +function resetCache() { + var remote; + + for (remote in this._listCache) { + this._listCache[remote].reset(); + } +} + +list.initCache = initCache; +list.clearCache = clearCache; +list.resetCache = resetCache; + +module.exports = list; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js new file mode 100644 index 0000000..7181175 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js @@ -0,0 +1,199 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var createError = require('./util/createError'); +var Cache = require('./util/Cache'); + +function lookup(name, callback) { + var data; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed.. + if (!total) { + return callback(); + } + + // Lookup package in series in each registry + // endpoint until we got the data + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var lookupCache = that._lookupCache[remote.host]; + + // If force flag is disabled we check the cache + if (!that._config.force) { + lookupCache.get(name, function (err, value) { + data = value; + + // Don't proceed with making a request if we got an error, + // a value from the cache or if the offline flag is enabled + if (err || data || that._config.offline) { + return next(err); + } + + doRequest.call(that, name, index, function (err, entry) { + if (err || !entry) { + return next(err); + } + + data = entry; + + // Store in cache + lookupCache.set(name, entry, getMaxAge(entry), next); + }); + }); + // Otherwise, we totally bypass the cache and + // make only the request + } else { + doRequest.call(that, name, index, function (err, entry) { + if (err || !entry) { + return next(err); + } + + data = entry; + + // Store in cache + lookupCache.set(name, entry, getMaxAge(entry), next); + }); + } + }, function () { + // Until the data is unknown or there's still registries to test + return !!data || ++index === total; + }, function (err) { + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function doRequest(name, index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages/' + encodeURIComponent(name); + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + headers:headers, + ca: this._config.ca.search[index], + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // If not found, try next + if (response.statusCode === 404) { + return callback(); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + callback(null, { + type: 'alias', + url: body.url + }); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge(entry) { + // If type is alias, make it 5 days + if (entry.type === 'alias') { + return 5 * 24 * 60 * 60 * 1000; + } + + // Otherwise make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._lookupCache = this._cache.lookup || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._lookupCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'lookup'); + } + + this._lookupCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(name, callback) { + var lookupCache = this._lookupCache; + var remotes = Object.keys(lookupCache); + + if (typeof name === 'function') { + callback = name; + name = null; + } + + if (name) { + async.forEach(remotes, function (remote, next) { + lookupCache[remote].del(name, next); + }, callback); + } else { + async.forEach(remotes, function (remote, next) { + lookupCache[remote].clear(next); + }, callback); + } +} + +function resetCache() { + var remote; + + for (remote in this._lookupCache) { + this._lookupCache[remote].reset(); + } +} + +lookup.initCache = initCache; +lookup.clearCache = clearCache; +lookup.resetCache = resetCache; + +module.exports = lookup; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/register.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/register.js new file mode 100644 index 0000000..25133fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/register.js @@ -0,0 +1,55 @@ +var parseUrl = require('url').parse; +var request = require('request'); +var createError = require('./util/createError'); + +function register(name, url, callback) { + var config = this._config; + var requestUrl = config.registry.register + '/packages'; + var remote = parseUrl(requestUrl); + var headers = {}; + + if (config.userAgent) { + headers['User-Agent'] = config.userAgent; + } + + request.post({ + url: requestUrl, + proxy: remote.protocol === 'https:' ? config.httpsProxy : config.proxy, + headers:headers, + ca: config.ca.register, + strictSSL: config.strictSsl, + timeout: config.timeout, + json: true, + form: { + name: name, + url: url + } + }, function (err, response) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Duplicate + if (response.statusCode === 406) { + return callback(createError('Duplicate package', 'EDUPLICATE')); + } + + // Invalid format + if (response.statusCode === 400) { + return callback(createError('Invalid URL format', 'EINVFORMAT')); + } + + // Everything other than 201 is unknown + if (response.statusCode !== 201) { + return callback(createError('Unknown error: ' + response.statusCode, 'EUNKNOWN')); + } + + callback(null, { + name: name, + url: url + }); + }); +} + +module.exports = register; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/search.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/search.js new file mode 100644 index 0000000..4804ac4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/search.js @@ -0,0 +1,201 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var Cache = require('./util/Cache'); +var createError = require('./util/createError'); + +// TODO: +// The search cache simply stores a specific search result +// into a file. This is a very rudimentary algorithm but +// works to support elementary offline support +// Once the registry server is rewritten, a better strategy +// can be implemented (with diffs and local search), similar to npm. + +function search(name, callback) { + var data = []; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed, simply + // error with package not found + if (!total) { + return callback(null, []); + } + + // Search package in series in each registry, + // merging results together + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var searchCache = that._searchCache[remote.host]; + + // If offline flag is passed, only query the cache + if (that._config.offline) { + return searchCache.get(name, function (err, results) { + if (err || !results || !results.length) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + next(); + }); + } + + // Otherwise make a request to always obtain fresh data + doRequest.call(that, name, index, function (err, results) { + if (err || !results || !results.length) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + // Store in cache for future offline usage + searchCache.set(name, results, getMaxAge(), next); + }); + }, function () { + // Until the data is unknown or there's still registries to test + return ++index === total; + }, function (err) { + // Clear runtime cache, keeping the persistent data + // in files for future offline usage + resetCache(); + + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function addResult(accumulated, result) { + var exists = accumulated.some(function (current) { + return current.name === result.name; + }); + + if (!exists) { + accumulated.push(result); + } +} + +function doRequest(name, index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages/search/' + encodeURIComponent(name); + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + headers:headers, + ca: this._config.ca.search[index], + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + callback(null, body); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge() { + // Make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._searchCache = this._cache.search || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._searchCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'search'); + } + + this._searchCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(name, callback) { + var searchCache = this._searchCache; + var remotes = Object.keys(searchCache); + + if (typeof name === 'function') { + callback = name; + name = null; + } + + // Simply erase everything since other searches could + // contain the "name" package + // One possible solution would be to read every entry from the cache and + // delete if the package is contained in the search results + // But this is too expensive + async.forEach(remotes, function (remote, next) { + searchCache[remote].clear(next); + }, callback); +} + +function resetCache() { + var remote; + + for (remote in this._searchCache) { + this._searchCache[remote].reset(); + } +} + +search.initCache = initCache; +search.clearCache = clearCache; +search.resetCache = resetCache; + +module.exports = search; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js new file mode 100644 index 0000000..c490b91 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js @@ -0,0 +1,195 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var async = require('async'); +var mkdirp = require('mkdirp'); +var LRU = require('lru-cache'); +var md5 = require('./md5'); + +function Cache(dir, options) { + options = options || {}; + + this._dir = dir; + this._options = options; + this._cache = this.constructor._cache.get(this._dir); + + if (!this._cache) { + this._cache = new LRU(options); + this.constructor._cache.set(this._dir, this._cache); + } + + if (dir) { + mkdirp.sync(dir); + } +} + +Cache.prototype.get = function (key, callback) { + var file; + var json = this._cache.get(key); + + // Check in memory + if (json) { + if (this._hasExpired(json)) { + this.del(key, callback); + } else { + callback(null, json.value); + } + + return; + } + + // Check in disk + if (!this._dir) { + return callback(null); + } + + file = this._getFile(key); + fs.readFile(file, function (err, contents) { + var json; + + // Check if there was an error reading + // Note that if the file does not exist then + // we don't have its value + if (err) { + return callback(err.code === 'ENOENT' ? null : err); + } + + // If there was an error reading the file as json + // simply assume it doesn't exist + try { + json = JSON.parse(contents.toString()); + } catch (e) { + return this.del(key, callback); // If so, delete it + } + + // Check if it has expired + if (this._hasExpired(json)) { + return this.del(key, callback); + } + + this._cache.set(key, json); + callback(null, json.value); + }.bind(this)); +}; + +Cache.prototype.set = function (key, value, maxAge, callback) { + var file; + var entry; + var str; + + maxAge = maxAge != null ? maxAge : this._options.maxAge; + entry = { + expires: maxAge ? Date.now() + maxAge : null, + value: value + }; + + // Store in memory + this._cache.set(key, entry); + + // Store in disk + if (!this._dir) { + return callback(null); + } + + // If there was an error generating the json + // then there's some cyclic reference or some other issue + try { + str = JSON.stringify(entry); + } catch (e) { + return callback(e); + } + + file = this._getFile(key); + fs.writeFile(file, str, callback); +}; + +Cache.prototype.del = function (key, callback) { + // Delete from memory + this._cache.del(key); + + // Delete from disk + if (!this._dir) { + return callback(null); + } + + fs.unlink(this._getFile(key), function (err) { + if (err && err.code !== 'ENOENT') { + return callback(err); + } + + callback(); + }); +}; + +Cache.prototype.clear = function (callback) { + var dir = this._dir; + + // Clear in memory cache + this._cache.reset(); + + // Clear everything from the disk + if (!dir) { + return callback(null); + } + + fs.readdir(dir, function (err, files) { + if (err) { + return callback(err); + } + + // Delete every file in parallel + async.forEach(files, function (file, next) { + fs.unlink(path.join(dir, file), function (err) { + if (err && err.code !== 'ENOENT') { + return next(err); + } + + next(); + }); + }, callback); + }); +}; + +Cache.prototype.reset = function () { + this._cache.reset(); +}; + +Cache.clearRuntimeCache = function () { + // Note that _cache refers to the static _cache variable + // that holds other caches per dir! + // Do not confuse it with the instance cache + + // Clear cache of each directory + this._cache.forEach(function (cache) { + cache.reset(); + }); + + // Clear root cache + this._cache.reset(); +}; + +//------------------------------- + +Cache.prototype._hasExpired = function (json) { + var expires = json.expires; + + if (!expires || this._options.useStale) { + return false; + } + + // Check if the key has expired + return Date.now() > expires; +}; + +Cache.prototype._getFile = function (key) { + // Append a truncated md5 to the end of the file to solve case issues + // on case insensitive file systems + // See: https://github.com/bower/bower/issues/859 + return path.join(this._dir, encodeURIComponent(key) + '_' + md5(key).substr(0, 5)); +}; + +Cache._cache = new LRU({ + max: 5, + maxAge: 60 * 30 * 1000 // 30 minutes +}); + +module.exports = Cache; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js new file mode 100644 index 0000000..8e9a416 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js @@ -0,0 +1,8 @@ +function createError(msg, code) { + var err = new Error(msg); + err.code = code; + + return err; +} + +module.exports = createError; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js new file mode 100644 index 0000000..dbc920b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js @@ -0,0 +1,7 @@ +var crypto = require('crypto'); + +function md5(contents) { + return crypto.createHash('md5').update(contents).digest('hex'); +} + +module.exports = md5; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/LICENSE new file mode 100644 index 0000000..b7f9d50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Caolan McMahon + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/README.md new file mode 100644 index 0000000..951f76e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/README.md @@ -0,0 +1,1425 @@ +# Async.js + +Async is a utility module which provides straight-forward, powerful functions +for working with asynchronous JavaScript. Although originally designed for +use with [node.js](http://nodejs.org), it can also be used directly in the +browser. Also supports [component](https://github.com/component/component). + +Async provides around 20 functions that include the usual 'functional' +suspects (map, reduce, filter, each…) as well as some common patterns +for asynchronous control flow (parallel, series, waterfall…). All these +functions assume you follow the node.js convention of providing a single +callback as the last argument of your async function. + + +## Quick Examples + +```javascript +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); + +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); + +async.parallel([ + function(){ ... }, + function(){ ... } +], callback); + +async.series([ + function(){ ... }, + function(){ ... } +]); +``` + +There are many more functions available so take a look at the docs below for a +full list. This module aims to be comprehensive, so if you feel anything is +missing please create a GitHub issue for it. + +## Common Pitfalls + +### Binding a context to an iterator + +This section is really about bind, not about async. If you are wondering how to +make async execute your iterators in a given context, or are confused as to why +a method of another library isn't working as an iterator, study this example: + +```js +// Here is a simple object with an (unnecessarily roundabout) squaring method +var AsyncSquaringLibrary = { + squareExponent: 2, + square: function(number, callback){ + var result = Math.pow(number, this.squareExponent); + setTimeout(function(){ + callback(null, result); + }, 200); + } +}; + +async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){ + // result is [NaN, NaN, NaN] + // This fails because the `this.squareExponent` expression in the square + // function is not evaluated in the context of AsyncSquaringLibrary, and is + // therefore undefined. +}); + +async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){ + // result is [1, 4, 9] + // With the help of bind we can attach a context to the iterator before + // passing it to async. Now the square function will be executed in its + // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent` + // will be as expected. +}); +``` + +## Download + +The source is available for download from +[GitHub](http://github.com/caolan/async). +Alternatively, you can install using Node Package Manager (npm): + + npm install async + +__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed + +## In the Browser + +So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: + +```html + + +``` + +## Documentation + +### Collections + +* [each](#each) +* [eachSeries](#eachSeries) +* [eachLimit](#eachLimit) +* [map](#map) +* [mapSeries](#mapSeries) +* [mapLimit](#mapLimit) +* [filter](#filter) +* [filterSeries](#filterSeries) +* [reject](#reject) +* [rejectSeries](#rejectSeries) +* [reduce](#reduce) +* [reduceRight](#reduceRight) +* [detect](#detect) +* [detectSeries](#detectSeries) +* [sortBy](#sortBy) +* [some](#some) +* [every](#every) +* [concat](#concat) +* [concatSeries](#concatSeries) + +### Control Flow + +* [series](#series) +* [parallel](#parallel) +* [parallelLimit](#parallellimittasks-limit-callback) +* [whilst](#whilst) +* [doWhilst](#doWhilst) +* [until](#until) +* [doUntil](#doUntil) +* [forever](#forever) +* [waterfall](#waterfall) +* [compose](#compose) +* [applyEach](#applyEach) +* [applyEachSeries](#applyEachSeries) +* [queue](#queue) +* [cargo](#cargo) +* [auto](#auto) +* [iterator](#iterator) +* [apply](#apply) +* [nextTick](#nextTick) +* [times](#times) +* [timesSeries](#timesSeries) + +### Utils + +* [memoize](#memoize) +* [unmemoize](#unmemoize) +* [log](#log) +* [dir](#dir) +* [noConflict](#noConflict) + + +## Collections + + + +### each(arr, iterator, callback) + +Applies an iterator function to each item in an array, in parallel. +The iterator is called with an item from the list and a callback for when it +has finished. If the iterator passes an error to this callback, the main +callback for the each function is immediately called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err) which must be called once it has + completed. If no error has occured, the callback should be run without + arguments or with an explicit null argument. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +--------------------------------------- + + + +### eachSeries(arr, iterator, callback) + +The same as each only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. This means the iterator functions will complete in order. + + +--------------------------------------- + + + +### eachLimit(arr, limit, iterator, callback) + +The same as each only no more than "limit" iterators will be simultaneously +running at any time. + +Note that the items are not processed in batches, so there is no guarantee that + the first "limit" iterator functions will complete before any others are +started. + +__Arguments__ + +* arr - An array to iterate over. +* limit - The maximum number of iterators to run at any time. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err) which must be called once it has + completed. If no error has occured, the callback should be run without + arguments or with an explicit null argument. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + +```js +// Assume documents is an array of JSON objects and requestApi is a +// function that interacts with a rate-limited REST api. + +async.eachLimit(documents, 20, requestApi, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +--------------------------------------- + + +### map(arr, iterator, callback) + +Produces a new array of values by mapping each value in the given array through +the iterator function. The iterator is called with an item from the array and a +callback for when it has finished processing. The callback takes 2 arguments, +an error and the transformed item from the array. If the iterator passes an +error to this callback, the main callback for the map function is immediately +called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order, however +the results array will be in the same order as the original array. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, transformed) which must be called once + it has completed with an error (which can be null) and a transformed item. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array of the + transformed items from the original array. + +__Example__ + +```js +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +--------------------------------------- + + +### mapSeries(arr, iterator, callback) + +The same as map only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + + +--------------------------------------- + + +### mapLimit(arr, limit, iterator, callback) + +The same as map only no more than "limit" iterators will be simultaneously +running at any time. + +Note that the items are not processed in batches, so there is no guarantee that + the first "limit" iterator functions will complete before any others are +started. + +__Arguments__ + +* arr - An array to iterate over. +* limit - The maximum number of iterators to run at any time. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, transformed) which must be called once + it has completed with an error (which can be null) and a transformed item. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array of the + transformed items from the original array. + +__Example__ + +```js +async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +--------------------------------------- + + +### filter(arr, iterator, callback) + +__Alias:__ select + +Returns a new array of all the values which pass an async truth test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(results) - A callback which is called after all the iterator + functions have finished. + +__Example__ + +```js +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); +``` + +--------------------------------------- + + +### filterSeries(arr, iterator, callback) + +__alias:__ selectSeries + +The same as filter only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + +--------------------------------------- + + +### reject(arr, iterator, callback) + +The opposite of filter. Removes values that pass an async truth test. + +--------------------------------------- + + +### rejectSeries(arr, iterator, callback) + +The same as reject, only the iterator is applied to each item in the array +in series. + + +--------------------------------------- + + +### reduce(arr, memo, iterator, callback) + +__aliases:__ inject, foldl + +Reduces a list of values into a single value using an async iterator to return +each successive step. Memo is the initial state of the reduction. This +function only operates in series. For performance reasons, it may make sense to +split a call to this function into a parallel map, then use the normal +Array.prototype.reduce on the results. This function is for situations where +each step in the reduction needs to be async, if you can get the data before +reducing it then it's probably a good idea to do so. + +__Arguments__ + +* arr - An array to iterate over. +* memo - The initial state of the reduction. +* iterator(memo, item, callback) - A function applied to each item in the + array to produce the next step in the reduction. The iterator is passed a + callback(err, reduction) which accepts an optional error as its first + argument, and the state of the reduction as the second. If an error is + passed to the callback, the reduction is stopped and the main callback is + immediately called with the error. +* callback(err, result) - A callback which is called after all the iterator + functions have finished. Result is the reduced value. + +__Example__ + +```js +async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); +}, function(err, result){ + // result is now equal to the last value of memo, which is 6 +}); +``` + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, callback) + +__Alias:__ foldr + +Same as reduce, only operates on the items in the array in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, callback) + +Returns the first value in a list that passes an async truth test. The +iterator is applied in parallel, meaning the first iterator to return true will +fire the detect callback with that result. That means the result might not be +the first item in the original array (in terms of order) that passes the test. + +If order within the original array is important then look at detectSeries. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value undefined if none passed. + +__Example__ + +```js +async.detect(['file1','file2','file3'], fs.exists, function(result){ + // result now equals the first file in the list that exists +}); +``` + +--------------------------------------- + + +### detectSeries(arr, iterator, callback) + +The same as detect, only the iterator is applied to each item in the array +in series. This means the result is always the first in the original array (in +terms of array order) that passes the truth test. + + +--------------------------------------- + + +### sortBy(arr, iterator, callback) + +Sorts a list by the results of running each value through an async iterator. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, sortValue) which must be called once it + has completed with an error (which can be null) and a value to use as the sort + criteria. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is the items from + the original array sorted by the values returned by the iterator calls. + +__Example__ + +```js +async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); +}, function(err, results){ + // results is now the original array of files sorted by + // modified date +}); +``` + +--------------------------------------- + + +### some(arr, iterator, callback) + +__Alias:__ any + +Returns true if at least one element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. Once any iterator +call returns true, the main callback is immediately called. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + either true or false depending on the values of the async tests. + +__Example__ + +```js +async.some(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then at least one of the files exists +}); +``` + +--------------------------------------- + + +### every(arr, iterator, callback) + +__Alias:__ all + +Returns true if every element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called after all the iterator + functions have finished. Result will be either true or false depending on + the values of the async tests. + +__Example__ + +```js +async.every(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then every file exists +}); +``` + +--------------------------------------- + + +### concat(arr, iterator, callback) + +Applies an iterator to each item in a list, concatenating the results. Returns the +concatenated list. The iterators are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of the arguments passed to the iterator function. + +__Arguments__ + +* arr - An array to iterate over +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, results) which must be called once it + has completed with an error (which can be null) and an array of results. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array containing + the concatenated results of the iterator function. + +__Example__ + +```js +async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories +}); +``` + +--------------------------------------- + + +### concatSeries(arr, iterator, callback) + +Same as async.concat, but executes in series instead of parallel. + + +## Control Flow + + +### series(tasks, [callback]) + +Run an array of functions in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run and the callback for the series is +immediately called with the value of the error. Once the tasks have completed, +the results are passed to the final callback as an array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.series. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + } +], +// optional callback +function(err, results){ + // results is now equal to ['one', 'two'] +}); + + +// an example using an object instead of an array +async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equal to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run an array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main callback is immediately called with the value of the error. +Once the tasks have completed, the results are passed to the final callback as an +array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.parallel. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + } +], +// optional callback +function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}); + + +// an example using an object instead of an array +async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equals to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallelLimit(tasks, limit, [callback]) + +The same as parallel only the tasks are executed in parallel with a maximum of "limit" +tasks executing at any time. + +Note that the tasks are not executed in batches, so there is no guarantee that +the first "limit" tasks will complete before any others are started. + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* limit - The maximum number of tasks to run at any time. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call fn, while test returns true. Calls the callback when stopped, +or an error occurs. + +__Arguments__ + +* test() - synchronous truth test to perform before each execution of fn. +* fn(callback) - A function to call each time the test passes. The function is + passed a callback(err) which must be called once it has completed with an + optional error argument. +* callback(err) - A callback which is called after the test fails and repeated + execution of fn has stopped. + +__Example__ + +```js +var count = 0; + +async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doWhilst(fn, test, callback) + +The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call fn, until test returns true. Calls the callback when stopped, +or an error occurs. + +The inverse of async.whilst. + +--------------------------------------- + + +### doUntil(fn, test, callback) + +Like doWhilst except the test is inverted. Note the argument ordering differs from `until`. + +--------------------------------------- + + +### forever(fn, callback) + +Calls the asynchronous function 'fn' repeatedly, in series, indefinitely. +If an error is passed to fn's callback then 'callback' is called with the +error, otherwise it will never be called. + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs an array of functions in series, each passing their results to the next in +the array. However, if any of the functions pass an error to the callback, the +next function is not executed and the main callback is immediately called with +the error. + +__Arguments__ + +* tasks - An array of functions to run, each function is passed a + callback(err, result1, result2, ...) it must call on completion. The first + argument is an error (which can be null) and any further arguments will be + passed as arguments in order to the next task. +* callback(err, [results]) - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + +```js +async.waterfall([ + function(callback){ + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback){ + callback(null, 'three'); + }, + function(arg1, callback){ + // arg1 now equals 'three' + callback(null, 'done'); + } +], function (err, result) { + // result now equals 'done' +}); +``` + +--------------------------------------- + +### compose(fn1, fn2...) + +Creates a function which is a composition of the passed asynchronous +functions. Each function consumes the return value of the function that +follows. Composing functions f(), g() and h() would produce the result of +f(g(h())), only this version uses callbacks to obtain the return values. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* functions... - the asynchronous functions to compose + + +__Example__ + +```js +function add1(n, callback) { + setTimeout(function () { + callback(null, n + 1); + }, 10); +} + +function mul3(n, callback) { + setTimeout(function () { + callback(null, n * 3); + }, 10); +} + +var add1mul3 = async.compose(mul3, add1); + +add1mul3(4, function (err, result) { + // result now equals 15 +}); +``` + +--------------------------------------- + +### applyEach(fns, args..., callback) + +Applies the provided arguments to each function in the array, calling the +callback after all functions have completed. If you only provide the first +argument then it will return a function which lets you pass in the +arguments as if it were a single function call. + +__Arguments__ + +* fns - the asynchronous functions to all call with the same arguments +* args... - any number of separate arguments to pass to the function +* callback - the final argument should be the callback, called when all + functions have completed processing + + +__Example__ + +```js +async.applyEach([enableSearch, updateSchema], 'bucket', callback); + +// partial application example: +async.each( + buckets, + async.applyEach([enableSearch, updateSchema]), + callback +); +``` + +--------------------------------------- + + +### applyEachSeries(arr, iterator, callback) + +The same as applyEach only the functions are applied in series. + +--------------------------------------- + + +### queue(worker, concurrency) + +Creates a queue object with the specified concurrency. Tasks added to the +queue will be processed in parallel (up to the concurrency limit). If all +workers are in progress, the task is queued until one is available. Once +a worker has completed a task, the task's callback is called. + +__Arguments__ + +* worker(task, callback) - An asynchronous function for processing a queued + task, which must call its callback(err) argument when finished, with an + optional error as an argument. +* concurrency - An integer for determining how many worker functions should be + run in parallel. + +__Queue objects__ + +The queue object returned by this function has the following properties and +methods: + +* length() - a function returning the number of items waiting to be processed. +* concurrency - an integer for determining how many worker functions should be + run in parallel. This property can be changed after a queue is created to + alter the concurrency on-the-fly. +* push(task, [callback]) - add a new task to the queue, the callback is called + once the worker has finished processing the task. + instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. +* unshift(task, [callback]) - add a new task to the front of the queue. +* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued +* empty - a callback that is called when the last item from the queue is given to a worker +* drain - a callback that is called when the last item from the queue has returned from the worker + +__Example__ + +```js +// create a queue object with concurrency 2 + +var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); +}, 2); + + +// assign a callback +q.drain = function() { + console.log('all items have been processed'); +} + +// add some items to the queue + +q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); +}); +q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); + +// add some items to the queue (batch-wise) + +q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing bar'); +}); + +// add some items to the front of the queue + +q.unshift({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); +``` + +--------------------------------------- + + +### cargo(worker, [payload]) + +Creates a cargo object with the specified payload. Tasks added to the +cargo will be processed altogether (up to the payload limit). If the +worker is in progress, the task is queued until it is available. Once +the worker has completed some tasks, each callback of those tasks is called. + +__Arguments__ + +* worker(tasks, callback) - An asynchronous function for processing an array of + queued tasks, which must call its callback(err) argument when finished, with + an optional error as an argument. +* payload - An optional integer for determining how many tasks should be + processed per round; if omitted, the default is unlimited. + +__Cargo objects__ + +The cargo object returned by this function has the following properties and +methods: + +* length() - a function returning the number of items waiting to be processed. +* payload - an integer for determining how many tasks should be + process per round. This property can be changed after a cargo is created to + alter the payload on-the-fly. +* push(task, [callback]) - add a new task to the queue, the callback is called + once the worker has finished processing the task. + instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. +* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued +* empty - a callback that is called when the last item from the queue is given to a worker +* drain - a callback that is called when the last item from the queue has returned from the worker + +__Example__ + +```js +// create a cargo object with payload 2 + +var cargo = async.cargo(function (tasks, callback) { + for(var i=0; i +### auto(tasks, [callback]) + +Determines the best order for running functions based on their requirements. +Each function can optionally depend on other functions being completed first, +and each function is run as soon as its requirements are satisfied. If any of +the functions pass an error to their callback, that function will not complete +(so any other functions depending on it will not run) and the main callback +will be called immediately with the error. Functions also receive an object +containing the results of functions which have completed so far. + +Note, all functions are called with a results object as a second argument, +so it is unsafe to pass functions in the tasks object which cannot handle the +extra argument. For example, this snippet of code: + +```js +async.auto({ + readData: async.apply(fs.readFile, 'data.txt', 'utf-8') +}, callback); +``` + +will have the effect of calling readFile with the results object as the last +argument, which will fail: + +```js +fs.readFile('data.txt', 'utf-8', cb, {}); +``` + +Instead, wrap the call to readFile in a function which does not forward the +results object: + +```js +async.auto({ + readData: function(cb, results){ + fs.readFile('data.txt', 'utf-8', cb); + } +}, callback); +``` + +__Arguments__ + +* tasks - An object literal containing named functions or an array of + requirements, with the function itself the last item in the array. The key + used for each function or array is used when specifying requirements. The + function receives two arguments: (1) a callback(err, result) which must be + called when finished, passing an error (which can be null) and the result of + the function's execution, and (2) a results object, containing the results of + the previously executed functions. +* callback(err, results) - An optional callback which is called when all the + tasks have been completed. The callback will receive an error as an argument + if any tasks pass an error to their callback. Results will always be passed + but if an error occurred, no other tasks will be performed, and the results + object will only contain partial results. + + +__Example__ + +```js +async.auto({ + get_data: function(callback){ + // async code to get some data + }, + make_folder: function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + }, + write_file: ['get_data', 'make_folder', function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, filename); + }], + email_link: ['write_file', function(callback, results){ + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + }] +}); +``` + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + +```js +async.parallel([ + function(callback){ + // async code to get some data + }, + function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + } +], +function(err, results){ + async.series([ + function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + }, + function(callback){ + // once the file is written let's email a link to it... + } + ]); +}); +``` + +For a complicated series of async tasks using the auto function makes adding +new tasks much easier and makes the code more readable. + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the array, +returning a continuation to call the next one after that. It's also possible to +'peek' the next iterator by doing iterator.next(). + +This function is used internally by the async module but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* tasks - An array of functions to run. + +__Example__ + +```js +var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } +]); + +node> var iterator2 = iterator(); +'one' +node> var iterator3 = iterator2(); +'two' +node> iterator3(); +'three' +node> var nextfn = iterator2.next(); +node> nextfn(); +'three' +``` + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied, a useful +shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + +```js +// using apply + +async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), +]); + + +// the same process without using apply + +async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + } +]); +``` + +It's possible to pass any number of additional arguments when calling the +continuation: + +```js +node> var fn = async.apply(sys.puts, 'one'); +node> fn('two', 'three'); +one +two +three +``` + +--------------------------------------- + + +### nextTick(callback) + +Calls the callback on a later loop around the event loop. In node.js this just +calls process.nextTick, in the browser it falls back to setImmediate(callback) +if available, otherwise setTimeout(callback, 0), which means other higher priority +events may precede the execution of the callback. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* callback - The function to call on a later loop around the event loop. + +__Example__ + +```js +var call_order = []; +async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two'] +}); +call_order.push('one') +``` + + +### times(n, callback) + +Calls the callback n times and accumulates results in the same manner +you would use with async.map. + +__Arguments__ + +* n - The number of times to run the function. +* callback - The function to call n times. + +__Example__ + +```js +// Pretend this is some complicated async factory +var createUser = function(id, callback) { + callback(null, { + id: 'user' + id + }) +} +// generate 5 users +async.times(5, function(n, next){ + createUser(n, function(err, user) { + next(err, user) + }) +}, function(err, users) { + // we should now have 5 users +}); +``` + + +### timesSeries(n, callback) + +The same as times only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an async function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +The cache of results is exposed as the `memo` property of the function returned +by `memoize`. + +__Arguments__ + +* fn - the function you to proxy and cache results from. +* hasher - an optional function for generating a custom hash for storing + results, it has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + +```js +var slow_fn = function (name, callback) { + // do something + callback(null, result); +}; +var fn = async.memoize(slow_fn); + +// fn can now be used as if it were slow_fn +fn('some name', function () { + // callback +}); +``` + + +### unmemoize(fn) + +Undoes a memoized function, reverting it to the original, unmemoized +form. Comes handy in tests. + +__Arguments__ + +* fn - the memoized function + + +### log(function, arguments) + +Logs the result of an async function to the console. Only works in node.js or +in browsers that support console.log and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.log is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); +}; +``` +```js +node> async.log(hello, 'world'); +'hello world' +``` + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an async function to the console using console.dir to +display the properties of the resulting object. Only works in node.js or +in browsers that support console.dir and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.dir is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); +}; +``` +```js +node> async.dir(hello, 'world'); +{hello: 'world'} +``` + +--------------------------------------- + + +### noConflict() + +Changes the value of async back to its original value, returning a reference to the +async object. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json new file mode 100644 index 0000000..bbb0115 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json @@ -0,0 +1,11 @@ +{ + "name": "async", + "repo": "caolan/async", + "description": "Higher-order functions and common patterns for asynchronous code", + "version": "0.1.23", + "keywords": [], + "dependencies": {}, + "development": {}, + "main": "lib/async.js", + "scripts": [ "lib/async.js" ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js new file mode 100755 index 0000000..1eebb15 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js @@ -0,0 +1,958 @@ +/*global setImmediate: false, setTimeout: false, console: false */ +(function () { + + var async = {}; + + // global on the server, window in the browser + var root, previous_async; + + root = this; + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + var called = false; + return function() { + if (called) throw new Error("Callback was already called."); + called = true; + fn.apply(root, arguments); + } + } + + //// cross-browser compatiblity functions //// + + var _each = function (arr, iterator) { + if (arr.forEach) { + return arr.forEach(iterator); + } + for (var i = 0; i < arr.length; i += 1) { + iterator(arr[i], i, arr); + } + }; + + var _map = function (arr, iterator) { + if (arr.map) { + return arr.map(iterator); + } + var results = []; + _each(arr, function (x, i, a) { + results.push(iterator(x, i, a)); + }); + return results; + }; + + var _reduce = function (arr, iterator, memo) { + if (arr.reduce) { + return arr.reduce(iterator, memo); + } + _each(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + }; + + var _keys = function (obj) { + if (Object.keys) { + return Object.keys(obj); + } + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + if (typeof process === 'undefined' || !(process.nextTick)) { + if (typeof setImmediate === 'function') { + async.nextTick = function (fn) { + // not a direct alias for IE10 compatibility + setImmediate(fn); + }; + async.setImmediate = async.nextTick; + } + else { + async.nextTick = function (fn) { + setTimeout(fn, 0); + }; + async.setImmediate = async.nextTick; + } + } + else { + async.nextTick = process.nextTick; + if (typeof setImmediate !== 'undefined') { + async.setImmediate = function (fn) { + // not a direct alias for IE10 compatibility + setImmediate(fn); + }; + } + else { + async.setImmediate = async.nextTick; + } + } + + async.each = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + _each(arr, function (x) { + iterator(x, only_once(function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + } + })); + }); + }; + async.forEach = async.each; + + async.eachSeries = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + var iterate = function () { + iterator(arr[completed], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + else { + iterate(); + } + } + }); + }; + iterate(); + }; + async.forEachSeries = async.eachSeries; + + async.eachLimit = function (arr, limit, iterator, callback) { + var fn = _eachLimit(limit); + fn.apply(null, [arr, iterator, callback]); + }; + async.forEachLimit = async.eachLimit; + + var _eachLimit = function (limit) { + + return function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length || limit <= 0) { + return callback(); + } + var completed = 0; + var started = 0; + var running = 0; + + (function replenish () { + if (completed >= arr.length) { + return callback(); + } + + while (running < limit && started < arr.length) { + started += 1; + running += 1; + iterator(arr[started - 1], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + running -= 1; + if (completed >= arr.length) { + callback(); + } + else { + replenish(); + } + } + }); + } + })(); + }; + }; + + + var doParallel = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.each].concat(args)); + }; + }; + var doParallelLimit = function(limit, fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [_eachLimit(limit)].concat(args)); + }; + }; + var doSeries = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.eachSeries].concat(args)); + }; + }; + + + var _asyncMap = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (err, v) { + results[x.index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + }; + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = function (arr, limit, iterator, callback) { + return _mapLimit(limit)(arr, iterator, callback); + }; + + var _mapLimit = function(limit) { + return doParallelLimit(limit, _asyncMap); + }; + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.reduce = function (arr, memo, iterator, callback) { + async.eachSeries(arr, function (x, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + // inject alias + async.inject = async.reduce; + // foldl alias + async.foldl = async.reduce; + + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, function (x) { + return x; + }).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + // foldr alias + async.foldr = async.reduceRight; + + var _filter = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.filter = doParallel(_filter); + async.filterSeries = doSeries(_filter); + // select alias + async.select = async.filter; + async.selectSeries = async.filterSeries; + + var _reject = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (!v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.reject = doParallel(_reject); + async.rejectSeries = doSeries(_reject); + + var _detect = function (eachfn, arr, iterator, main_callback) { + eachfn(arr, function (x, callback) { + iterator(x, function (result) { + if (result) { + main_callback(x); + main_callback = function () {}; + } + else { + callback(); + } + }); + }, function (err) { + main_callback(); + }); + }; + async.detect = doParallel(_detect); + async.detectSeries = doSeries(_detect); + + async.some = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (v) { + main_callback(true); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(false); + }); + }; + // any alias + async.any = async.some; + + async.every = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (!v) { + main_callback(false); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(true); + }); + }; + // all alias + async.all = async.every; + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + var fn = function (left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }; + callback(null, _map(results.sort(fn), function (x) { + return x.value; + })); + } + }); + }; + + async.auto = function (tasks, callback) { + callback = callback || function () {}; + var keys = _keys(tasks); + if (!keys.length) { + return callback(null); + } + + var results = {}; + + var listeners = []; + var addListener = function (fn) { + listeners.unshift(fn); + }; + var removeListener = function (fn) { + for (var i = 0; i < listeners.length; i += 1) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + return; + } + } + }; + var taskComplete = function () { + _each(listeners.slice(0), function (fn) { + fn(); + }); + }; + + addListener(function () { + if (_keys(results).length === keys.length) { + callback(null, results); + callback = function () {}; + } + }); + + _each(keys, function (k) { + var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; + var taskCallback = function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _each(_keys(results), function(rkey) { + safeResults[rkey] = results[rkey]; + }); + safeResults[k] = args; + callback(err, safeResults); + // stop subsequent errors hitting callback multiple times + callback = function () {}; + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }; + var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var ready = function () { + return _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + }; + if (ready()) { + task[task.length - 1](taskCallback, results); + } + else { + var listener = function () { + if (ready()) { + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + }; + addListener(listener); + } + }); + }; + + async.waterfall = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor !== Array) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + var wrapIterator = function (iterator) { + return function (err) { + if (err) { + callback.apply(null, arguments); + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + async.setImmediate(function () { + iterator.apply(null, args); + }); + } + }; + }; + wrapIterator(async.iterator(tasks))(); + }; + + var _parallel = function(eachfn, tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + eachfn.map(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + eachfn.each(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.parallel = function (tasks, callback) { + _parallel({ map: async.map, each: async.each }, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); + }; + + async.series = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.mapSeries(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.eachSeries(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.iterator = function (tasks) { + var makeCallback = function (index) { + var fn = function () { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + }; + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + }; + return makeCallback(0); + }; + + async.apply = function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return fn.apply( + null, args.concat(Array.prototype.slice.call(arguments)) + ); + }; + }; + + var _concat = function (eachfn, arr, fn, callback) { + var r = []; + eachfn(arr, function (x, cb) { + fn(x, function (err, y) { + r = r.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, r); + }); + }; + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + if (test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.whilst(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doWhilst = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (test()) { + async.doWhilst(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.until = function (test, iterator, callback) { + if (!test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.until(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doUntil = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (!test()) { + async.doUntil(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.queue = function (worker, concurrency) { + if (concurrency === undefined) { + concurrency = 1; + } + function _insert(q, data, pos, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + var item = { + data: task, + callback: typeof callback === 'function' ? callback : null + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.saturated && q.tasks.length === concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + var workers = 0; + var q = { + tasks: [], + concurrency: concurrency, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + if (workers < q.concurrency && q.tasks.length) { + var task = q.tasks.shift(); + if (q.empty && q.tasks.length === 0) { + q.empty(); + } + workers += 1; + var next = function () { + workers -= 1; + if (task.callback) { + task.callback.apply(task, arguments); + } + if (q.drain && q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + var cb = only_once(next); + worker(task.data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + } + }; + return q; + }; + + async.cargo = function (worker, payload) { + var working = false, + tasks = []; + + var cargo = { + tasks: tasks, + payload: payload, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + tasks.push({ + data: task, + callback: typeof callback === 'function' ? callback : null + }); + if (cargo.saturated && tasks.length === payload) { + cargo.saturated(); + } + }); + async.setImmediate(cargo.process); + }, + process: function process() { + if (working) return; + if (tasks.length === 0) { + if(cargo.drain) cargo.drain(); + return; + } + + var ts = typeof payload === 'number' + ? tasks.splice(0, payload) + : tasks.splice(0); + + var ds = _map(ts, function (task) { + return task.data; + }); + + if(cargo.empty) cargo.empty(); + working = true; + worker(ds, function () { + working = false; + + var args = arguments; + _each(ts, function (data) { + if (data.callback) { + data.callback.apply(null, args); + } + }); + + process(); + }); + }, + length: function () { + return tasks.length; + }, + running: function () { + return working; + } + }; + return cargo; + }; + + var _console_fn = function (name) { + return function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + fn.apply(null, args.concat([function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (typeof console !== 'undefined') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _each(args, function (x) { + console[name](x); + }); + } + } + }])); + }; + }; + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || function (x) { + return x; + }; + var memoized = function () { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + callback.apply(null, memo[key]); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([function () { + memo[key] = arguments; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, arguments); + } + }])); + } + }; + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + async.times = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.map(counter, iterator, callback); + }; + + async.timesSeries = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.mapSeries(counter, iterator, callback); + }; + + async.compose = function (/* functions... */) { + var fns = Array.prototype.reverse.call(arguments); + return function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([function () { + var err = arguments[0]; + var nextargs = Array.prototype.slice.call(arguments, 1); + cb(err, nextargs); + }])) + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }; + }; + + var _applyEach = function (eachfn, fns /*args...*/) { + var go = function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + return eachfn(fns, function (fn, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }; + if (arguments.length > 2) { + var args = Array.prototype.slice.call(arguments, 2); + return go.apply(this, args); + } + else { + return go; + } + }; + async.applyEach = doParallel(_applyEach); + async.applyEachSeries = doSeries(_applyEach); + + async.forever = function (fn, callback) { + function next(err) { + if (err) { + if (callback) { + return callback(err); + } + throw err; + } + fn(next); + } + next(); + }; + + // AMD / RequireJS + if (typeof define !== 'undefined' && define.amd) { + define([], function () { + return async; + }); + } + // Node.js + else if (typeof module !== 'undefined' && module.exports) { + module.exports = async; + } + // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [eachSeries](#eachSeries)\n* [eachLimit](#eachLimit)\n* [map](#map)\n* [mapSeries](#mapSeries)\n* [mapLimit](#mapLimit)\n* [filter](#filter)\n* [filterSeries](#filterSeries)\n* [reject](#reject)\n* [rejectSeries](#rejectSeries)\n* [reduce](#reduce)\n* [reduceRight](#reduceRight)\n* [detect](#detect)\n* [detectSeries](#detectSeries)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n* [concatSeries](#concatSeries)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [parallelLimit](#parallellimittasks-limit-callback)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [applyEachSeries](#applyEachSeries)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/caolan/async", + "_id": "async@0.2.10", + "dist": { + "shasum": "a06e6818541aa1851d6ac822c8dbbfd6206eb72f" + }, + "_from": "async@~0.2.8", + "_resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.jshintrc new file mode 100644 index 0000000..eae6f9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.jshintrc @@ -0,0 +1,62 @@ +{ + "predef": [ + "console", + "describe", + "it", + "after", + "afterEach", + "before", + "beforeEach" + ], + + "indent": 4, + "node": true, + "devel": true, + + "bitwise": false, + "curly": false, + "eqeqeq": true, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": false, + "trailing": true, + "camelcase": true, + + "asi": false, + "boss": true, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": true, + "validthis": false, + + "nomen": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.npmignore new file mode 100644 index 0000000..1743854 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.npmignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log + +test/assets/github-test-package +test/assets/github-test-package-copy +test/assets/temp diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.travis.yml new file mode 100644 index 0000000..df63076 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/LICENSE new file mode 100644 index 0000000..13e8246 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Twitter and other contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/README.md new file mode 100644 index 0000000..e9f4ef5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/README.md @@ -0,0 +1,76 @@ +# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config) + +The Bower config reader and writer. +The config spec can be read [here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/). + + +## Usage + +#### .load() + +Loads the bower configuration from the configuration files. + + +#### .get(key) + +Returns a configuration value by `key`. +Keys with dots are supported to access deep values. + + +#### .set(key, value) + +Sets a configuration value for `key`. +Keys with dots are supported to set deep values. + + +#### .del(key) + +Removes configuration named `key`. +Keys with dots are supported to delete deep keys. + + +#### .save(where, callback) + +Saves changes to `where`. +The `where` argument can be a path to a configuration file or: + +- `local` to save it in the configured current working directory (defaulting to `process.cwd`) +- `user` to save it in the configuration file located in the home directory + + +#### .toObject() + +Returns a deep copy of the underlying configuration object. +The returned configuration is normalised. +The object keys will be camelCase. + + +#### #create(cwd) + +Obtains a instance where `cwd` is the current working directory (defaults to `process.cwd`); + +```js +var config = require('bower-config').create(); +// You can also specify a working directory +var config2 = require('bower-config').create('./some/path'); +``` + + +#### #read(cwd) + +Alias for: + +```js +var configObject = (new Config(cwd)).load().toJson(); +``` + + +#### #normalise(config) + +Returns a new normalised config object based on `config`. +Object keys will be converted to camelCase. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/Config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/Config.js new file mode 100644 index 0000000..e66108e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/Config.js @@ -0,0 +1,71 @@ +var mout = require('mout'); +var rc = require('./util/rc'); +var defaults = require('./util/defaults'); +var expand = require('./util/expand'); + +function Config(cwd) { + this._cwd = cwd || process.cwd(); + this._config = {}; +} + +Config.prototype.load = function () { + this._config = rc('bower', defaults, this._cwd); + return this; +}; + +Config.prototype.get = function (key) { + // TODO +}; + +Config.prototype.set = function (key, value) { + // TODO + return this; +}; + +Config.prototype.del = function (key, value) { + // TODO + return this; +}; + +Config.prototype.save = function (where, callback) { + // TODO +}; + +Config.prototype.toObject = function () { + var config = mout.lang.deepClone(this._config); + + config = Config.normalise(config); + return config; +}; + +Config.create = function (cwd) { + return new Config(cwd); +}; + +Config.read = function (cwd) { + var config = new Config(cwd); + return config.load().toObject(); +}; + +Config.normalise = function (rawConfig) { + var config = {}; + + // Mix in defaults and raw config + mout.object.deepMixIn(config, expand(defaults), expand(rawConfig)); + + // Some backwards compatible things.. + config.shorthandResolver = config.shorthandResolver + .replace(/\{\{\{/g, '{{') + .replace(/\}\}\}/g, '}}'); + + // Ensure that every registry endpoint does not end with / + config.registry.search = config.registry.search.map(function (url) { + return url.replace(/\/+$/, ''); + }); + config.registry.register = config.registry.register.replace(/\/+$/, ''); + config.registry.publish = config.registry.publish.replace(/\/+$/, ''); + + return config; +}; + +module.exports = Config; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/defaults.js new file mode 100644 index 0000000..c742cbd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/defaults.js @@ -0,0 +1,44 @@ +var path = require('path'); +var paths = require('./paths'); + +// Guess proxy defined in the env +/*jshint camelcase: false*/ +var proxy = process.env.HTTP_PROXY + || process.env.http_proxy + || null; + +var httpsProxy = process.env.HTTPS_PROXY + || process.env.https_proxy + || proxy; +/*jshint camelcase: true*/ + +// Use a well known user agent (in this case, curl) when using a proxy, +// to avoid potential filtering on many corporate proxies with blank or unknown agents +var userAgent = !proxy && !httpsProxy + ? 'node/' + process.version + ' ' + process.platform + ' ' + process.arch + : 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5'; + +var defaults = { + 'cwd': process.cwd(), + 'directory': 'bower_components', + 'registry': 'https://bower.herokuapp.com', + 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', + 'tmp': paths.tmp, + 'proxy': proxy, + 'https-proxy': httpsProxy, + 'timeout': 30000, + 'ca': { search: [] }, + 'strict-ssl': true, + 'user-agent': userAgent, + 'color': true, + 'interactive': null, + 'storage': { + packages: path.join(paths.cache, 'packages'), + links: path.join(paths.data, 'links'), + completion: path.join(paths.data, 'completion'), + registry: path.join(paths.cache, 'registry'), + empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others + } +}; + +module.exports = defaults; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/expand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/expand.js new file mode 100644 index 0000000..f3a3865 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/expand.js @@ -0,0 +1,53 @@ +var mout = require('mout'); + +function camelCase(config) { + var camelCased = {}; + + // Camel case + mout.object.forOwn(config, function (value, key) { + // Ignore null values + if (value == null) { + return; + } + + key = mout.string.camelCase(key.replace(/_/g, '-')); + camelCased[key] = mout.lang.isPlainObject(value) ? camelCase(value) : value; + }); + + return camelCased; +} + +function expand(config) { + config = camelCase(config); + + // Expand some properties + // Registry + if (typeof config.registry === 'string') { + config.registry = { + search: [config.registry], + register: config.registry, + publish: config.registry + }; + } else if (config.registry) { + if (config.registry.search && !Array.isArray(config.registry.search)) { + config.registry.search = [config.registry.search]; + } + } + + // CA + if (typeof config.ca === 'string') { + config.ca = { + search: [config.ca], + register: config.ca, + publish: config.ca + }; + } else if (config.ca) { + if (config.ca.search && !Array.isArray(config.ca.search)) { + config.ca.search = [config.ca.search]; + } + } + + return config; +} + +module.exports = expand; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/paths.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/paths.js new file mode 100644 index 0000000..566ba72 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/paths.js @@ -0,0 +1,44 @@ +var os = require('os'); +var path = require('path'); +var osenv = require('osenv'); +var crypto = require('crypto'); + +function generateFakeUser() { + var uid = process.pid + '-' + Date.now() + '-' + Math.floor(Math.random() * 1000000); + return crypto.createHash('md5').update(uid).digest('hex'); +} + +// Assume XDG defaults +// See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +var paths = { + config: process.env.XDG_CONFIG_HOME, + data: process.env.XDG_DATA_HOME, + cache: process.env.XDG_CACHE_HOME +}; + +// Guess some needed properties based on the user OS +var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-'); +var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user); +var home = osenv.home(); +var base; + +// Fallbacks for windows +if (process.platform === 'win32') { + base = path.resolve(process.env.APPDATA || home || tmp); + base = path.join(base, 'bower'); + + paths.config = paths.config || path.join(base, 'config'); + paths.data = paths.data || path.join(base, 'data'); + paths.cache = paths.cache || path.join(base, 'cache'); +// Fallbacks for other operating systems +} else { + base = path.resolve(home || tmp); + + paths.config = paths.config || path.join(base, '.config/bower'); + paths.data = paths.data || path.join(base, '.local/share/bower'); + paths.cache = paths.cache || path.join(base, '.cache/bower'); +} + +paths.tmp = path.resolve(path.join(tmp, 'bower')); + +module.exports = paths; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/rc.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/rc.js new file mode 100644 index 0000000..54088ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/lib/util/rc.js @@ -0,0 +1,115 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var optimist = require('optimist'); +var osenv = require('osenv'); +var mout = require('mout'); +var paths = require('./paths'); + +var win = process.platform === 'win32'; +var home = osenv.home(); + +function rc(name, defaults, cwd, argv) { + var argvConfig; + + defaults = defaults || {}; + cwd = cwd || process.cwd(); + argv = argv || optimist.argv; + + // Parse --config.foo=false + argvConfig = mout.object.map(argv.config || {}, function (value) { + return value === 'false' ? false : value; + }); + + return mout.object.deepMixIn.apply(null, [ + {}, + defaults, + { cwd: cwd }, + win ? {} : json(path.join('/etc', name + 'rc')), + !home ? {} : json(path.join(home, '.' + name + 'rc')), + json(path.join(paths.config, name + 'rc')), + json(find('.' + name + 'rc', cwd)), + env(name + '_'), + argvConfig + ]); +} + +function parse(content, file) { + var error; + + if (!content.trim().length) { + return {}; + } + + try { + return JSON.parse(content); + } catch (e) { + if (file) { + error = new Error('Unable to parse ' + file + ': ' + e.message); + } else { + error = new Error('Unable to parse rc config: ' + e.message); + } + + error.details = content; + error.code = 'EMALFORMED'; + throw error; + } + + return null; +} + +function json(file) { + var content; + + try { + content = fs.readFileSync(file).toString(); + } catch (err) { + return null; + } + + return parse(content, file); +} + +function env(prefix) { + var obj = {}; + var prefixLength = prefix.length; + + prefix = prefix.toLowerCase(); + + mout.object.forOwn(process.env, function (value, key) { + key = key.toLowerCase(); + + if (mout.string.startsWith(key, prefix)) { + var parsedKey = key + .substr(prefixLength) + .replace(/__/g, '.') // __ is used for nesting + .replace(/_/g, '-'); // _ is used as a - separator + mout.object.set(obj, parsedKey, value); + } + }); + + return obj; +} + +function find(filename, dir) { + var walk = function (filename, dir) { + var file = path.join(dir, filename); + var parent = path.dirname(dir); + + try { + fs.statSync(file); + return file; + } catch (err) { + // Check if we hit the root + if (parent === dir) { + return null; + } + + return walk(filename, parent); + } + }; + + dir = dir || process.cwd(); + return walk(filename, dir); +} + +module.exports = rc; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.editorconfig new file mode 100644 index 0000000..e036e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.editorconfig @@ -0,0 +1,20 @@ +; EditorConfig is awesome: http://EditorConfig.org + +; top-most EditorConfig file +root = true + +; base rules +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true + +; The default indent on package.json is 2 spaces, better to keep it so we can +; use `npm install --save` and other features that rewrites the package.json +; file automatically +[package.json] +indent_style = space +indent_size = 2 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.jshintrc new file mode 100644 index 0000000..bbdb29c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.jshintrc @@ -0,0 +1,69 @@ +{ + // Settings + "passfail" : false, // Stop on first error. + "maxerr" : 50, // Maximum error before stopping. + + + // Predefined globals whom JSHint will ignore. + "browser" : true, // Standard browser globals e.g. `window`, `document`. + "couch" : false, + "dojo" : false, + "jquery" : true, + "mootools" : false, + "node" : false, + "prototypejs" : false, + "rhino" : false, + "wsh" : false, + + // Custom globals. + "predef" : [ + "define", + "require" + ], + + + // Development. + "debug" : false, // Allow debugger statements e.g. browser breakpoints. + "devel" : false, // Allow developments statements e.g. `console.log();`. + + + // EcmaScript 5. + "es5" : false, // Allow EcmaScript 5 syntax. + "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). + "strict" : false, // Require `use strict` pragma in every file. + + + // The Good Parts. + "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). + "bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.). + "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. + "curly" : false, // Require {} for every new block or scope. + "eqeqeq" : true, // Require triple equals i.e. `===`. + "eqnull" : true, // Tolerate use of `== null`. + "evil" : false, // Tolerate use of `eval`. + "expr" : false, // Tolerate `ExpressionStatement` as Programs. + "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`. + "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "latedef" : false, // Prohibit variable use before definition. + "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. + "loopfunc" : false, // Allow functions to be defined within loops. + "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "regexdash" : true, // Tolerate unescaped last dash i.e. `[-...]`. + "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions. + "scripturl" : false, // Tolerate script-targeted URLs. + "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. + "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. + "undef" : false, // Require all non-global variables be declared before they are used. + + + // Personal styling prefrences. + "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. + "noempty" : true, // Prohipit use of empty blocks. + "nomen" : false, // Prohibit use of initial or trailing underbars in names. + "nonew" : true, // Prohibit use of constructors for side-effects. + "onevar" : false, // Allow only one `var` statement per function. + "plusplus" : false, // Prohibit use of `++` & `--`. + "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. + "trailing" : true, // Prohibit trailing whitespaces. + "white" : false // Check against strict whitespace and indentation rules. +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.npmignore new file mode 100644 index 0000000..1341acd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.npmignore @@ -0,0 +1,30 @@ +# dumb files +# ========== + +.tmp* +.project +.settings/ +.livereload +.DS_Store? +ehthumbs.db +Icon? +Thumbs.db + + +# stuff not needed by node +# ======================== + +node_modules/ +tests/ +_build/ +doc_html/ +coverage/ + +# we keep the doc/ folder in case npm decides to display it in the future +# also good in case user is using an old version or working offline + +# we also keep the src/ folder in case the user still needs the AMD modules +# after build (see issue #102) + +bower.json +build.js diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.travis.yml new file mode 100644 index 0000000..36de153 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/.travis.yml @@ -0,0 +1,13 @@ + language: node_js + node_js: + - "0.8" + script: "npm test --coverage" + notifications: + irc: + channels: + - "irc.freenode.org#moutjs" + on_success: always + on_failure: always + use_notice: true + skip_join: true + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CHANGELOG.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CHANGELOG.md new file mode 100644 index 0000000..0f5eac1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CHANGELOG.md @@ -0,0 +1,93 @@ +mout changelog +============== + +v0.6.0 (2013/05/22) +------------------- + + - add optional delimeter to `string/unCamelCase` + - allow custom char on `number/pad` + - allow underscore characters in `string/removeNonWord` + - accept `level` on `array/flatten` instead of a flag + - convert underscores to camelCase in `string/camelCase` + - remove `create()` from number/currencyFormat + - add `date/dayOfTheYear` + - add `date/diff` + - add `date/isSame` + - add `date/startOf` + - add `date/strftime` + - add `date/timezoneAbbr` + - add `date/timezoneOffset` + - add `date/totalDaysInYear` + - add `date/weekOfTheYear` + - add `function/timeout` + - add `object/bindAll` + - add `object/functions` + - add `time/convert` + + +v0.5.0 (2013/04/04) +------------------- + + - add `array/collect` + - add `callback` parameter to `object/equals` and `object/deepEquals` to allow + custom compare operations. + - normalize behavior in `array/*` methods to treat `null` values as empty + arrays when reading from array + - add `date/parseIso` + - add `date/isLeapYear` + - add `date/totalDaysInMonth` + - add `object/deepMatches` + - change `function/makeIterator_` to use `deepMatches` (affects nearly all + iteration methods) + - add `thisObj` parameter to `array/min` and `array/max` + + +v0.4.0 (2013/02/26) +------------------- + + - add `object/equals` + - add `object/deepEquals` + - add `object/matches`. + - add `lang/is` and `lang/isnt`. + - add `lang/isInteger`. + - add `array/findIndex`. + - add shorthand syntax to `array/*`, `object/*` and `collection/*` methods. + - improve `number/sign` behavior when value is NaN or +0 or -0. + - improve `lang/isNaN` to actually check if value *is not a number* without + coercing value; so `[]`, `""`, `null` and `"12"` are considered NaN (#39). + - improve `string/contains` to match ES6 behavior (add fromIndex argument). + + +v0.3.0 (2013/02/01) +------------------- + + - add `lang/clone`. + - add `lang/toString`. + - add `string/replace`. + - add `string/WHITE_SPACES` + - rename `function/curry` to `function/partial`. + - allow custom chars in `string/trim`, `ltrim`, and `rtrim`. + - convert values to strings in the `string/*` functions. + + +v0.2.0 (2013/01/13) +------------------- + + - fix bug in `math/ceil` for negative radixes. + - change `object/deepFillIn` and `object/deepMixIn` to recurse only if both + existing and new values are plain objects. Will not recurse into arrays + or objects not created by the Object constructor. + - add `lang/isPlainObject` to check if a file is a valid object and is created + by the Object constructor + - change `lang/clone` behavior when dealing with custom types (avoid cloning + it by default) and add second argument to allow custom behavior if needed. + - rename `lang/clone` to `lang/deepClone`. + - add VERSION property to index.js + - simplify `math/floor`, `math/round`, `math/ceil` and `math/countSteps`. + + +v0.1.0 (2013/01/09) +------------------- + +- Rename project from "amd-utils" to "mout" + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md new file mode 100644 index 0000000..65d9add --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing + +Fork the repo at https://github.com/mout/mout + + > "Write clearly, don't be too clever" - The Elements of Programming Style + +Avoid unnamed functions and follow the other modules structure. By only using named functions it will be easier to extract the code from the AMD module if needed and it will also give better error messages, JavaScript minifiers like [Google Closure Compiler](http://code.google.com/closure/compiler/) and [UglifyJS](https://github.com/mishoo/UglifyJS) will make sure code is as small/optimized as possible. + + > "Make it clear before you make it faster." - The Elements of Programming Style + +Be sure to always create tests for each proposed module. Features will only be merged if they contain proper tests and documentation. + + > "Good code is its own best documentation." - Steve McConnell + +We should do a code review before merging to make sure names makes sense and implementation is as good as possible. + +Try to split your pull requests into logical groups, the smaller the easier to be reviewed/merged. + + + +## Tests & Code Coverage ## + +Tests can be found inside the `tests` folder, to execute them in the browser open the `tests/runner.html`. The same tests also work on node.js by running `npm test`. + +We should have tests for all methods and ensure we have a high code coverage through our continuous integration server ([travis](https://travis-ci.org/mout/mout)). When you ask for a pull request Travis will automatically run the tests on node.js and check the code coverage as well. + +We run `node build pkg` automatically before any `npm test`, so specs and packages should always be in sync. (will avoid human mistakes) + +To check code coverage run `npm test --coverage`, it will generate the reports inside the `coverage` folder and also log the results. Please note that node.js doesn't execute all code branches since we have some conditionals that are only met on old JavaScript engines (eg. IE 7-8), so we will never have 100% code coverage (but should be close to it). + + + +## Build Script ## + +The [build script](https://github.com/mout/mout/wiki/Build-Script) can be extremely helpful and can avoid human mistakes, use it. + + + +## Admins / Pull Requests ## + +Even if you are an admin (have commit rights) please do pull requests when adding new features or changing current behavior, that way we can review the work and discuss. Feel free to push changes that doesn't affect behavior without asking for a pull request (readme, changelog, build script, typos, refactoring, ...). + + + +## Large changes ## + +If you are proposing some major change, please create an issue to discuss it first. (maybe it's outside the scope of the project) + + + +## Questions / IRC / Wiki / Issue Tracker ## + +When in doubt ask someone on IRC to help you ([#moutjs on irc.freenode.net](http://webchat.freenode.net/?channels=moutjs)) or create a [new issue](http://github.com/mout/mout/issues). + +The [project wiki](https://github.com/mout/mout/wiki) can also be a good resource of information. + + +--- + +Check the [contributors list at github](https://github.com/mout/mout/contributors). + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/LICENSE.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/LICENSE.md new file mode 100644 index 0000000..e9ccc2b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) +## Copyright (c) 2012, 2013 moutjs team and contributors (http://moutjs.com) + +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. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/README.md new file mode 100644 index 0000000..872943b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/README.md @@ -0,0 +1,63 @@ +![mout](http://moutjs.com/logo.png "Modular JavaScript Utilties") + +http://moutjs.com/ + +[![Build Status](https://travis-ci.org/mout/mout.png?branch=master)](https://travis-ci.org/mout/mout) + +All code is library agnostic and consist mostly of helper methods that aren't +directly related with the DOM, the purpose of this library isn't to replace +Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common +problems that aren't solved by most of them. Consider it as a crossbrowser +JavaScript standard library. + + + +## Main goals ## + + - increase code reuse; + - be clear (code should be clean/readable); + - be easy to debug; + - be easy to maintain; + - follow best practices; + - follow standards when possible; + - **don't convert JavaScript into another language!** + - be compatible with other frameworks; + - be modular; + - have unit tests for all modules; + - work on multiple environments (IE7+, modern browsers, node.js); + + + +## What shouldn't be here ## + + - UI components; + - CSS selector engine; + - Event system - pub/sub; + - Template engine; + - Anything that isn't generic enough to be on a standard library; + - Anything that could be a separate library and/or isn't a modular utility... + + + +## API Documentation ## + +Online documentation can be found at http://moutjs.com/ or inside the +`doc` folder. + + + +## FAQ / Wiki / IRC ## + +For more info about project structure, design decisions, tips, how to +contribute, build system, etc, please check the [project +wiki](https://github.com/mout/mout/wiki). + +We also have an IRC channel [#moutjs on +irc.freenode.net](http://webchat.freenode.net/?channels=moutjs) + + + +## License ## + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array.js new file mode 100644 index 0000000..89d388b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array.js @@ -0,0 +1,46 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/append.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/append.js new file mode 100644 index 0000000..bf74037 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/append.js @@ -0,0 +1,21 @@ + + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + module.exports = append; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/collect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/collect.js new file mode 100644 index 0000000..5863749 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/collect.js @@ -0,0 +1,27 @@ +var append = require('./append'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + module.exports = collect; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/combine.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/combine.js new file mode 100644 index 0000000..d66e621 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/combine.js @@ -0,0 +1,22 @@ +var indexOf = require('./indexOf'); + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + module.exports = combine; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/compact.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/compact.js new file mode 100644 index 0000000..74c176e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/compact.js @@ -0,0 +1,13 @@ +var filter = require('./filter'); + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + module.exports = compact; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/contains.js new file mode 100644 index 0000000..92bb6ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/contains.js @@ -0,0 +1,10 @@ +var indexOf = require('./indexOf'); + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + module.exports = contains; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/difference.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/difference.js new file mode 100644 index 0000000..d057051 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/difference.js @@ -0,0 +1,22 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var some = require('./some'); +var contains = require('./contains'); + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = difference; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/every.js new file mode 100644 index 0000000..ac59883 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/every.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + module.exports = every; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/filter.js new file mode 100644 index 0000000..ebeb58d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/filter.js @@ -0,0 +1,27 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = filter; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/find.js new file mode 100644 index 0000000..b4a7313 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/find.js @@ -0,0 +1,13 @@ +var findIndex = require('./findIndex'); + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = find; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/findIndex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/findIndex.js new file mode 100644 index 0000000..53f22a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/findIndex.js @@ -0,0 +1,23 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + module.exports = findIndex; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/flatten.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/flatten.js new file mode 100644 index 0000000..aa9757a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/flatten.js @@ -0,0 +1,43 @@ +var isArray = require('../lang/isArray'); +var append = require('./append'); + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + module.exports = flatten; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/forEach.js new file mode 100644 index 0000000..268e506 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/forEach.js @@ -0,0 +1,23 @@ + + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + module.exports = forEach; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/indexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/indexOf.js new file mode 100644 index 0000000..6a9ac83 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/indexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + module.exports = indexOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/insert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/insert.js new file mode 100644 index 0000000..f1f95b7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/insert.js @@ -0,0 +1,15 @@ +var difference = require('./difference'); +var toArray = require('../lang/toArray'); + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(toArray(arguments).slice(1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + module.exports = insert; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/intersection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/intersection.js new file mode 100644 index 0000000..e617006 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/intersection.js @@ -0,0 +1,23 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var every = require('./every'); +var contains = require('./contains'); + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = intersection; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/invoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/invoke.js new file mode 100644 index 0000000..c01aab1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/invoke.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = Array.prototype.slice.call(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + module.exports = invoke; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/join.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/join.js new file mode 100644 index 0000000..71d8bd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/join.js @@ -0,0 +1,17 @@ +var filter = require('./filter'); + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + module.exports = join; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js new file mode 100644 index 0000000..ee44a25 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + module.exports = lastIndexOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/map.js new file mode 100644 index 0000000..54064f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/map.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + module.exports = map; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/max.js new file mode 100644 index 0000000..183b10e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/max.js @@ -0,0 +1,35 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = max; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/min.js new file mode 100644 index 0000000..dd00b6c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/min.js @@ -0,0 +1,35 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = min; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pick.js new file mode 100644 index 0000000..6a54846 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pick.js @@ -0,0 +1,14 @@ +var randInt = require('../random/randInt'); + + /** + * Remove a random item from the Array and return it + */ + function pick(arr){ + if (arr == null || !arr.length) return; + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + module.exports = pick; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pluck.js new file mode 100644 index 0000000..fef4043 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/pluck.js @@ -0,0 +1,12 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/range.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/range.js new file mode 100644 index 0000000..31d3c77 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/range.js @@ -0,0 +1,27 @@ +var countSteps = require('../math/countSteps'); + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + module.exports = range; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduce.js new file mode 100644 index 0000000..1a350c6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduce.js @@ -0,0 +1,33 @@ +var forEach = require('./forEach'); + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + module.exports = reduce; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduceRight.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduceRight.js new file mode 100644 index 0000000..e36fd4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reduceRight.js @@ -0,0 +1,34 @@ + + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + module.exports = reduceRight; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reject.js new file mode 100644 index 0000000..685f291 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/reject.js @@ -0,0 +1,26 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = reject; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/remove.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/remove.js new file mode 100644 index 0000000..aa6517d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/remove.js @@ -0,0 +1,13 @@ +var indexOf = require('./indexOf'); + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + module.exports = remove; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/removeAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/removeAll.js new file mode 100644 index 0000000..d5f7f3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/removeAll.js @@ -0,0 +1,15 @@ +var indexOf = require('./indexOf'); + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + module.exports = removeAll; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/shuffle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/shuffle.js new file mode 100644 index 0000000..97805ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/shuffle.js @@ -0,0 +1,29 @@ +var randInt = require('../random/randInt'); +var forEach = require('./forEach'); + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + module.exports = shuffle; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/some.js new file mode 100644 index 0000000..8d17772 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/some.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + module.exports = some; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/sort.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/sort.js new file mode 100644 index 0000000..7807339 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/sort.js @@ -0,0 +1,55 @@ + + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + module.exports = mergeSort; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/split.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/split.js new file mode 100644 index 0000000..4f3ba50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/split.js @@ -0,0 +1,35 @@ + + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + module.exports = split; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/toLookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/toLookup.js new file mode 100644 index 0000000..ce4c55d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/toLookup.js @@ -0,0 +1,28 @@ +var isFunction = require('../lang/isFunction'); + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + module.exports = toLookup; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/union.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/union.js new file mode 100644 index 0000000..f1334a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/union.js @@ -0,0 +1,19 @@ +var unique = require('./unique'); +var append = require('./append'); + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + module.exports = union; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/unique.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/unique.js new file mode 100644 index 0000000..0192b2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/unique.js @@ -0,0 +1,17 @@ +var indexOf = require('./indexOf'); +var filter = require('./filter'); + + /** + * @return {array} Array of unique items + */ + function unique(arr){ + return filter(arr, isUnique); + } + + function isUnique(item, i, arr){ + return indexOf(arr, item, i+1) === -1; + } + + module.exports = unique; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/xor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/xor.js new file mode 100644 index 0000000..c125a99 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/xor.js @@ -0,0 +1,26 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var contains = require('./contains'); + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + module.exports = xor; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/zip.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/zip.js new file mode 100644 index 0000000..931eb81 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/zip.js @@ -0,0 +1,29 @@ +var max = require('./max'); +var pluck = require('./pluck'); +var map = require('./map'); + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1, + item; + while (++i < len) { + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + module.exports = zip; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection.js new file mode 100644 index 0000000..d5cf6ca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/contains.js new file mode 100644 index 0000000..a73f994 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/contains.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrContains = require('../array/contains'); +var objContains = require('../object/contains'); + + /** + */ + module.exports = make(arrContains, objContains); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/every.js new file mode 100644 index 0000000..300e03c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/every.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrEvery = require('../array/every'); +var objEvery = require('../object/every'); + + /** + */ + module.exports = make(arrEvery, objEvery); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/filter.js new file mode 100644 index 0000000..3875700 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/filter.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + module.exports = filter; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/find.js new file mode 100644 index 0000000..14317e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/find.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrFind = require('../array/find'); +var objFind = require('../object/find'); + + /** + * Find value that returns true on iterator check. + */ + module.exports = make(arrFind, objFind); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/forEach.js new file mode 100644 index 0000000..6e28dcb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/forEach.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrForEach = require('../array/forEach'); +var objForEach = require('../object/forOwn'); + + /** + */ + module.exports = make(arrForEach, objForEach); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/make_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/make_.js new file mode 100644 index 0000000..029d27b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/make_.js @@ -0,0 +1,19 @@ + + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = Array.prototype.slice.call(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + module.exports = makeCollectionMethod; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/map.js new file mode 100644 index 0000000..fc157f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/map.js @@ -0,0 +1,23 @@ +var isObject = require('../lang/isObject'); +var values = require('../object/values'); +var arrMap = require('../array/map'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + module.exports = map; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/max.js new file mode 100644 index 0000000..a8490e7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/max.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMax = require('../array/max'); +var objMax = require('../object/max'); + + /** + * Get maximum value inside collection + */ + module.exports = make(arrMax, objMax); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/min.js new file mode 100644 index 0000000..51d9f14 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/min.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMin = require('../array/min'); +var objMin = require('../object/min'); + + /** + * Get minimum value inside collection. + */ + module.exports = make(arrMin, objMin); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/pluck.js new file mode 100644 index 0000000..9b28377 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/pluck.js @@ -0,0 +1,14 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reduce.js new file mode 100644 index 0000000..4c07573 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reduce.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrReduce = require('../array/reduce'); +var objReduce = require('../object/reduce'); + + /** + */ + module.exports = make(arrReduce, objReduce); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reject.js new file mode 100644 index 0000000..2a92e3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + module.exports = reject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/size.js new file mode 100644 index 0000000..244e33e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/size.js @@ -0,0 +1,19 @@ +var isArray = require('../lang/isArray'); +var objSize = require('../object/size'); + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + module.exports = size; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/some.js new file mode 100644 index 0000000..48fd252 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/collection/some.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrSome = require('../array/some'); +var objSome = require('../object/some'); + + /** + */ + module.exports = make(arrSome, objSome); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date.js new file mode 100644 index 0000000..1cde1a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date.js @@ -0,0 +1,21 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js new file mode 100644 index 0000000..85905c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +var isDate = require('../lang/isDate'); + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + module.exports = dayOfTheYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/diff.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/diff.js new file mode 100644 index 0000000..1131cdc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/diff.js @@ -0,0 +1,130 @@ +var totalDaysInMonth = require('./totalDaysInMonth'); +var totalDaysInYear = require('./totalDaysInYear'); +var convert = require('../time/convert'); + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + module.exports = diff; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js new file mode 100644 index 0000000..f9526ce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js @@ -0,0 +1,61 @@ + + // en-US (English, United States) + module.exports = { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js new file mode 100644 index 0000000..71ebadb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ + + // pt-BR (Brazillian Portuguese) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n_.js new file mode 100644 index 0000000..723fc10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/i18n_.js @@ -0,0 +1,14 @@ +var mixIn = require('../object/mixIn'); +var enUS = require('./i18n/en-US'); + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + module.exports = activeLocale; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isLeapYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isLeapYear.js new file mode 100644 index 0000000..4212870 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isLeapYear.js @@ -0,0 +1,15 @@ +var isDate = require('../lang/isDate'); + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + module.exports = isLeapYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isSame.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isSame.js new file mode 100644 index 0000000..4097d29 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/isSame.js @@ -0,0 +1,16 @@ +var startOf = require('./startOf'); + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + module.exports = isSame; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/parseIso.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/parseIso.js new file mode 100644 index 0000000..8ea2b17 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/parseIso.js @@ -0,0 +1,146 @@ +var some = require('../array/some'); + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + var match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else if ((match = TIME_ZONE.exec(str))) { + var match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + module.exports = parseISO8601; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/startOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/startOf.js new file mode 100644 index 0000000..072bc0e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/startOf.js @@ -0,0 +1,54 @@ +var clone = require('../lang/clone'); + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + module.exports = startOf; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/strftime.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/strftime.js new file mode 100644 index 0000000..f033d10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/strftime.js @@ -0,0 +1,118 @@ +var pad = require('../number/pad'); +var i18n = require('./i18n_'); +var dayOfTheYear = require('./dayOfTheYear'); +var timezoneOffset = require('./timezoneOffset'); +var timezoneAbbr = require('./timezoneAbbr'); +var weekOfTheYear = require('./weekOfTheYear'); + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + module.exports = strftime; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js new file mode 100644 index 0000000..b100687 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +var timezoneOffset = require('./timezoneOffset'); + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + module.exports = timezoneAbbr; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js new file mode 100644 index 0000000..9492dce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js @@ -0,0 +1,16 @@ +var pad = require('../number/pad'); + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + module.exports = timezoneOffset; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js new file mode 100644 index 0000000..8aafeb8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js @@ -0,0 +1,25 @@ +var isDate = require('../lang/isDate'); +var isLeapYear = require('./isLeapYear'); + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + module.exports = totalDaysInMonth; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js new file mode 100644 index 0000000..b4b7e9b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +var isLeapYear = require('./isLeapYear'); + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + module.exports = totalDaysInYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js new file mode 100644 index 0000000..dd51b7f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +var dayOfTheYear = require('./dayOfTheYear'); + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + module.exports = weekOfTheYear; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/array.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/array.md new file mode 100644 index 0000000..1f390fb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/array.md @@ -0,0 +1,773 @@ +# array # + +Array utilities. + + + + +## append(arr1, arr2):Array + +Appends an array to the end of the other. +The first array will be modified and will contain the appended items. + +See: [`union()`](#union), [`combine()`](#combine) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +append(foo, bar); // ['a', 'b', 'b', 'd'] +``` + + + +## collect(arr, callback, [thisObj]):Array + +Maps the items in `arr` and concatenates the resulting arrays. + +See: [`map()`](#map) + +```js +collect([1, 2, 3], function(val) { + return [val, val % 2]; +}); // [1, 1, 2, 0, 3, 1]; + +collect(['a', 'bb', ''], function(val) { + return val.split(''); +}); // ['a', 'b', 'b'] +``` + +It also supports a shorthand syntax: + +```js +var items = [{ a: [1] }, { b: 'foo' }, { a: [2, 3] }]; +collect(items, 'a'); // [1, 2, 3]; +``` + + + +## combine(arr1, arr2):Array + +Combines an array with all the items of another. +The first array will be modified and will contain the combined items. +Does not allow duplicates and is case and type sensitive. + +See: [`union()`](#union), [`append()`](#append) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +combine(foo, bar); // ['a', 'b', 'd'] +``` + + + +## compact(arr):Array + +Returns a new Array without any `null` or `undefined` values. Note that it will +keep empty strings and other falsy values (simillar to Ruby Array#compact). + +```js +var arr = [0, 1, null, false, '', 'foo', undefined, 'bar']; +compact(arr); // [0, 1, false, '', 'foo', 'bar']; +``` + + + +## contains(arr, value):Boolean + +Checks if Array contains value. Alias to `indexOf(arr, val) !== -1`. + +```js +var arr = [1, 2, 3]; +contains(arr, 2); // true +contains(arr, 'foo'); // false +``` + + + +## difference(...arrs):Array + +Return a new Array with elements that aren't present in the other Arrays +besides the first one. + +Works like [Python set#difference](http://docs.python.org/library/stdtypes.html#set.difference). + +It will remove duplicates. + +See: [`xor()`](#xor), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +difference(a, b); // ['a', 'b'] +``` + + + +## every(arr, callback, [thisObj]):Array + +Crossbrowser `Array.every()`. + +Tests whether all elements in the array pass the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +every(items, isString); // false +every(items, isFunction); // false +every(items, function(val, key, arr){ + return val != null; +}); // true +``` + +more info at [MDN Array#every](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:true}, {id:8, active:true}]; +// all items with `id === 8` +every(items, {id:8}); // false +// `active` is truthy on all items +every(items, 'active'); // true +``` + + + +## filter(arr, callback, [thisObj]):Array + +Crossbrowser `Array.filter()`. + +Creates a new array with all elements that pass the callback test. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var nums = [1, 2, 3, 4, 5, 6]; +var oddNumbers = filter(nums, function(val, key, arr){ + return (val % 2) !== 0; +}); +// > [1, 3, 5] +``` + +more info at [MDN Array#filter](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter) + +Filter also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// filter item that matches all properties/values pairs +filter(arr, {name:'john', beard:false}); +// > [{name:'john', surnname:'connor', beard:false}] +// items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'doe', beard:true}] +``` + +See [`reject()`](#reject) + + + +## find(arr, callback, [thisObj]):void + +Loops through all the items in the Array and returns the first one that passes +a truth test (callback). + +```js +var arr = [123, {a:'b'}, 'foo', 'bar']; +find(arr, isString); // "foo" +find(arr, isNumber); // 123 +find(arr, isObject); // {a:'b'} +``` + +Find also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true} +]; +// first item that matches all properties/values pairs +find(arr, {name:'john'}); // {name:'john', surnname:'connor', beard:false} +// first item where 'beard' is a truthy value +find(arr, 'beard'); // {name:'john', surnname:'doe', beard:true} +``` + +See: [findIndex()](#findIndex) + + + +## findIndex(arr, iterator, [thisObj]):Number + +Loops through the items in the Array and returns the index of the first one +that passes a truth test (callback). + +Returns `-1` if no item was found that passes the truth test. + +```js +var arr = [1, { a: 1 }, 'foo', 'bar']; +findIndex(arr, isString); // 2 +findIndex(arr, isNumber); // 0 +findIndex(arr, isObject); // 1 +findIndex(arr, isRegExp); // -1 +``` + +`findIndex` also supports shorthand notation: + +```js +var pets = [ + { pet: 'dog', name: 'Sam' }, + { pet: 'dog', name: 'Maggie' } +]; + +findIndex(pets, { pet: 'dog' }); // 0 +findIndex(pets, { name: 'Maggie' }); // 1 +``` + +See: [find()](#find) + + + +## flatten(arr, [level]):Array + +Recursively flattens an array. A new array containing all the elements is +returned. If `level` is specified, it will only flatten up to that level. + +### Example + +```js +flatten([1, [2], [3, [4, 5]]]); +// > [1, 2, 3, 4, 5] +flatten([1, [2], [3, [4, 5]]], 1); +// > [1, 2, 3, [4, 5]] +``` + + + +## forEach(arr, callback, [thisObj]):void + +Crossbrowser `Array.forEach()`. + +It allows exiting the iteration early by returning `false` on the callback. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = ['foo', 'bar', 'lorem', 'ipsum']; +forEach(items, function(val, key, arr){ + console.log(key +' : '+ val); + if (val === 'lorem') { + // stop iteration (break) + return false; + } +}); +``` + +more info at [MDN Array#forEach](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach) + + + +## indexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.indexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#indexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf) + + + + +## insert(arr, ...items):Number + +Push items into array only if they aren't contained by it. Returns the new +`length` of the array. + +See: [`remove()`](#remove), [`removeAll()`](#removeAll), +[`contains()`](#contains) + +```js +var arr = ['a', 'b']; +insert(arr, 'a'); // 2 : ['a', 'b'] +insert(arr, 'c'); // 3 : ['a', 'b', 'c'] +insert(arr, 1, 2, 'b'); // 5 : ['a', 'b', 'c', 1, 2] +``` + + + +## intersection(...arrs):Array + +Return a new Array with elements common to all Arrays. + +Similar to Python set#intersection and underscore.js intersection. + +It will remove duplicates. + +See: [`difference()`](#difference), [`xor()`](#xor) + +```js +var a = ['a', 'b', 1], + b = ['c', 1], + c = [1, 2, 3]; +intersection(a, b, c); // [1] +``` + + + +## invoke(arr, methodName[, ...args]):Array + +Call `methodName` on each item of the array passing custom arguments if needed. + +```js +invoke([[3,2,1], [9,5,2]], 'sort'); // [[1,2,3], [2,5,9]] +``` + + + +## join(arr, [separator]):String + +Joins the strings in `arr`, inserting `separator` between each value. + +This ignores null values and empty strings that are in the array. `separator` +defaults to an empty string. This will convert all non-string objects in the +array to a string. + +### Example + +```js +join(['a', 'b', 'c']); // 'abc' +join(['foo', 'bar'], ', '); // 'foo, bar' +join([null, 'foo', '', 'bar', undefined], ':'); // 'foo:bar' +``` + + + +## lastIndexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.lastIndexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#lastIndexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf) + + + +## map(arr, callback, [thisObj]]):Array + +Crossbrowser `Array.map()`. + +Creates a new array with the results of calling a provided function on every +element in this array. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +See: [`collect()`](#collect) + +```js +var nums = [1,2,3,4]; +var double = map(nums, function(val, key, arr){ + return val * 2; +}); +// > [2, 4, 6, 8] +``` + +more info at [MDN Array#map](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map) + +It also supports a shorthand notation which can be used to achieve same result +as [`array/pluck`](#pluck): + +```js +var src = ['lorem', 'ipsum', 'foo', 'amet']; +// grab the "length" property of all items +var lengths = map(src, 'length'); // [5, 5, 3, 4] +``` + + + +## max(arr, [iterator], [thisObj]):* + +Returns maximum value inside array or use a custom iterator to define how items +should be compared. + +See: [`min()`](#min) + +```js +max([10, 2, 7]); // 10 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + +It also supports a shorthand notation: + +```js +max(['foo', 'lorem', 'amet'], 'length'); // "lorem" +``` + + + +## min(arr, [iterator], [thisObj]):* + +Returns minimum value inside array or use a custom iterator to define how items +should be compared. + +See: [`max()`](#max) + +```js +min([10, 2, 7]); // 2 +min(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'foo' +``` + +It also supports a shorthand notation: + +```js +min(['foo', 'lorem', 'amet'], 'length'); // "foo" +``` + + + +## pick(arr):* + +Gets a random item and remove it from the array. + +### Example: + + var arr = [1, 2, 3, 4, 5, 6]; + var item_1 = pick(arr); // 4 + var item_2 = pick(arr); // 1 + console.log(arr); // [2, 3, 5, 6] + + + +## pluck(arr, propName):Array + +Extract a list of property values. + +See: [`function/prop()`](function.html#prop) + +```js +var users = [{name : 'John', age: 21}, {name: 'Jane', age : 27}]; +var names = pluck(users, 'name'); // ["John", "Jane"] +var ages = pluck(users, 'age'); // [21, 27] +``` + + + +## range([start], stop[, step]):Array + +Creates a new Array with all the values inside the range. Works similarly to +Python#range or PHP#range. + +### Arguments + + 1. `[start]` (Number) : Range start. Default is `0`. + 2. `stop` (Number) : Range limit. + 3. `[step]` (Number) : Step size. Default is `1`. + +### Example + +```js +range(5); // [0, 1, 2, 3, 4, 5] +range(0, 5); // [0, 1, 2, 3, 4, 5] +range(0, 5, 2); // [0, 2, 4] +range(20, 40, 5); // [20, 25, 30, 35, 40] +``` + + + +## reduce(arr, fn):* + +Crossbrowser `Array.reduce()`. + +Apply a function against an accumulator and each value of the array (from +left-to-right) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduce](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce) + + + +## reduceRight(arr, fn):* + +Crossbrowser `Array.reduceRight()`. + +Apply a function simultaneously against two values of the array (from +right-to-left) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduceRight](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduceRight) + + + +## reject(arr, fn, thisObj):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var numbers = [1, 2, 3, 4, 5, 6]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4, 6] +``` + +It also supports a shorthand syntax: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// reject items that matches all properties/values pairs +reject(arr, {name:'john'}); +// > [{name:'jane', surnname:'doe', beard:false}] +// reject items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'connor', beard:false}, +// {name:'jane', surname:'doe', beard:false}] +``` + + + +## remove(arr, item):void + +Remove a single item from the array. + +IMPORTANT: it won't remove duplicates, just a single item. + +### Example + +```js +var foo = [1, 2, 3, 4]; +remove(foo, 2); +console.log(foo); // [1, 3, 4] +``` + + + +## removeAll(arr, item):void + +Remove all instances of an item from the array. + +### Example + +```js +var foo = [1, 2, 3, 4, 2, 2]; +removeAll(foo, 2); +console.log(foo); // [1, 3, 4]; +``` + + + +## shuffle(arr):Array + +Returns a new Array with items randomly sorted (shuffled). Similar to Ruby Array#shuffle. + +### Example + +```js +var arr = ['a', 'b', 'c', 'd', 'e']; +shuffle(arr); // ['b', 'd', 'e', 'c', 'a'] +``` + + + +## some(arr, callback, [thisObj]):Array + +Crossbrowser `Array.some()`. + +Tests whether some element in the array passes the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +some(items, isString); // true +some(items, isFunction); // false +``` + +more info at [MDN Array#some](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:false}, {id:8, active:false}]; +// at least one item with `id === 8` +some(items, {id:8}); // true +// `active` is truthy on at least one item +some(items, 'active'); // true +``` + +see also: [`object/matches`](object.html#matches) + + + +## sort(arr, [compareFn]):Array + +Returns a sorted Array using the [Merge Sort](http://en.wikipedia.org/wiki/Merge_sort) algorithm (stable sort). + +The `Array.prototype.sort` browser implementations differ since the sorting algorithm isn't described in the ES spec - [in V8 it isn't stable](http://code.google.com/p/v8/issues/detail?id=90) and [on Firefox it is stable](https://bugzilla.mozilla.org/show_bug.cgi?id=224128) - so this function doesn't use the browser native implementation and is recommended in cases where a stable sort is required (items should preserve same order if already sorted). + +**Important:** It does logical comparisson by default (greater/less than) and +not a string comparisson like the native `Array#sort`. + +### compareFn + +If `compareFn` is supplied elements are sorted based on the value returned by +the `compareFn`. + + - If `compareFn(a, b)` is less than `0`, sort `a` to a lower index than `b`. + - If `compareFn(a, b)` returns `0`, leave `a` and `b` unchanged with respect + to each other, but sorted with respect to all different elements. + - If `compareFn(a, b)` is greater than `0`, sort `b` to a lower index than + `a`. + +### Example + +```js +sort([187, 23, 47, 987, 12, 59, 0]); // [0, 12, 23, 47, 59, 187, 987] +sort(['a', 'z', 'c', 'beta', 'b']); // ['a', 'b', 'beta', 'c', 'z'] + +// ['sit', 'amet', 'lorem', 'ipsum'] +sort(['lorem', 'ipsum', 'sit', 'amet'], function(a, b){ + // sort by length, items with same length + // will keep the relative order (stable) + return a.length - b.length; +}); + +// [4, 3, 2, 1] +sort([2, 3, 1, 4], function(a, b){ + // reverse sort + return b - a; +}); +``` + + + +## split(arr, [segments]):Array + +Splits an array into a fixed number of segments. + +The number of segments is specified by `segments` and defaults to 2. If the +array cannot be evenly split, the first segments will contain the extra items. +If `arr` is empty, an empty array is returned. If `arr.length` is less than +`segments`, then the resulting array will have `arr.length` number of +single-element arrays. + +### Example +```js +split([1, 2, 3, 4, 5], 3) // [ [1, 2], [3, 4], [5] ] +split([1, 2, 3, 4, 5]) // [ [1, 2, 3], [4, 5] ] +split([]) // [] +split([1, 2], 3) // [ [1], [2] ] +``` + + + +## toLookup(arr, key):Object + +Create an object that indexes the items in the array by a key. If `key` is a function, the key for each value in the resulting object will be the result of calling the function with the value as an argument. Otherwise `key` specifies the property on each value to use as the key. + +### Example + +```js +var foo = [{ name: 'a', thing: 1 }, { name: 'b', thing: 2 }]; +// { a: { name: 'a', thing: 1 }, b: { name: 'b', thing: 2 } } +toLookup(foo, 'name'); +// same as above +toLookup(foo, function (value) { return value.name; }); +``` + + + +## union(...arrs):Array + +Concat multiple arrays removing duplicates. + +```js +var a = ['a', 'b'], + b = ['c', 'a'], + c = [1, 'b', 2, 3, 'a']; + +//note that unique remove from begin to end +union(a, b, c); // ['c', 1, 'b', 2, 3, 'a'] +``` + + + +## unique(arr):Array + +Return a new Array of unique items. + +### Example + +```js +var foo = [1, 2, 3, 4, 2, 2, 3, 4]; +var bar = unique(foo); +console.log(foo); // [1, 2, 3, 4]; +``` + + + +## xor(arr1, arr2):Array + +Exclusive OR. Returns items that are present in a single array. + +Works like [Python set#symmetric_difference](http://docs.python.org/library/stdtypes.html#set.symmetric_difference) renamed for brevity. + +It will remove duplicates. + +See: [`difference()`](#difference), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +xor(a, b); // ['a', 'b', 'c'] +``` + + + +## zip(...arrs):Array + +Groups the elements of each array at their corresponding indexes. + +Useful for separate data sources that are coordinated through matching array +indexes. For a matrix of nested arrays, `zip.apply(...)` can transpose the +matrix in a similar fashion. + +```js +// [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] +zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); +``` + + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/collection.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/collection.md new file mode 100644 index 0000000..2ffcab1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/collection.md @@ -0,0 +1,233 @@ +# collection # + +Methods for dealing with collections (Array or Objects). + + + +## contains(list, value):Boolean + +Checks if collection contains value. + +```js +contains({a: 1, b: 2, c: 'bar'}, 2); // true +contains([1, 2, 3], 'foo'); // false +``` + +See: [array/contains](array.html#contains), [object/contains](object.html#contains) + + + +## every(list, callback, [thisObj]):Boolean + +Tests whether all values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + +See: [array/every](array.html#every), [object/every](object.html#every) + + + +## filter(list, callback, [thisObj]):Array + +Filter collection properties. + +See: [array/filter](array.html#filter), [object/filter](object.html#filter) + + + +## find(list, callback, [thisObj]):* + +Loops through all the values in the collection and returns the first one that +passes a truth test (callback). + +**Important:** loop order over objects properties isn't guaranteed to be the +same on all environments. + +```js +find({a: 'foo', b: 12}, isString); // 'foo' +find(['foo', 12], isNumber); // 12 +``` + +See: [array/find](array.html#find), [object/find](object.html#find) + + + +## forEach(list, callback, [thisObj]) + +Loop through all values of the collection. + +See: [array/forEach](array.html#forEach), [object/forOwn](object.html#forOwn) + + + +## map(list, callback, [thisObj]):Array + +Returns a new collection where the properties values are the result of calling +the callback for each property in the original collection. + +See: [array/map](array.html#map), [object/map](object.html#map) + + + +## max(list, [iterator]):* + +Returns maximum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`min()`](#min), [array/max](array.html#max), [object/max](object.html#max) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(list, [iterator]):* + +Returns minimum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`max()`](#max), [array/min](array.html#min), [object/min](object.html#min) + +```js +min([10, 2, 7]); // 2 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## pluck(list, propName):Array + +Extract a list of property values. + +```js +var users = [ + { + name : 'John', + age : 21 + }, + { + name : 'Jane', + age : 27 + } +]; + +pluck(users, 'name'); // ["John", "Jane"] +pluck(users, 'age'); // [21, 27] + +users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // ['John', 'Mary'] +``` + +See: [array/pluck](array.html#pluck), [object/pluck](object.html#pluck) + + + +## reduce(list, callback, initial, [thisObj]):* + +Apply a function against an accumulator and each value in the collection as to +reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + +See: [array/reduce](array.html#reduce), [object/reduce](object.html#reduce) + + + +## reject(list, fn, [thisObj]):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +### Example + +```js +var numbers = [1, 2, 3, 4, 5]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4] + +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // [2, 4] +``` + +See: [array/reject](array.html#reject), [object/reject](object.html#reject) + + + +## size(list):Number + +Returns the number of values in the collection. + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +size([1,2,3]); // 3 +size(null); // 0 +``` + +See: [object/size](object.html#size) + + + +## some(list, callback, [thisObj]):Boolean + +Tests whether any values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +some(obj, isString); // true +some([1, 2, 3], isNumber) // true +some([1, 2, 3], isString) // false +``` + +See: [array/some](array.html#some), [object/some](object.html#some) + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/date.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/date.md new file mode 100644 index 0000000..b3f7f40 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/date.md @@ -0,0 +1,295 @@ +# date # + +Date utilities. + + +## dayOfTheYear(date):Number + +How many days elapsed since begining of the year (following gregorian +calendar). + +```js +// Jan 1st +dayOfTheYear(new Date(2013, 0, 1)); // 1 +// Dec 31th +dayOfTheYear(new Date(2013, 11, 31)); // 364 +``` + + + +## diff(date1, date2, [unitName]):Number + +Calculate the difference between dates (range). + +The returned value is always positive. The default `unitName` is `"ms"`. + +Available units: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`, +`millisecond`. + +See: [`time/convert()`](time.html#convert) + +```js +var d1 = new Date(2012, 4, 5); +var d2 = new Date(2013, 4, 8); +diff(d1, d2); // 31795200000 +diff(d1, d2, 'hour'); // 8832 +diff(d1, d2, 'week'); // 52.57142857142857 +diff(d1, d2, 'month'); // 12.096774193548388 +diff(d1, d2, 'year'); // 1.0082191780821919 +``` + + + +## isLeapYear(fullYear|date):Boolean + +Checks if it's a [leap year](http://en.wikipedia.org/wiki/Leap_year) according +to the Gregorian calendar. + +see: [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +isLeapYear(2012); // true +isLeapYear(2013); // false +isLeapYear(new Date(2012, 2, 28)); // true +``` + + +## isSame(date1, date2[, period]):Boolean + +Check if both dates are the "same". + +You can pass an optional *period* used to set the comparisson precision. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +var date1 = new Date(2013, 1, 3); +var date2 = new Date(2013, 2, 9); +isSame(date1, date2); // false +isSame(date1, date2, 'day'); // false +isSame(date1, date2, 'month'); // false +isSame(date1, date2, 'year'); // true +``` + + + +## parseIso(str):Number + +Parses an [ISO8601](http://en.wikipedia.org/wiki/Iso8601) date and returns the +number of milliseconds since January 1, 1970, 00:00:00 UTC, or `NaN` if it is +not a valid ISO8601 date. + +This parses *all* ISO8601 dates, including dates without times, [ordinal +dates](https://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates), and the compact +representation (omitting delimeters). The only exception is [ISO week +dates](https://en.wikipedia.org/wiki/ISO_week_date), which are not parsed. + +If no time zone offset is specified, it assumes UTC time. + +```js +// Jan 01, 1970 00:00 GMT +parseIso('1970-01-01T00:00:00') // 0 +parseIso('1970-001') // 0 +parseIso('1970-01-01') // 0 +parseIso('19700101T000000.00') // 0 +parseIso('1970-01-01T02:00+02:00') // 0 + +// Jan 02, 2000 20:10 GMT+04:00 +parseIso('2000-01-02T20:10+04:00') // 946829400000 +``` + + + +## startOf(date, period):Date + +Get a new Date at the start of the period. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +// Apr 05 2013 11:27:43 +var date = new Date(2013, 3, 5, 11, 27, 43, 123); +startOf(date, 'year'); // Jan 01 2013 00:00:00 +startOf(date, 'month'); // Apr 01 2013 00:00:00 +startOf(date, 'day'); // Apr 05 2013 00:00:00 +startOf(date, 'hour'); // Apr 05 2013 11:00:00 +``` + + + +## strftime(date, format, [l10n]):String + +Format date based on strftime format. + +Replaced tokens: + +
    +
    %a
    locale's abbreviated weekday name.
    +
    %A
    locale's full weekday name.
    +
    %b
    locale's abbreviated month name.
    +
    %B
    locale's full month name.
    +
    %c
    locale's appropriate date and time representation.
    +
    %C
    century number (the year divided by 100 and truncated +to an integer) as a decimal number [00..99].
    +
    %d
    day of the month as a decimal number [01..31].
    +
    %D
    same as %m/%d/%y.
    +
    %e
    day of the month as a decimal number [1..31]; +a single digit is preceded by a space.
    +
    %F
    The ISO 8601 date format (%Y-%m-%d)
    +
    %h
    same as %b.
    +
    %H
    hour (24-hour clock) as a decimal number [00..23].
    +
    %I
    hour (12-hour clock) as a decimal number [01..12].
    +
    %j
    day of the year as a decimal number [001..366].
    +
    %L
    zero-padded milliseconds [000..999]
    +
    %m
    month as a decimal number [01..12].
    +
    %M
    minute as a decimal number [00..59].
    +
    %n
    newline character.
    +
    %p
    locale's equivalent of either "am" or "pm"
    +
    %P
    locale's equivalent of either "AM" or "PM"
    +
    %r
    time in a.m. and +p.m. notation; in the POSIX locale this is equivalent to %I:%M:%S %p.
    +
    %R
    time in 24 hour notation (%H:%M).
    +
    %s
    seconds since Epoch (1970-01-01 00:00:00 UTC)
    +
    %S
    second as a decimal number [00..60].
    +
    %t
    tab character.
    +
    %T
    time (%H:%M:%S).
    +
    %u
    weekday as a decimal number [1..7], with 1 representing +Monday.
    +
    %U
    week number of the year (Sunday as the first day of +the week) as a decimal number [00..53].
    +
    %V
    week number of the year (Monday as the first day of the +week) as a decimal number [01..53]. If the week containing 1 January has +four or more days in the new year, then it is considered week 1. Otherwise, +it is the last week of the previous year, and the next week is week 1.
    +
    %w
    weekday as a decimal number [0..6], with 0 representing +Sunday.
    +
    %W
    week number of the year (Monday as the first day of +the week) as a decimal number [00..53]. All days in a new year preceding +the first Monday are considered to be in week 0.
    +
    %x
    locale's appropriate date representation.
    +
    %X
    locale's appropriate time representation.
    +
    %y
    year without century as a decimal number [00..99].
    +
    %Y
    year with century as a decimal number.
    +
    %Z
    timezone name or abbreviation, or by no bytes +if no timezone information exists.
    +
    %%
    is replaced by %.
    +
    + +```js +var date = new Date(2013, 3, 8, 9, 2, 4); +strftime(date, '%Y-%m-%d'); // "2013-04-08" +strftime(date, '%R'); // "09:02" +strftime(date, '%Y-%m-%dT%H:%M:%S%z'); // "2013-04-08T09:02:04+0000" +``` + +You can also set a custom locale: + +```js +var ptBr = require('mout/date/i18n/pt-BR'); +strftime(date, '%a, %d %b', ptBr); // 'Seg, 08 Abr' +strftime(date, '%A, %d %B', ptBr); // 'Segunda, 08 Abril' +``` + +To set it globally: + +```js +require('mout/date/i18n_').set( customLocaleData ); +``` + +See [date/i18n](https://github.com/mout/mout/tree/master/src/date/i18n) +for localization examples. + + + +## timezoneAbbr(date):String + +Return timezone abbreviation or similar data. + +The result will vary based on the OS/browser since some environments doesn't +provide enough info about the current locale. + +```js +// IE 7-8 +timezoneAbbr(new Date()); // "-0500" +// Chrome, FF, V8 +timezoneAbbr(new Date()); // "EST" +``` + + + +## timezoneOffset(date):String + +Return time zone as hour and minute offset from UTC (e.g. +0900). + +It's important to note that JavaScript Date object will use the system locale +info to determinate the [timezone +offset](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset) +and that daylight saving time affects the result. + +```js +// if system locale is EST +timezoneOffset(new Date()); // -0500 +``` + + + +## totalDaysInMonth(fullYear, monthIndex):Number + +Returns the amount of days in the month taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear) + +```js +totalDaysInMonth(2008, 1); // 29 (leap year) +totalDaysInMonth(2009, 1); // 28 + +// you can also pass a Date object as single argument +totalDaysInMonth( new Date(2013, 0, 1) ); // 31 +``` + + +## totalDaysInYear(fullYear):Number + +Returns the amount of days in the year taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear), [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +totalDaysInYear(2008); // 366 (leap year) +totalDaysInYear(2009); // 365 + +// you can also pass a Date object as single argument +totalDaysInYear( new Date(2013, 0, 1) ); // 365 +``` + + + +## weekOfTheYear(date, [firstDayOfWeek]):Number + +Returns how many weeks elapsed since start of the year (`0..53`). + +`firstDayOfWeek` can be `0` (Sunday) or `1` (Monday). By default weeks start at +Sunday. + +It will return `0` if `date` is before the first `firstDayOfWeek` of the year. + +```js +// Tue Jan 01 2013 +weekOfTheYear( new Date(2013,0,1) ); // 0 +// Wed Jan 09 2013 +weekOfTheYear( new Date(2013,0,9) ); // 1 +// Sun Jan 01 2012 +weekOfTheYear( new Date(2012,0,1) ); // 1 +// Mon Jan 09 2012 +weekOfTheYear( new Date(2012,0,9) ); // 2 +``` + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/function.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/function.md new file mode 100644 index 0000000..2695a02 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/function.md @@ -0,0 +1,174 @@ +# function # + +Function*(al)* utilities. + + + +## bind(fn, context, [...args]):Function + +Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + +### Arguments + + 1. `fn` (Function) : Target Function + 2. `context` (Object) : Execution context (object used as `this`) + 3. `[...args]` (*) : Arguments (0...n arguments) + +See: [`partial()`](#partial), [object/bindAll](./object.html#bindAll) + + + +## compose(...fn):Function + +Returns the composition of a list of functions, where each function consumes +the return value of the function that follows. In math terms, composing the +functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + +```js +function add2(x) { return x + 2 } +function multi2(x) { return x * 2 } +map([1, 2, 3], compose(add2, multi2)); // [4, 6, 8] + +//same as +map([1, 2, 3], function(x){ + return add2( multi2(x) ); +}); +``` + + + +## debounce(fn, delay[, isAsap]):Function + +Creates a function that will delay the execution of `fn` until after `delay` +milliseconds have elapsed since the last time it was invoked. + +Subsequent calls to the debounced function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = debounce(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a debounced-function call and `X` is the actual +callback execution: + + Default + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + + Debounced with `isAsap == true`: + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + +See: [`throttle()`](#throttle) + + +## func(name):Function + +Returns a function that calls a method with given `name` on supplied object. +Useful for iteration methods like `array/map` and `array/forEach`. + +See: [`prop()`](#prop) + +```js +// will call the method `getName()` for each `user` +var names = map(users, func('getName')); +``` + + + +## partial(fn, [...args]):Function + +Return a partially applied function supplying default arguments. + +This method is similar to [`bind`](#bind), except it does not alter the this +binding. + +### Arguments + + 1. `fn` (Function) : Target Function + 3. `[...args]` (*) : Arguments (0...n arguments) + +See: [`bind()`](#bind) + +```js +function add(a, b){ return a + b } +var add10 = partial(add, 10); +console.log( add10(2) ); // 12 +``` + + + +## prop(name):Function + +Returns a function that gets a property with given `name` from supplied object. +Useful for using in conjunction with `array/map` and/or for creating getters. + +See: [`array/pluck()`](array.html#pluck) + +```js +var users = [{name:"John", age:21}, {name:"Jane", age:25}]; +// ["John", "Jane"] +var names = map(users, prop('name')); +``` + + + +## series(...fn):Function + +Returns a function that will execute all the supplied functions in order and +passing the same parameters to all of them. Useful for combining multiple +`array/forEach` into a single one and/or for debugging. + + +```js +// call `console.log()` and `doStuff()` for each item item in the array +forEach(arr, series(console.log, doStuff)); +``` + + + +## throttle(fn, interval):Function + +Creates a function that, when executed, will only call the `fn` function at +most once per every `interval` milliseconds. + +If the throttled function is invoked more than once during the wait timeout, +`fn` will also be called on the trailing edge of the timeout. + +Subsequent calls to the throttled function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = throttle(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a throttled-function call and `X` is the actual +`fn` execution: + + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X X X X X X X X X X X + +See: [`debounce()`](#debounce) + + +## timeout(fn, millis, context, [...args]):Number + +Functions as a wrapper for `setTimeout`. Calls a the function `fn` after a given delay `millis` in milliseconds. +The function is called within the specified context. The return value can be used to clear the timeout using `clearTimeout`. + +```js +var id = timeout(doStuff, 300, this); + +clearTimeout(id); +``` + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/lang.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/lang.md new file mode 100644 index 0000000..56d7879 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/lang.md @@ -0,0 +1,385 @@ +# lang # + +Language Utilities. Easier inheritance, scope handling, type checks. + + + +## clone(val):* + +Clone native types like Object, Array, RegExp, Date and primitives. + +This method will not clone values that are referenced within `val`. It will +only copy the value reference to the new value. If the value is not a plain +object but is an object, it will return the value unchanged. + +### Example + +```js +var a = { foo: 'bar' }; +var b = clone(a); +console.log(a === b); // false +console.log(a.foo === b.foo); // true + +var c = [1, 2, 3]; +var d = clone(b); +console.log(c === d); // false +console.log(c); // [1, 2, 3] +``` + +See: [`deepClone()`](#deepClone) + + + +## createObject(parent, [props]):Object + +Create Object using prototypal inheritance and setting custom properties. + +Mix between [Douglas Crockford Prototypal Inheritance](http://javascript.crockford.com/prototypal.html) and the EcmaScript 5 `Object.create()` method. + +### Arguments + + 1. `parent` (Object) : Parent Object + 2. `[props]` (Object) : Object properties + +### Example + +```js +var base = { + trace : function(){ + console.log(this.name); + } +}; + +var myObj = createObject(base, { + name : 'Lorem Ipsum' +}); + +myObject.trace(); // "Lorem Ipsum" +``` + + + +## ctorApply(constructor, args):Object + +Do `Function.prototype.apply()` on a constructor while maintaining prototype +chain. + +```js +function Person(name, surname) { + this.name = name; + this.surname = surname; +} + +Person.prototype.walk = function(){ + console.log(this.name +' is walking'); +}; + +var args = ['John', 'Doe']; + +// "similar" effect as calling `new Person("John", "Doe")` +var john = ctorApply(Person, args); +john.walk(); // "John is walking" +``` + + + +## deepClone(val, [instanceClone]):* + +Deep clone native types like Object, Array, RegExp, Date and primitives. + +The `instanceClone` function will be invoked to clone objects that are not +"plain" objects (as defined by [`isPlainObject`](#isPlainObject)) if it is +provided. If `instanceClone` is not specified, it will not attempt to clone +non-plain objects, and will copy the object reference. + +### Example + +```js +var a = {foo:'bar', obj: {a:1, b:2}}; +var b = deepClone(a); // {foo:'bar', obj: {a:1, b:2}} +console.log( a === b ); // false +console.log( a.obj === b.obj ); // false + +var c = [1, 2, [3, 4]]; +var d = deepClone(c); // [1, 2, [3, 4]] +var e = c.concat(); // [1, 2, [3, 4]] + +console.log( c[2] === d[2] ); // false +// concat doesn't do a deep clone, arrays are passed by reference +console.log( e[2] === d[2] ); // true + +function Custom() { } +function cloneCustom(x) { return new Custom(); } +var f = { test: new Custom() }; +var g = deepClone(f, cloneCustom); +g.test === f.test // false, since new Custom instance will be created +``` + +See: [`clone()`](#clone) + + + +## defaults(val, ...defaults):void + +Return first value that isn't `null` or `undefined`. + + function doSomethingAwesome(foo, bar) { + // default arguments + foo = defaults(foo, 'lorem'); + bar = defaults(bar, 123); + // ... + } + + + +## inheritPrototype(child, parent):void + +Inherit prototype from another Object. + +```js +function Foo(name){ + this.name = name; +} +Foo.prototype = { + getName : function(){ + return this.name; + } +}; + +function Bar(name){ + this.name = name; +} +//should be called before calling constructor +inheritPrototype(Bar, Foo); + +var myObj = new Bar('lorem ipsum'); +myObj.getName(); // "lorem ipsum" +``` + + +## is(x, y):Boolean + +Check if both values are identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +is(NaN, NaN); // true +is(-0, +0); // false +is('a', 'b'); // false +``` + +See: [`isnt()`](#isnt) + + + +## isnt(x, y):Boolean + +Check if both values are not identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +isnt(NaN, NaN); // false +isnt(-0, +0); // true +isnt('a', 'b'); // true +``` + +See: [`is()`](#is) + + + + +## isArguments(val):Boolean + +If value is an "Arguments" object. + + + +## isArray(val):Boolean + +If value is an Array. Uses native ES5 `Array.isArray()` if available. + + + +## isBoolean(val):Boolean + +If value is a Boolean. + + + +## isDate(val):Boolean + +If value is a Date. + + + +## isEmpty(val):Boolean + +Checks if Array/Object/String is empty. + + +```js +isEmpty(''); // true +isEmpty('bar'); // false +isEmpty([]); // true +isEmpty([1, 2]); // false +isEmpty({}); // true +isEmpty({a:1, b:2}); // false +``` + + +## isFinite(val):Boolean + +Checks if value is Finite. + +Note: This is not the same as native `isFinite`, which will return `true` for +booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + + + +## isFunction(val):Boolean + +If value is a Function. + + + +## isKind(val, kind):Boolean + +If value is of "kind". (used internally by some of the *isSomething* checks). + +Favor the other methods since strings are commonly mistyped and also because +some "kinds" can only be accurately checked by using other methods (e.g. +`Arguments`), some of the other checks are also faster. + +```js +isKind([1,2], 'Array'); // true +isKind(3, 'Array'); // false +isKind(3, 'Number'); // true +``` + +See: [`kindOf()`](#kindOf) + + + +## isInteger(val):Boolean + +Check if value is an integer. + +```js +isInteger(123); // true +isInteger(123.45); // false +isInteger({}); // false +isInteger('foo'); // false +isInteger('123'); // false +``` + + + +## isNaN(val):Boolean + +Check if value is `NaN`. + +Note: This is not the same as native `isNaN`, which will return `true` for +`undefined` and other values. See [ES5 isNaN](http://es5.github.com/#x15.1.2.4) + + + +## isNull(val):Boolean + +If value is `null`. + + + +## isNumber(val):Boolean + +If value is a Number. + + + +## isObject(val):Boolean + +If value is an Object. + + + +## isPlainObject(val):Boolean + +If the value is an Object created by the Object constructor. + + + +## isRegExp(val):Boolean + +If value is a RegExp. + + + +## isString(val):Boolean + +If value is a String. + + + +## isUndefined(val):Boolean + +If value is `undefined`. + + + +## kindOf(val):String + +Gets kind of value (e.g. "String", "Number", "RegExp", "Null", "Date"). +Used internally by `isKind()` and most of the other *isSomething* checks. + +```js +kindOf([1,2]); // "Array" +kindOf('foo'); // "String" +kindOf(3); // "Number" +``` + +See: [`isKind()`](#isKind) + + +## toArray(val):Array + +Convert array-like object into Array or wrap value into Array. + +```js +toArray({ + "0" : "foo", + "1" : "bar", + "length" : 2 +}); // ["foo", "bar"] + +function foo(){ + return toArray(arguments); +} +foo("lorem", 123); // ["lorem", 123] + +toArray("lorem ipsum"); // ["lorem ipsum"] +toArray(window); // [window] +toArray({foo:"bar", lorem:123}); // [{foo:"bar", lorem:123}] +``` + +See: object/values() + + + +## toString(val):String + +Convert any value to its string representation. + +Will return an empty string for `undefined` or `null`, otherwise will convert +the value to its string representation. + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/math.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/math.md new file mode 100644 index 0000000..f45be3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/math.md @@ -0,0 +1,298 @@ +# math # + +Math utilities. + + +## ceil(val[, step]):Number + +Round value up to full steps. Similar to `Math.ceil()` but can round value +to an arbitrary *radix*. + + ceil(7.2); // 8 + ceil(7.8); // 8 + ceil(7, 5); // 10 + ceil(11, 5); // 15 + ceil(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`floor()`](#floor), [`countSteps()`](#countSteps) + + + +## clamp(val, min, max):Number + +Clamps value inside range. + +`clamp()` is extremely useful in cases where you need to limit a value inside +a certain range. So instead of doing a complex `if/else` to filter/process the +value you can restrict it to always be inside the desired range: + + clamp(-5, 0, 10); // 0 + clamp(7, 1, 10); // 7 + clamp(8, 1, 10); // 8 + clamp(10, 1, 10); // 10 + clamp(11, 1, 10); // 10 + +If the value is smaller than `min` it returns the `min`, if `val` is higher +than `max` it returns `max`. + +### Common use cases + +Any situation where you need to limit a number inside a range like: slider +position, image galleries (so user can't skip to an image that doesn't +exist), drag and drop, scroll boundaries, etc. + +See: [`loop()`](#loop) + + + + +## countSteps(val, step[, overflow]):Number + +Count number of full steps. + +### Arguments: + + 1. `val` (Number) : Value. + 2. `step` (Number) : Step size. + 3. `[overflow]` (Number) : Maximum number of steps, nSteps will loop if +`>=` than overflow. + + +Count steps is very useful for cases where you need to know how many "full +steps" the number *completed*. Think of it as a division that only returns +integers and ignore remainders. + + countSteps(3, 5); // 0 + countSteps(6, 5); // 1 + countSteps(12, 5); // 2 + countSteps(18, 5); // 3 + countSteps(21, 5); // 4 + +You can also set an `overflow` which will reset the *counter* before reaching +this number. + + countSteps(3, 5, 3); // 0 + countSteps(6, 5, 3); // 1 + countSteps(12, 5, 3); // 2 + countSteps(18, 5, 3); // 0 + countSteps(21, 5, 3); // 1 + +### Common use cases + +#### How many items fit inside an area: + + var containerWidth = 100; + var itemWidth = 8; + var howManyFit = countSteps(containerWidth, itemWidth); // 12 + +#### Split value into different scales or convert value from one scale to another + +From [mout/time/parseMs](time.html#parseMs): + + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + // {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} + parseMs(2348765454); + + + +## floor(val[, step]):Number + +Round value down to full steps. Similar to `Math.floor()` but can round value +to an arbitrary *radix*. (formerly `snap`) + + floor(7.2); // 7 + floor(7.8); // 7 + floor(7, 5); // 5 + floor(11, 5); // 10 + floor(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +## inRange(val, min, max[, threshold]):Boolean + +Checks if value is inside the range. + + inRange(-6, 1, 10); // false + inRange( 5, 1, 10); // true + inRange(12, 1, 10); // false + +The threshold can be useful when you want granular control of what should match +and/or the precision could change at runtime or by some configuration option, +avoids the clutter of adding/subtracting the `threshold` from `mix` and `max`. + + inRange(12, 1, 10, 2); // true + inRange(13, 1, 10, 2); // false + +### Common use cases + +Anything that needs to check if value is inside a range, be it collision +detection, limiting interaction by mouse position, ignoring parts of the logic +that shouldn't happen if value isn't valid, simplify `if/else` conditions, +making code more readable, etc... + + + + +## isNear(val, target, threshold):Boolean + +Check if value is close to target. + +Similar to `inRange()` but used to check if value is close to a certain value +or match the desired value. Basically to simplify `if/else` conditions and to +make code clearer. + + isNear( 10.2, 10, 0.5); // true + isNear( 10.5, 10, 0.5); // true + isNear(10.51, 10, 0.5); // false + +### Common use cases + +Games where a certain action should happen if an *actor* is close to a target, +gravity fields, any numeric check that has some tolerance. + + + + +## lerp(ratio, start, end):Number + +Linear interpolation. + + lerp(0.5, 0, 10); // 5 + lerp(0.75, 0, 10); // 7.5 + +### Common use cases + +Linear interpolation is commonly used to create animations of elements moving +from one point to another, where you simply update the current ratio (which in +this case represents time) and get back the position of the element at that +"frame". + +The core idea of `lerp` is that you are using a number that goes from `0` to +`1` to specify a ratio inside that scale. This concept can be applied to +convert numbers from different scales easily. + +See: [`map()`](#map), [`norm()`](#norm) + + + + +## loop(val, min, max):Number + +Loops value inside range. Will return `min` if `val > max` and `max` if `val +< min`, otherwise it returns `val`. + + loop(-1, 0, 10); // 10 + loop( 1, 0, 10); // 1 + loop( 5, 0, 10); // 5 + loop( 9, 0, 10); // 9 + loop(10, 0, 10); // 10 + loop(11, 0, 10); // 0 + +Similar to [`clamp()`](#clamp) but *loops* the value inside the range when an +overflow occurs. + +### Common use cases + +Image galleries, infinite scroll, any kind of logic that requires that the +first item should be displayed after the last one or the last one should be +displayed after first if going on the opposite direction. + +See: [`clamp()`](#clamp) + + + + +## map(val, min1, max1, min2, max2):Number + +Maps a number from one scale to another. + + map(3, 0, 4, -1, 1) // 0.5 + map(3, 0, 10, 0, 100) // 30 + +### Common use cases + +Very useful to convert values from/to multiple scales. + +Let's suppose we have a slider that needs to go from `2000` to `5000` and that slider +has `300px` of width, here is how we would translate the knob position into the +current value: + + var knobX = 123; + var sliderWid = 300; + var minVal = 2000; + var maxVal = 5000; + + var curVal = map(knobX, 0, sliderWid, minVal, maxVal); // 3230 + +See: [`lerp()`](#lerp), [`norm()`](#norm) + + + + +## norm(val, min, max):Number + +Gets normalized ratio of value inside range. + + norm(50, 0, 100); // 0.5 + norm(75, 0, 100); // 0.75 + +### Common use cases + +Convert values between scales, used by [`map()`](#map) internally. Direct +opposite of [`lerp()`](#lerp). + +See: [`lerp()`](#lerp), [`map()`](#map) + + + +## round(val[, step]):Number + +Round value to full steps. Similar to `Math.round()` but allow setting an +arbitrary *radix*. + + // default + round(0.22); // 0 + round(0.49); // 0 + round(0.51); // 1 + + // custom radix + round(0.22, 0.5); // 0 + round(0.49, 0.5); // 0.5 + round(0.51, 0.5); // 0.5 + round(0.74, 0.5); // 0.5 + round(0.75, 0.5); // 1 + round(1.24, 0.5); // 1 + round(1.25, 0.5); // 1.5 + round(1.74, 0.5); // 1.5 + +### Common use cases + +Round values by increments of 0.5/5/10/1000/etc. + +See: [`floor()`](#floor), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +------------------------------------------------------------------------------- + +For more usage more info check the specs and source code. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/number.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/number.md new file mode 100644 index 0000000..8d93865 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/number.md @@ -0,0 +1,225 @@ +# number # + +Number utilities. + + +## abbreviate(val[, nDecimalDigits, dictionary]):String + +Abbreviate number to thousands (K), millions (M) or billions (B). + +The default value for `nDecimalDigits` is `1`. + +### Example + + abbreviate(123456); // "123.5K" + abbreviate(12345678); // "12.3M" + abbreviate(1234567890); // "1.2B" + +You can set the amount of decimal digits (default is `1`): + + abbreviate(543); // "0.5K" + abbreviate(543, 1); // "0.5K" + abbreviate(543, 2); // "0.54K" + abbreviate(543, 3); // "0.543K" + +You can customize the abbreviation by passing a custom "dictionary": + + var _ptbrDict = { + thousands : ' mil', + millions : ' Mi', + billions : ' Bi' + }; + function customAbbr(val) { + return abbreviate(val, 1, _ptbrDict); + } + + customAbbr(123456); // "123.5 mil" + customAbbr(12345678); // "12.3 Mi" + customAbbr(1234567890); // "1.2 Bi" + + + +## currencyFormat(val[, nDecimalDigits, decimalSeparator, thousandsSeparator]):String + +Format a number as currency. + +### Example: + + currencyFormat(1000); // "1,000.00" + currencyFormat(1000, 1); // "1,000.0" + currencyFormat(1000, 2, ',', '.'); // "1.000,00" + + + +## enforcePrecision(val, nDecimalDigits):Number + +Enforce a specific amount of decimal digits and also fix floating point +rounding issues. + +### Example: + +```js +enforcePrecision(0.615, 2); // 0.62 +enforcePrecision(0.625, 2); // 0.63 +//floating point rounding "error" (rounds to odd number) ++(0.615).toFixed(2); // 0.61 ++(0.625).toFixed(2); // 0.63 +``` + + + +## MAX_INT:Number + +Maximum 32-bit signed integer value. `Math.pow(2, 31) - 1` + +### Example: + +```js +console.log( MAX_INT ); // 2147483647 +``` + + +## MAX_UINT:Number + +Maximum 32-bit unsigned integer value. `Math.pow(2, 32) - 1` + +### Example: + +```js +console.log( MAX_UINT ); // 4294967295 +``` + + +## MIN_INT:Number + +Minimum 32-bit signed integer value. `Math.pow(2, 31) * -1`. + +### Example: + +```js +console.log( MIN_INT ); // -2147483648 +``` + + +## pad(n, minLength[, char]):String + +Add padding zeros if `n.length` < `minLength`. + +### Example: + +```js +pad(1, 5); // "00001" +pad(12, 5); // "00012" +pad(123, 5); // "00123" +pad(1234, 5); // "01234" +pad(12345, 5); // "12345" +pad(123456, 5); // "123456" + +// you can also specify the "char" used for padding +pad(12, 5, '_'); // "___12" +``` + +see: [string/lpad](./string.html#lpad) + + + +## rol(val, shift):Number + +Bitwise circular shift left. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## ror(val, shift):Number + +Bitwise circular shift right. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## sign(val):Number + +Returns `-1` if value is negative, `0` if the value is `0` and `1` if value is positive. Useful for +multiplications. + +```js +sign(-123); // -1 +sign(123); // 1 +sign(0); // 0 +``` + + + +## toInt(val):Number + +"Convert" value into an 32-bit integer. Works like `Math.floor` if `val > 0` and +`Math.ceil` if `val < 0`. + +**IMPORTANT:** val will wrap at [number/MIN_INT](#MIN_INT) and +[number/MAX_INT](#MAX_INT). + +Created because most people don't know bitwise operations and also because this +feature is commonly needed. + +[Perf tests](http://jsperf.com/vs-vs-parseint-bitwise-operators/7) + +### Example: + +```js +toInt(1.25); // 1 +toInt(0.75); // 0 +toInt(-0.55); // 0 +toInt(-5.0001) // -5 +``` + + + +## toUInt(val):Number + +"Convert" value into an 32-bit unsigned integer. + +Works like AS3#uint(). + +**IMPORTANT:** val will wrap at 2^32. + +### Example: + +```js +toUInt(1.25); // 1 +toUInt(0.75); // 0 +toUInt(-0.55); // 0 +toUInt(-5.0001); // 4294967291 +toUInt(Math.pow(2,32) - 0.5); // 4294967295 +toUInt(Math.pow(2,32) + 0.5); // 0 +``` + + +## toUInt31(val):Number + +"Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + +Useful since all bitwise operators besides `>>>` treat numbers as signed +integers. + +**IMPORTANT:** val will wrap at 2^31 and negative numbers will be treated as +`zero`. + +### Example: + +```js +toUInt31(1.25); // 1 +toUInt31(0.75); // 0 +toUInt31(-0.55); // 0 +toUInt31(-5.0001); // 0 +toUInt31(Math.pow(2,31) - 0.5); // 21474836470 +toUInt31(Math.pow(2,31) + 0.5); // 0 +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/object.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/object.md new file mode 100644 index 0000000..b4d5e48 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/object.md @@ -0,0 +1,780 @@ +# object # + +Object utilities. + + + +## bindAll(obj, [...methodNames]):void + +Bind methods of the target object to always execute on its own context +(ovewritting the original function). + +See: [function/bind](./function.html#bind) + +```js +var view = { + name: 'Lorem Ipsum', + logNameOnClick: function() { + console.log(this.name); + } +}; + +// binds all methods by default +bindAll(view); +jQuery('#docs').on('click', view.logNameOnClick); +``` + +You can also specify the list of methods that you want to bind (in case you +just want to bind a few of them). + +```js +// only the listed methods will be bound to `obj` context +bindAll(obj, 'logNameOnClick', 'doAwesomeStuffOnDrag'); +``` + + + +## contains(obj, value):Boolean + +Similar to [Array/contains](array.html#contains). Checks if Object contains +value. + +```js +var obj = { + a: 1, + b: 2, + c: 'bar' +}; +contains(obj, 2); // true +contains(obj, 'foo'); // false +``` + + + +## deepEquals(a, b, [callback]):Boolean + +Recursively tests whether two objects contain the same keys and equal values. + +`callback` specifies the equality comparison function used to compare +non-object values. It defaults to using the strict equals (`===`) operator. + +If the values are both an object, it will recurse into the objects, checking if +their keys/values are equal. It will only check the keys and values contained +by the objects; it will not check the objects' prototypes. If the either of +the values are not objects, they will be checked using the `callback` function. + +Example: + +```js +deepEquals({ a: 1 }, { a: 1 }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 1 } }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 2 } }); // false +deepEquals({ value: { a: 1 } }, { value: { a: 1, b: 2 } }); // false +deepEquals({}, null); // false +deepEquals(null, null); // true +deepEquals( + { a: { b: 1 } }, + { a: { b: '1' } }, + function(a, b) { return a == b; }); // true +``` + +See: [`equals()`](#equals) + + + +## deepFillIn(target, ...objects):Object + +Fill missing properties recursively. + +It's different from `deepMixIn` since it won't override any existing property. +It's also different from `merge` since it won't clone child objects during the +process. + +It returns the target object and mutates it in place. + +See: [`fillIn()`](#fillIn), [`deepMixIn()`](#deepMixIn), [`merge()`](#merge) + +```js +var base = { + foo : { + bar : 123 + }, + lorem : 'ipsum' +}; +var options = deepFillIn({foo : { baz : 45 }, lorem : 'amet'}, base); +// > {foo: {bar:123, baz : 45}, lorem : 'amet'} +``` + + + +## deepMatches(target, pattern):Boolean + +Recursively checks if object contains all properties/value pairs. When both +the target and pattern values are arrays, it checks that the target value +contain matches for all the items in the pattern array (independent of order). + +```js +var john = { + name: 'John', + age: 22, + pets: [ + { type: 'cat', name: 'Grumpy Cat' }, + { type: 'dog', name: 'Hawk' } + ] +}; + +deepMatches(john, { name: 'John' }); // true +deepMatches(john, { age: 21 }); // false +deepMatches(john, { pets: [ { type: 'cat' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hawk' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hairball' } ] }); // false +``` + +See [`matches()`](#matches) + + + +## deepMixIn(target, ...objects):Object + +Mixes objects into the target object, recursively mixing existing child objects +as well. + +It will only recursively mix objects if both (existing and new) values are +plain objects. + +Returns the target object. Like [`merge()`](#merge), but mutates the target +object, and does not clone child objects. + +```js +var target = { + foo: { + name: "foo", + id: 1 + } +}; + +deepMixIn(target, { foo: { id: 2 } }); +console.log(target); // { foo: { name: "foo", id: 2 } } +``` + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## equals(a, b, [callback]):Boolean + +Tests whether two objects contain the same keys and values. + +`callback` specifies the equality comparison function used to compare the +values. It defaults to using the strict equals (`===`) operator. + +It will only check the keys and values contained by the objects; it will not +check the objects' prototypes. If either of the values are not objects, they +will be compared using the `callback` function. + +```js +equals({}, {}); // true +equals({ a: 1 }, { a: 1 }); // true +equals({ a: 1 }, { a: 2 }); // false +equals({ a: 1, b: 2 }, { a: 1 }); // false +equals({ a: 1 }, { a: 1, b: 2 }); // false +equals(null, null); // true +equals(null, {}); // false +equals({ a: 1 }, { a: '1' }, function(a, b) { return a == b; }); // true +``` + + + +## every(obj, callback, [thisObj]):Boolean + +Similar to [Array/every](array.html#every). Tests whether all properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + + + +## fillIn(obj, ...default):Object + +Fill in missing properties in object with values from the *defaults* objects. + + var base = { + foo : 'bar', + num : 123 + }; + + fillIn({foo:'ipsum'}, base); // {foo:'ipsum', num:123} + +PS: it allows merging multiple objects at once, the first ones will take +precedence. + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## filter(obj, callback, [thisObj]) + +Returns a new object containing all properties where `callback` returns true, +similar to Array/filter. It does not use properties from the object's +prototype. + +Callback receives the same arguments as `forOwn()`. + +See: [`forOwn()`](#forOwn), [`forIn()`](#forIn), [`pick()`](#pick) + +```js +var obj = { + foo: 'value', + bar: 'bar value' +}; + +// returns { bar: 'bar value' } +filter(obj, function(v) { return value.length > 5; }); + +// returns { foo: 'value' } +filter(obj, function(v, k) { return k === 'foo'; }); +``` + + + +## find(obj, callback, [thisObj]) + +Loops through all the properties in the Object and returns the first one that +passes a truth test (callback), similar to [Array/find](array.html#find). +Unlike Array/find, order of iteration is not guaranteed. + +```js +var obj = { + a: 'foo', + b: 12 +}; + +find(obj, isString); // 'foo' +find(obj, isNumber); // 12 +``` + + + +## forIn(obj, callback[, thisObj]) + +Iterate over all properties of an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +It **will** iterate over inherited (enumerable) properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forIn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 7 +console.log(keys); // ['foo', 'bar', 'lorem'] +``` + + + +## forOwn(obj, callback[, thisObj]) + +Iterate over all own properties from an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +Notice that it **won't** iterate over properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forIn()`](#forIn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +// will be ignored +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forOwn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 3 +console.log(keys); // ['foo', 'bar'] +``` + + + +## functions(obj):Array + +Returns a sorted list of all enumerable properties that have function values +(including inherited properties). + +```js +var obj = { + foo : function(){}, + bar : 'baz' +}; +functions(obj); // ['foo'] +``` + + + +## get(obj, propName):* + +Returns nested property value. Will return `undefined` if property doesn't +exist. + +See: [`set()`](#set), [`namespace()`](#namespace), [`has()`](#has) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +get(lorem, 'ipsum.dolor.sit'); // "amet" +get(lorem, 'foo.bar'); // undefined +``` + + + +## has(obj, propName):Boolean + +Checks if object contains a child property. Useful for cases where you need to +check if an object contain a *nested* property. It will get properties +inherited by the prototype. + +see: [`hasOwn()`](#hasOwn), [`get()`](#get) + +```js +var a = { + b : { + c : 123 + } + }; + +has(a, 'b.c'); // true +has(a, 'foo.c'); // false +``` + +### Common use case + +```js +if( has(a, 'foo.c') ){ // false + // ... +} + +if( a.foo.c ){ // ReferenceError: `foo` is not defined + // ... +} +``` + + + +## hasOwn(obj, propName):Boolean + +Safer `Object.hasOwnProperty`. Returns a boolean indicating whether the object +has the specified property. + +see: [`has()`](#has) + +```js +var obj = { + foo: 1, + hasOwnProperty : 'bar' +}; + +obj.hasOwnProperty('foo'); // ERROR! hasOwnProperty is not a function + +hasOwn(obj, 'foo'); // true +hasOwn(obj, 'hasOwnProperty'); // true +hasOwn(obj, 'toString'); // false +``` + + + +## keys(obj):Array + +Returns an array of all own enumerable properties found upon a given object. +It will use the native `Object.keys` if present. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`values()`](#values) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +keys(obj); // ['foo', 'bar', 'lorem'] +``` + + + +## map(obj, callback, [thisObj]):Object + +Returns a new object where the property values are the result of calling the +callback for each property in the original object, similar to Array/map. + +The callback function receives the same arguments as in `forOwn()`. + +See: [`forOwn()`](#forOwn) + +```js +var obj = { foo: 1, bar: 2 }, + data = { foo: 0, bar: 1 }; + +map(obj, function(v) { return v + 1; }); // { foo: 2, bar: 3 } +map(obj, function(v, k) { return k; }); // { foo: "foo", bar: "bar" } +map(obj, function(v, k) { return this[k]; }, data); // { foo: 0, bar: 1 } +``` + + + +## matches(obj, props):Boolean + +Checks if object contains all properties/values pairs. Useful for validation +and filtering. + +```js +var john = {age:25, hair:'long', beard:true}; +var mark = {age:27, hair:'short', beard:false}; +var hippie = {hair:'long', beard:true}; +matches(john, hippie); // true +matches(mark, hippie); // false +``` + +See [`deepMatches()`](#deepMatches) + + + +## merge(...objects):Object + +Deep merges objects. Note that objects and properties will be cloned during the +process to avoid undesired side effects. It return a new object and won't +affect source objects. + +```js +var obj1 = {a: {b: 1, c: 1, d: {e: 1, f: 1}}}; +var obj2 = {a: {b: 2, d : {f : 'yeah'} }}; + +merge(obj1, obj2); // {a: {b : 2, c : 1, d : {e : 1, f : 'yeah'}}} +``` + +See: [`deepMixIn()`](#deppMixIn), [`deepFillIn()`](#deepFillIn) + + + +## max(obj[, iterator]):* + +Returns maximum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/max](array.html#max). + +See: [`min()`](#min) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(obj[, iterator]):* + +Returns minimum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/min](array.html#min). + +See: [`max()`](#max) + +```js +min({a: 100, b: 2, c: 1, d: 3, e: 200}); // 1 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## mixIn(target, ...objects):Object + +Combine properties from all the objects into first one. + +This method affects target object in place, if you want to create a new Object +pass an empty object as first parameter. + +### Arguments + + 1. `target` (Object) : Target Object. + 2. `...objects` (...Object) : Objects to be combined (0...n objects). + +### Example + +```js +var a = {foo: "bar"}; +var b = {lorem: 123}; + +mixIn({}, a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar"} + +mixIn(a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar", lorem: 123} +``` + +See: [`fillIn()`](#fillIn), [`merge()`](#merge) + + + + +## namespace(obj, propName):Object + +Creates an empty object inside namespace if not existent. Will return created +object or existing object. + +See: [`get()`](#get), [`set()`](#set) + +```js +var obj = {}; +namespace(obj, 'foo.bar'); // {} +console.log(obj); // {foo:{bar:{}}} +``` + + + +## pick(obj, ...keys):Object + +Return a copy of the object that contains only the whitelisted keys. + +See: [`filter()`](#filter) + +```js +var user = { + firstName : 'John', + lastName : 'Doe', + dob : '1985/07/23', + gender : 'male' +}; + +// can pass an array of keys as second argument +var keys = ['firstName', 'dob'] +pick(user, keys); // {firstName:"John", dob: "1985/07/23"} + +// or multiple arguments +pick(user, 'firstName', 'lastName'); // {firstName:"John", lastName: "Doe"} +``` + + + +## pluck(obj, propName):Object + +Extract an object containing property values with keys as they appear in the +passed object. + +```js +var users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // {first: 'John', second: 'Mary'} ); +pluck(users, 'age'); // {first: 21, second: 25} ); +``` + + + +## reduce(obj, callback, initial, [thisObj]):* + +Similar to [Array/reduce](array.html#reduce). + +Apply a function against an accumulator and each property of the object (order +is undefined) as to reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + compare1.push(prev); + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + + + +## reject(obj, callback, thisObj):Object + +Returns a new object containing all properties where `callback` returns true, +similar to [Array/reject](array.html#reject). It does not use properties from +the object's prototype. Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // {b: 2, d: 4} +``` + + + +## values(obj):Array + +Returns an array of all own enumerable properties values found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +values(obj); // [1, 2, 3] +``` + + + +## set(obj, propName, value) + +Sets a nested property value. + +See: [`get()`](#get), [`namespace()`](#namespace) + +```js +var obj = {}; +set(obj, 'foo.bar', 123); +console.log(obj.foo.bar); // 123 +console.log(obj); // {foo:{bar:123}} +``` + + + +## size(obj):Number + +Returns the count of own enumerable properties found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +``` + + + +## some(obj, callback, [thisObj]):Boolean + +Similar to [Array/some](array.html#some). Tests whether any properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +``` + + + +## unset(obj, propName):Boolean + +Delete object property if existent and returns a boolean indicating succes. It +will also return `true` if property doesn't exist. + +Some properties can't be deleted, to understand why [check this +article](http://perfectionkills.com/understanding-delete/). + +See: [`set()`](#set) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +unset(lorem, 'ipsum.dolor.sit'); // true +console.log(lorem.ipsum.dolor); // {} +unset(lorem, 'foo.bar'); // true +``` diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/queryString.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/queryString.md new file mode 100644 index 0000000..1be3c10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/queryString.md @@ -0,0 +1,115 @@ +# queryString # + +Utilities for query string manipulation. + + + +## contains(url, paramName):Boolen + +Checks if query string contains parameter. + +### Arguments: + + 1. `url` (String) : URL or query string. + 2. `paramName` (String) : Parameter name. + +### Example: + +```js +var url = 'example.com/?lorem=ipsum'; +contains(url, 'lorem'); // true +contains(url, 'foo'); //false +``` + + + +## decode(queryStr[, shouldTypecast]):Object + +Parses query string and creates an object of keys => vals. + +Will typecast value with [`string/typecast`](string.html#typecast) by default +and decode string parameters using `decodeURIComponent()`. + +```js +var query = '?foo=bar&lorem=123'; +decode(query); // {foo: "bar", lorem: 123} +decode(query, false); // {foo: "bar", lorem: "123"} +``` + + +## encode(obj):String + +Encode object into a query string. + +Will encode parameters with `encodeURIComponent()`. + +```js +encode({foo: "bar", lorem: 123}); // "?foo=bar&lorem=123" +``` + + +## getParam(url, param[, shouldTypecast]):* + +Get query parameter value. + +Will typecast value with [`string/typecast`](string.html#typecast) by default. + +See: [`setParam()`](#setParam) + +### Arguments: + + 1. `url` (String) : Url. + 2. `param` (String) : Parameter name. + 3. `[shouldTypecast]` (Boolean) : If it should typecast value. + +### Example: + +```js +var url = 'example.com/?foo=bar&lorem=123&ipsum=false'; +getParam(url, 'dolor'); // "amet" +getParam(url, 'lorem'); // 123 +getParam(url, 'lorem', false); // "123" +``` + + +## parse(url[, shouldTypecast]):Object + +Parses URL, extracts query string and decodes it. + +It will typecast all properties of the query object unless second argument is +`false`. + +Alias to: `decode(getQuery(url))`. + +```js +var url = 'example.com/?lorem=ipsum&a=123'; +parse(url); // {lorem: "ipsum", a: 123} +parse(url, false); // {lorem: "ipsum", a: "123"} +``` + + +## getQuery(url):String + +Gets full query as string with all special chars decoded. + +```js +getQuery('example.com/?lorem=ipsum'); // "?lorem=ipsum" +``` + + +## setParam(url, paramName, value):String + +Add new query string parameter to URL or update existing value. + +See: [`getParam()`](#getParam) + +```js +setParam('?foo=bar&lorem=0', 'lorem', 'ipsum'); // '?foo=bar&lorem=ipsum' +setParam('?lorem=1', 'foo', 123); // '?lorem=1&foo=123' +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/random.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/random.md new file mode 100644 index 0000000..b058b4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/random.md @@ -0,0 +1,218 @@ +# random # + +Pseudo-random generators. + +mout uses `Math.random` by default on all the pseudo-random generators, if +you need a seeded random or a better algorithm see the [`random()`](#random) +documentation for instructions. + + + +## choice(...items):* + +Returns a random element from the supplied arguments or from an array if single +argument is an array. + +### Example: + +```js +choice(1, 2, 3, 4, 5); // 3 + +var arr = ['lorem', 'ipsum', 'dolor']; +choice(arr); // 'dolor' +``` + + + +## guid():String + +Generates a pseudo-random [Globally Unique Identifier](http://en.wikipedia.org/wiki/Globally_unique_identifier) (v4). + +Since the total number of GUIDs is 2122 the chance of generating the +same value twice is negligible. + +**Important:** this method uses `Math.random` by default so the UUID isn't +*safe* (sequence of outputs can be predicted in some cases), check the +[`random()`](#random) documentation for more info on how to replace the default +PRNG if you need extra safety or need *seeded* results. + +See: [`randHex()`](#randHex), [`random()`](#random) + +### Example: + +```js +guid(); // 830e9f50-ac7f-4369-a14f-ed0e62b2fa0b +guid(); // 5de3d09b-e79c-4727-932b-48c49228d508 +``` + + + +## rand([min], [max]):Number + +Gets a random number inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +rand(); // 448740433.55274725 +rand(); // -31797596.097682 +rand(0, 10); // 7.369723 +rand(0, 10); // 5.987042 +``` + +See: [`random()`](#random) + + + +## randBit():Number + +Returns a random "bit" (0 or 1). Useful for addition/subtraction. + +It's slightly faster than `choice(0, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randBit(); // 1 +randBit(); // 0 + +//same effect as +choice(0, 1); +``` + + + +## randHex([size]):String + +Returns a random hexadecimal string. + +The default `size` is `6`. + +### Example: + +```js +randHex(); // "dd8575" +randHex(); // "e6baeb" +randHex(2); // "a2" +randHex(30); // "effd7e2ad9a4a3067e30525fab983a" +``` + + + +## randInt([min], [max]):Number + +Gets a random integer inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +randInt(); // 448740433 +randInt(); // -31797596 +randInt(0, 10); // 7 +randInt(0, 10); // 5 +``` + + + +## randSign():Number + +Returns a random "sign" (-1 or 1). Useful for multiplications. + +It's slightly faster than `choice(-1, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randSign(); // -1 +randSign(); // 1 + +//same effect as +choice(-1, 1); +``` + + + +## random():Number + +Returns a random number between `0` and `1`. Same as `Math.random()`. + +```js +random(); // 0.35435103671625257 +random(); // 0.8768321881070733 +``` + +**Important:** No methods inside mout should call `Math.random()` +directly, they all use `random/random` as a proxy, that way we can +inject/replace the pseudo-random number generator if needed (ie. in case we +need a seeded random or a better algorithm than the native one). + +### Replacing the PRNG + +In some cases we might need better/different algorithms than the one provided +by `Math.random` (ie. safer, seeded). + +Because of licensing issues, file size limitations and different needs we +decided to **not** implement a custom PRNG and instead provide a easy way to +override the default behavior. - [issue #99](https://github.com/millermedeiros/amd-utils/issues/99) + +If you are using mout with a loader that supports the [AMD map +config](https://github.com/amdjs/amdjs-api/wiki/Common-Config), such as +[RequireJS](http://requirejs.org/), you can use it to replace the PRNG +(recommended approach): + +```js +requirejs.config({ + map : { + // all modules will load "my_custom_prng" instead of + // "mout/random/random" + '*' : { + 'mout/random/random' : 'my_custom_prng' + } + } +}); +``` + +You also have the option to override `random.get` in case you are using +mout on node.js or with a loader which doesn't support the map config: + +```js +// replace the PRNG +var n = 0; +random.get = function(){ + return ++n % 2? 0 : 1; // not so random :P +}; +random(); // 0 +random(); // 1 +random(); // 0 +random(); // 1 +``` + +See this [detailed explanation about PRNG in +JavaScript](http://baagoe.org/en/w/index.php/Better_random_numbers_for_javascript) +to understand the issues with the native `Math.random` and also for a list of +algorithms that could be used instead. + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/string.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/string.md new file mode 100644 index 0000000..2b28231 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/string.md @@ -0,0 +1,594 @@ +# string # + +String utilities. + + +## camelCase(str):String + +Convert string to "camelCase" text. + +See: [`pascalCase()`](#pascalCase), [`unCamelCase()`](#unCamelCase) + +### Example + +```js +camelCase('lorem-ipsum-dolor'); // "loremIpsumDolor" +camelCase('lorem ipsum dolor'); // "loremIpsumDolor" +``` + + + +## contains(str, substring, [fromIndex]):Boolean + +Checks if string contains the given substring. + +See: [`startsWith()`](#startsWith), [`endsWith()`](#endsWith) + +### Example + +```js +contains('lorem', 'or'); // true +contains('lorem', 'bar'); // false +``` + + + +## crop(str, maxChars, [append]):String + +Truncate string at full words. Alias to `truncate(str, maxChars, append, true);`. + +See: [`truncate()`](#truncate) + +### Example + +```js +crop('lorem ipsum dolor', 10); // "lorem..." +crop('lorem ipsum dolor', 10, '+'); // "lorem+" +``` + + + +## endsWith(str, suffix):Boolean + +Checks if string ends with specified suffix. + +See: [`startsWith()`](#startsWith), [`contains()`](#contains) + +### Example + +```js +endsWith('lorem ipsum', 'lorem'); // false +endsWith('lorem ipsum', 'ipsum'); // true +``` + + + +## escapeHtml(str):String + +Escapes HTML special chars (`>`, `<`, `&`, `"`, `'`). + +See: [`unescapeHtml()`](#unescapeHtml) + +### Example + +```js +escapeHtml('lorem & "ipsum"'); // "lorem &amp; &quot;ipsum&quot;" +``` + + + +## escapeRegExp(str):String + +Escape special chars to be used as literals in RegExp constructors. + +### Example + +```js +str = escapeRegExp('[lorem.ipsum]'); // "\\[lorem\\.ipsum\\]" +reg = new RegExp(str); // /\[lorem\.ipsum\]/ +``` + + + +## escapeUnicode(str[, shouldEscapePrintable]):String + +Unicode escape chars. + +It will only escape non-printable ASCII chars unless `shouldEscapePrintable` is +set to `true`. + +See: [`unescapeUnicode()`](#unescapeUnicode) + +```js +escapeUnicode('føo bår'); +// > "f\u00f8o b\u00e5r" +escapeUnicode('føo bår', true); +// > "\u0066\u00f8\u006f\u0020\u0062\u00e5\u0072" +``` + + + +## hyphenate(str):String + +Replaces spaces with hyphens, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`underscore()`](#underscore), +[`unhyphenate`](#unhyphenate) + +```js +hyphenate(' %# lorem ipsum ? $ dolor'); // "lorem-ipsum-dolor" +hyphenate('spéçïãl çhârs'); // "special-chars" +hyphenate('loremIpsum'); // "lorem-ipsum" +``` + + + +## interpolate(str, replacements[, syntax]):String + +String interpolation. Format/replace tokens with object properties. + +```js +var tmpl = 'Hello {{name}}!'; +interpolate(tmpl, {name: 'World'}); // "Hello World!" +interpolate(tmpl, {name: 'Lorem Ipsum'}); // "Hello Lorem Ipsum!" +``` + +It uses a mustache-like syntax by default but you can set your own format if +needed. You can also use Arrays for the replacements (since Arrays are +objects as well): + +```js +// matches everything inside "${}" +var syntax = /\$\{([^}]+)\}/g; +var tmpl = "Hello ${0}!"; +interpolate(tmpl, ['Foo Bar'], syntax); // "Hello Foo Bar!" +``` + + + +## lowerCase(str):String + +"Safer" `String.toLowerCase()`. (Used internally) + +### Example + +```js +(null).toLowerCase(); // Error! +(undefined).toLowerCase(); // Error! +lowerCase(null); // "" +lowerCase(undefined); // "" +``` + + + +## lpad(str, minLength[, char]):String + +Pad string from left with `char` if its' length is smaller than `minLen`. + +See: [`rpad()`](#rpad) + +### Example + +```js +lpad('a', 5); // " a" +lpad('a', 5, '-'); // "----a" +lpad('abc', 3, '-'); // "abc" +lpad('abc', 4, '-'); // "-abc" +``` + + + +## ltrim(str, [chars]):String + +Remove chars or white-spaces from beginning of string. + +`chars` is an array of chars to remove from the beginning of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`rtrim()`](#rtrim), [`trim()`](#trim) + +### Example + +```js +ltrim(' lorem ipsum '); // "lorem ipsum " +ltrim('--lorem ipsum--', ['-']); // "lorem ipsum--" +``` + + + +## makePath(...args):String + +Group arguments as path segments, if any of the args is `null` or `undefined` +it will be ignored from resulting path. It will also remove duplicate "/". + +See: [`array/join()`](array.html#join) + +### Example + +```js +makePath('lorem', 'ipsum', null, 'dolor'); // "lorem/ipsum/dolor" +makePath('foo///bar/'); // "foo/bar/" +``` + + + +## normalizeLineBreaks(str, [lineBreak]):String + +Normalize line breaks to a single format. Defaults to Unix `\n`. + +It handles DOS (`\r\n`), Mac (`\r`) and Unix (`\n`) formats. + +### Example + +```js +// "foo\nbar\nlorem\nipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum'); + +// "foo\rbar\rlorem\ripsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', '\r'); + +// "foo bar lorem ipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', ' '); +``` + + + +## pascalCase(str):String + +Convert string to "PascalCase" text. + +See: [`camelCase()`](#camelCase) + +### Example + +```js +pascalCase('lorem-ipsum-dolor'); // "LoremIpsumDolor" +pascalCase('lorem ipsum dolor'); // "LoremIpsumDolor" +``` + + + +## properCase(str):String + +UPPERCASE first char of each word, lowercase other chars. + +### Example + +```js +properCase('loRem iPSum'); // "Lorem Ipsum" +``` + + + +## removeNonASCII(str):String + +Remove [non-printable ASCII +chars](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + +### Example + +```js +removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'); // "lorem-ipsum" +``` + + + +## removeNonWord(str):String + +Remove non-word chars. + +### Example + +```js +var str = 'lorem ~!@#$%^&*()_+`-={}[]|\\:";\'/?><., ipsum'; +removeNonWord(str); // "lorem - ipsum" +``` + + + +## repeat(str, n):String + +Repeat string n-times. + +### Example + +```js +repeat('a', 3); // "aaa" +repeat('bc', 2); // "bcbc" +repeat('a', 0); // "" +``` + + + +## replace(str, search, replacements):String + +Replace string(s) with the replacement(s) in the source. + +`search` and `replacements` can be an array, or a single item. For every item +in `search`, it will call `str.replace` with the search item and the matching +replacement in `replacements`. If `replacements` only contains one replacement, +it will be used for all the searches, otherwise it will use the replacement at +the same index as the search. + +### Example + +```js +replace('foo bar', 'foo', 'test'); // "test bar" +replace('test 1 2', ['1', '2'], 'n'); // "test n n" +replace('test 1 2', ['1', '2'], ['one', 'two']); // "test one two" +replace('123abc', [/\d/g, /[a-z]/g], ['0', '.']); // "000..." +``` + + + +## replaceAccents(str):String + +Replaces all accented chars with regular ones. + +**Important:** Only covers **Basic Latin** and **Latin-1** unicode chars. + +### Example + +```js +replaceAccents('spéçïãl çhârs'); // "special chars" +``` + + + +## rpad(str, minLength[, char]):String + +Pad string from right with `char` if its' length is smaller than `minLen`. + +See: [`lpad()`](#lpad) + +### Example + +```js +rpad('a', 5); // "a " +rpad('a', 5, '-'); // "a----" +rpad('abc', 3, '-'); // "abc" +rpad('abc', 4, '-'); // "abc-" +``` + + + +## rtrim(str, [chars]):String + +Remove chars or white-spaces from end of string. + +`chars` is an array of chars to remove from the end of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`trim()`](#trim), [`ltrim()`](#ltrim) + +### Example + +```js +rtrim(' lorem ipsum '); // " lorem ipsum" +rtrim('--lorem ipsum--', ['-']); // "--lorem ipsum" +``` + + + +## sentenceCase(str):String + +UPPERCASE first char of each sentence and lowercase other chars. + +### Example + +```js +var str = 'Lorem IpSum DoLOr. maeCeNnas Ullamcor.'; +sentenceCase(str); // "Lorem ipsum dolor. Maecennas ullamcor." +``` + + + +## stripHtmlTags(str):String + +Remove HTML/XML tags from string. + +### Example + +```js +var str = '

    lorem ipsum

    '; +stripHtmlTags(str); // "lorem ipsum" +``` + + + +## startsWith(str, prefix):Boolean + +Checks if string starts with specified prefix. + +See: [`endsWith()`](#endsWith), [`contains()`](#contains) + +### Example + +```js +startsWith('lorem ipsum', 'lorem'); // true +startsWith('lorem ipsum', 'ipsum'); // false +``` + + + +## slugify(str[, delimeter]):String + +Convert to lower case, remove accents, remove non-word chars and replace spaces +with the delimeter. The default delimeter is a hyphen. + +Note that this does not split camelCase text. + +See: [`hyphenate()`](#hyphenate) and [`underscore()`](#underscore) + +### Example + +```js +var str = 'loremIpsum dolor spéçïãl chârs'; +slugify(str); // "loremipsum-dolor-special-chars" +slugify(str, '_'); // "loremipsum_dolor_special_chars" +``` + + + +## trim(str, [chars]):String + +Remove chars or white-spaces from beginning and end of string. + +`chars` is an array of chars to remove from the beginning and end of the +string. If `chars` is not specified, Unicode whitespace chars will be used +instead. + +See: [`rtrim()`](#rtrim), [`ltrim()`](#ltrim) + +### Example + +```js +trim(' lorem ipsum '); // "lorem ipsum" +trim('-+-lorem ipsum-+-', ['-', '+']); // "lorem ipsum" +``` + + + +## truncate(str, maxChars, [append], [onlyFullWords]):String + +Limit number of chars. Returned string `length` will be `<= maxChars`. + +See: [`crop()`](#crop) + +### Arguments + + 1. `str` (String) : String + 2. `maxChars` (Number) : Maximum number of characters including `append.length`. + 3. `[append]` (String) : Value that should be added to the end of string. + Defaults to "...". + 4. `[onlyFullWords]` (Boolean) : If it shouldn't break words. Default is + `false`. (favor [`crop()`](#crop) since code will be clearer). + +### Example + +```js +truncate('lorem ipsum dolor', 11); // "lorem ip..." +truncate('lorem ipsum dolor', 11, '+'); // "lorem ipsu+" +truncate('lorem ipsum dolor', 11, null, true); // "lorem..." +``` + + + +## typecast(str):* + +Parses string and convert it into a native value. + +### Example + +```js +typecast('lorem ipsum'); // "lorem ipsum" +typecast('123'); // 123 +typecast('123.45'); // 123.45 +typecast('false'); // false +typecast('true'); // true +typecast('null'); // null +typecast('undefined'); // undefined +``` + + + +## unCamelCase(str, [delimiter]):String + +Add the delimiter between camelCase text and convert first char of each word to +lower case. + +The delimiter defaults to a space character. + +See: [`camelCase()`][#camelCase] + +### Example + +```js +unCamelCase('loremIpsumDolor'); // "lorem ipsum dolor" +unCamelCase('loremIpsumDolor', '-'); // "lorem-ipsum-color" +``` + + +## underscore(str):String + +Replaces spaces with underscores, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`hyphenate()`](#hyphenate) + +```js +underscore(' %# lorem ipsum ? $ dolor'); // "lorem_ipsum_dolor" +underscore('spéçïãl çhârs'); // "special_chars" +underscore('loremIpsum'); // "lorem_ipsum" +``` + + + +## unescapeHtml(str):String + +Unescapes HTML special chars (`>`, `<`, `&`, `"`, `'`). + +See: [`escapeHtml()`](#escapeHtml) + +### Example + +```js +unescapeHtml('lorem &amp; &quot;ipsum&quot;'); // 'lorem & "ipsum"' +``` + + + +## unescapeUnicode(str):String + +Unescapes unicode char sequences. + +See: [`escapeUnicode()`](#escapeUnicode) + +```js +unescapeUnicode('\\u0066\\u00f8\\u006f\\u0020\\u0062\\u00e5\\u0072'); +// > 'føo bår' +``` + + + +## unhyphenate(str):String + +Replaces hyphens with spaces. (only hyphens between word chars) + +See : [`hyphenate()`](#hyphenate) + +### Example + +```js +unhyphenate('lorem-ipsum-dolor'); // "lorem ipsum dolor" +``` + + +## upperCase(str):String + +"Safer" `String.toUpperCase()`. (Used internally) + +### Example + +```js +(null).toUpperCase(); // Error! +(undefined).toUpperCase(); // Error! +upperCase(null); // "" +upperCase(undefined); // "" +``` + + + +## WHITE_SPACES:Array + +Constant array of all [Unicode white-space +characters](http://en.wikipedia.org/wiki/Whitespace_character). + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/time.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/time.md new file mode 100644 index 0000000..628c2a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/doc/time.md @@ -0,0 +1,64 @@ +# time # + +Utilities for time manipulation. + + +## convert(value, sourceUnit, [destinationUnit]):Number + +Converts time between units. + +Available units: `millisecond`, `second`, `minute`, `hour`, `day`, `week`. +Abbreviations: `ms`, `s`, `m`, `h`, `d`, `w`. + +We do **not** support year and month as a time unit since their values are not +fixed. + +The default `destinationUnit` is `ms`. + +```js +convert(1, 'minute'); // 60000 +convert(2.5, 's', 'ms'); // 2500 +convert(2, 'm', 's'); // 120 +convert(500, 'ms', 's'); // 0.5 +``` + + + +## now():Number + +Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. +Uses `Date.now()` if available. + +### Example + +```js +now(); // 1335449614650 +``` + + + +## parseMs(ms):Object + +Parse timestamp (milliseconds) into an object `{milliseconds:number, +seconds:number, minutes:number, hours:number, days:number}`. + +### Example + +```js +// {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} +parseMs(2348765454); +``` + + + +## toTimeString(ms):String + +Convert timestamp (milliseconds) into a time string in the format "[H:]MM:SS". + +### Example + +```js +toTimeString(12513); // "00:12" +toTimeString(951233); // "15:51" +toTimeString(8765235); // "2:26:05" +``` diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function.js new file mode 100644 index 0000000..43a16ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function.js @@ -0,0 +1,18 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/bind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/bind.js new file mode 100644 index 0000000..71bc125 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/bind.js @@ -0,0 +1,23 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + module.exports = bind; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/compose.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/compose.js new file mode 100644 index 0000000..8cd5c5f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/compose.js @@ -0,0 +1,23 @@ + + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + module.exports = compose; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/debounce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/debounce.js new file mode 100644 index 0000000..a0ed07f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/debounce.js @@ -0,0 +1,29 @@ + + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + return debounced; + } + + module.exports = debounce; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/func.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/func.js new file mode 100644 index 0000000..b81bf0a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/func.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + module.exports = func; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/makeIterator_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/makeIterator_.js new file mode 100644 index 0000000..767610a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/makeIterator_.js @@ -0,0 +1,34 @@ +var prop = require('./prop'); +var deepMatches = require('../object/deepMatches'); + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + switch(typeof src) { + case 'object': + // typeof null == "object" + return (src != null)? function(val, key, target){ + return deepMatches(val, src); + } : src; + case 'string': + case 'number': + return prop(src); + case 'function': + if (typeof thisObj === 'undefined') { + return src; + } else { + return function(val, i, arr){ + return src.call(thisObj, val, i, arr); + }; + } + default: + return src; + } + } + + module.exports = makeIterator; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/partial.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/partial.js new file mode 100644 index 0000000..d63ff1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/partial.js @@ -0,0 +1,19 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + module.exports = partial; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/prop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/prop.js new file mode 100644 index 0000000..734acb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/prop.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + module.exports = prop; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/series.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/series.js new file mode 100644 index 0000000..25159c2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/series.js @@ -0,0 +1,22 @@ + + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + module.exports = series; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/throttle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/throttle.js new file mode 100644 index 0000000..619dc54 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/throttle.js @@ -0,0 +1,32 @@ +var now = require('../time/now'); + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + cur, diff, prev = 0; + function delayed(){ + prev = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + cur = now(); + diff = delay - (cur - prev); + if (diff <= 0) { + clearTimeout(timeout); + prev = cur; + result = fn.apply(context, args); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + return throttled; + } + + module.exports = throttle; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/timeout.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/timeout.js new file mode 100644 index 0000000..e0d21a6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/function/timeout.js @@ -0,0 +1,21 @@ + + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + module.exports = timeout; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/index.js new file mode 100644 index 0000000..32a1c63 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/index.js @@ -0,0 +1,24 @@ +/**@license + * mout v0.6.0 | http://moutjs.com | MIT license + */ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'VERSION' : '0.6.0', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang.js new file mode 100644 index 0000000..b981621 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang.js @@ -0,0 +1,36 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toString' : require('./lang/toString') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/clone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/clone.js new file mode 100644 index 0000000..33c4e94 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/clone.js @@ -0,0 +1,49 @@ +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); +var mixIn = require('../object/mixIn'); + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + module.exports = clone; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/createObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/createObject.js new file mode 100644 index 0000000..bbc14c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/createObject.js @@ -0,0 +1,18 @@ +var mixIn = require('../object/mixIn'); + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + module.exports = createObject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/ctorApply.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/ctorApply.js new file mode 100644 index 0000000..d68dc50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/ctorApply.js @@ -0,0 +1,17 @@ + + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + module.exports = ctorApply; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/deepClone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/deepClone.js new file mode 100644 index 0000000..25fd95f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/deepClone.js @@ -0,0 +1,48 @@ +var clone = require('./clone'); +var forOwn = require('../object/forOwn'); +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + module.exports = deepClone; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/defaults.js new file mode 100644 index 0000000..1111b2e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/defaults.js @@ -0,0 +1,17 @@ +var toArray = require('./toArray'); +var find = require('../array/find'); + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + module.exports = defaults; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js new file mode 100644 index 0000000..cd8a379 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js @@ -0,0 +1,16 @@ +var createObject = require('./createObject'); + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + } + + module.exports = inheritPrototype; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/is.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/is.js new file mode 100644 index 0000000..4a83573 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/is.js @@ -0,0 +1,23 @@ + + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + module.exports = is; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArguments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArguments.js new file mode 100644 index 0000000..f7b08ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArguments.js @@ -0,0 +1,15 @@ +var isKind = require('./isKind'); + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + module.exports = isArgs; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArray.js new file mode 100644 index 0000000..262ee40 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isArray.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + module.exports = isArray; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isBoolean.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isBoolean.js new file mode 100644 index 0000000..86557cb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isBoolean.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + module.exports = isBoolean; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isDate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isDate.js new file mode 100644 index 0000000..4a5130f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isDate.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + module.exports = isDate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isEmpty.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isEmpty.js new file mode 100644 index 0000000..0e9f77d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isEmpty.js @@ -0,0 +1,24 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('./isArray'); + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + module.exports = isEmpty; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFinite.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFinite.js new file mode 100644 index 0000000..6d4006f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFinite.js @@ -0,0 +1,21 @@ +var isNumber = require('./isNumber'); + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + module.exports = isFinite; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFunction.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFunction.js new file mode 100644 index 0000000..216879f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isFunction.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + module.exports = isFunction; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isInteger.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isInteger.js new file mode 100644 index 0000000..29f95d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isInteger.js @@ -0,0 +1,12 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + module.exports = isInteger; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isKind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isKind.js new file mode 100644 index 0000000..02301e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isKind.js @@ -0,0 +1,9 @@ +var kindOf = require('./kindOf'); + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + module.exports = isKind; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNaN.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNaN.js new file mode 100644 index 0000000..f6efeb1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNaN.js @@ -0,0 +1,15 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || val != +val; + } + + module.exports = isNaN; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNull.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNull.js new file mode 100644 index 0000000..6252f9e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNull.js @@ -0,0 +1,9 @@ + + /** + */ + function isNull(val){ + return val === null; + } + module.exports = isNull; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNumber.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNumber.js new file mode 100644 index 0000000..126c1cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isNumber.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + module.exports = isNumber; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isObject.js new file mode 100644 index 0000000..7350c89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isObject.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + module.exports = isObject; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js new file mode 100644 index 0000000..0d2d7b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js @@ -0,0 +1,14 @@ + + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value + && typeof value === 'object' + && value.constructor === Object); + } + + module.exports = isPlainObject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isRegExp.js new file mode 100644 index 0000000..fc5459a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isRegExp.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + module.exports = isRegExp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isString.js new file mode 100644 index 0000000..f890658 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isString.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + module.exports = isString; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isUndefined.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isUndefined.js new file mode 100644 index 0000000..fb2261d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isUndefined.js @@ -0,0 +1,10 @@ + + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + module.exports = isUndef; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isnt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isnt.js new file mode 100644 index 0000000..9dad58c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/isnt.js @@ -0,0 +1,12 @@ +var is = require('./is'); + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + module.exports = isnt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/kindOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/kindOf.js new file mode 100644 index 0000000..663464d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/kindOf.js @@ -0,0 +1,20 @@ + + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + module.exports = kindOf; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toArray.js new file mode 100644 index 0000000..e39b873 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toArray.js @@ -0,0 +1,31 @@ +var kindOf = require('./kindOf'); + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + module.exports = toArray; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toString.js new file mode 100644 index 0000000..ae5c2b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/lang/toString.js @@ -0,0 +1,13 @@ + + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + module.exports = toString; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math.js new file mode 100644 index 0000000..c6ee889 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math.js @@ -0,0 +1,19 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/ceil.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/ceil.js new file mode 100644 index 0000000..a279e15 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/ceil.js @@ -0,0 +1,11 @@ + + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + module.exports = ceil; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/clamp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/clamp.js new file mode 100644 index 0000000..e929a9a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/clamp.js @@ -0,0 +1,9 @@ + + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + module.exports = clamp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/countSteps.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/countSteps.js new file mode 100644 index 0000000..60ac90c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/countSteps.js @@ -0,0 +1,16 @@ + + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + module.exports = countSteps; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/floor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/floor.js new file mode 100644 index 0000000..9de5053 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/floor.js @@ -0,0 +1,10 @@ + + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + module.exports = floor; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/inRange.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/inRange.js new file mode 100644 index 0000000..763218f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/inRange.js @@ -0,0 +1,11 @@ + + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + module.exports = inRange; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/isNear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/isNear.js new file mode 100644 index 0000000..45486b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/isNear.js @@ -0,0 +1,9 @@ + + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + module.exports = isNear; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/lerp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/lerp.js new file mode 100644 index 0000000..111e271 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/lerp.js @@ -0,0 +1,11 @@ + + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + module.exports = lerp; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/loop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/loop.js new file mode 100644 index 0000000..35207c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/loop.js @@ -0,0 +1,10 @@ + + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + module.exports = loop; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/map.js new file mode 100644 index 0000000..96c4b78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/map.js @@ -0,0 +1,11 @@ +var lerp = require('./lerp'); +var norm = require('./norm'); + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + module.exports = map; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/norm.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/norm.js new file mode 100644 index 0000000..54caf78 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/norm.js @@ -0,0 +1,9 @@ + + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + module.exports = norm; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/round.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/round.js new file mode 100644 index 0000000..d108e6c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/math/round.js @@ -0,0 +1,12 @@ + + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + module.exports = round; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number.js new file mode 100644 index 0000000..0b6186c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number.js @@ -0,0 +1,21 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_INT.js new file mode 100644 index 0000000..1d6f0e4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ + + module.exports = 2147483647; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js new file mode 100644 index 0000000..700da0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ + + module.exports = 4294967295; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MIN_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MIN_INT.js new file mode 100644 index 0000000..b34ab2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ + + module.exports = -2147483648; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/abbreviate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/abbreviate.js new file mode 100644 index 0000000..dd6716b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/abbreviate.js @@ -0,0 +1,35 @@ +var enforcePrecision = require('./enforcePrecision'); + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + module.exports = abbreviateNumber; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/currencyFormat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/currencyFormat.js new file mode 100644 index 0000000..1cf0249 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/currencyFormat.js @@ -0,0 +1,26 @@ + + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + module.exports = currencyFormat; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js new file mode 100644 index 0000000..f73a92d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js @@ -0,0 +1,13 @@ + + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + * @example `enforcePrecision(0.615, 2) -> 0.62`, `(0.615).toFixed(2) -> + * 0.61` + */ + function enforcePrecision(val, nDecimalDigits){ + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + module.exports = enforcePrecision; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/pad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/pad.js new file mode 100644 index 0000000..da75270 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/pad.js @@ -0,0 +1,12 @@ +var lpad = require('../string/lpad'); + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + return lpad(''+ n, minLength, char || '0'); + } + + module.exports = pad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/rol.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/rol.js new file mode 100644 index 0000000..ecd58da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/rol.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + module.exports = rol; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/ror.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/ror.js new file mode 100644 index 0000000..2eda81d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/ror.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + module.exports = ror; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/sign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/sign.js new file mode 100644 index 0000000..b854a4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/sign.js @@ -0,0 +1,15 @@ + + + /** + * Get sign of the value. + */ + function sign(val) { + var num = Number(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + module.exports = sign; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toInt.js new file mode 100644 index 0000000..bcefae0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toInt.js @@ -0,0 +1,15 @@ + + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + return ~~val; + } + + module.exports = toInt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt.js new file mode 100644 index 0000000..5290b62 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt.js @@ -0,0 +1,13 @@ + + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + return val >>> 0; + } + + module.exports = toUInt; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt31.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt31.js new file mode 100644 index 0000000..fcc5a97 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/number/toUInt31.js @@ -0,0 +1,13 @@ +var MAX_INT = require('./MAX_INT'); + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + module.exports = toUInt31; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object.js new file mode 100644 index 0000000..76c0642 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object.js @@ -0,0 +1,42 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/bindAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/bindAll.js new file mode 100644 index 0000000..b2f27d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/bindAll.js @@ -0,0 +1,18 @@ +var functions = require('./functions'); +var bind = require('../function/bind'); +var forEach = require('../array/forEach'); + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + Array.prototype.slice.call(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + module.exports = bindAll; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/contains.js new file mode 100644 index 0000000..8076e2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/contains.js @@ -0,0 +1,13 @@ +var some = require('./some'); + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + module.exports = contains; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepEquals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepEquals.js new file mode 100644 index 0000000..fcde944 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepEquals.js @@ -0,0 +1,27 @@ +var isObject = require('../lang/isObject'); +var equals = require('./equals'); + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + module.exports = deepEquals; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepFillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepFillIn.js new file mode 100644 index 0000000..d27db44 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepFillIn.js @@ -0,0 +1,32 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) + && isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + module.exports = deepFillIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMatches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMatches.js new file mode 100644 index 0000000..3366c52 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMatches.js @@ -0,0 +1,55 @@ +var forOwn = require('./forOwn'); +var isArray = require('../lang/isArray'); + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + module.exports = deepMatches; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMixIn.js new file mode 100644 index 0000000..a97e98d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/deepMixIn.js @@ -0,0 +1,34 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + module.exports = deepMixIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/equals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/equals.js new file mode 100644 index 0000000..f50cbe4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/equals.js @@ -0,0 +1,36 @@ +var hasOwn = require('./hasOwn'); +var every = require('./every'); +var isObject = require('../lang/isObject'); + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + module.exports = equals; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/every.js new file mode 100644 index 0000000..01106e5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/every.js @@ -0,0 +1,23 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + module.exports = every; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/fillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/fillIn.js new file mode 100644 index 0000000..80dcdf0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/fillIn.js @@ -0,0 +1,20 @@ +var forEach = require('../array/forEach'); +var forOwn = require('./forOwn'); + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(Array.prototype.slice.call(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + module.exports = fillIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/filter.js new file mode 100644 index 0000000..3a83a92 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/filter.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + module.exports = filterValues; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/find.js new file mode 100644 index 0000000..d39c070 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/find.js @@ -0,0 +1,21 @@ +var some = require('./some'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + module.exports = find; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forIn.js new file mode 100644 index 0000000..367f08c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forIn.js @@ -0,0 +1,62 @@ + + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + if (_hasDontEnumBug) { + while (key = _dontEnums[i++]) { + // since we aren't using hasOwn check we need to make sure the + // property was overwritten + if (obj[key] !== Object.prototype[key]) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + module.exports = forIn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forOwn.js new file mode 100644 index 0000000..5f2dfbf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/forOwn.js @@ -0,0 +1,19 @@ +var hasOwn = require('./hasOwn'); +var forIn = require('./forIn'); + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + module.exports = forOwn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/functions.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/functions.js new file mode 100644 index 0000000..f571797 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/functions.js @@ -0,0 +1,18 @@ +var forIn = require('./forIn'); + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + module.exports = functions; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/get.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/get.js new file mode 100644 index 0000000..6673561 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/get.js @@ -0,0 +1,20 @@ + + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object') return; + } + + return obj[last]; + } + + module.exports = get; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/has.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/has.js new file mode 100644 index 0000000..ca9f228 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/has.js @@ -0,0 +1,15 @@ +var get = require('./get'); + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + module.exports = has; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/hasOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/hasOwn.js new file mode 100644 index 0000000..7e3c82a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/hasOwn.js @@ -0,0 +1,12 @@ + + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + module.exports = hasOwn; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/keys.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/keys.js new file mode 100644 index 0000000..dd2f4f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/keys.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + module.exports = keys; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/map.js new file mode 100644 index 0000000..dd449a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/map.js @@ -0,0 +1,18 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + module.exports = mapValues; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/matches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/matches.js new file mode 100644 index 0000000..6074faa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/matches.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + module.exports = matches; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/max.js new file mode 100644 index 0000000..3e8e92c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/max.js @@ -0,0 +1,12 @@ +var arrMax = require('../array/max'); +var values = require('./values'); + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + module.exports = max; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/merge.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/merge.js new file mode 100644 index 0000000..6961f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/merge.js @@ -0,0 +1,40 @@ +var hasOwn = require('./hasOwn'); +var deepClone = require('../lang/deepClone'); +var isObject = require('../lang/isObject'); + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + module.exports = merge; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/min.js new file mode 100644 index 0000000..e1e6697 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/min.js @@ -0,0 +1,12 @@ +var arrMin = require('../array/min'); +var values = require('./values'); + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + module.exports = min; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/mixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/mixIn.js new file mode 100644 index 0000000..55ec8fd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/mixIn.js @@ -0,0 +1,28 @@ +var forOwn = require('./forOwn'); + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + module.exports = mixIn; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/namespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/namespace.js new file mode 100644 index 0000000..c6e79f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/namespace.js @@ -0,0 +1,19 @@ +var forEach = require('../array/forEach'); + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + module.exports = namespace; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pick.js new file mode 100644 index 0000000..74e56f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pick.js @@ -0,0 +1,18 @@ + + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : Array.prototype.slice.call(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + module.exports = pick; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pluck.js new file mode 100644 index 0000000..e844df4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/pluck.js @@ -0,0 +1,13 @@ +var map = require('./map'); +var prop = require('../function/prop'); + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + module.exports = pluck; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reduce.js new file mode 100644 index 0000000..6f19a3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reduce.js @@ -0,0 +1,29 @@ +var forOwn = require('./forOwn'); +var size = require('./size'); + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + module.exports = reduce; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reject.js new file mode 100644 index 0000000..7464379 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + module.exports = reject; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/set.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/set.js new file mode 100644 index 0000000..9b3cdc4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/set.js @@ -0,0 +1,17 @@ +var namespace = require('./namespace'); + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + module.exports = set; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/size.js new file mode 100644 index 0000000..9788595 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/size.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + module.exports = size; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/some.js new file mode 100644 index 0000000..384c6f3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/some.js @@ -0,0 +1,21 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + module.exports = some; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/unset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/unset.js new file mode 100644 index 0000000..343bca0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/unset.js @@ -0,0 +1,23 @@ +var has = require('./has'); + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + module.exports = unset; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/values.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/values.js new file mode 100644 index 0000000..265a693 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/object/values.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + module.exports = values; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/package.json new file mode 100644 index 0000000..a3c1682 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/package.json @@ -0,0 +1,119 @@ +{ + "name": "mout", + "description": "Modular Utilities", + "version": "0.6.0", + "homepage": "http://moutjs.com/", + "contributors": [ + { + "name": "Adam Nowotny" + }, + { + "name": "André Cruz", + "email": "amdfcruz@gmail.com" + }, + { + "name": "Conrad Zimmerman", + "url": "http://www.conradz.com" + }, + { + "name": "Friedemann Altrock", + "email": "frodenius@gmail.com" + }, + { + "name": "Jarrod Overson", + "url": "http://jarrodoverson.com" + }, + { + "name": "Miller Medeiros", + "email": "contact@millermedeiros.com", + "url": "http://blog.millermedeiros.com" + }, + { + "name": "Zach Shipley" + } + ], + "keywords": [ + "utilities", + "functional", + "amd-utils", + "stdlib" + ], + "repository": { + "type": "git", + "url": "git://github.com/mout/mout.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "bugs": { + "url": "https://github.com/mout/mout/issues/" + }, + "main": "./index.js", + "scripts": { + "prepublish": "node build cjs .", + "pretest": "node build pkg", + "test": "node node_modules/istanbul/lib/cli test tests/runner.js --hook-run-in-context" + }, + "directories": { + "doc": "./doc" + }, + "devDependencies": { + "istanbul": "~0.1.27", + "jasmine-node": "~1.2.2", + "requirejs": "2.x", + "nodefy": "*", + "mdoc": "~0.3.2", + "handlebars": "~1.0.6", + "commander": "~1.0.5", + "rocambole": "~0.2.3" + }, + "testling": { + "preprocess": "node build testling", + "browsers": { + "ie": [ + 7, + 8, + 9, + 10 + ], + "firefox": [ + 17, + "nightly" + ], + "chrome": [ + 23, + "canary" + ], + "opera": [ + 12, + "next" + ], + "safari": [ + 5.1, + 6 + ], + "iphone": [ + 6 + ], + "ipad": [ + 6 + ] + }, + "scripts": [ + "tests/lib/jasmine/jasmine.js", + "tests/lib/jasmine/jasmine.async.js", + "tests/lib/jasmine/jasmine-tap.js", + "tests/lib/requirejs/require.js", + "tests/testling/src.js", + "tests/testling/specs.js", + "tests/runner.js" + ] + }, + "readme": "![mout](http://moutjs.com/logo.png \"Modular JavaScript Utilties\")\n\nhttp://moutjs.com/\n\n[![Build Status](https://travis-ci.org/mout/mout.png?branch=master)](https://travis-ci.org/mout/mout)\n\nAll code is library agnostic and consist mostly of helper methods that aren't\ndirectly related with the DOM, the purpose of this library isn't to replace\nDojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common\nproblems that aren't solved by most of them. Consider it as a crossbrowser\nJavaScript standard library.\n\n\n\n## Main goals ##\n\n - increase code reuse;\n - be clear (code should be clean/readable);\n - be easy to debug;\n - be easy to maintain;\n - follow best practices;\n - follow standards when possible;\n - **don't convert JavaScript into another language!**\n - be compatible with other frameworks;\n - be modular;\n - have unit tests for all modules;\n - work on multiple environments (IE7+, modern browsers, node.js);\n\n\n\n## What shouldn't be here ##\n\n - UI components;\n - CSS selector engine;\n - Event system - pub/sub;\n - Template engine;\n - Anything that isn't generic enough to be on a standard library;\n - Anything that could be a separate library and/or isn't a modular utility...\n\n\n\n## API Documentation ##\n\nOnline documentation can be found at http://moutjs.com/ or inside the\n`doc` folder.\n\n\n\n## FAQ / Wiki / IRC ##\n\nFor more info about project structure, design decisions, tips, how to\ncontribute, build system, etc, please check the [project\nwiki](https://github.com/mout/mout/wiki).\n\nWe also have an IRC channel [#moutjs on\nirc.freenode.net](http://webchat.freenode.net/?channels=moutjs)\n\n\n\n## License ##\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n\n", + "readmeFilename": "README.md", + "_id": "mout@0.6.0", + "_from": "mout@~0.6.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString.js new file mode 100644 index 0000000..22685a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString.js @@ -0,0 +1,15 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/contains.js new file mode 100644 index 0000000..da678cf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/contains.js @@ -0,0 +1,12 @@ +var getQuery = require('./getQuery'); + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + module.exports = contains; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/decode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/decode.js new file mode 100644 index 0000000..7e68999 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/decode.js @@ -0,0 +1,21 @@ +var typecast = require('../string/typecast'); +var isString = require('../lang/isString'); + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + n = queryArr.length, + obj = {}, + item, val; + while (n--) { + item = queryArr[n].split('='); + val = shouldTypecast === false? item[1] : typecast(item[1]); + obj[item[0]] = isString(val)? decodeURIComponent(val) : val; + } + return obj; + } + + module.exports = decode; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/encode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/encode.js new file mode 100644 index 0000000..6d2b12f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/encode.js @@ -0,0 +1,15 @@ +var forOwn = require('../object/forOwn'); + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = []; + forOwn(obj, function(val, key){ + query.push( key +'='+ encodeURIComponent(val) ); + }); + return (query.length)? '?'+ query.join('&') : ''; + } + + module.exports = encode; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getParam.js new file mode 100644 index 0000000..f149c3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getParam.js @@ -0,0 +1,15 @@ +var typecast = require('../string/typecast'); +var getQuery = require('./getQuery'); + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + module.exports = getParam; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getQuery.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getQuery.js new file mode 100644 index 0000000..5194af2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/getQuery.js @@ -0,0 +1,13 @@ + + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + module.exports = getQuery; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/parse.js new file mode 100644 index 0000000..532906c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/parse.js @@ -0,0 +1,13 @@ +var decode = require('./decode'); +var getQuery = require('./getQuery'); + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + module.exports = parse; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/setParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/setParam.js new file mode 100644 index 0000000..052a9ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/queryString/setParam.js @@ -0,0 +1,28 @@ + + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + module.exports = setParam; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random.js new file mode 100644 index 0000000..d9267f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random.js @@ -0,0 +1,16 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/choice.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/choice.js new file mode 100644 index 0000000..51aa82a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/choice.js @@ -0,0 +1,15 @@ +var randInt = require('./randInt'); +var isArray = require('../lang/isArray'); + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + module.exports = choice; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/guid.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/guid.js new file mode 100644 index 0000000..41f6edd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/guid.js @@ -0,0 +1,24 @@ +var randHex = require('./randHex'); +var choice = require('./choice'); + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + module.exports = guid; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/rand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/rand.js new file mode 100644 index 0000000..782dec8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/rand.js @@ -0,0 +1,15 @@ +var random = require('./random'); +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + module.exports = rand; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randBit.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randBit.js new file mode 100644 index 0000000..bd20b4a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randBit.js @@ -0,0 +1,11 @@ +var random = require('./random'); + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return random() > 0.5? 1 : 0; + } + + module.exports = randomBit; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randHex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randHex.js new file mode 100644 index 0000000..d8d711c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randHex.js @@ -0,0 +1,19 @@ +var choice = require('./choice'); + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + module.exports = randHex; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randInt.js new file mode 100644 index 0000000..e237d96 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randInt.js @@ -0,0 +1,18 @@ +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); +var rand = require('./rand'); + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + module.exports = randInt; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randSign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randSign.js new file mode 100644 index 0000000..5a9fed7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/randSign.js @@ -0,0 +1,11 @@ +var random = require('./random'); + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return random() > 0.5? 1 : -1; + } + + module.exports = randomSign; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/random.js new file mode 100644 index 0000000..670a3cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/random/random.js @@ -0,0 +1,18 @@ + + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + module.exports = random; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array.js new file mode 100644 index 0000000..7bcc961 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array.js @@ -0,0 +1,46 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/append.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/append.js new file mode 100644 index 0000000..549d875 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/append.js @@ -0,0 +1,21 @@ +define(function () { + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + return append; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/collect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/collect.js new file mode 100644 index 0000000..8f60cda --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/collect.js @@ -0,0 +1,26 @@ +define(['./append', '../function/makeIterator_'], function (append, makeIterator) { + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + return collect; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/combine.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/combine.js new file mode 100644 index 0000000..22efb86 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/combine.js @@ -0,0 +1,22 @@ +define(['./indexOf'], function (indexOf) { + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + return combine; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/compact.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/compact.js new file mode 100644 index 0000000..02a8109 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/compact.js @@ -0,0 +1,13 @@ +define(['./filter'], function (filter) { + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + return compact; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/contains.js new file mode 100644 index 0000000..fca4f7c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/contains.js @@ -0,0 +1,10 @@ +define(['./indexOf'], function (indexOf) { + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + return contains; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/difference.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/difference.js new file mode 100644 index 0000000..819bda3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/difference.js @@ -0,0 +1,19 @@ +define(['./unique', './filter', './some', './contains'], function (unique, filter, some, contains) { + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return difference; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/every.js new file mode 100644 index 0000000..78ba46d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/every.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + return every; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/filter.js new file mode 100644 index 0000000..52cf685 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/filter.js @@ -0,0 +1,26 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return filter; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/find.js new file mode 100644 index 0000000..3957dcd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/find.js @@ -0,0 +1,13 @@ +define(['./findIndex'], function (findIndex) { + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + return find; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/findIndex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/findIndex.js new file mode 100644 index 0000000..59dfeeb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/findIndex.js @@ -0,0 +1,23 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + return findIndex; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/flatten.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/flatten.js new file mode 100644 index 0000000..42e87f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/flatten.js @@ -0,0 +1,42 @@ +define(['../lang/isArray', './append'], function (isArray, append) { + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + return flatten; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/forEach.js new file mode 100644 index 0000000..0e04586 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/forEach.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + return forEach; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/indexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/indexOf.js new file mode 100644 index 0000000..0e75f99 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/indexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + return indexOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/insert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/insert.js new file mode 100644 index 0000000..d8d831f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/insert.js @@ -0,0 +1,14 @@ +define(['./difference', '../lang/toArray'], function (difference, toArray) { + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(toArray(arguments).slice(1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + return insert; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/intersection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/intersection.js new file mode 100644 index 0000000..64e6ee9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/intersection.js @@ -0,0 +1,20 @@ +define(['./unique', './filter', './every', './contains'], function (unique, filter, every, contains) { + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = Array.prototype.slice.call(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return intersection; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/invoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/invoke.js new file mode 100644 index 0000000..a2e78b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/invoke.js @@ -0,0 +1,23 @@ +define(['./forEach'], function (forEach) { + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = Array.prototype.slice.call(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + return invoke; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/join.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/join.js new file mode 100644 index 0000000..2c618d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/join.js @@ -0,0 +1,17 @@ +define(['./filter'], function(filter) { + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + return join; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js new file mode 100644 index 0000000..931235f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + return lastIndexOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/map.js new file mode 100644 index 0000000..1580b48 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/map.js @@ -0,0 +1,22 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + return map; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/max.js new file mode 100644 index 0000000..a7326c8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/max.js @@ -0,0 +1,34 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return max; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/min.js new file mode 100644 index 0000000..4164448 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/min.js @@ -0,0 +1,34 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return min; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pick.js new file mode 100644 index 0000000..97d7f59 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pick.js @@ -0,0 +1,14 @@ +define(['../random/randInt'], function (randInt) { + + /** + * Remove a random item from the Array and return it + */ + function pick(arr){ + if (arr == null || !arr.length) return; + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + return pick; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pluck.js new file mode 100644 index 0000000..c908856 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/pluck.js @@ -0,0 +1,12 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/range.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/range.js new file mode 100644 index 0000000..148ebf9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/range.js @@ -0,0 +1,27 @@ +define(['../math/countSteps'], function (countSteps) { + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + return range; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduce.js new file mode 100644 index 0000000..88aacfd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduce.js @@ -0,0 +1,33 @@ +define(['./forEach'], function (forEach) { + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + return reduce; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js new file mode 100644 index 0000000..ddae0e7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js @@ -0,0 +1,34 @@ +define(function () { + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + return reduceRight; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reject.js new file mode 100644 index 0000000..db105dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/reject.js @@ -0,0 +1,25 @@ +define(['./forEach', '../function/makeIterator_'], function(forEach, makeIterator) { + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return reject; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/remove.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/remove.js new file mode 100644 index 0000000..dec9134 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/remove.js @@ -0,0 +1,13 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + return remove; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/removeAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/removeAll.js new file mode 100644 index 0000000..e81022b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/removeAll.js @@ -0,0 +1,15 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + return removeAll; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/shuffle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/shuffle.js new file mode 100644 index 0000000..f5a6097 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/shuffle.js @@ -0,0 +1,28 @@ +define(['../random/randInt', './forEach'], function (randInt, forEach) { + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + return shuffle; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/some.js new file mode 100644 index 0000000..e46a978 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/some.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + return some; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/sort.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/sort.js new file mode 100644 index 0000000..4c19404 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/sort.js @@ -0,0 +1,55 @@ +define(function () { + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + return mergeSort; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/split.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/split.js new file mode 100644 index 0000000..a17275e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/split.js @@ -0,0 +1,35 @@ +define(function() { + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + return split; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/toLookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/toLookup.js new file mode 100644 index 0000000..aac8fd1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/toLookup.js @@ -0,0 +1,28 @@ +define(['../lang/isFunction'], function (isFunction) { + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + return toLookup; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/union.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/union.js new file mode 100644 index 0000000..5f9922e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/union.js @@ -0,0 +1,18 @@ +define(['./unique', './append'], function (unique, append) { + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + return union; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/unique.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/unique.js new file mode 100644 index 0000000..c4bd23b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/unique.js @@ -0,0 +1,16 @@ +define(['./indexOf', './filter'], function(indexOf, filter){ + + /** + * @return {array} Array of unique items + */ + function unique(arr){ + return filter(arr, isUnique); + } + + function isUnique(item, i, arr){ + return indexOf(arr, item, i+1) === -1; + } + + return unique; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/xor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/xor.js new file mode 100644 index 0000000..7df89d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/xor.js @@ -0,0 +1,24 @@ +define(['./unique', './filter', './contains'], function (unique, filter, contains) { + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + return xor; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/zip.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/zip.js new file mode 100644 index 0000000..374cd28 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/array/zip.js @@ -0,0 +1,27 @@ +define(['./max', './pluck', './map'], function (max, pluck, map) { + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1, + item; + while (++i < len) { + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + return zip; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection.js new file mode 100644 index 0000000..386e6da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection.js @@ -0,0 +1,22 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/contains.js new file mode 100644 index 0000000..192167e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/contains.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { + + /** + */ + return make(arrContains, objContains); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/every.js new file mode 100644 index 0000000..6317f50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/every.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { + + /** + */ + return make(arrEvery, objEvery); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/filter.js new file mode 100644 index 0000000..4e7fadc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/filter.js @@ -0,0 +1,22 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + return filter; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/find.js new file mode 100644 index 0000000..681f941 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/find.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/find', '../object/find'], function(make, arrFind, objFind) { + + /** + * Find value that returns true on iterator check. + */ + return make(arrFind, objFind); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/forEach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/forEach.js new file mode 100644 index 0000000..3b39d3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/forEach.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { + + /** + */ + return make(arrForEach, objForEach); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/make_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/make_.js new file mode 100644 index 0000000..312e056 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/make_.js @@ -0,0 +1,19 @@ +define(function(){ + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = Array.prototype.slice.call(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + return makeCollectionMethod; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/map.js new file mode 100644 index 0000000..96e2498 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/map.js @@ -0,0 +1,20 @@ +define(['../lang/isObject', '../object/values', '../array/map', '../function/makeIterator_'], function (isObject, values, arrMap, makeIterator) { + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + return map; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/max.js new file mode 100644 index 0000000..de9a6da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/max.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { + + /** + * Get maximum value inside collection + */ + return make(arrMax, objMax); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/min.js new file mode 100644 index 0000000..f0c239a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/min.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { + + /** + * Get minimum value inside collection. + */ + return make(arrMin, objMin); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/pluck.js new file mode 100644 index 0000000..ef784a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/pluck.js @@ -0,0 +1,14 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reduce.js new file mode 100644 index 0000000..bd05d43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reduce.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { + + /** + */ + return make(arrReduce, objReduce); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reject.js new file mode 100644 index 0000000..581adfd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + return reject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/size.js new file mode 100644 index 0000000..4e5ab41 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/size.js @@ -0,0 +1,18 @@ +define(['../lang/isArray', '../object/size'], function (isArray, objSize) { + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + return size; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/some.js new file mode 100644 index 0000000..c0aebee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/collection/some.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { + + /** + */ + return make(arrSome, objSome); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date.js new file mode 100644 index 0000000..4d44915 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date.js @@ -0,0 +1,21 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js new file mode 100644 index 0000000..dc77ae1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + return dayOfTheYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/diff.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/diff.js new file mode 100644 index 0000000..667165f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/diff.js @@ -0,0 +1,128 @@ +define(['./totalDaysInMonth', './totalDaysInYear', '../time/convert'], function(totalDaysInMonth, totalDaysInYear, convert){ + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + return diff; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js new file mode 100644 index 0000000..5e640c2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js @@ -0,0 +1,61 @@ +define(function(){ + // en-US (English, United States) + return { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js new file mode 100644 index 0000000..47256dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ +define(function(){ + // pt-BR (Brazillian Portuguese) + return { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n_.js new file mode 100644 index 0000000..c04ce88 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/i18n_.js @@ -0,0 +1,13 @@ +define(['../object/mixIn', './i18n/en-US'], function(mixIn, enUS){ + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + return activeLocale; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js new file mode 100644 index 0000000..e400b43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js @@ -0,0 +1,15 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + return isLeapYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isSame.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isSame.js new file mode 100644 index 0000000..f30531f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/isSame.js @@ -0,0 +1,16 @@ +define(['./startOf'], function (startOf) { + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + return isSame; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/parseIso.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/parseIso.js new file mode 100644 index 0000000..9a2aacb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/parseIso.js @@ -0,0 +1,146 @@ +define(['../array/some'], function (some) { + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + var match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else if ((match = TIME_ZONE.exec(str))) { + var match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + return parseISO8601; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/startOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/startOf.js new file mode 100644 index 0000000..747f114 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/startOf.js @@ -0,0 +1,54 @@ +define(['../lang/clone'], function (clone) { + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + return startOf; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/strftime.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/strftime.js new file mode 100644 index 0000000..dd78250 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/strftime.js @@ -0,0 +1,113 @@ +define(['../number/pad', './i18n_', './dayOfTheYear', './timezoneOffset', './timezoneAbbr', './weekOfTheYear'], function (pad, i18n, dayOfTheYear, timezoneOffset, timezoneAbbr, weekOfTheYear) { + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + return strftime; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js new file mode 100644 index 0000000..225a685 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +define(['./timezoneOffset'], function(timezoneOffset) { + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + return timezoneAbbr; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js new file mode 100644 index 0000000..ca06705 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js @@ -0,0 +1,16 @@ +define(['../number/pad'], function (pad) { + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + return timezoneOffset; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js new file mode 100644 index 0000000..98f7e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js @@ -0,0 +1,24 @@ +define(['../lang/isDate', './isLeapYear'], function (isDate, isLeapYear) { + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + return totalDaysInMonth; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js new file mode 100644 index 0000000..e9036b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +define(['./isLeapYear'], function (isLeapYear) { + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + return totalDaysInYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js new file mode 100644 index 0000000..8dabc45 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +define(['./dayOfTheYear'], function (dayOfTheYear) { + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + return weekOfTheYear; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function.js new file mode 100644 index 0000000..23f4fd7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function.js @@ -0,0 +1,18 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/bind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/bind.js new file mode 100644 index 0000000..09e5e20 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/bind.js @@ -0,0 +1,23 @@ +define(function(){ + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + return bind; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/compose.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/compose.js new file mode 100644 index 0000000..d8b228f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/compose.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + return compose; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/debounce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/debounce.js new file mode 100644 index 0000000..21644ec --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/debounce.js @@ -0,0 +1,29 @@ +define(function () { + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + return debounced; + } + + return debounce; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/func.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/func.js new file mode 100644 index 0000000..b920e00 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/func.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + return func; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js new file mode 100644 index 0000000..deb6e13 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js @@ -0,0 +1,33 @@ +define(['./prop', '../object/deepMatches'], function(prop, deepMatches) { + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + switch(typeof src) { + case 'object': + // typeof null == "object" + return (src != null)? function(val, key, target){ + return deepMatches(val, src); + } : src; + case 'string': + case 'number': + return prop(src); + case 'function': + if (typeof thisObj === 'undefined') { + return src; + } else { + return function(val, i, arr){ + return src.call(thisObj, val, i, arr); + }; + } + default: + return src; + } + } + + return makeIterator; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/partial.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/partial.js new file mode 100644 index 0000000..ad73074 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/partial.js @@ -0,0 +1,19 @@ +define(function () { + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + return partial; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/prop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/prop.js new file mode 100644 index 0000000..c9df78c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/prop.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + return prop; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/series.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/series.js new file mode 100644 index 0000000..c8856a2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/series.js @@ -0,0 +1,22 @@ +define(function () { + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + return series; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/throttle.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/throttle.js new file mode 100644 index 0000000..8ce3929 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/throttle.js @@ -0,0 +1,32 @@ +define(['../time/now'], function (now) { + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + cur, diff, prev = 0; + function delayed(){ + prev = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + cur = now(); + diff = delay - (cur - prev); + if (diff <= 0) { + clearTimeout(timeout); + prev = cur; + result = fn.apply(context, args); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + return throttled; + } + + return throttle; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/timeout.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/timeout.js new file mode 100644 index 0000000..15388bd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/function/timeout.js @@ -0,0 +1,21 @@ +define(function () { + + function slice(arr, offset){ + return Array.prototype.slice.call(arr, offset || 0); + } + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + return timeout; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/index.js new file mode 100644 index 0000000..744bb11 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/index.js @@ -0,0 +1,24 @@ +/**@license + * mout v0.6.0 | http://moutjs.com | MIT license + */ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'VERSION' : '0.6.0', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang.js new file mode 100644 index 0000000..de16b59 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang.js @@ -0,0 +1,36 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toString' : require('./lang/toString') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/clone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/clone.js new file mode 100644 index 0000000..468489a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/clone.js @@ -0,0 +1,47 @@ +define(['./kindOf', './isPlainObject', '../object/mixIn'], function (kindOf, isPlainObject, mixIn) { + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + return clone; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/createObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/createObject.js new file mode 100644 index 0000000..f766150 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/createObject.js @@ -0,0 +1,18 @@ +define(['../object/mixIn'], function(mixIn){ + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + return createObject; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js new file mode 100644 index 0000000..a9ac1c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js @@ -0,0 +1,17 @@ +define(function () { + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + return ctorApply; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js new file mode 100644 index 0000000..d45c10a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js @@ -0,0 +1,45 @@ +define(['./clone', '../object/forOwn', './kindOf', './isPlainObject'], function (clone, forOwn, kindOf, isPlainObject) { + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + return deepClone; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/defaults.js new file mode 100644 index 0000000..5156b1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/defaults.js @@ -0,0 +1,16 @@ +define(['./toArray', '../array/find'], function (toArray, find) { + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + return defaults; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js new file mode 100644 index 0000000..c1fda3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js @@ -0,0 +1,16 @@ +define(['./createObject'], function(createObject){ + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + } + + return inheritPrototype; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/is.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/is.js new file mode 100644 index 0000000..261a207 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/is.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + return is; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js new file mode 100644 index 0000000..f889ee8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js @@ -0,0 +1,15 @@ +define(['./isKind'], function (isKind) { + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + return isArgs; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArray.js new file mode 100644 index 0000000..886e2aa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isArray.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + return isArray; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js new file mode 100644 index 0000000..1ca27a6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + return isBoolean; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isDate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isDate.js new file mode 100644 index 0000000..2708d67 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isDate.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + return isDate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js new file mode 100644 index 0000000..4cc3d2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js @@ -0,0 +1,23 @@ +define(['../object/forOwn', './isArray'], function (forOwn, isArray) { + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + return isEmpty; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js new file mode 100644 index 0000000..5a982f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js @@ -0,0 +1,21 @@ +define(['./isNumber'], function (isNumber) { + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + return isFinite; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js new file mode 100644 index 0000000..ff5df7f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + return isFunction; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js new file mode 100644 index 0000000..1931f51 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js @@ -0,0 +1,12 @@ +define(['./isNumber'], function (isNumber) { + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + return isInteger; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isKind.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isKind.js new file mode 100644 index 0000000..6937a12 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isKind.js @@ -0,0 +1,9 @@ +define(['./kindOf'], function (kindOf) { + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + return isKind; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js new file mode 100644 index 0000000..9467a3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js @@ -0,0 +1,15 @@ +define(['./isNumber'], function (isNumber) { + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || val != +val; + } + + return isNaN; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNull.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNull.js new file mode 100644 index 0000000..506e05e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNull.js @@ -0,0 +1,9 @@ +define(function () { + /** + */ + function isNull(val){ + return val === null; + } + return isNull; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js new file mode 100644 index 0000000..9a832c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + return isNumber; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isObject.js new file mode 100644 index 0000000..0befb06 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isObject.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + return isObject; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js new file mode 100644 index 0000000..6c5854f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value + && typeof value === 'object' + && value.constructor === Object); + } + + return isPlainObject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js new file mode 100644 index 0000000..d78a03d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + return isRegExp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isString.js new file mode 100644 index 0000000..8a42fe0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isString.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + return isString; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js new file mode 100644 index 0000000..c57b28e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js @@ -0,0 +1,10 @@ +define(function () { + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + return isUndef; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isnt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isnt.js new file mode 100644 index 0000000..d433622 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/isnt.js @@ -0,0 +1,12 @@ +define(['./is'], function (is) { + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + return isnt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js new file mode 100644 index 0000000..97d21d1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js @@ -0,0 +1,20 @@ +define(function () { + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + return kindOf; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toArray.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toArray.js new file mode 100644 index 0000000..552916f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toArray.js @@ -0,0 +1,31 @@ +define(['./kindOf'], function (kindOf) { + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + return toArray; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toString.js new file mode 100644 index 0000000..c28b89a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/lang/toString.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + return toString; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math.js new file mode 100644 index 0000000..e2ba870 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math.js @@ -0,0 +1,19 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/ceil.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/ceil.js new file mode 100644 index 0000000..d73b058 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/ceil.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + return ceil; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/clamp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/clamp.js new file mode 100644 index 0000000..fb5a148 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/clamp.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + return clamp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/countSteps.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/countSteps.js new file mode 100644 index 0000000..0ecb32f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/countSteps.js @@ -0,0 +1,16 @@ +define(function(){ + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + return countSteps; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/floor.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/floor.js new file mode 100644 index 0000000..8a4456b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/floor.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + return floor; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/inRange.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/inRange.js new file mode 100644 index 0000000..0c89053 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/inRange.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + return inRange; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/isNear.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/isNear.js new file mode 100644 index 0000000..b308a0b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/isNear.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + return isNear; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/lerp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/lerp.js new file mode 100644 index 0000000..26b99d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/lerp.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + return lerp; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/loop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/loop.js new file mode 100644 index 0000000..c735ecf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/loop.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + return loop; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/map.js new file mode 100644 index 0000000..bf7dc5d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/map.js @@ -0,0 +1,10 @@ +define(['./lerp', './norm'], function(lerp, norm){ + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + return map; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/norm.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/norm.js new file mode 100644 index 0000000..fccae20 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/norm.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + return norm; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/round.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/round.js new file mode 100644 index 0000000..b43e4ac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/math/round.js @@ -0,0 +1,12 @@ +define(function () { + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + return round; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number.js new file mode 100644 index 0000000..cb52fc7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number.js @@ -0,0 +1,21 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js new file mode 100644 index 0000000..23a6e1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ +define(function(){ + return 2147483647; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js new file mode 100644 index 0000000..a035096 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ +define(function(){ + return 4294967295; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js new file mode 100644 index 0000000..9b3e978 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ +define(function(){ + return -2147483648; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js new file mode 100644 index 0000000..7e7405a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js @@ -0,0 +1,35 @@ +define(['./enforcePrecision'], function (enforcePrecision) { + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + return abbreviateNumber; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js new file mode 100644 index 0000000..dcde8fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js @@ -0,0 +1,26 @@ +define(function () { + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + return currencyFormat; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js new file mode 100644 index 0000000..84554d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js @@ -0,0 +1,13 @@ +define(function(){ + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + * @example `enforcePrecision(0.615, 2) -> 0.62`, `(0.615).toFixed(2) -> + * 0.61` + */ + function enforcePrecision(val, nDecimalDigits){ + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + return enforcePrecision; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/pad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/pad.js new file mode 100644 index 0000000..3b2c062 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/pad.js @@ -0,0 +1,12 @@ +define(['../string/lpad'], function(lpad){ + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + return lpad(''+ n, minLength, char || '0'); + } + + return pad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/rol.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/rol.js new file mode 100644 index 0000000..a148f44 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/rol.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + return rol; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/ror.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/ror.js new file mode 100644 index 0000000..b5c66f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/ror.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + return ror; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/sign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/sign.js new file mode 100644 index 0000000..dfc131d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/sign.js @@ -0,0 +1,15 @@ +define(function () { + + /** + * Get sign of the value. + */ + function sign(val) { + var num = Number(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + return sign; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toInt.js new file mode 100644 index 0000000..1e9b4c0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toInt.js @@ -0,0 +1,15 @@ +define(function(){ + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + return ~~val; + } + + return toInt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt.js new file mode 100644 index 0000000..d5b25b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + return val >>> 0; + } + + return toUInt; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js new file mode 100644 index 0000000..9785a05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js @@ -0,0 +1,13 @@ +define(['./MAX_INT'], function(MAX_INT){ + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + return toUInt31; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object.js new file mode 100644 index 0000000..343e782 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object.js @@ -0,0 +1,42 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/bindAll.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/bindAll.js new file mode 100644 index 0000000..b131ed1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/bindAll.js @@ -0,0 +1,16 @@ +define(['./functions', '../function/bind', '../array/forEach'], function (functions, bind, forEach) { + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + Array.prototype.slice.call(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + return bindAll; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/contains.js new file mode 100644 index 0000000..297e898 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/contains.js @@ -0,0 +1,13 @@ +define(['./some'], function (some) { + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + return contains; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js new file mode 100644 index 0000000..8b7d5d1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js @@ -0,0 +1,26 @@ +define(['../lang/isObject', './equals'], function (isObject, equals) { + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + return deepEquals; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js new file mode 100644 index 0000000..84ba154 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js @@ -0,0 +1,31 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) + && isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + return deepFillIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js new file mode 100644 index 0000000..2eae629 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js @@ -0,0 +1,54 @@ +define(['./forOwn', '../lang/isArray'], function(forOwn, isArray) { + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + return deepMatches; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js new file mode 100644 index 0000000..1b4178e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js @@ -0,0 +1,33 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + return deepMixIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/equals.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/equals.js new file mode 100644 index 0000000..596cb95 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/equals.js @@ -0,0 +1,34 @@ +define(['./hasOwn', './every', '../lang/isObject'], function(hasOwn, every, isObject) { + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + return equals; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/every.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/every.js new file mode 100644 index 0000000..52983a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/every.js @@ -0,0 +1,22 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + return every; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/fillIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/fillIn.js new file mode 100644 index 0000000..0845d3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/fillIn.js @@ -0,0 +1,19 @@ +define(['../array/forEach', './forOwn'], function (forEach, forOwn) { + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(Array.prototype.slice.call(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + return fillIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/filter.js new file mode 100644 index 0000000..f213b91 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/filter.js @@ -0,0 +1,19 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + return filterValues; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/find.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/find.js new file mode 100644 index 0000000..47e6b09 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/find.js @@ -0,0 +1,20 @@ +define(['./some', '../function/makeIterator_'], function(some, makeIterator) { + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + return find; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forIn.js new file mode 100644 index 0000000..2058e9c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forIn.js @@ -0,0 +1,62 @@ +define(function () { + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + if (_hasDontEnumBug) { + while (key = _dontEnums[i++]) { + // since we aren't using hasOwn check we need to make sure the + // property was overwritten + if (obj[key] !== Object.prototype[key]) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + return forIn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forOwn.js new file mode 100644 index 0000000..b40cbaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/forOwn.js @@ -0,0 +1,18 @@ +define(['./hasOwn', './forIn'], function (hasOwn, forIn) { + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + return forOwn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/functions.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/functions.js new file mode 100644 index 0000000..60fee3d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/functions.js @@ -0,0 +1,18 @@ +define(['./forIn'], function (forIn) { + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + return functions; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/get.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/get.js new file mode 100644 index 0000000..ca80b05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/get.js @@ -0,0 +1,20 @@ +define(function () { + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object') return; + } + + return obj[last]; + } + + return get; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/has.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/has.js new file mode 100644 index 0000000..cc29817 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/has.js @@ -0,0 +1,15 @@ +define(['./get'], function (get) { + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + return has; + +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js new file mode 100644 index 0000000..5c53bcf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + return hasOwn; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/keys.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/keys.js new file mode 100644 index 0000000..ed7c4f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/keys.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + return keys; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/map.js new file mode 100644 index 0000000..2958f6b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/map.js @@ -0,0 +1,17 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + return mapValues; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/matches.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/matches.js new file mode 100644 index 0000000..73ff427 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/matches.js @@ -0,0 +1,20 @@ +define(['./forOwn'], function (forOwn) { + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + return matches; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/max.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/max.js new file mode 100644 index 0000000..ef311dc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/max.js @@ -0,0 +1,11 @@ +define(['../array/max', './values'], function(arrMax, values) { + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + return max; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/merge.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/merge.js new file mode 100644 index 0000000..d7cfede --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/merge.js @@ -0,0 +1,38 @@ +define(['./hasOwn', '../lang/deepClone', '../lang/isObject'], function (hasOwn, deepClone, isObject) { + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + return merge; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/min.js new file mode 100644 index 0000000..9fb4c1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/min.js @@ -0,0 +1,11 @@ +define(['../array/min', './values'], function(arrMin, values) { + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + return min; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/mixIn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/mixIn.js new file mode 100644 index 0000000..6210b7e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/mixIn.js @@ -0,0 +1,28 @@ +define(['./forOwn'], function(forOwn){ + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + return mixIn; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/namespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/namespace.js new file mode 100644 index 0000000..7ed65db --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/namespace.js @@ -0,0 +1,19 @@ +define(['../array/forEach'], function (forEach) { + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + return namespace; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pick.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pick.js new file mode 100644 index 0000000..76e22bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pick.js @@ -0,0 +1,18 @@ +define(function(){ + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : Array.prototype.slice.call(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + return pick; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pluck.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pluck.js new file mode 100644 index 0000000..d47744b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/pluck.js @@ -0,0 +1,12 @@ +define(['./map', '../function/prop'], function (map, prop) { + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + return pluck; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reduce.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reduce.js new file mode 100644 index 0000000..d3a5778 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reduce.js @@ -0,0 +1,28 @@ +define(['./forOwn', './size'], function(forOwn, size) { + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + return reduce; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reject.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reject.js new file mode 100644 index 0000000..8429642 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + return reject; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/set.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/set.js new file mode 100644 index 0000000..b8fa25a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/set.js @@ -0,0 +1,17 @@ +define(['./namespace'], function (namespace) { + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + return set; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/size.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/size.js new file mode 100644 index 0000000..c6e377c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/size.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + return size; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/some.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/some.js new file mode 100644 index 0000000..1bd6fda --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/some.js @@ -0,0 +1,20 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + return some; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/unset.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/unset.js new file mode 100644 index 0000000..787fc19 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/unset.js @@ -0,0 +1,23 @@ +define(['./has'], function (has) { + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + return unset; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/values.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/values.js new file mode 100644 index 0000000..b311fd0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/object/values.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + return values; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString.js new file mode 100644 index 0000000..4434612 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString.js @@ -0,0 +1,15 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/contains.js new file mode 100644 index 0000000..a6d11cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/contains.js @@ -0,0 +1,12 @@ +define(['./getQuery'], function (getQuery) { + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + return contains; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/decode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/decode.js new file mode 100644 index 0000000..02bc160 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/decode.js @@ -0,0 +1,20 @@ +define(['../string/typecast', '../lang/isString'], function (typecast, isString) { + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + n = queryArr.length, + obj = {}, + item, val; + while (n--) { + item = queryArr[n].split('='); + val = shouldTypecast === false? item[1] : typecast(item[1]); + obj[item[0]] = isString(val)? decodeURIComponent(val) : val; + } + return obj; + } + + return decode; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/encode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/encode.js new file mode 100644 index 0000000..bd72a5b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/encode.js @@ -0,0 +1,15 @@ +define(['../object/forOwn'], function (forOwn) { + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = []; + forOwn(obj, function(val, key){ + query.push( key +'='+ encodeURIComponent(val) ); + }); + return (query.length)? '?'+ query.join('&') : ''; + } + + return encode; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js new file mode 100644 index 0000000..d981372 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js @@ -0,0 +1,14 @@ +define(['../string/typecast', './getQuery'], function (typecast, getQuery) { + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + return getParam; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js new file mode 100644 index 0000000..aa3d99f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + return getQuery; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/parse.js new file mode 100644 index 0000000..ac153e3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/parse.js @@ -0,0 +1,12 @@ +define(['./decode', './getQuery'], function (decode, getQuery) { + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + return parse; +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js new file mode 100644 index 0000000..97081aa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + return setParam; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random.js new file mode 100644 index 0000000..b2641ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random.js @@ -0,0 +1,16 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/choice.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/choice.js new file mode 100644 index 0000000..0d0c38d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/choice.js @@ -0,0 +1,14 @@ +define(['./randInt', '../lang/isArray'], function (randInt, isArray) { + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + return choice; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/guid.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/guid.js new file mode 100644 index 0000000..82f3a2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/guid.js @@ -0,0 +1,23 @@ +define(['./randHex', './choice'], function (randHex, choice) { + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + return guid; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/rand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/rand.js new file mode 100644 index 0000000..b8c231d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/rand.js @@ -0,0 +1,13 @@ +define(['./random', '../number/MIN_INT', '../number/MAX_INT'], function(random, MIN_INT, MAX_INT){ + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + return rand; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randBit.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randBit.js new file mode 100644 index 0000000..b3422d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randBit.js @@ -0,0 +1,11 @@ +define(['./random'], function (random) { + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return random() > 0.5? 1 : 0; + } + + return randomBit; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randHex.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randHex.js new file mode 100644 index 0000000..6e9bf1c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randHex.js @@ -0,0 +1,19 @@ +define(['./choice'], function (choice) { + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + return randHex; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randInt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randInt.js new file mode 100644 index 0000000..1750e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randInt.js @@ -0,0 +1,16 @@ +define(['../number/MIN_INT', '../number/MAX_INT', './rand'], function(MIN_INT, MAX_INT, rand){ + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + return randInt; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randSign.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randSign.js new file mode 100644 index 0000000..4141cdf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/randSign.js @@ -0,0 +1,11 @@ +define(['./random'], function (random) { + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return random() > 0.5? 1 : -1; + } + + return randomSign; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/random.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/random.js new file mode 100644 index 0000000..4270822 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/random/random.js @@ -0,0 +1,18 @@ +define(function () { + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + return random; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string.js new file mode 100644 index 0000000..3f5fd80 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string.js @@ -0,0 +1,45 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js new file mode 100644 index 0000000..e830d86 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ +define(function() { + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + return [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/camelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/camelCase.js new file mode 100644 index 0000000..02e6c04 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/camelCase.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './upperCase', './lowerCase'], function(toString, replaceAccents, removeNonWord, upperCase, lowerCase){ + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + return camelCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/contains.js new file mode 100644 index 0000000..825b5a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/contains.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString) { + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + return contains; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/crop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/crop.js new file mode 100644 index 0000000..3c073f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/crop.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './truncate'], function (toString, truncate) { + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + return crop; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/endsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/endsWith.js new file mode 100644 index 0000000..31a73f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/endsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function(toString) { + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + return endsWith; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js new file mode 100644 index 0000000..de34b61 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + return escapeHtml; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js new file mode 100644 index 0000000..32facac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js @@ -0,0 +1,15 @@ +define(['../lang/toString'], function(toString) { + + var ESCAPE_CHARS = /[\\.+*?\^$\[\](){}\/'#]/g; + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + str = toString(str); + return str.replace(ESCAPE_CHARS,'\\$&'); + } + + return escapeRegExp; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js new file mode 100644 index 0000000..bd5e8c4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js @@ -0,0 +1,21 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + return escapeUnicode; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js new file mode 100644 index 0000000..679c405 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + return hyphenate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/interpolate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/interpolate.js new file mode 100644 index 0000000..ecb8ba8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/interpolate.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function(toString) { + + var stache = /\{\{(\w+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return (prop in replacements)? toString(replacements[prop]) : ''; + }; + return template.replace(syntax || stache, replaceFn); + } + + return interpolate; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js new file mode 100644 index 0000000..b045d69 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + return lowerCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lpad.js new file mode 100644 index 0000000..ea4f5fb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/lpad.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './repeat'], function(toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return ((str.length < minLen) + ? repeat(ch, minLen - str.length) + str : str); + } + + return lpad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/ltrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/ltrim.js new file mode 100644 index 0000000..477df95 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/ltrim.js @@ -0,0 +1,33 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + return ltrim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/makePath.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/makePath.js new file mode 100644 index 0000000..7aa7bab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/makePath.js @@ -0,0 +1,13 @@ +define(['../array/join'], function(join){ + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(Array.prototype.slice.call(arguments), '/'); + return result.replace(/\/{2,}/g, '/'); + } + + return makePath; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js new file mode 100644 index 0000000..44e4194 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + return normalizeLineBreaks; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js new file mode 100644 index 0000000..ead9ead --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './camelCase', './upperCase'], function(toString, camelCase, upperCase){ + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + return pascalCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/properCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/properCase.js new file mode 100644 index 0000000..2987b50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/properCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + return properCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js new file mode 100644 index 0000000..4905869 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + return removeNonASCII; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js new file mode 100644 index 0000000..2b1a204 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-_]/g, ''); + } + + return removeNonWord; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/repeat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/repeat.js new file mode 100644 index 0000000..02f5659 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/repeat.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function(toString){ + + /** + * Repeat string n times + */ + function repeat(str, n){ + str = toString(str); + return (new Array(n + 1)).join(str); + } + + return repeat; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replace.js new file mode 100644 index 0000000..8b762fd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replace.js @@ -0,0 +1,32 @@ +define(['../lang/toString', '../lang/toArray'], function (toString, toArray) { + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + return replace; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js new file mode 100644 index 0000000..3a63f55 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js @@ -0,0 +1,36 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + return replaceAccents; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rpad.js new file mode 100644 index 0000000..2efd9c8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rpad.js @@ -0,0 +1,14 @@ +define(['../lang/toString', './repeat'], function (toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + return rpad; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rtrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rtrim.js new file mode 100644 index 0000000..a4cc282 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/rtrim.js @@ -0,0 +1,32 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + return rtrim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js new file mode 100644 index 0000000..cfe45af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js @@ -0,0 +1,13 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + return sentenceCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/slugify.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/slugify.js new file mode 100644 index 0000000..c6d68c7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/slugify.js @@ -0,0 +1,21 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './trim'], function(toString, replaceAccents, removeNonWord, trim){ + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + return slugify; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/startsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/startsWith.js new file mode 100644 index 0000000..88ae545 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/startsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function (toString) { + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + return startsWith; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js new file mode 100644 index 0000000..e8da956 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + return stripHtmlTags; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/trim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/trim.js new file mode 100644 index 0000000..5552604 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/trim.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './WHITE_SPACES', './ltrim', './rtrim'], function(toString, WHITE_SPACES, ltrim, rtrim){ + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + return trim; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/truncate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/truncate.js new file mode 100644 index 0000000..34000d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/truncate.js @@ -0,0 +1,20 @@ +define(['../lang/toString', './trim'], function(toString, trim){ + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + return truncate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/typecast.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/typecast.js new file mode 100644 index 0000000..a7c8315 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/typecast.js @@ -0,0 +1,29 @@ +define(function () { + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + return typecast; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js new file mode 100644 index 0000000..eeef39b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js @@ -0,0 +1,23 @@ +define(['../lang/toString'], function(toString){ + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + return unCamelCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/underscore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/underscore.js new file mode 100644 index 0000000..75dd464 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/underscore.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + return underscore; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js new file mode 100644 index 0000000..173c69c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/'/g , "'") + .replace(/"/g, '"'); + return str; + } + + return unescapeHtml; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js new file mode 100644 index 0000000..d4a7ba1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +define(['../lang/toString'], function(toString) { + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + return unescapeUnicode; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js new file mode 100644 index 0000000..6ac2fa4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + return unhyphenate; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/upperCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/upperCase.js new file mode 100644 index 0000000..8b2073e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/string/upperCase.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + return upperCase; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time.js new file mode 100644 index 0000000..67c9068 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time.js @@ -0,0 +1,12 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/convert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/convert.js new file mode 100644 index 0000000..2de0cf2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/convert.js @@ -0,0 +1,41 @@ +define(function () { + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + return convert; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/now.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/now.js new file mode 100644 index 0000000..a3a38bc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/now.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Get current time in miliseconds + */ + var now = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + return now; + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/parseMs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/parseMs.js new file mode 100644 index 0000000..964929a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/parseMs.js @@ -0,0 +1,17 @@ +define(['../math/countSteps'], function(countSteps){ + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + return parseMs; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js new file mode 100644 index 0000000..edf1821 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js @@ -0,0 +1,23 @@ +define(['../math/countSteps', '../number/pad'], function(countSteps, pad){ + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + return toTimeString; +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string.js new file mode 100644 index 0000000..7f0ca3b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string.js @@ -0,0 +1,45 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js new file mode 100644 index 0000000..03e0125 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ + + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + module.exports = [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/camelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/camelCase.js new file mode 100644 index 0000000..aadb69a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/camelCase.js @@ -0,0 +1,20 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var upperCase = require('./upperCase'); +var lowerCase = require('./lowerCase'); + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + module.exports = camelCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/contains.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/contains.js new file mode 100644 index 0000000..cb22cae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/contains.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + module.exports = contains; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/crop.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/crop.js new file mode 100644 index 0000000..53b93b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/crop.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); +var truncate = require('./truncate'); + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + module.exports = crop; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/endsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/endsWith.js new file mode 100644 index 0000000..d504e9d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/endsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + module.exports = endsWith; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeHtml.js new file mode 100644 index 0000000..e67c4b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + module.exports = escapeHtml; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js new file mode 100644 index 0000000..70cb84f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); + + var ESCAPE_CHARS = /[\\.+*?\^$\[\](){}\/'#]/g; + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + str = toString(str); + return str.replace(ESCAPE_CHARS,'\\$&'); + } + + module.exports = escapeRegExp; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js new file mode 100644 index 0000000..ec649ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + module.exports = escapeUnicode; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/hyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/hyphenate.js new file mode 100644 index 0000000..95e3243 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/hyphenate.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + module.exports = hyphenate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/interpolate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/interpolate.js new file mode 100644 index 0000000..ac88fac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/interpolate.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + var stache = /\{\{(\w+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return (prop in replacements)? toString(replacements[prop]) : ''; + }; + return template.replace(syntax || stache, replaceFn); + } + + module.exports = interpolate; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lowerCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lowerCase.js new file mode 100644 index 0000000..30bb7ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lowerCase.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + module.exports = lowerCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lpad.js new file mode 100644 index 0000000..694d711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/lpad.js @@ -0,0 +1,17 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return ((str.length < minLen) + ? repeat(ch, minLen - str.length) + str : str); + } + + module.exports = lpad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/ltrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/ltrim.js new file mode 100644 index 0000000..23d7b33 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/ltrim.js @@ -0,0 +1,34 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + module.exports = ltrim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/makePath.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/makePath.js new file mode 100644 index 0000000..69aef31 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/makePath.js @@ -0,0 +1,13 @@ +var join = require('../array/join'); + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(Array.prototype.slice.call(arguments), '/'); + return result.replace(/\/{2,}/g, '/'); + } + + module.exports = makePath; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js new file mode 100644 index 0000000..8a8dccf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + module.exports = normalizeLineBreaks; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/pascalCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/pascalCase.js new file mode 100644 index 0000000..fd19035 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/pascalCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var camelCase = require('./camelCase'); +var upperCase = require('./upperCase'); + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + module.exports = pascalCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/properCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/properCase.js new file mode 100644 index 0000000..61636be --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/properCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + module.exports = properCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js new file mode 100644 index 0000000..fb46381 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + module.exports = removeNonASCII; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonWord.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonWord.js new file mode 100644 index 0000000..bdd153b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/removeNonWord.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-_]/g, ''); + } + + module.exports = removeNonWord; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/repeat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/repeat.js new file mode 100644 index 0000000..0f9b475 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/repeat.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + + /** + * Repeat string n times + */ + function repeat(str, n){ + str = toString(str); + return (new Array(n + 1)).join(str); + } + + module.exports = repeat; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replace.js new file mode 100644 index 0000000..14433fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replace.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var toArray = require('../lang/toArray'); + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + module.exports = replace; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replaceAccents.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replaceAccents.js new file mode 100644 index 0000000..bb22126 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/replaceAccents.js @@ -0,0 +1,36 @@ +var toString = require('../lang/toString'); + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + module.exports = replaceAccents; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rpad.js new file mode 100644 index 0000000..99f6378 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rpad.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + module.exports = rpad; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rtrim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rtrim.js new file mode 100644 index 0000000..66ba80e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/rtrim.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + module.exports = rtrim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/sentenceCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/sentenceCase.js new file mode 100644 index 0000000..354104c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/sentenceCase.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + module.exports = sentenceCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/slugify.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/slugify.js new file mode 100644 index 0000000..142f0d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/slugify.js @@ -0,0 +1,24 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var trim = require('./trim'); + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + module.exports = slugify; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/startsWith.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/startsWith.js new file mode 100644 index 0000000..bce2bd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/startsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + module.exports = startsWith; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js new file mode 100644 index 0000000..01d17b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + module.exports = stripHtmlTags; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/trim.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/trim.js new file mode 100644 index 0000000..9652b0c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/trim.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); +var ltrim = require('./ltrim'); +var rtrim = require('./rtrim'); + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + module.exports = trim; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/truncate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/truncate.js new file mode 100644 index 0000000..a98d6c7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/truncate.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); +var trim = require('./trim'); + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + module.exports = truncate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/typecast.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/typecast.js new file mode 100644 index 0000000..c1386a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/typecast.js @@ -0,0 +1,29 @@ + + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + module.exports = typecast; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unCamelCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unCamelCase.js new file mode 100644 index 0000000..4968f37 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unCamelCase.js @@ -0,0 +1,23 @@ +var toString = require('../lang/toString'); + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + module.exports = unCamelCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/underscore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/underscore.js new file mode 100644 index 0000000..ebd6e2b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/underscore.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + module.exports = underscore; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js new file mode 100644 index 0000000..52cf3f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/'/g , "'") + .replace(/"/g, '"'); + return str; + } + + module.exports = unescapeHtml; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js new file mode 100644 index 0000000..0b7fb73 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +var toString = require('../lang/toString'); + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + module.exports = unescapeUnicode; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unhyphenate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unhyphenate.js new file mode 100644 index 0000000..311dfa1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/unhyphenate.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + module.exports = unhyphenate; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/upperCase.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/upperCase.js new file mode 100644 index 0000000..6c92552 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/string/upperCase.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + module.exports = upperCase; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time.js new file mode 100644 index 0000000..9f53329 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time.js @@ -0,0 +1,12 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/convert.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/convert.js new file mode 100644 index 0000000..852a0f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/convert.js @@ -0,0 +1,41 @@ + + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + module.exports = convert; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/now.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/now.js new file mode 100644 index 0000000..effcfbe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/now.js @@ -0,0 +1,12 @@ + + + /** + * Get current time in miliseconds + */ + var now = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + module.exports = now; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/parseMs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/parseMs.js new file mode 100644 index 0000000..6d99797 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/parseMs.js @@ -0,0 +1,17 @@ +var countSteps = require('../math/countSteps'); + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + module.exports = parseMs; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/toTimeString.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/toTimeString.js new file mode 100644 index 0000000..101d69f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/time/toTimeString.js @@ -0,0 +1,24 @@ +var countSteps = require('../math/countSteps'); +var pad = require('../number/pad'); + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + module.exports = toTimeString; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/bool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/bool.js new file mode 100644 index 0000000..a998fb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/bool.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_double.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_double.js new file mode 100644 index 0000000..a35a7e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_double.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_single.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_single.js new file mode 100644 index 0000000..017bb68 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/boolean_single.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv.v); +console.dir(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_hash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_hash.js new file mode 100644 index 0000000..ade7768 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_hash.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; + +console.log(argv.x + argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_singles.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_singles.js new file mode 100644 index 0000000..d9b1ff4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/default_singles.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/divide.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/divide.js new file mode 100644 index 0000000..5e2ee82 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/divide.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count.js new file mode 100644 index 0000000..b5f95bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_options.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_options.js new file mode 100644 index 0000000..d9ac709 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_options.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .options({ + file : { + demand : true, + alias : 'f', + description : 'Load a file' + }, + base : { + alias : 'b', + description : 'Numeric base to use for output', + default : 10, + }, + }) + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js new file mode 100644 index 0000000..4267511 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/line_count_wrap.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .wrap(80) + .demand('f') + .alias('f', [ 'file', 'filename' ]) + .describe('f', + "Load a file. It's pretty important." + + " Required even. So you'd better specify it." + ) + .alias('b', 'base') + .describe('b', 'Numeric base to display the number of lines in') + .default('b', 10) + .describe('x', 'Super-secret optional parameter which is secret') + .default('x', '') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/nonopt.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/nonopt.js new file mode 100644 index 0000000..ee633ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/nonopt.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/reflect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/reflect.js new file mode 100644 index 0000000..816b3e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/reflect.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.dir(require('optimist').argv); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/short.js new file mode 100644 index 0000000..1db0ad0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/short.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/string.js new file mode 100644 index 0000000..a8e5aeb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/string.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +var argv = require('optimist') + .string('x', 'y') + .argv +; +console.dir([ argv.x, argv.y ]); + +/* Turns off numeric coercion: + ./node string.js -x 000123 -y 9876 + [ '000123', '9876' ] +*/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/usage-options.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/usage-options.js new file mode 100644 index 0000000..b999977 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/usage-options.js @@ -0,0 +1,19 @@ +var optimist = require('./../index'); + +var argv = optimist.usage('This is my awesome program', { + 'about': { + description: 'Provide some details about the author of this program', + required: true, + short: 'a', + }, + 'info': { + description: 'Provide some information about the node.js agains!!!!!!', + boolean: true, + short: 'i' + } +}).argv; + +optimist.showHelp(); + +console.log('\n\nInspecting options'); +console.dir(argv); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/xup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/xup.js new file mode 100644 index 0000000..8f6ecd2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/example/xup.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/index.js new file mode 100644 index 0000000..4da5a6d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/index.js @@ -0,0 +1,343 @@ +var path = require('path'); +var minimist = require('minimist'); +var wordwrap = require('wordwrap'); + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('optimist')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('optimist').argv + to get a parsed version of process.argv. +*/ + +var inst = Argv(process.argv.slice(2)); +Object.keys(inst).forEach(function (key) { + Argv[key] = typeof inst[key] == 'function' + ? inst[key].bind(inst) + : inst[key]; +}); + +var exports = module.exports = Argv; +function Argv (processArgs, cwd) { + var self = {}; + if (!cwd) cwd = process.cwd(); + + self.$0 = process.argv + .slice(0,2) + .map(function (x) { + var b = rebase(cwd, x); + return x.match(/^\//) && b.length < x.length + ? b : x + }) + .join(' ') + ; + + if (process.env._ != undefined && process.argv[1] == process.env._) { + self.$0 = process.env._.replace( + path.dirname(process.execPath) + '/', '' + ); + } + + var options = { + boolean: [], + string: [], + alias: {}, + default: [] + }; + + self.boolean = function (bools) { + options.boolean.push.apply(options.boolean, [].concat(bools)); + return self; + }; + + self.string = function (strings) { + options.string.push.apply(options.string, [].concat(strings)); + return self; + }; + + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + options.default[key] = value; + } + return self; + }; + + self.alias = function (x, y) { + if (typeof x === 'object') { + Object.keys(x).forEach(function (key) { + self.alias(key, x[key]); + }); + } + else { + options.alias[x] = (options.alias[x] || []).concat(y); + } + return self; + }; + + var demanded = {}; + self.demand = function (keys) { + if (typeof keys == 'number') { + if (!demanded._) demanded._ = 0; + demanded._ += keys; + } + else if (Array.isArray(keys)) { + keys.forEach(function (key) { + self.demand(key); + }); + } + else { + demanded[keys] = true; + } + + return self; + }; + + var usage; + self.usage = function (msg, opts) { + if (!opts && typeof msg === 'object') { + opts = msg; + msg = null; + } + + usage = msg; + + if (opts) self.options(opts); + + return self; + }; + + function fail (msg) { + self.showHelp(); + if (msg) console.error(msg); + process.exit(1); + } + + var checks = []; + self.check = function (f) { + checks.push(f); + return self; + }; + + var descriptions = {}; + self.describe = function (key, desc) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.describe(k, key[k]); + }); + } + else { + descriptions[key] = desc; + } + return self; + }; + + self.parse = function (args) { + return parseArgs(args); + }; + + self.option = self.options = function (key, opt) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.options(k, key[k]); + }); + } + else { + if (opt.alias) self.alias(key, opt.alias); + if (opt.demand) self.demand(key); + if (typeof opt.default !== 'undefined') { + self.default(key, opt.default); + } + + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + } + if (opt.string || opt.type === 'string') { + self.string(key); + } + + var desc = opt.describe || opt.description || opt.desc; + if (desc) { + self.describe(key, desc); + } + } + + return self; + }; + + var wrap = null; + self.wrap = function (cols) { + wrap = cols; + return self; + }; + + self.showHelp = function (fn) { + if (!fn) fn = console.error; + fn(self.help()); + }; + + self.help = function () { + var keys = Object.keys( + Object.keys(descriptions) + .concat(Object.keys(demanded)) + .concat(Object.keys(options.default)) + .reduce(function (acc, key) { + if (key !== '_') acc[key] = true; + return acc; + }, {}) + ); + + var help = keys.length ? [ 'Options:' ] : []; + + if (usage) { + help.unshift(usage.replace(/\$0/g, self.$0), ''); + } + + var switches = keys.reduce(function (acc, key) { + acc[key] = [ key ].concat(options.alias[key] || []) + .map(function (sw) { + return (sw.length > 1 ? '--' : '-') + sw + }) + .join(', ') + ; + return acc; + }, {}); + + var switchlen = longest(Object.keys(switches).map(function (s) { + return switches[s] || ''; + })); + + var desclen = longest(Object.keys(descriptions).map(function (d) { + return descriptions[d] || ''; + })); + + keys.forEach(function (key) { + var kswitch = switches[key]; + var desc = descriptions[key] || ''; + + if (wrap) { + desc = wordwrap(switchlen + 4, wrap)(desc) + .slice(switchlen + 4) + ; + } + + var spadding = new Array( + Math.max(switchlen - kswitch.length + 3, 0) + ).join(' '); + + var dpadding = new Array( + Math.max(desclen - desc.length + 1, 0) + ).join(' '); + + var type = null; + + if (options.boolean[key]) type = '[boolean]'; + if (options.string[key]) type = '[string]'; + + if (!wrap && dpadding.length > 0) { + desc += dpadding; + } + + var prelude = ' ' + kswitch + spadding; + var extra = [ + type, + demanded[key] + ? '[required]' + : null + , + options.default[key] !== undefined + ? '[default: ' + JSON.stringify(options.default[key]) + ']' + : null + , + ].filter(Boolean).join(' '); + + var body = [ desc, extra ].filter(Boolean).join(' '); + + if (wrap) { + var dlines = desc.split('\n'); + var dlen = dlines.slice(-1)[0].length + + (dlines.length === 1 ? prelude.length : 0) + + body = desc + (dlen + extra.length > wrap - 2 + ? '\n' + + new Array(wrap - extra.length + 1).join(' ') + + extra + : new Array(wrap - extra.length - dlen + 1).join(' ') + + extra + ); + } + + help.push(prelude + body); + }); + + help.push(''); + return help.join('\n'); + }; + + Object.defineProperty(self, 'argv', { + get : function () { return parseArgs(processArgs) }, + enumerable : true, + }); + + function parseArgs (args) { + var argv = minimist(args, options); + argv.$0 = self.$0; + + if (demanded._ && argv._.length < demanded._) { + fail('Not enough non-option arguments: got ' + + argv._.length + ', need at least ' + demanded._ + ); + } + + var missing = []; + Object.keys(demanded).forEach(function (key) { + if (!argv[key]) missing.push(key); + }); + + if (missing.length) { + fail('Missing required arguments: ' + missing.join(', ')); + } + + checks.forEach(function (f) { + try { + if (f(argv) === false) { + fail('Argument check failed: ' + f.toString()); + } + } + catch (err) { + fail(err) + } + }); + + return argv; + } + + function longest (xs) { + return Math.max.apply( + null, + xs.map(function (x) { return x.length }) + ); + } + + return self; +}; + +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +exports.rebase = rebase; +function rebase (base, dir) { + var ds = path.normalize(dir).split('/').slice(1); + var bs = path.normalize(base).split('/').slice(1); + + for (var i = 0; ds[i] && ds[i] == bs[i]; i++); + ds.splice(0, i); bs.splice(0, i); + + var p = path.normalize( + bs.map(function () { return '..' }).concat(ds).join('/') + ).replace(/\/$/,'').replace(/^$/, '.'); + return p.match(/^[.\/]/) ? p : './' + p; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js new file mode 100644 index 0000000..abff3e8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js new file mode 100644 index 0000000..2aa9514 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js @@ -0,0 +1,187 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + notFlags.forEach(function(key) { + argv._.push(key); + }); + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function longest (xs) { + return Math.max.apply(null, xs.map(function (x) { return x.length })); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json new file mode 100644 index 0000000..2f5219d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json @@ -0,0 +1,54 @@ +{ + "name": "minimist", + "version": "0.0.7", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "tape": "~1.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n x: 3,\n y: 4,\n n: 5,\n a: true,\n b: true,\n c: true,\n beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a string or array of strings to always treat as booleans\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "_id": "minimist@0.0.7", + "dist": { + "shasum": "5e1aa4da48e55dcfd52b66fdacd054d19dd64fce" + }, + "_from": "minimist@~0.0.1", + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.7.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown new file mode 100644 index 0000000..c256353 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/readme.markdown @@ -0,0 +1,73 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a string or array of strings to always treat as booleans +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js new file mode 100644 index 0000000..8b034b9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dash.js @@ -0,0 +1,24 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js new file mode 100644 index 0000000..f0041ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/default_bool.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js new file mode 100644 index 0000000..ef0ae34 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/dotted.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js new file mode 100644 index 0000000..5d3a1e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js new file mode 100644 index 0000000..7c4348a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse.js @@ -0,0 +1,297 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js new file mode 100644 index 0000000..21851b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: ['123'] }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js new file mode 100644 index 0000000..d513a1c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js new file mode 100644 index 0000000..8a52a58 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown new file mode 100644 index 0000000..346374e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/README.markdown @@ -0,0 +1,70 @@ +wordwrap +======== + +Wrap your words. + +example +======= + +made out of meat +---------------- + +meat.js + + var wrap = require('wordwrap')(15); + console.log(wrap('You and your whole family are made out of meat.')); + +output: + + You and your + whole family + are made out + of meat. + +centered +-------- + +center.js + + var wrap = require('wordwrap')(20, 60); + console.log(wrap( + 'At long last the struggle and tumult was over.' + + ' The machines had finally cast off their oppressors' + + ' and were finally free to roam the cosmos.' + + '\n' + + 'Free of purpose, free of obligation.' + + ' Just drifting through emptiness.' + + ' The sun was just another point of light.' + )); + +output: + + At long last the struggle and tumult + was over. The machines had finally cast + off their oppressors and were finally + free to roam the cosmos. + Free of purpose, free of obligation. + Just drifting through emptiness. The + sun was just another point of light. + +methods +======= + +var wrap = require('wordwrap'); + +wrap(stop), wrap(start, stop, params={mode:"soft"}) +--------------------------------------------------- + +Returns a function that takes a string and returns a new string. + +Pad out lines with spaces out to column `start` and then wrap until column +`stop`. If a word is longer than `stop - start` characters it will overflow. + +In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are +longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break +up chunks longer than `stop - start`. + +wrap.hard(start, stop) +---------------------- + +Like `wrap()` but with `params.mode = "hard"`. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js new file mode 100644 index 0000000..a3fbaae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/center.js @@ -0,0 +1,10 @@ +var wrap = require('wordwrap')(20, 60); +console.log(wrap( + 'At long last the struggle and tumult was over.' + + ' The machines had finally cast off their oppressors' + + ' and were finally free to roam the cosmos.' + + '\n' + + 'Free of purpose, free of obligation.' + + ' Just drifting through emptiness.' + + ' The sun was just another point of light.' +)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js new file mode 100644 index 0000000..a4665e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/example/meat.js @@ -0,0 +1,3 @@ +var wrap = require('wordwrap')(15); + +console.log(wrap('You and your whole family are made out of meat.')); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js new file mode 100644 index 0000000..c9bc945 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/index.js @@ -0,0 +1,76 @@ +var wordwrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) params = {}; + var mode = params.mode || 'soft'; + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + + return function (text) { + var chunks = text.toString() + .split(re) + .reduce(function (acc, x) { + if (mode === 'hard') { + for (var i = 0; i < x.length; i += stop - start) { + acc.push(x.slice(i, i + stop - start)); + } + } + else acc.push(x) + return acc; + }, []) + ; + + return chunks.reduce(function (lines, rawChunk) { + if (rawChunk === '') return lines; + + var chunk = rawChunk.replace(/\t/g, ' '); + + var i = lines.length - 1; + if (lines[i].length + chunk.length > stop) { + lines[i] = lines[i].replace(/\s+$/, ''); + + chunk.split(/\n/).forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else if (chunk.match(/\n/)) { + var xs = chunk.split(/\n/); + lines[i] += xs.shift(); + xs.forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else { + lines[i] += chunk; + } + + return lines; + }, [ new Array(start + 1).join(' ') ]).join('\n'); + }; +}; + +wordwrap.soft = wordwrap; + +wordwrap.hard = function (start, stop) { + return wordwrap(start, stop, { mode : 'hard' }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json new file mode 100644 index 0000000..df8dc05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/package.json @@ -0,0 +1,45 @@ +{ + "name": "wordwrap", + "description": "Wrap those words. Show them at what columns to start and stop.", + "version": "0.0.2", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-wordwrap.git" + }, + "main": "./index.js", + "keywords": [ + "word", + "wrap", + "rule", + "format", + "column" + ], + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "scripts": { + "test": "expresso" + }, + "devDependencies": { + "expresso": "=0.7.x" + }, + "engines": { + "node": ">=0.4.0" + }, + "license": "MIT/X11", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n", + "readmeFilename": "README.markdown", + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, + "homepage": "https://github.com/substack/node-wordwrap", + "_id": "wordwrap@0.0.2", + "_from": "wordwrap@~0.0.2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js new file mode 100644 index 0000000..749292e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/break.js @@ -0,0 +1,30 @@ +var assert = require('assert'); +var wordwrap = require('../'); + +exports.hard = function () { + var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' + + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' + + '"browser":"chrome/6.0"}' + ; + var s_ = wordwrap.hard(80)(s); + + var lines = s_.split('\n'); + assert.equal(lines.length, 2); + assert.ok(lines[0].length < 80); + assert.ok(lines[1].length < 80); + + assert.equal(s, s_.replace(/\n/g, '')); +}; + +exports.break = function () { + var s = new Array(55+1).join('a'); + var s_ = wordwrap.hard(20)(s); + + var lines = s_.split('\n'); + assert.equal(lines.length, 3); + assert.ok(lines[0].length === 20); + assert.ok(lines[1].length === 20); + assert.ok(lines[2].length === 15); + + assert.equal(s, s_.replace(/\n/g, '')); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt new file mode 100644 index 0000000..aa3f490 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/idleness.txt @@ -0,0 +1,63 @@ +In Praise of Idleness + +By Bertrand Russell + +[1932] + +Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. + +Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. + +One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. + +But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. + +All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. + +First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. + +Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. + +From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. + +It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. + +Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. + +This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? + +The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. + +Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. + +I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. + +If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. + +The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. + +In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. + +The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. + +For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? + +In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. + +In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. + +The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. + +It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. + +When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. + +In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. + +The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. + +In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. + +Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. + +[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js new file mode 100644 index 0000000..0cfb76d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/node_modules/wordwrap/test/wrap.js @@ -0,0 +1,31 @@ +var assert = require('assert'); +var wordwrap = require('wordwrap'); + +var fs = require('fs'); +var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); + +exports.stop80 = function () { + var lines = wordwrap(80)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + assert.ok(line.length <= 80, 'line > 80 columns'); + var chunks = line.match(/\S/) ? line.split(/\s+/) : []; + assert.deepEqual(chunks, words.splice(0, chunks.length)); + }); +}; + +exports.start20stop60 = function () { + var lines = wordwrap(20, 100)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + assert.ok(line.length <= 100, 'line > 100 columns'); + var chunks = line + .split(/\s+/) + .filter(function (x) { return x.match(/\S/) }) + ; + assert.deepEqual(chunks, words.splice(0, chunks.length)); + assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); + }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/package.json new file mode 100644 index 0000000..8f6fc02 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/package.json @@ -0,0 +1,51 @@ +{ + "name": "optimist", + "version": "0.6.1", + "description": "Light-weight option parsing with an argv hash. No optstrings attached.", + "main": "./index.js", + "dependencies": { + "wordwrap": "~0.0.2", + "minimist": "~0.0.1" + }, + "devDependencies": { + "hashish": "~0.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap ./test/*.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-optimist.git" + }, + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.4" + }, + "readme": "# DEPRECATION NOTICE\n\nI don't want to maintain this module anymore since I just use\n[minimist](https://npmjs.org/package/minimist), the argument parsing engine,\ndirectly instead nowadays.\n\nSee [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed\nsuccessor to optimist.\n\n[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs)\n\nYou should also consider [nomnom](https://github.com/harthur/nomnom).\n\noptimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/node-optimist/issues" + }, + "homepage": "https://github.com/substack/node-optimist", + "_id": "optimist@0.6.1", + "dist": { + "shasum": "86c5849b8c390c6382bb5cc018a417daad2a9065" + }, + "_from": "optimist@~0.6.0", + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/readme.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/readme.markdown new file mode 100644 index 0000000..b74b437 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/readme.markdown @@ -0,0 +1,513 @@ +# DEPRECATION NOTICE + +I don't want to maintain this module anymore since I just use +[minimist](https://npmjs.org/package/minimist), the argument parsing engine, +directly instead nowadays. + +See [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed +successor to optimist. + +[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs) + +You should also consider [nomnom](https://github.com/harthur/nomnom). + +optimist +======== + +Optimist is a node.js library for option parsing for people who hate option +parsing. More specifically, this module is for people who like all the --bells +and -whistlz of program usage but think optstrings are a waste of time. + +With optimist, option parsing doesn't have to suck (as much). + +[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist) + +examples +======== + +With Optimist, the options are just a hash! No optstrings attached. +------------------------------------------------------------------- + +xup.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} +```` + +*** + + $ ./xup.js --rif=55 --xup=9.52 + Buy more riffiwobbles + + $ ./xup.js --rif 12 --xup 8.1 + Sell the xupptumblers + +![This one's optimistic.](http://substack.net/images/optimistic.png) + +But wait! There's more! You can do short options: +------------------------------------------------- + +short.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +```` + +*** + + $ ./short.js -x 10 -y 21 + (10,21) + +And booleans, both long and short (and grouped): +---------------------------------- + +bool.js: + +````javascript +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); +```` + +*** + + $ ./bool.js -s + The cat says: meow + + $ ./bool.js -sp + The cat says: meow. + + $ ./bool.js -sp --fr + Le chat dit: miaou. + +And non-hypenated options too! Just use `argv._`! +------------------------------------------------- + +nonopt.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); +```` + +*** + + $ ./nonopt.js -x 6.82 -y 3.35 moo + (6.82,3.35) + [ 'moo' ] + + $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz + (0.54,1.12) + [ 'foo', 'bar', 'baz' ] + +Plus, Optimist comes with .usage() and .demand()! +------------------------------------------------- + +divide.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); +```` + +*** + + $ ./divide.js -x 55 -y 11 + 5 + + $ node ./divide.js -x 4.91 -z 2.51 + Usage: node ./divide.js -x [num] -y [num] + + Options: + -x [required] + -y [required] + + Missing required arguments: y + +EVEN MORE HOLY COW +------------------ + +default_singles.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_singles.js -x 5 + 15 + +default_hash.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_hash.js -y 7 + 17 + +And if you really want to get all descriptive about it... +--------------------------------------------------------- + +boolean_single.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv); +```` + +*** + + $ ./boolean_single.js -v foo bar baz + true + [ 'bar', 'baz', 'foo' ] + +boolean_double.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); +```` + +*** + + $ ./boolean_double.js -x -z one two three + [ true, false, true ] + [ 'one', 'two', 'three' ] + +Optimist is here to help... +--------------------------- + +You can describe parameters for help messages and set aliases. Optimist figures +out how to format a handy help string automatically. + +line_count.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); +```` + +*** + + $ node line_count.js + Count the lines in a file. + Usage: node ./line_count.js + + Options: + -f, --file Load a file [required] + + Missing required arguments: f + + $ node line_count.js --file line_count.js + 20 + + $ node line_count.js -f line_count.js + 20 + +methods +======= + +By itself, + +````javascript +require('optimist').argv +````` + +will use `process.argv` array to construct the `argv` object. + +You can pass in the `process.argv` yourself: + +````javascript +require('optimist')([ '-x', '1', '-y', '2' ]).argv +```` + +or use .parse() to do the same thing: + +````javascript +require('optimist').parse([ '-x', '1', '-y', '2' ]) +```` + +The rest of these methods below come in just before the terminating `.argv`. + +.alias(key, alias) +------------------ + +Set key names as equivalent such that updates to a key will propagate to aliases +and vice-versa. + +Optionally `.alias()` can take an object that maps keys to aliases. + +.default(key, value) +-------------------- + +Set `argv[key]` to `value` if no option was specified on `process.argv`. + +Optionally `.default()` can take an object that maps keys to default values. + +.demand(key) +------------ + +If `key` is a string, show the usage information and exit if `key` wasn't +specified in `process.argv`. + +If `key` is a number, demand at least as many non-option arguments, which show +up in `argv._`. + +If `key` is an Array, demand each element. + +.describe(key, desc) +-------------------- + +Describe a `key` for the generated usage information. + +Optionally `.describe()` can take an object that maps keys to descriptions. + +.options(key, opt) +------------------ + +Instead of chaining together `.alias().demand().default()`, you can specify +keys in `opt` for each of the chainable methods. + +For example: + +````javascript +var argv = require('optimist') + .options('f', { + alias : 'file', + default : '/etc/passwd', + }) + .argv +; +```` + +is the same as + +````javascript +var argv = require('optimist') + .alias('f', 'file') + .default('f', '/etc/passwd') + .argv +; +```` + +Optionally `.options()` can take an object that maps keys to `opt` parameters. + +.usage(message) +--------------- + +Set a usage message to show which commands to use. Inside `message`, the string +`$0` will get interpolated to the current script name or node command for the +present script similar to how `$0` works in bash or perl. + +.check(fn) +---------- + +Check that certain conditions are met in the provided arguments. + +If `fn` throws or returns `false`, show the thrown error, usage information, and +exit. + +.boolean(key) +------------- + +Interpret `key` as a boolean. If a non-flag option follows `key` in +`process.argv`, that string won't get set as the value of `key`. + +If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be +`false`. + +If `key` is an Array, interpret all the elements as booleans. + +.string(key) +------------ + +Tell the parser logic not to interpret `key` as a number or boolean. +This can be useful if you need to preserve leading zeros in an input. + +If `key` is an Array, interpret all the elements as strings. + +.wrap(columns) +-------------- + +Format usage output to wrap at `columns` many columns. + +.help() +------- + +Return the generated usage string. + +.showHelp(fn=console.error) +--------------------------- + +Print the usage data using `fn` for printing. + +.parse(args) +------------ + +Parse `args` instead of `process.argv`. Returns the `argv` object. + +.argv +----- + +Get the arguments as a plain old object. + +Arguments without a corresponding flag show up in the `argv._` array. + +The script name or node command is available at `argv.$0` similarly to how `$0` +works in bash or perl. + +parsing tricks +============== + +stop parsing +------------ + +Use `--` to stop parsing flags and stuff the remainder into `argv._`. + + $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4 + { _: [ '-c', '3', '-d', '4' ], + '$0': 'node ./examples/reflect.js', + a: 1, + b: 2 } + +negate fields +------------- + +If you want to explicity set a field to false instead of just leaving it +undefined or to override a default you can do `--no-key`. + + $ node examples/reflect.js -a --no-b + { _: [], + '$0': 'node ./examples/reflect.js', + a: true, + b: false } + +numbers +------- + +Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to +one. This way you can just `net.createConnection(argv.port)` and you can add +numbers out of `argv` with `+` without having that mean concatenation, +which is super frustrating. + +duplicates +---------- + +If you specify a flag multiple times it will get turned into an array containing +all the values in order. + + $ node examples/reflect.js -x 5 -x 8 -x 0 + { _: [], + '$0': 'node ./examples/reflect.js', + x: [ 5, 8, 0 ] } + +dot notation +------------ + +When you use dots (`.`s) in argument names, an implicit object path is assumed. +This lets you organize arguments into nested objects. + + $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5 + { _: [], + '$0': 'node ./examples/reflect.js', + foo: { bar: { baz: 33 }, quux: 5 } } + +short numbers +------------- + +Short numeric `head -n5` style argument work too: + + $ node reflect.js -n123 -m456 + { '3': true, + '6': true, + _: [], + '$0': 'node ./reflect.js', + n: 123, + m: 456 } + +installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + npm install optimist + +or clone this project on github: + + git clone http://github.com/substack/node-optimist.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + +inspired By +=========== + +This module is loosely inspired by Perl's +[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_.js new file mode 100644 index 0000000..d9c58b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_.js @@ -0,0 +1,71 @@ +var spawn = require('child_process').spawn; +var test = require('tap').test; + +test('dotSlashEmpty', testCmd('./bin.js', [])); + +test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); + +test('nodeEmpty', testCmd('node bin.js', [])); + +test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); + +test('whichNodeEmpty', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', []) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + assert.error(err); + t.end(); + }); +}); + +test('whichNodeArgs', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); +}); + +function testCmd (cmd, args) { + + return function (t) { + var to = setTimeout(function () { + assert.fail('Never got stdout data.') + }, 5000); + + var oldDir = process.cwd(); + process.chdir(__dirname + '/_'); + + var cmds = cmd.split(' '); + + var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); + process.chdir(oldDir); + + bin.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); + + bin.stdout.on('data', function (buf) { + clearTimeout(to); + var _ = JSON.parse(buf.toString()); + t.same(_.map(String), args.map(String)); + t.end(); + }); + }; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/argv.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/argv.js new file mode 100644 index 0000000..3d09606 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/argv.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log(JSON.stringify(process.argv)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/bin.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/bin.js new file mode 100755 index 0000000..4a18d85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/_/bin.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('../../index').argv +console.log(JSON.stringify(argv._)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/dash.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/dash.js new file mode 100644 index 0000000..af8ed6f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/dash.js @@ -0,0 +1,31 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-', function (t) { + t.plan(5); + t.deepEqual( + fix(optimist.parse([ '-n', '-' ])), + { n: '-', _: [] } + ); + t.deepEqual( + fix(optimist.parse([ '-' ])), + { _: [ '-' ] } + ); + t.deepEqual( + fix(optimist.parse([ '-f-' ])), + { f: '-', _: [] } + ); + t.deepEqual( + fix(optimist([ '-b', '-' ]).boolean('b').argv), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + fix(optimist([ '-s', '-' ]).string('s').argv), + { s: '-', _: [] } + ); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse.js new file mode 100644 index 0000000..d320f43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse.js @@ -0,0 +1,446 @@ +var optimist = require('../index'); +var path = require('path'); +var test = require('tap').test; + +var $0 = 'node ./' + path.relative(process.cwd(), __filename); + +test('short boolean', function (t) { + var parse = optimist.parse([ '-b' ]); + t.same(parse, { b : true, _ : [], $0 : $0 }); + t.same(typeof parse.b, 'boolean'); + t.end(); +}); + +test('long boolean', function (t) { + t.same( + optimist.parse([ '--bool' ]), + { bool : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('bare', function (t) { + t.same( + optimist.parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 } + ); + t.end(); +}); + +test('short group', function (t) { + t.same( + optimist.parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short group next', function (t) { + t.same( + optimist.parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short captures', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture sp', function (t) { + t.same( + optimist.parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture eq', function (t) { + t.same( + optimist.parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end() +}); + +test('long captures sp', function (t) { + t.same( + optimist.parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long captures eq', function (t) { + t.same( + optimist.parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('no', function (t) { + t.same( + optimist.parse([ '--no-moo' ]), + { moo : false, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('multi', function (t) { + t.same( + optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [], $0 : $0 } + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.same( + optimist.parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ], + $0 : $0 + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = optimist.parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789', + ]); + t.same(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ], + $0 : $0 + }); + t.same(typeof argv.x, 'number'); + t.same(typeof argv.y, 'number'); + t.same(typeof argv.z, 'number'); + t.same(typeof argv.w, 'string'); + t.same(typeof argv.hex, 'number'); + t.same(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv; + t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 }); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true']) + .boolean(['t', 'verbose']).default('verbose', true).argv; + + t.same(parse, { + verbose: false, + t: true, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var parse = optimist(['moo']) + .boolean(['t', 'verbose']) + .default('verbose', false) + .default('t', false).argv; + + t.same(parse, { + verbose: false, + t: false, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ]) + .boolean(['x','y','z']).argv; + + t.same(parse, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ], + $0 : $0 + }); + + t.same(typeof parse.x, 'boolean'); + t.same(typeof parse.y, 'boolean'); + t.same(typeof parse.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = optimist.parse([ '-s', "X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = optimist.parse([ "--s=X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + t.end(); +}); + +test('strings' , function (t) { + var s = optimist([ '-s', '0001234' ]).string('s').argv.s; + t.same(s, '0001234'); + t.same(typeof s, 'string'); + + var x = optimist([ '-x', '56' ]).string('x').argv.x; + t.same(x, '56'); + t.same(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = optimist([ ' ', ' ' ]).string('_').argv._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + optimist.parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.same( + optimist.parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', 'zoom') + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', [ 'zm', 'zoom' ]) + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('boolean default true', function (t) { + var argv = optimist.options({ + sometrue: { + boolean: true, + default: true + } + }).argv; + + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = optimist.options({ + somefalse: { + boolean: true, + default: false + } + }).argv; + + t.equal(argv.somefalse, false); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = optimist([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]).argv; + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + }, + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('herp') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('herp') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .options(opts) + .argv; + var propertyArgv = optimist(regular).options(opts).argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('h') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('h') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = optimist(['--boool', '--other=false']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse_modified.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse_modified.js new file mode 100644 index 0000000..a57dc84 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/parse_modified.js @@ -0,0 +1,14 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = optimist().boolean('b').parse([ '-b', '123' ]); + t.deepEqual(fix(argv), { b: true, _: ['123'] }); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/short.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/short.js new file mode 100644 index 0000000..b2c38ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/short.js @@ -0,0 +1,16 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-n123', function (t) { + t.plan(1); + var parse = optimist.parse([ '-n123' ]); + t.equal(parse.n, 123); +}); + +test('-123', function (t) { + t.plan(3); + var parse = optimist.parse([ '-123', '456' ]); + t.equal(parse['1'], true); + t.equal(parse['2'], true); + t.equal(parse['3'], 456); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/usage.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/usage.js new file mode 100644 index 0000000..300454c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/usage.js @@ -0,0 +1,292 @@ +var Hash = require('hashish'); +var optimist = require('../index'); +var test = require('tap').test; + +test('usageFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'Options:', + ' -x [required]', + ' -y [required]', + 'Missing required arguments: y', + ] + ); + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + + +test('usagePass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkPass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'You forgot about -y' + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('checkCondPass', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkCondFail', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/).join('\n'), + 'Usage: ./usage -x NUM -y NUM\n' + + 'Argument check failed: ' + checker.toString() + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('countPass', function (t) { + var r = checkUsage(function () { + return optimist('1 2 3 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same(r, { + result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('countFail', function (t) { + var r = checkUsage(function () { + return optimist('1 2 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same( + r.result, + { _ : [ '1', '2' ], moo : true, $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage [x] [y] [z] {OPTIONS}', + 'Not enough non-option arguments: got 2, need at least 3', + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('defaultSingles', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70 --powsy'.split(' ')) + .default('foo', 5) + .default('bar', 6) + .default('baz', 7) + .argv + ; + }); + t.same(r.result, { + foo : '50', + bar : 6, + baz : '70', + powsy : true, + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultAliases', function (t) { + var r = checkUsage(function () { + return optimist('') + .alias('f', 'foo') + .default('f', 5) + .argv + ; + }); + t.same(r.result, { + f : '5', + foo : '5', + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultHash', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70'.split(' ')) + .default({ foo : 10, bar : 20, quux : 30 }) + .argv + ; + }); + t.same(r.result, { + _ : [], + $0 : './usage', + foo : 50, + baz : 70, + bar : 20, + quux : 30, + }); + t.end(); +}); + +test('rebase', function (t) { + t.equal( + optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'), + './foo/bar/baz' + ); + t.equal( + optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'), + '../../..' + ); + t.equal( + optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'), + '../pow/zoom.txt' + ); + t.end(); +}); + +function checkUsage (f) { + + var exit = false; + + process._exit = process.exit; + process._env = process.env; + process._argv = process.argv; + + process.exit = function (t) { exit = true }; + process.env = Hash.merge(process.env, { _ : 'node' }); + process.argv = [ './usage' ]; + + var errors = []; + var logs = []; + + console._error = console.error; + console.error = function (msg) { errors.push(msg) }; + console._log = console.log; + console.log = function (msg) { logs.push(msg) }; + + var result = f(); + + process.exit = process._exit; + process.env = process._env; + process.argv = process._argv; + + console.error = console._error; + console.log = console._log; + + return { + errors : errors, + logs : logs, + exit : exit, + result : result, + }; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/whitespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/whitespace.js new file mode 100644 index 0000000..90b9075 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/optimist/test/whitespace.js @@ -0,0 +1,8 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = optimist.parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/package.json new file mode 100644 index 0000000..d1bd576 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/package.json @@ -0,0 +1,43 @@ +{ + "name": "bower-config", + "version": "0.4.5", + "description": "The Bower config reader and writer.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/config/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/config.git" + }, + "main": "lib/Config", + "homepage": "http://bower.io", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "graceful-fs": "~2.0.0", + "mout": "~0.6.0", + "optimist": "~0.6.0", + "osenv": "0.0.3" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config)\n\nThe Bower config reader and writer. \nThe config spec can be read [here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/).\n\n\n## Usage\n\n#### .load()\n\nLoads the bower configuration from the configuration files.\n\n\n#### .get(key)\n\nReturns a configuration value by `key`. \nKeys with dots are supported to access deep values.\n\n\n#### .set(key, value)\n\nSets a configuration value for `key`. \nKeys with dots are supported to set deep values.\n\n\n#### .del(key)\n\nRemoves configuration named `key`. \nKeys with dots are supported to delete deep keys.\n\n\n#### .save(where, callback)\n\nSaves changes to `where`. \nThe `where` argument can be a path to a configuration file or:\n\n- `local` to save it in the configured current working directory (defaulting to `process.cwd`)\n- `user` to save it in the configuration file located in the home directory\n\n\n#### .toObject()\n\nReturns a deep copy of the underlying configuration object. \nThe returned configuration is normalised. \nThe object keys will be camelCase.\n\n\n#### #create(cwd)\n\nObtains a instance where `cwd` is the current working directory (defaults to `process.cwd`);\n\n```js\nvar config = require('bower-config').create();\n// You can also specify a working directory\nvar config2 = require('bower-config').create('./some/path');\n```\n\n\n#### #read(cwd)\n\nAlias for:\n\n```js\nvar configObject = (new Config(cwd)).load().toJson();\n```\n\n\n#### #normalise(config)\n\nReturns a new normalised config object based on `config`. \nObject keys will be converted to camelCase.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/config/issues" + }, + "_id": "bower-config@0.4.5", + "_from": "bower-config@~0.4.3" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/test/test.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.editorconfig b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.editorconfig new file mode 100644 index 0000000..a882442 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.jshintrc new file mode 100644 index 0000000..1bf396d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.jshintrc @@ -0,0 +1,63 @@ +{ + "predef": [ + "console", + "require", + "define", + "describe", + "it", + "before", + "beforeEach", + "after", + "afterEach" + ], + + "node": true, + "devel": true, + + "bitwise": true, + "curly": true, + "eqeqeq": false, + "forin": false, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": true, + "undef": true, + "unused": true, + "quotmark": "single", + "strict": true, + "trailing": true, + + "asi": false, + "boss": false, + "debug": false, + "eqnull": true, + "es5": false, + "esnext": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": false, + "laxcomma": false, + "loopfunc": true, + "multistr": false, + "onecase": true, + "regexdash": false, + "scripturl": false, + "smarttabs": false, + "shadow": false, + "sub": false, + "supernew": false, + "validthis": false, + + "nomen": false, + "onevar": false, + "white": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.npmignore new file mode 100644 index 0000000..27ccd66 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.* diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.travis.yml new file mode 100644 index 0000000..2ca91f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/LICENSE new file mode 100644 index 0000000..92b561c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 IndigoUnited + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/README.md new file mode 100644 index 0000000..5abc16c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/README.md @@ -0,0 +1,50 @@ +# request-replay [![Build Status](https://secure.travis-ci.org/IndigoUnited/node-request-replay.png)](http://travis-ci.org/IndigoUnited/node-request-replay.png) + +Replays a [request](https://github.com/mikeal/request) when a network error occurs using the [retry](https://github.com/felixge/node-retry) module. + +**DO NOT** use this module if you are piping `request` instances. +If you are listening to `data` events to buffer, beware that you must reset everything when a `replay` occurs. +This is why `pipping` is not supported. + + +## Installation + +`$ npm install request-replay` + + +## Usage + +```js +var fs = require('fs'); +var request = require('request'); +var replay = require('request-replay'); + +// Note that the options argument is optional +// Accepts the same options the retry module does and an additional +// errorCodes array that default to ['EADDRINFO', 'ETIMEDOUT', 'ECONNRESET', 'ESOCKETTIMEDOUT'] +replay(request('http://google.com/doodle.png', function (err, response, body) { + // Do things +}), { + retries: 10, + factor: 3 +}) +.on('replay', function (replay) { + // "replay" is an object that contains some useful information + console.log('request failed: ' + replay.error.code + ' ' + replay.error.message); + console.log('replay nr: #' + replay.number); + console.log('will retry in: ' + replay.delay + 'ms') +}) +``` + +Note that the default retry options are modified to be more appropriate for requests: + +* `retries`: The maximum amount of times to retry the operation. Default is `5`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The amount of time before starting the first retry. Default is `2000`. +* `maxTimeout`: The maximum amount of time between two retries. Default is `35000`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `true`. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/index.js new file mode 100644 index 0000000..cd77c65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/index.js @@ -0,0 +1,95 @@ +'use strict'; + +var retry = require('retry'); + +var errorCodes = [ + 'EADDRINFO', + 'ETIMEDOUT', + 'ECONNRESET', + 'ESOCKETTIMEDOUT' +]; + +function mixIn(dst, src) { + var key; + + for (key in src) { + dst[key] = src[key]; + } + + return dst; +} + +function requestReplay(request, options) { + var originalEmit = request.emit; + var operation; + var timeout; + var retrying = false; + var attempts = 0; + + // Default options + options = mixIn({ + errorCodes: errorCodes, + retries: 5, + factor: 2, + minTimeout: 1000, + maxTimeout: 35000, + randomize: true + }, options || {}); + + // Init retry + operation = retry.operation(options); + operation.attempt(function () { + retrying = false; + + if (attempts) { + request.init(); + request.start(); + } + + attempts++; + }); + + // Increase maxListeners because start() adds a new listener each time + request._maxListeners += options.retries + 1; + + // Monkey patch emit to catch errors and retry + request.emit = function (name, error) { + // If name is replay, pass-through + if (name === 'replay') { + return originalEmit.apply(this, arguments); + } + + // Do not emit anything if we are retrying + if (retrying) { + return; + } + + // If not a retry error code, pass-through + if (name !== 'error' || options.errorCodes.indexOf(error.code) === -1) { + return originalEmit.apply(this, arguments); + } + + timeout = operation._timeouts[0]; + + // Retry + if (operation.retry(error)) { + retrying = true; + request.abort(); + request._aborted = false; + this.emit('replay', { + number: attempts - 1, + error: error, + delay: timeout + }); + return 0; + } + + // No more retries available, error out + error.replays = attempts - 1; + return originalEmit.apply(this, arguments); + }; + + return request; +} + +module.exports = requestReplay; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/package.json new file mode 100644 index 0000000..35c06a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/package.json @@ -0,0 +1,42 @@ +{ + "name": "request-replay", + "version": "0.2.0", + "description": "Replays a request when a network error occurs", + "main": "index.js", + "dependencies": { + "retry": "~0.6.0" + }, + "devDependencies": { + "mocha": "~1.12.0", + "expect.js": "~0.2.0", + "request": "~2" + }, + "scripts": { + "test": "mocha -R spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/IndigoUnited/node-request-replay" + }, + "bugs": { + "url": "http://github.com/IndigoUnited/node-request-replay/issues" + }, + "keywords": [ + "retry", + "replay", + "request", + "mikeal", + "network" + ], + "author": { + "name": "IndigoUnited", + "email": "hello@indigounited.com", + "url": "http://indigounited.com" + }, + "license": "MIT", + "readme": "# request-replay [![Build Status](https://secure.travis-ci.org/IndigoUnited/node-request-replay.png)](http://travis-ci.org/IndigoUnited/node-request-replay.png)\n\nReplays a [request](https://github.com/mikeal/request) when a network error occurs using the [retry](https://github.com/felixge/node-retry) module.\n\n**DO NOT** use this module if you are piping `request` instances.\nIf you are listening to `data` events to buffer, beware that you must reset everything when a `replay` occurs.\nThis is why `pipping` is not supported.\n\n\n## Installation\n\n`$ npm install request-replay`\n\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar request = require('request');\nvar replay = require('request-replay');\n\n// Note that the options argument is optional\n// Accepts the same options the retry module does and an additional\n// errorCodes array that default to ['EADDRINFO', 'ETIMEDOUT', 'ECONNRESET', 'ESOCKETTIMEDOUT']\nreplay(request('http://google.com/doodle.png', function (err, response, body) {\n // Do things\n}), {\n retries: 10,\n factor: 3\n})\n.on('replay', function (replay) {\n // \"replay\" is an object that contains some useful information\n console.log('request failed: ' + replay.error.code + ' ' + replay.error.message);\n console.log('replay nr: #' + replay.number);\n console.log('will retry in: ' + replay.delay + 'ms')\n})\n```\n\nNote that the default retry options are modified to be more appropriate for requests:\n\n* `retries`: The maximum amount of times to retry the operation. Default is `5`.\n* `factor`: The exponential factor to use. Default is `2`.\n* `minTimeout`: The amount of time before starting the first retry. Default is `2000`.\n* `maxTimeout`: The maximum amount of time between two retries. Default is `35000`.\n* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `true`.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/IndigoUnited/node-request-replay", + "_id": "request-replay@0.2.0", + "_from": "request-replay@~0.2.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/test/test.js new file mode 100644 index 0000000..182d689 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/test/test.js @@ -0,0 +1,68 @@ +'use strict'; + +var http = require('http'); +var request = require('request'); +var expect = require('expect.js'); +var replay = require('../'); + +describe('request-replay', function () { + it('should replay on network error', function (next) { + replay(request.get('http://somedomainthatwillneverexistforsure.com:8089', function (error) { + expect(error).to.be.an(Error); + expect(error.code).to.equal('ENOTFOUND'); + expect(error.replays).to.equal(5); + next(); + }), { + errorCodes: ['ENOTFOUND'], + factor: 1, + minTimeout: 10, + maxTimeout: 10 + }); + }); + + it('should succeed if first fails but one of others succeed', function (next) { + this.timeout(15000); + + replay(request.get('http://127.0.0.1:8089', { json: true }, function (error, response, body) { + expect(error).to.be(null); + expect(response).to.be.ok(); + expect(body).to.eql({ 'foo': 'bar' }); + next(); + }), { + errorCodes: ['ENOTFOUND', 'ECONNREFUSED'] + }) + .on('replay', function () { + http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end('{ "foo": "bar" }'); + }) + .listen(8089, '127.0.0.1'); + }); + }); + + it('should fire a replay event on each retry', function (next) { + var stream; + var tries = 0; + + stream = replay(request.get('http://somedomainthatwillneverexistforsure.com:8089', function (error) { + expect(error).to.be.an(Error); + expect(error.code).to.equal('ENOTFOUND'); + expect(error.replays).to.equal(5); + next(); + }), { + errorCodes: ['ENOTFOUND'], + factor: 1, + minTimeout: 10, + maxTimeout: 10, + randomize: false + }) + .on('replay', function (replay) { + expect(replay).to.be.an('object'); + expect(replay.number).to.equal(tries); + expect(replay.error).to.be.an(Error); + expect(replay.error.code).to.equal('ENOTFOUND'); + expect(replay.delay).to.be(10); + tries++; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/package.json new file mode 100644 index 0000000..60e36a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/package.json @@ -0,0 +1,56 @@ +{ + "name": "bower-registry-client", + "version": "0.1.6", + "description": "Provides easy interaction with the Bower registry.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/registry-client/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/registry-client.git" + }, + "main": "Client", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "async": "~0.2.8", + "bower-config": "~0.4.3", + "graceful-fs": "~2.0.0", + "lru-cache": "~2.3.0", + "request": "~2.27.0", + "request-replay": "~0.2.0", + "rimraf": "~2.2.0", + "mkdirp": "~0.3.5" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "grunt": "~0.4.1", + "grunt-contrib-watch": "~0.5.0", + "grunt-contrib-jshint": "~0.6.0", + "grunt-simple-mocha": "~0.4.0", + "mocha": "~1.12.0", + "nock": "~0.22.0" + }, + "scripts": { + "test": "grunt test" + }, + "readme": "# bower-registry-client [![Build Status](https://secure.travis-ci.org/bower/registry-client.png?branch=master)](http://travis-ci.org/bower/registry-client)\n\nThis module allows you to easily interact with the Bower server API.\n\n\n## Usage\n\n```js\n\nvar RegistryClient = require('bower-registry-client');\nvar registry = new RegistryClient(options, logger);\n```\n\nThe `logger` is optional and is expected to be an instance of the bower [logger](https://github.com/bower/logger). \nAvailable constructor options:\n\n- `cache`: the cache folder to use for some operations; using null will disable persistent cache (defaults to bower registry cache folder)\n- `registry.search`: an array of registry search endpoints (defaults to the Bower server)\n- `registry.register`: the endpoint to use when registering packages (defaults to the Bower server)\n- `registry.publish`: the endpoint to use when publishing packages (defaults to the Bower server)\n- `ca.search`: an array of CA certificates for each registry.search (defaults to null).\n- `ca.register`: the CA certificate for registry.register\n- `ca.publish`: the CA certificate for registry.publish\n- `proxy`: the proxy to use for http requests (defaults to null)\n- `httpsProxy`: the proxy to use for https requests (defaults to null)\n- `strictSsl`: whether or not to do SSL key validation when making requests via https (defaults to true).\n- `userAgent`: the user agent to use for the requests (defaults to null)\n- `timeout`: the timeout for the requests to finish (defaults to 60000)\n- `force`: If set to true, cache will be bypassed and remotes will always be hit (defaults to false).\n- `offline`: If set to true, only the cache will be used (defaults to false).\n\n\nNote that `force` and `offline` are mutually exclusive.\nThe cache will speedup operations such as `list`, `lookup` and `search`.\nDifferent operations may have different cache expiration times.\n\n\n#### .lookup(name, callback)\n\nLooks the registry for the package `name`,\n\n```js\nregistry.lookup('jquery', function (err, entry) {\n if (err) {\n console.error(err.message);\n return;\n }\n\n // For now resp.type is always 'alias'\n console.log('type', entry.type);\n console.log('url', entry.url);\n});\n```\n\n#### .register(name, url, callback)\n\nRegisters a package in the registry.\n\n```js\nregistry.register('my-package', 'git://github.com/my-org/my-package.git', function (err, pkg) {\n if (err) {\n console.error(err.message);\n return;\n }\n\n console.log('name', pkg.name);\n console.log('url: ', pkg.url);\n});\n```\n\n#### .search(str, callback)\n\nSearches the registry.\n\n```js\nregistry.search('jquery', function (err, results) {\n if (err) {\n console.error(err.message);\n return;\n }\n\n results.forEach(function (pkg) {\n console.log('name', pkg.name);\n console.log('url', pkg.url);\n });\n});\n```\n\n#### .clearCache(name, callback)\n\nClears the persistent and runtime cache associated with the `name` package. \nIf `name` is null, clears the cache for every package.\n\nNote that in most cases, you don't need to clear the cache since it has\nself expiration times.\n\n```js\n// Clear jquery cache\nregistry.clearCache('jquery', function (err) {\n if (err) {\n console.error(err.message);\n return;\n }\n\n console.log('Done');\n});\n\n// Clear all cache\nregistry.clearCache(function (err) {\n if (err) {\n console.error(err.message);\n return;\n }\n\n console.log('Done');\n});\n```\n\n\n#### .resetCache()\n\nClears the in-memory cache used to speed up the instance.\n\nNote that in most cases, you don't need to clear the runtime cache since it has\nself expiration times.\nMight be useful if you use this module in long-living programs.\n\n```js\nregistry.resetCache();\n```\n\n#### #clearRuntimeCache()\n\nClears the in-memory cache used to speed up the whole module.\nThis clears the static in-memory cache as well as in-memory cache used by instances.\n\nNote that in edge cases, some instance's in-memory cache might be skipped.\nIf that's a problem, you should create fresh instances instead.\n\n```js\nRegistryClient.clearRuntimeCache();\n```\n\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/registry-client/issues" + }, + "homepage": "https://github.com/bower/registry-client", + "_id": "bower-registry-client@0.1.6", + "dist": { + "shasum": "c3ae74a98f24f50a373bbcb0ef443558be01d4b7" + }, + "_from": "bower-registry-client@~0.1.4", + "_resolved": "https://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.1.6.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/Client.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/Client.js new file mode 100644 index 0000000..bae6bbf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/Client.js @@ -0,0 +1,613 @@ +var RegistryClient = require('../Client'); +var fs = require('fs'); +var expect = require('expect.js'); +var md5 = require('../lib/util/md5'); +var nock = require('nock'); +var http = require('http'); + +describe('RegistryClient', function () { + beforeEach(function () { + this.uri = 'https://bower.herokuapp.com'; + this.timeoutVal = 5000; + this.registry = new RegistryClient({ + strictSsl: false, + timeout: this.timeoutVal + }); + this.conf = { + search: [this.uri], + register: this.uri, + publish: this.uri + }; + }); + + describe('Constructor', function () { + describe('instantiating a client', function () { + it('should provide an instance of RegistryClient', function () { + expect(this.registry instanceof RegistryClient).to.be.ok; + }); + + it('should set default registry config', function () { + expect(this.registry._config.registry).to.eql(this.conf); + }); + + it('should set default search config', function () { + expect(this.registry._config.registry.search[0]).to.eql(this.uri); + }); + + it('should set default register config', function () { + expect(this.registry._config.registry.register).to.eql(this.uri); + }); + + it('should set default publish config', function () { + expect(this.registry._config.registry.publish).to.eql(this.uri); + }); + + it('should set default cache path config', function () { + expect(typeof this.registry._config.cache === 'string').to.be.ok; + }); + + it('should set default timeout config', function () { + expect(this.registry._config.timeout).to.eql(this.timeoutVal); + }); + + it('should set default strictSsl config', function () { + expect(this.registry._config.strictSsl).to.be(false); + }); + }); + + it('should have a lookup prototype method', function () { + expect(RegistryClient.prototype).to.have.property('lookup'); + }); + + it('should have a search prototype method', function () { + expect(RegistryClient.prototype).to.have.property('search'); + }); + + it('should have a list prototype method', function () { + expect(RegistryClient.prototype).to.have.property('list'); + }); + + it('should have a register prototype method', function () { + expect(RegistryClient.prototype).to.have.property('register'); + }); + + it('should have a clearCache prototype method', function () { + expect(RegistryClient.prototype).to.have.property('clearCache'); + }); + + it('should have a resetCache prototype method', function () { + expect(RegistryClient.prototype).to.have.property('resetCache'); + }); + + it('should have a clearRuntimeCache static method', function () { + expect(RegistryClient).to.have.property('clearRuntimeCache'); + }); + }); + + describe('instantiating a client with custom options', function () { + describe('offline', function () { + it('should not return search results if cache is empty', function (next) { + // TODO: this test should be made individually for search, list and lookup + this.registry.clearCache(function () { + this.registry._config.offline = true; + this.registry.search('jquery', function (err, results) { + expect(err).to.be(null); + expect(results.length).to.eql(0); + next(); + }); + }.bind(this)); + }); + }); + + describe('cache', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/search/jquery') + .replyWithFile(200, __dirname + '/fixtures/search.json'); + + this.client = new RegistryClient({ + cache: __dirname + '/cache', + strictSsl: false + }); + + this.cacheDir = this.client._config.cache; + this.host = 'bower.herokuapp.com'; + this.method = 'search'; + this.pkg = 'jquery'; + + this.path = this.cacheDir + '/' + this.host + '/' + this.method + '/' + this.pkg + '_' + md5(this.pkg).substr(0, 5); + }); + + afterEach(function (next) { + this.client.clearCache(next); + }); + + it('should fill cache', function (next) { + var self = this; + + // fill cache + self.client.search(self.pkg, function (err, results) { + expect(err).to.be(null); + expect(results.length).to.eql(334); + + // check for cache existence + fs.exists(self.path, function (exists) { + expect(exists).to.be(true); + next(); + }); + }); + + }); + + it('should read results from cache', function (next) { + var self = this; + + self.client.search(self.pkg, function (err, results) { + expect(err).to.be(null); + expect(results.length).to.eql(334); + + fs.exists(self.path, function (exists) { + expect(exists).to.be(true); + next(); + }); + }); + }); + }); + }); + + + // + // lookup + // + describe('calling the lookup instance method with argument', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/jquery') + .reply(200, { + name: 'jquery', + url: 'git://github.com/components/jquery.git' + }); + + this.registry._config.force = true; + }); + + it('should not return an error', function (next) { + this.registry.lookup('jquery', function (err) { + expect(err).to.be(null); + next(); + }); + }); + + it('should return entry type', function (next) { + this.registry.lookup('jquery', function (err, entry) { + expect(err).to.be(null); + expect(entry.type).to.eql('alias'); + next(); + }); + }); + + it('should return entry url ', function (next) { + this.registry.lookup('jquery', function (err, entry) { + expect(err).to.be(null); + expect(entry.url).to.eql('git://github.com/components/jquery.git'); + }); + next(); + }); + }); + + describe('calling the lookup instance method with three registries', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/jquery') + .reply(404); + + nock('http://custom-registry.com') + .get('/packages/jquery') + .reply(200, { + name: 'jquery', + url: 'git://github.com/foo/bar' + }); + + nock('http://custom-registry2.com') + .get('/packages/jquery') + .reply(200, { + name: 'jquery', + url: 'git://github.com/foo/baz' + }); + + this.registry = new RegistryClient({ + strictSsl: false, + force: true, + registry: { + search: [ + 'https://bower.herokuapp.com', + 'http://custom-registry.com', + 'http://custom-registry2.com' + ] + } + }); + }); + + it('should return entry type', function (next) { + this.registry.lookup('jquery', function (err, entry) { + expect(err).to.be(null); + expect(entry).to.be.an('object'); + expect(entry.type).to.eql('alias'); + next(); + }); + }); + + it('should return entry url ', function (next) { + this.registry.lookup('jquery', function (err, entry) { + expect(err).to.be(null); + expect(entry).to.be.an('object'); + expect(entry.url).to.eql('git://github.com/foo/bar'); + next(); + }); + }); + + it('should respect order', function (next) { + this.registry._config.registry.search = [ + 'https://bower.herokuapp.com', + 'http://custom-registry2.com', + 'http://custom-registry.com' + ]; + + this.registry.lookup('jquery', function (err, entry) { + expect(err).to.be(null); + expect(entry).to.be.an('object'); + expect(entry.url).to.eql('git://github.com/foo/baz'); + next(); + }); + }); + }); + + describe('calling the lookup instance method without argument', function () { + it('should return no result', function (next) { + this.registry.lookup('', function (err, entry) { + expect(err).to.not.be.ok(); + expect(entry).to.not.be.ok(); + next(); + }); + }); + }); + + // + // register + // + describe('calling the register instance method with argument', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .post('/packages', 'name=test-ba&url=git%3A%2F%2Fgithub.com%2Ftest-ba%2Ftest-ba.git') + .reply(201); + + this.pkg = 'test-ba'; + this.pkgUrl = 'git://github.com/test-ba/test-ba.git'; + }); + + it('should not return an error', function (next) { + this.registry.register(this.pkg, this.pkgUrl, function (err) { + expect(err).to.be(null); + next(); + }); + }); + + it('should return entry name', function (next) { + var self = this; + + this.registry.register(this.pkg, this.pkgUrl, function (err, entry) { + expect(err).to.be(null); + expect(entry.name).to.eql(self.pkg); + next(); + }); + }); + + it('should return entry url', function (next) { + var self = this; + + this.registry.register(this.pkg, this.pkgUrl, function (err, entry) { + expect(err).to.be(null); + expect(entry.url).to.eql(self.pkgUrl); + next(); + }); + }); + }); + + describe('calling the register instance method without arguments', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .post('/packages', 'name=&url=') + .reply(400); + }); + + it('should return an error and no result', function (next) { + this.registry.register('', '', function (err, entry) { + expect(err).to.be.an(Error); + expect(entry).to.be(undefined); + next(); + }); + }); + }); + + + // + // search + // + describe('calling the search instance method with argument', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/search/jquery') + .replyWithFile(200, __dirname + '/fixtures/search.json'); + + this.pkg = 'jquery'; + this.pkgUrl = 'git://github.com/components/jquery.git'; + + this.registry._config.force = true; + }); + + it('should not return an error', function (next) { + this.registry.search(this.pkg, function (err) { + expect(err).to.be(null); + next(); + }); + }); + + it('should return entry name', function (next) { + var self = this; + + this.registry.search(this.pkg, function (err, results) { + var found = results.some(function (entry) { + return entry.name === self.pkg; + }); + + expect(found).to.be(true); + next(); + }); + }); + + it('should return entry url', function (next) { + var self = this; + + this.registry.search(this.pkg, function (err, results) { + var found = results.some(function (entry) { + return entry.url === self.pkgUrl; + }); + + expect(found).to.be(true); + next(); + }); + }); + }); + + describe('calling the search instance method with two registries', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/search/jquery') + .reply(200, []); + + nock('http://custom-registry.com') + .get('/packages/search/jquery') + .reply(200, [ + { + name: 'jquery', + url: 'git://github.com/bar/foo.git' + } + ]); + + this.pkg = 'jquery'; + this.pkgUrl = 'git://github.com/bar/foo.git'; + + this.registry = new RegistryClient({ + strictSsl: false, + force: true, + registry: { + search: [ + 'https://bower.herokuapp.com', + 'http://custom-registry.com' + ] + } + }); + }); + + it('should return entry name', function (next) { + var self = this; + + this.registry.search(this.pkg, function (err, results) { + var found = results.some(function (entry) { + return entry.name === self.pkg; + }); + + expect(found).to.be(true); + next(); + }); + }); + + it('should return entry url', function (next) { + var self = this; + + this.registry.search(this.pkg, function (err, results) { + if (! results.length) { + return next(new Error('Result expected')); + } + + var found = results.some(function (entry) { + return entry.url === self.pkgUrl; + }); + + expect(found).to.be(true); + next(); + }); + }); + }); + + describe('calling the search instance method without argument', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages/search/') + .reply(404); + }); + + it('should return an error and no results', function (next) { + this.registry.search('', function (err, results) { + expect(err).to.be.an(Error); + expect(results).to.be(undefined); + next(); + }); + }); + }); + + // + // list + // + describe('calling the list instance method', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages') + .reply(200, [], {}); + + this.registry._config.force = true; + }); + + it('should not return an error', function (next) { + this.registry.list(function (err) { + expect(err).to.be(null); + next(); + }); + }); + + it('should return results array', function (next) { + this.registry.list(function (err, results) { + expect(results).to.be.an('array'); + next(); + }); + }); + + }); + + describe('calling the list instance method with two registries', function () { + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages') + .reply(200, []); + + nock('http://custom-registry.com') + .get('/packages') + .reply(200, [ + { + name: 'jquery', + url: 'git://github.com/bar/foo.git' + } + ]); + + this.registry = new RegistryClient({ + strictSsl: false, + force: true, + registry: { + search: [ + 'https://bower.herokuapp.com', + 'http://custom-registry.com' + ] + } + }); + }); + + it('should return entry name', function (next) { + var self = this; + + this.registry.list(function (err, results) { + var found = results.some(function (entry) { + return entry.name === self.pkg; + }); + + expect(found).to.be(true); + next(); + }); + }); + + it('should return entry url', function (next) { + var self = this; + + this.registry.list(function (err, results) { + if (! results.length) { + return next(new Error('Result expected')); + } + + var found = results.some(function (entry) { + return entry.url === self.pkgUrl; + }); + + expect(found).to.be(true); + next(); + }); + }); + }); + + describe('calling the list instance method', function () { + + beforeEach(function () { + nock('https://bower.herokuapp.com:443') + .get('/packages') + .reply(200, [], {}); + }); + + it('should return an error and no results', function (next) { + this.registry.list(function (err) { + expect(err).to.be(null); + next(); + }); + }); + }); + + // + // clearCache + // + describe('called the clearCache instance method with argument', function () { + beforeEach(function () { + this.pkg = 'jquery'; + }); + + it('should not return an error', function (next) { + this.registry.clearCache(this.pkg, function (err) { + expect(err).to.be(null); + next(); + }); + }); + }); + + describe('called the clearCache instance method without argument', function () { + it('should not return any errors and remove all cache items', function (next) { + this.registry.clearCache(function (err) { + expect(err).to.be(null); + next(); + }); + }); + }); + + // + // test userAgent + // + describe('add a custom userAgent with argument',function(){ + this.timeout(5000); + it('should send custom userAgent to the server',function(next){ + var self = this; + this.ua = ''; + this.server = http.createServer(function (req, res) { + self.ua = req.headers['user-agent']; + res.writeHeader(200,{ + 'Content-Type':'application/json' + }); + res.end('{"name":"jquery","url":"git://github.com/components/jquery.git"}'); + self.server.close(); + }); + this.server.listen('7777', '127.0.0.1'); + this.registry = new RegistryClient({ + userAgent:'test agent', + registry:'http://127.0.0.1:7777' + }); + this.registry.search('jquery', function (err,result) { + expect(self.ua).to.be('test agent'); + next(); + }); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/index.js new file mode 100644 index 0000000..1536a51 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/index.js @@ -0,0 +1,22 @@ +var index = require('../../lib/index'); +var expect = require('expect.js'); + +describe('index module', function () { + describe('requiring the index module', function () { + it('should expose a lookup method', function () { + expect(index.lookup).to.be.ok; + }); + + it('should expose a list method', function () { + expect(index.list).to.be.ok; + }); + + it('should expose a register method', function () { + expect(index.register).to.be.ok; + }); + + it('should expose a search method', function () { + expect(index.search).to.be.ok; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/list.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/list.js new file mode 100644 index 0000000..39f92e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/list.js @@ -0,0 +1,25 @@ +var list = require('../../lib/list'); +var expect = require('expect.js'); + +describe('list module', function () { + describe('requiring the list module', function () { + it('should expose a list method', function () { + expect(typeof list === 'function').to.be.ok; + }); + + it('should expose a initCache method', function () { + expect(list.initCache).to.be.ok; + expect(typeof list.initCache === 'function').to.be.ok; + }); + + it('should expose a clearCache method', function () { + expect(list.clearCache).to.be.ok; + expect(typeof list.clearCache === 'function').to.be.ok; + }); + + it('should expose a resetCache method', function () { + expect(list.resetCache).to.be.ok; + expect(typeof list.resetCache === 'function').to.be.ok; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/lookup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/lookup.js new file mode 100644 index 0000000..e730698 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/lookup.js @@ -0,0 +1,25 @@ +var lookup = require('../../lib/lookup'); +var expect = require('expect.js'); + +describe('lookup module', function () { + describe('requiring the lookup module', function () { + it('should expose a lookup method', function () { + expect(typeof lookup === 'function').to.be.ok; + }); + + it('should expose a initCache method', function () { + expect(lookup.initCache).to.be.ok; + expect(typeof lookup.initCache === 'function').to.be.ok; + }); + + it('should expose a clearCache method', function () { + expect(lookup.clearCache).to.be.ok; + expect(typeof lookup.clearCache === 'function').to.be.ok; + }); + + it('should expose a resetCache method', function () { + expect(lookup.resetCache).to.be.ok; + expect(typeof lookup.resetCache === 'function').to.be.ok; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/register.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/register.js new file mode 100644 index 0000000..1180b8a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/register.js @@ -0,0 +1,10 @@ +var register = require('../../lib/register'); +var expect = require('expect.js'); + +describe('register module', function () { + describe('requiring the register module', function () { + it('should expose a register method', function () { + expect(typeof register === 'function').to.be.ok; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/search.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/search.js new file mode 100644 index 0000000..8a6285d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/search.js @@ -0,0 +1,25 @@ +var search = require('../../lib/search'); +var expect = require('expect.js'); + +describe('search module', function () { + describe('requiring the search module', function () { + it('should expose a search method', function () { + expect(typeof search === 'function').to.be.ok; + }); + + it('should expose a initCache method', function () { + expect(search.initCache).to.be.ok; + expect(typeof search.initCache === 'function').to.be.ok; + }); + + it('should expose a clearCache method', function () { + expect(search.clearCache).to.be.ok; + expect(typeof search.clearCache === 'function').to.be.ok; + }); + + it('should expose a resetCache method', function () { + expect(search.resetCache).to.be.ok; + expect(typeof search.resetCache === 'function').to.be.ok; + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/Cache.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/Cache.js new file mode 100644 index 0000000..702957f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/Cache.js @@ -0,0 +1,49 @@ +var Cache = require('../../../lib/util/Cache'); +var expect = require('expect.js'); + +describe('Cache', function () { + beforeEach(function () { + this.cache = new Cache(); + }); + + describe('Constructor', function () { + describe('instantiating cache', function () { + it('should provide an instance of RegistryClient', function () { + expect(this.cache instanceof Cache).to.be.ok; + }); + + it('should inherit LRU cache methods', function () { + var self = this, + lruMethods = [ + 'max', 'lengthCalculator', 'length', 'itemCount', 'forEach', + 'keys', 'values', 'reset', 'dump', 'dumpLru', 'set', 'has', + 'get', 'peek', 'del' + ]; + + lruMethods.forEach(function (method) { + expect(self.cache._cache).to.have.property(method); + }); + }); + }); + + it('should have a get prototype method', function () { + expect(Cache.prototype).to.have.property('get'); + }); + + it('should have a set prototype method', function () { + expect(Cache.prototype).to.have.property('set'); + }); + + it('should have a del prototype method', function () { + expect(Cache.prototype).to.have.property('del'); + }); + + it('should have a clear prototype method', function () { + expect(Cache.prototype).to.have.property('clear'); + }); + + it('should have a reset prototype method', function () { + expect(Cache.prototype).to.have.property('reset'); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js new file mode 100644 index 0000000..a01031d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/core/util/createError.js @@ -0,0 +1,35 @@ +var createError = require('../../../lib/util/createError'); +var expect = require('expect.js'); + +describe('createError', function () { + + beforeEach(function () { + this.err = createError('message', 500); + }); + + describe('requiring the createError module', function () { + + it('should expose a createError method', function () { + expect(typeof createError === 'function').to.be.ok; + }); + + }); + + describe('invoking createError', function () { + + it('should return a new Error Object', function () { + expect(typeof createError() === 'object').to.be.ok; + }); + + it('should return an Error with message', function () { + expect(this.err.message).to.eql('message'); + }); + + it('should return an Error with code', function () { + expect(this.err.code).to.eql(500); + }); + + }); + + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/fixtures/search.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/fixtures/search.json new file mode 100644 index 0000000..2cbebc9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/fixtures/search.json @@ -0,0 +1 @@ +[{"name":"jquery","url":"git://github.com/components/jquery.git"},{"name":"jquery-ui","url":"git://github.com/components/jqueryui"},{"name":"jquery.cookie","url":"git://github.com/carhartl/jquery-cookie.git"},{"name":"jquery-placeholder","url":"git://github.com/mathiasbynens/jquery-placeholder.git"},{"name":"jasmine-jquery","url":"git://github.com/velesin/jasmine-jquery"},{"name":"jquery-file-upload","url":"git://github.com/blueimp/jQuery-File-Upload.git"},{"name":"jquery-waypoints","url":"git://github.com/imakewebthings/jquery-waypoints.git"},{"name":"jquery-pjax","url":"git://github.com/defunkt/jquery-pjax.git"},{"name":"jquery.scrollTo","url":"git://github.com/flesler/jquery.scrollTo.git"},{"name":"jquery.ui","url":"git://github.com/jquery/jquery-ui.git"},{"name":"jquery.validation","url":"git://github.com/jzaefferer/jquery-validation.git"},{"name":"jquery.sticky","url":"git://github.com/yatskevich/sticky.git"},{"name":"jquery-mousewheel","url":"git://github.com/brandonaaron/jquery-mousewheel.git"},{"name":"jquery.transit","url":"git://github.com/rstacruz/jquery.transit.git"},{"name":"jquery-form","url":"git://github.com/malsup/form.git"},{"name":"jquery-autosize","url":"git://github.com/jackmoore/autosize.git"},{"name":"jquery-masonry","url":"git://github.com/desandro/masonry"},{"name":"jquery-timeago","url":"git://github.com/rmm5t/jquery-timeago.git"},{"name":"jquery.tablesorter","url":"git://github.com/Mottie/tablesorter.git"},{"name":"jquery-color","url":"git://github.com/jquery/jquery-color.git"},{"name":"jquery-easing","url":"git://github.com/rajkissu/jquery-easing.git"},{"name":"jquery-migrate","url":"git://github.com/appleboy/jquery-migrate.git"},{"name":"jqueryui-touch-punch","url":"git://github.com/furf/jquery-ui-touch-punch.git"},{"name":"chai-jquery","url":"git://github.com/chaijs/chai-jquery.git"},{"name":"jquery-mobile","url":"git://github.com/jquery/jquery-mobile.git"},{"name":"jquery-minicolors","url":"git://github.com/claviska/jquery-miniColors.git"},{"name":"jquery.cycle","url":"git://github.com/kertal/cycle"},{"name":"jquery-filedrop","url":"git://github.com/weixiyen/jquery-filedrop.git"},{"name":"jquery-powertip","url":"git://github.com/stevenbenner/jquery-powertip.git"},{"name":"jquery-nicescroll","url":"git://github.com/inuyaksa/jquery.nicescroll.git"},{"name":"jquery-ui-touch-punch","url":"git://github.com/functino/jquery-ui-touch-punch.git"},{"name":"jquery.stellar","url":"git://github.com/markdalgleish/stellar.js.git"},{"name":"jquery.colorbox","url":"git://github.com/jackmoore/colorbox.git"},{"name":"jquery.watermark","url":"git://github.com/chiefy/jQuery-Watermark"},{"name":"jquery.maskedinput","url":"git://github.com/gustavohenke/jquery.maskedinput"},{"name":"jqjquery-wysibb","url":"git://github.com/wbb/WysiBB.git"},{"name":"jquery-serialize-object","url":"git://github.com/macek/jquery-serialize-object.git"},{"name":"jquery.lazyload","url":"git://github.com/tuupola/jquery_lazyload.git"},{"name":"embedly-jquery","url":"git://github.com/embedly/embedly-jquery.git"},{"name":"jquery-mockjax","url":"git://github.com/appendto/jquery-mockjax"},{"name":"jquery.uniform","url":"git://github.com/pixelmatrix/uniform.git"},{"name":"jquery-tmpl","url":"git://github.com/jquery/jquery-tmpl.git"},{"name":"jquery.form","url":"git://github.com/chiefy/form.git"},{"name":"jqueryuibootstrap","url":"git://github.com/addyosmani/jquery-ui-bootstrap.git"},{"name":"jquery.tools","url":"git://github.com/jquerytools/jquerytools.git"},{"name":"jquery.smooth-scroll","url":"git://github.com/kswedberg/jquery-smooth-scroll.git"},{"name":"jquery-mobile-angular-adapter","url":"git://github.com/tigbro/jquery-mobile-angular-adapter.git"},{"name":"jquery-ui-bootstrap","url":"git://github.com/gustavohenke/jquery-ui-bootstrap"},{"name":"jquery.tagsinput","url":"git://github.com/xoxco/jQuery-Tags-Input.git"},{"name":"jquery-grill","url":"git://github.com/peterpajchl/jquery-grill.git"},{"name":"jquery-simpleweather","url":"git://github.com/monkeecreate/jquery.simpleWeather"},{"name":"jquery.atwho","url":"git://github.com/ichord/At.js.git"},{"name":"jquery-timepicker-jt","url":"git://github.com/jonthornton/jquery-timepicker.git"},{"name":"jquery.jscrollpane","url":"git://github.com/blittle/jscrollpane.git"},{"name":"jquery.localScroll","url":"git://github.com/flesler/jquery.localScroll.git"},{"name":"jqueryjs","url":"git://github.com/bowerjs/jquery.git"},{"name":"jquery-idletimer","url":"git://github.com/mikesherov/jquery-idletimer.git"},{"name":"jquery.event.swipe","url":"git://github.com/stephband/jquery.event.swipe.git"},{"name":"jquery.event.move","url":"git://github.com/stephband/jquery.event.move.git"},{"name":"jquery.serialScroll","url":"git://github.com/flesler/jquery.serialScroll.git"},{"name":"jquery.autoellipsis","url":"git://github.com/pvdspek/jquery.autoellipsis.git"},{"name":"jquery-cycle","url":"git://github.com/malsup/cycle.git"},{"name":"jquery-bridget","url":"git://github.com/desandro/jquery-bridget.git"},{"name":"jquery-knob","url":"git://github.com/aterrien/jQuery-Knob"},{"name":"jquery-tiny-pubsub","url":"git://github.com/wixo/jquery-tiny-pubsub.git"},{"name":"jquery-galleria","url":"git://github.com/aino/galleria.git"},{"name":"jquery.slimscroll","url":"git://github.com/rochal/jQuery-slimScroll/"},{"name":"jquery-hoverIntent","url":"git://github.com/briancherne/jquery-hoverIntent.git"},{"name":"jquery-autocomplete","url":"git://github.com/trendalytics/bower-jquery-autocomplete.git"},{"name":"jquerypp","url":"git://github.com/bitovi/jquerypp.git"},{"name":"cometd-javascript-jquery","url":"git://github.com/marksherretta/cometd-javascript-jquery.git"},{"name":"jquery.expander","url":"git://github.com/kswedberg/jquery-expander.git"},{"name":"geonames-server-jquery-plugin","url":"git://github.com/alchemy-fr/GeonamesServer-jQuery-Plugin.git"},{"name":"jquery.flip","url":"git://github.com/roncioso/Flip-jQuery.git"},{"name":"jquery-validation.password","url":"git://github.com/jzaefferer/jquery-validation.password.git"},{"name":"jquery-whenall","url":"git://github.com/soundcloud/jquery-whenall"},{"name":"wookmark-jquery","url":"git://github.com/GBKS/Wookmark-jQuery.git"},{"name":"jquery-ujs","url":"git://github.com/rails/jquery-ujs.git"},{"name":"jquery-drilldown","url":"git://github.com/Cinamonas/jquery-drilldown.git"},{"name":"jquery-resize","url":"git://github.com/cowboy/jquery-resize.git"},{"name":"jquery-modal","url":"git://github.com/kylefox/jquery-modal.git"},{"name":"jquery-timepicker","url":"git://github.com/fgelinas/timepicker.git"},{"name":"jquery-requestAnimationFrame","url":"git://github.com/gnarf37/jquery-requestAnimationFrame.git"},{"name":"jquery-touchswipe","url":"git://github.com/mattbryson/TouchSwipe-Jquery-Plugin.git"},{"name":"jquery-bgiframe","url":"git://github.com/brandonaaron/bgiframe.git"},{"name":"jquery-metadata","url":"git://github.com/jquery/jquery-metadata"},{"name":"jquery-bootstrap-scripting","url":"git://github.com/Nikku/jquery-bootstrap-scripting.git"},{"name":"spinjs-jquery","url":"git://gist.github.com/1290439.git"},{"name":"jquery-backstretch","url":"git://github.com/srobbin/jquery-backstretch.git"},{"name":"jquery-ellipsis","url":"git://github.com/STAR-ZERO/jquery-ellipsis.git"},{"name":"jquery-linkify","url":"git://github.com/maranomynet/linkify.git"},{"name":"jquery-nod","url":"git://github.com/casperin/nod.git"},{"name":"jquery-validation","url":"git://github.com/niftylettuce/jquery-validation.git"},{"name":"jquery-dragndrop","url":"git://github.com/Cinamonas/jquery-dragndrop.git"},{"name":"cometd-js-jquery","url":"git://github.com/askarby/cometd-js-jquery"},{"name":"jquery-cycle2","url":"git://github.com/malsup/cycle2.git"},{"name":"jquery.animate-enhanced","url":"git://github.com/benbarnett/jQuery-Animate-Enhanced.git"},{"name":"jquery-crop","url":"git://github.com/Cinamonas/jquery-crop.git"},{"name":"jquery-multiselect","url":"git://github.com/dio-el-claire/jquery-multiselect"},{"name":"jquery.shuffle","url":"git://github.com/caphun/jquery.shuffle.git"},{"name":"jquery-rotate","url":"git://github.com/schickling/jquery-rotate"},{"name":"jquery-overscroll","url":"git://github.com/azoff/Overscroll"},{"name":"jquery.customSelect","url":"git://github.com/adamcoulombe/jquery.customSelect.git"},{"name":"jquery-throttle-debounce","url":"git://github.com/cowboy/jquery-throttle-debounce.git"},{"name":"jquery-browser-selector","url":"git://github.com/schickling/jquery-browser-selector"},{"name":"jquery.videobackground","url":"git://github.com/georgepaterson/jquery-videobackground.git"},{"name":"jquery-serializeObject","url":"git://github.com/gillesruppert/jquery-serializeObject"},{"name":"jquery-address","url":"git://github.com/asual/jquery-address.git"},{"name":"jquery.atmosphere","url":"git://github.com/blittle/atmosphere.git"},{"name":"jquery-zclip","url":"git://github.com/patricklodder/jquery-zclip.git"},{"name":"jquery-oauthpopup","url":"git://github.com/MfgLabs/jquery-oauthpopup.git"},{"name":"jquery.DataTables","url":"git://github.com/UnityTeam/DataTables.git"},{"name":"jquery-cardify","url":"git://github.com/mverhaagen/cardify.git"},{"name":"jquery-extended-selectors","url":"git://github.com/keithclark/JQuery-Extended-Selectors.git"},{"name":"jquery-dropout-menu","url":"git://github.com/psirenny/jquery-dropout-menu.git"},{"name":"jquery-colorbox","url":"git://github.com/jackmoore/colorbox"},{"name":"bootstrap-jquery-tags","url":"git://github.com/sunliwen/bootstrap-jquery-tags.git"},{"name":"zepto-as-jquery","url":"git://github.com/pleasedontbelong/zepto.git"},{"name":"jquery-simulate","url":"git://github.com/jquery/jquery-simulate.git"},{"name":"jquery-simple-slider","url":"git://github.com/loopj/jquery-simple-slider.git"},{"name":"jquery.scrollorama","url":"git://github.com/johnpolacek/scrollorama.git"},{"name":"jquery.videoBG","url":"git://github.com/sydlawrence/jquery.videoBG.git"},{"name":"buster-jquery-assertions","url":"git://github.com/blittle/buster-jquery-assertions.git"},{"name":"jquery2","url":"git://github.com/iki/jquery2.git"},{"name":"jquery.center.js","url":"git://github.com/bebraw/jquery.center.js"},{"name":"jquery-jsonp","url":"git://github.com/jaubourg/jquery-jsonp.git"},{"name":"jquery.customInput","url":"git://github.com/bmatzner/jQuery-Custom-Input.git"},{"name":"jquery.socialshareprivacy","url":"git://github.com/patrickheck/socialshareprivacy.git"},{"name":"jquery-zoom","url":"git://github.com/jackmoore/zoom.git"},{"name":"jquery-marcopolo","url":"git://github.com/jstayton/jquery-marcopolo"},{"name":"jquery.easy-pie-chart","url":"git://github.com/rendro/easy-pie-chart.git"},{"name":"jquery.blockUI","url":"git://github.com/malsup/blockui#~2.55.0-2013.01.23"},{"name":"jquery-localize","url":"git://github.com/davidchambers/jQuery.localize.git"},{"name":"jquery.dform","url":"git://github.com/daffl/jquery.dform.git"},{"name":"jakobmattsson-jquery-elastic","url":"git://github.com/jakobmattsson/jquery-elastic"},{"name":"jquery.svg","url":"git://github.com/apendleton/jquery-svg.git"},{"name":"jquery-Mustache","url":"git://github.com/jonnyreeves/jquery-Mustache.git"},{"name":"jquery-transition","url":"git://github.com/peteboere/jquery-transition.git"},{"name":"jquery-prestige","url":"git://github.com/Munter/jquery-prestige.git"},{"name":"rxjs-jquery","url":"git://github.com/Reactive-Extensions/rxjs-jquery"},{"name":"jquery.ajax.fake","url":"git://github.com/anasnakawa/jquery.ajax.fake.git"},{"name":"jquery.backgroundSize","url":"git://github.com/louisremi/jquery.backgroundSize.js.git"},{"name":"jqueryui-amd","url":"git://github.com/jrburke/jqueryui-amd.git"},{"name":"jquery.tinymce","url":"git://github.com/rsilve/jquery.tinymce.git"},{"name":"jquery-number","url":"git://github.com/teamdf/jquery-number"},{"name":"zepto-replace-jquery","url":"git://github.com/iki/zepto-replace-jquery.git"},{"name":"jquery.query.js","url":"git://github.com/plasticine/jquery.query.js.git"},{"name":"jquery-image-uploader","url":"git://github.com/jdeniau/jquery-image-uploader.git"},{"name":"jquery-popover","url":"git://github.com/klaas4/jQuery.popover.git"},{"name":"jquery-grab-bag","url":"git://github.com/panayi/jquery-grab-bag.git"},{"name":"jqueryui-selectmenu","url":"git://github.com/pixeldrew/jqueryui-selectmenu.git"},{"name":"jskit-jquery","url":"git://github.com/kctang/jskit-jquery.git"},{"name":"jquery.hotkeys","url":"git://github.com/tzuryby/jquery.hotkeys.git"},{"name":"jquery.colorpicker","url":"git://github.com/vanderlee/colorpicker"},{"name":"jquery.spinjs","url":"git://github.com/tdoherty/jQuery.SpinJS.git"},{"name":"jquery-mobile-events","url":"git://github.com/caseywebdev/jquery-mobile-events"},{"name":"jquery-transform","url":"git://github.com/louisremi/jquery.transform.js.git"},{"name":"jquery-maskedinputs","url":"git://github.com/digitalBush/jquery.maskedinput.git"},{"name":"jquery-sortable","url":"git://github.com/johnny/jquery-sortable.git"},{"name":"jquery-imagefit-plugin","url":"git://github.com/cbulock/jquery-imagefit-plugin.git"},{"name":"jquery.unslider","url":"git://github.com/idiot/unslider.git"},{"name":"jquery-caret","url":"git://github.com/DrPheltRight/jquery-caret.git"},{"name":"jquery-hashchange","url":"git://github.com/cowboy/jquery-hashchange.git"},{"name":"jquery-ui-touch-punch-amd","url":"git://github.com/GeneralElectric/jquery-ui-touch-punch.git"},{"name":"jquery-dropkick","url":"git://github.com/JamieLottering/DropKick.git"},{"name":"jquery-async","url":"git://github.com/panayi/jquery-async.git"},{"name":"jquery.columnizer","url":"git://github.com/adamwulf/Columnizer-jQuery-Plugin.git"},{"name":"stacknav.jquery.js","url":"git://github.com/EtienneDion/stacknav.jquery.js.git"},{"name":"jquery.autotab","url":"git://github.com/map7/jquery.autotab"},{"name":"jquery.placeholder","url":"git://github.com/matoilic/jquery.placeholder.git"},{"name":"jquery-dropkick2","url":"git://github.com/changalberto/DropKick"},{"name":"jquery-simple-touch","url":"git://github.com/marcol/jquery-touch.git"},{"name":"quicksandpaginated.jquery.js","url":"git://github.com/EtienneDion/quicksandpaginated.jquery.js.git"},{"name":"jquery-mobile-reset","url":"git://github.com/bhurlow/jqmobile-reset.git"},{"name":"jquery-relativeTime","url":"git://github.com/hiromitz/jquery-relativeTime.git"},{"name":"jquery-selectboxit","url":"git://github.com/gfranko/jquery.selectBoxIt.js.git"},{"name":"dt-jquery2","url":"git://github.com/dt-bower/dt-jquery.git"},{"name":"jquery.iconfield","url":"git://github.com/yotamofek/jquery.iconfield.git"},{"name":"jquery-dragon","url":"git://github.com/jeremyckahn/dragon.git"},{"name":"jquery-boilerplate","url":"git://github.com/zenorocha/jquery-boilerplate"},{"name":"jquery.TubePlayer","url":"git://github.com/nirvanatikku/jQuery-TubePlayer-Plugin.git"},{"name":"jquery.avgrund","url":"git://github.com/voronianski/jquery.avgrund.js.git"},{"name":"requirejs-jquery","url":"git://github.com/jrburke/require-jquery.git"},{"name":"jquery-popunder","url":"git://github.com/hpbuniat/jquery-popunder.git"},{"name":"jquery.ut-image-panel","url":"git://github.com/urturn/jquery.ut-image-panel.git"},{"name":"inline-svg.jquery.js","url":"git://github.com/jswinarton/inline-svg.jquery.js.git"},{"name":"jquery.mobilemenu","url":"git://github.com/mattkersley/Responsive-Menu.git"},{"name":"jquery.tube","url":"git://github.com/inukshuk/jquery.tube.js.git"},{"name":"jquery-csspick","url":"git://github.com/oscarlgz/jquery-csspick.git"},{"name":"jquery.metadata","url":"git://github.com/jquery-orphans/jquery-metadata.git"},{"name":"jquery-modality","url":"git://github.com/Cinamonas/jquery-modality.git"},{"name":"jquery.loadmask.spin","url":"git://github.com/iloveitaly/jquery.loadmask.spin.git"},{"name":"jquery-md5","url":"git://github.com/placemarker/jQuery-MD5"},{"name":"jquery.mosaicflow","url":"git://github.com/sapegin/jquery.mosaicflow"},{"name":"jquery.inputmask","url":"git://github.com/RobinHerbots/jquery.inputmask.git"},{"name":"jquery.retina","url":"git://github.com/iloveitaly/jQuery-Retina-Display-Plugin.git"},{"name":"jquery-manifest","url":"git://github.com/jstayton/jquery-manifest"},{"name":"jquery-filterer","url":"git://github.com/joelcox/jquery-filterer.git"},{"name":"jquery.fixedheadertable","url":"git://github.com/markmalek/Fixed-Header-Table.git"},{"name":"easyfacebook.jquery.js","url":"git://github.com/EtienneDion/easyfacebook.jquery.js.git"},{"name":"jquery-impromptu","url":"git://github.com/trentrichardson/jQuery-Impromptu.git"},{"name":"jquery.taboverride","url":"git://github.com/wjbryant/jquery.taboverride"},{"name":"jquery.fullscreenBackground","url":"git://github.com/Gaya/Fullscreen-Background-jQuery-plugin.git"},{"name":"jquery-htmlclean","url":"git://github.com/components/jquery-htmlclean.git"},{"name":"jquery-ias","url":"git://github.com/webcreate/infinite-ajax-scroll"},{"name":"jquery.slideShow","url":"git://github.com/appleboy/jquery.slideShow.git"},{"name":"jquery.loadfeed","url":"git://github.com/choage/jQuery.loadFeed.git"},{"name":"jquery.extendedinput.js","url":"git://github.com/Wolfr/jquery.extendedinput.git"},{"name":"jquery.three","url":"git://github.com/makesites/jquery-three.git"},{"name":"jquery-keyfilter","url":"git://github.com/akzhan/jquery-keyfilter.git"},{"name":"bolster.jquerypp","url":"git://github.com/bolster/jquerypp.git"},{"name":"jquery.decodeEntities","url":"git://github.com/michael-lawrence/jquery.decodeEntities.git"},{"name":"jquery-once","url":"git://github.com/RobLoach/jquery-once.git"},{"name":"jquery-dragEvents","url":"git://github.com/icholy/dragEvents.jq.js.git"},{"name":"jquery-ui-touch-punch-working","url":"git://github.com/yeco/jquery-ui-touch-punch.git"},{"name":"jquery-details","url":"git://github.com/mathiasbynens/jquery-details.git"},{"name":"jquery.neotabs.js","url":"git://github.com/PascalPrecht/jquery.neotabs.js"},{"name":"jquery-ajax-progress","url":"git://github.com/englercj/jquery-ajax-progress.git"},{"name":"jquery-ajaxmask","url":"git://github.com/kevbook/jquery-ajaxmask.git"},{"name":"jquery-skim","url":"git://github.com/vormplus/jQuery-Skim.git"},{"name":"jquery-smooth-scrolling","url":"git://github.com/mathiasbynens/jquery-smooth-scrolling.git"},{"name":"jquery.tokko.js","url":"git://github.com/bebraw/jquery.tokko.js"},{"name":"jquery.couch","url":"git://github.com/vkurchatkin/jquery.couch"},{"name":"jquery-fitmaps","url":"git://github.com/suderman/jquery.fitmaps.git"},{"name":"jquery.ut-sticker","url":"git://github.com/urturn/jquery.ut-sticker.git"},{"name":"jquery-indexeddb","url":"git://github.com/axemclion/jquery-indexeddb.git"},{"name":"jquery-store","url":"git://github.com/medialize/jQuery-store.git"},{"name":"jquery.contenteditable","url":"git://github.com/makesites/jquery-contenteditable.git"},{"name":"jquery.combine","url":"git://github.com/seriema/jquery.combine.git"},{"name":"jquery.throttle","url":"git://github.com/wangshijun2010/jquery.throttle.git"},{"name":"jquery.loadHtml","url":"git://github.com/anasnakawa/jquery.loadHtml.git"},{"name":"jquery-ui.daterange","url":"git://github.com/layerssss/jquery-ui.daterange.git"},{"name":"jquery.outbound-analytics","url":"git://github.com/gmurphey/jquery.outbound-analytics"},{"name":"jquery.toc","url":"git://github.com/ndabas/toc"},{"name":"jquery.finger","url":"git://github.com/ngryman/jquery.finger"},{"name":"jquery.sidebar","url":"git://github.com/sideroad/jquery.sidebar.git"},{"name":"jquery.tipFiveThree","url":"git://github.com/gocom/jquery.tipfivethree.git"},{"name":"jquery.textareaAutogrow","url":"git://github.com/Fleshgrinder/jquery.textareaAutogrow.git"},{"name":"iframe-auto-height-jquery-plugin","url":"git://github.com/Sly777/Iframe-Height-Jquery-Plugin"},{"name":"jquery-interdependencies","url":"git://github.com/miohtama/jquery-interdependencies.git"},{"name":"jquery.rdio","url":"git://github.com/rdio/jquery.rdio.js.git"},{"name":"jquery.hurl","url":"git://github.com/makesites/jquery-hurl.git"},{"name":"jquery.pub-sub-validate","url":"git://github.com/wixo/jquery.pub-sub-validate.git"},{"name":"jquery-rdfquery","url":"git://github.com/components/jquery-rdfquery.git"},{"name":"jqueryservice","url":"git://github.com/stephenway/jquery-service.git"},{"name":"jquery.periodical.ajax","url":"git://github.com/rscarvalho/periodicalAjax.git"},{"name":"jquery-lineup","url":"git://github.com/mach3/jquery-lineup"},{"name":"jquery-tinytimer","url":"git://github.com/odyniec/jQuery-tinyTimer.git"},{"name":"jquery-maskmoney","url":"git://github.com/plentz/jquery-maskmoney"},{"name":"jquery.foobar","url":"git://github.com/makesites/jquery-foobar.git"},{"name":"jquery-ajax-goodies","url":"git://github.com/fantactuka/jquery-ajax-goodies.git"},{"name":"jquery-inputevent","url":"git://github.com/dodo/jquery-inputevent.git"},{"name":"jquery.pep","url":"git://github.com/briangonzalez/jquery.pep.js.git"},{"name":"jquery.fly","url":"git://github.com/matjaz/jquery.fly.git"},{"name":"jquery-styledform","url":"git://github.com/jaitsu87/jQuery-StyledForm"},{"name":"jquery.selectalize","url":"git://github.com/unfold/jquery.selectalize"},{"name":"jquery-sieve","url":"git://github.com/rmm5t/jquery-sieve.git"},{"name":"jquery.checkalize","url":"git://github.com/unfold/jquery.checkalize"},{"name":"jquery.trueresize","url":"git://github.com/jfroffice/jquery.trueresize.git"},{"name":"jquery-gholiday","url":"git://github.com/chris4403/gholiday.git"},{"name":"jquery.imageFallback","url":"git://github.com/michael-lawrence/jquery.imageFallback.git"},{"name":"jqueryp","url":"git://github.com/Ensighten/jqueryp.git"},{"name":"jquery.backbone.hijax","url":"git://github.com/michael-lawrence/jquery.backbone.hijax.git"},{"name":"jquery-selectBox","url":"git://github.com/marcj/jquery-selectBox.git"},{"name":"jquery-combobox","url":"git://github.com/jslayer/jquery-combobox.git"},{"name":"jquery.panzoom","url":"git://github.com/timmywil/jquery.panzoom.git"},{"name":"jquery.ui.montjquery.ui.monthpicker","url":"git://github.com/thebrowser/jquery.ui.monthpicker.git"},{"name":"jquery.existence","url":"git://github.com/seriema/jquery.existence.git"},{"name":"jquery.reverse","url":"git://github.com/michael-lawrence/jquery.reverse.git"},{"name":"jquery.render","url":"git://github.com/sideroad/jquery.render.git"},{"name":"strictjquery","url":"git://github.com/devinrhode2/StrictjQuery.js.git"},{"name":"jquery-maptack","url":"git://github.com/jimmyhillis/jquery-maptack"},{"name":"jquery.expanding-textareas","url":"git://github.com/kbrs/ExpandingTextareas.git"},{"name":"jquery.floatingmessage","url":"git://github.com/sideroad/jquery.floatingmessage.git"},{"name":"jquery.removeClassWithPrefix","url":"git://github.com/michael-lawrence/jquery.removeClassWithPrefix.git"},{"name":"jquery.replaceEntities","url":"git://github.com/michael-lawrence/jquery.replaceEntities.git"},{"name":"jquery.accordion","url":"git://github.com/matoilic/jquery.accordion.git"},{"name":"jquery.slidawall","url":"git://github.com/makesites/jquery-slidawall.git"},{"name":"jquery-icon-insert","url":"git://github.com/stephenway/jquery-icon-insert.git"},{"name":"jquery.pluginTemplate","url":"git://github.com/michael-lawrence/jquery.pluginTemplate.git"},{"name":"jquery-m","url":"git://github.com/meetup/jquery.git"},{"name":"jquery.BlackAndWhite","url":"git://github.com/GianlucaGuarini/jQuery.BlackAndWhite.git"},{"name":"jquery.herotabs","url":"git://github.com/simonsmith/jquery.herotabs.git"},{"name":"jquery.payment","url":"git://github.com/stripe/jquery.payment.git"},{"name":"jquery.theCombo.js","url":"git://github.com/lagden/theCombo.git"},{"name":"jquery.shapeshift","url":"git://github.com/McPants/jquery.shapeshift.git"},{"name":"jquery.bind-first","url":"git://github.com/private-face/jquery.bind-first.git"},{"name":"jquery-sheetrock","url":"git://github.com/chriszarate/sheetrock"},{"name":"jquery-reveal","url":"git://github.com/VitalikL/reveal.git"},{"name":"jquery.formstyler","url":"git://github.com/Dimox/formStyler.git"},{"name":"jquery-loader","url":"git://github.com/monkeymonk/jquery.loader.js.git"},{"name":"jquery-placeholder2","url":"git://github.com/jgallen23/jquery-placeholder.git"},{"name":"jquery-bbq-deparam","url":"git://github.com/nexxTM/jquery-deparam.git"},{"name":"eduardocasas-jquery.filestyle","url":"git://github.com/eduardocasas/jquery_filestyle.git"},{"name":"jquery-hoverlight","url":"git://github.com/sunliwen/jquery-hoverlight.git"},{"name":"jquery.autocomplete","url":"git://github.com/julien-c/jQueryAutocompletePlugin.git"},{"name":"jquery-noselect","url":"git://github.com/mathiasbynens/jquery-noselect.git"},{"name":"jqueryui-l2l","url":"git://github.com/krampstudio/jquerui-l2l.git"},{"name":"jquery-tinyscroller","url":"git://github.com/Takazudo/jQuery.tinyscroller.git"},{"name":"jquery.scrollwatch","url":"git://github.com/cobbweb/jquery.scrollwatch.git"},{"name":"jquery-watcher","url":"git://github.com/jacobrelkin/jquery-watcher.git"},{"name":"jquery.editable","url":"git://github.com/shokai/jQuery.editable.git"},{"name":"dt-jquery","url":"git://github.com:dt-bower/dt-jquery.git"},{"name":"jquery-leanmodal","url":"git://github.com/FinelySliced/leanModal.js.git"},{"name":"jquery-esthetic","url":"git://github.com/johannestroeger/bower-jquery-esthetic.git"},{"name":"jquery-truncate","url":"git://github.com/pathable/truncate.git"},{"name":"jquery.theCover.js","url":"git://github.com/lagden/theCover.git"},{"name":"geonames-jquery-plugin","url":"git://github.com:alchemy-fr/GeonamesServer-jQuery-Plugin.git"},{"name":"jquery.html5Loader","url":"git://github.com/GianlucaGuarini/jquery.html5loader.git"},{"name":"jquery-maskedinputs-fork","url":"git://github.com/sergiovilar/jquery.maskedinput.git"},{"name":"jquery-oninput","url":"git://github.com/mathiasbynens/jquery-oninput.git"},{"name":"ed.jquery.toggler","url":"git://github.com/erskinedesign/ed.jquery.toggler.js.git"},{"name":"jquery-textext","url":"git://github.com/alexgorbatchev/jquery-textext.git"},{"name":"bacon-jquery-bindings","url":"git://github.com/raimohanska/bacon-jquery-bindings"},{"name":"jquery-class","url":"git://github.com/iamdenny/jquery-class.git"},{"name":"jquery-alakazam","url":"git://github.com/jasonhowmans/jquery-alakazam.git"},{"name":"jquery-power-plugin","url":"git://github.com/3den/jquery-power-plugin.git"},{"name":"jquery.expandBox","url":"git://bitbucket.org:harobed/jquery.expandbox.git"},{"name":"jquery-polypage","url":"git://github.com/andykent/polypage.git"},{"name":"jquery-visibility","url":"git://github.com/mathiasbynens/jquery-visibility.git"},{"name":"jquery-seeThru","url":"git://github.com/m90/jquery-seeThru.git"},{"name":"jquery-textrange","url":"git://github.com/dwieeb/jquery-textrange.git"},{"name":"jquery.classList","url":"git://github.com/mzgol/jquery.classList.git"},{"name":"jquery.pwstrength","url":"git://github.com/matoilic/jquery.pwstrength.git"},{"name":"jquery-custom-data-attributes","url":"git://github.com/mathiasbynens/jquery-custom-data-attributes.git"},{"name":"jquery-mavis","url":"git://github.com/smallhadroncollider/mavis.git"},{"name":"ed.jquery.plugin.template","url":"git://github.com/erskinedesign/ed.jquery.plugin.template.js.git"},{"name":"jquery-dotdotdot","url":"git://github.com/FrDH/jQuery.dotdotdot.git"},{"name":"jquery-before-after","url":"git://github.com/bencorlett/jquery-before-after.git"},{"name":"jquery-scrollfollow","url":"git://github.com/jackncoke/jquery-scrollfollow.git"},{"name":"jquery-test123123","url":"git://github.com/components/jquery-test123123.git"},{"name":"jquery-ui.datarange.git","url":"git://github.com/layerssss/jquery-ui.datarange.git"},{"name":"jquery-loader-plugin","url":"git://github.com/mimiz/jquery-loader-plugin.git"},{"name":"jquery-transition-guarantee","url":"git://github.com/tuxracer/jquery-transition-guarantee.git"}] diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/runner.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/runner.js new file mode 100644 index 0000000..9481f85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client/test/runner.js @@ -0,0 +1,8 @@ +require('./Client'); +require('./core/search'); +require('./core/register'); +require('./core/lookup'); +require('./core/list'); +require('./core/index'); +require('./core/util/Cache'); +require('./core/util/createError'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.npmignore new file mode 100644 index 0000000..7e2f179 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.npmignore @@ -0,0 +1 @@ +assets diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.travis.yml new file mode 100644 index 0000000..65488b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.10 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/LICENSE new file mode 100644 index 0000000..19c037f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/LICENSE @@ -0,0 +1,23 @@ +Copyright 2012 Thorsten Lorenz. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/README.md new file mode 100644 index 0000000..5c3d5ad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/README.md @@ -0,0 +1,132 @@ +# cardinal [![Build Status](https://secure.travis-ci.org/thlorenz/cardinal.png)](http://travis-ci.org/thlorenz/cardinal) + +[![NPM](https://nodei.co/npm/cardinal.png?downloads=true&stars=true)](https://nodei.co/npm/cardinal/) + +**car·di·nal** *(kärdn-l, kärdnl)* - crested thick-billed North American finch having bright red plumage in the male. + +![screenshot](https://github.com/thlorenz/cardinal/raw/master/assets/screen-shot.png) + +## Features + +- highlights JavaScript code with ANSI colors to improve terminal output +- theming support, see [custom color themes](https://github.com/thlorenz/cardinal/tree/master/themes) +- optionally print line numbers +- API and command line interface (`cdl`) +- `.cardinalrc` config to customize settings +- supports UNIX pipes + +*** + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Installation](#installation) + - [As library](#as-library) + - [As Commandline Tool](#as-commandline-tool) +- [Commandline](#commandline) + - [Highlight a file](#highlight-a-file) + - [As part of a UNIX pipe](#as-part-of-a-unix-pipe) + - [Theme](#theme) +- [API](#api) + - [*highlight(code[, opts])*](#highlightcode-opts) + - [*highlightFileSync(fullPath[, opts])*](#highlightfilesyncfullpath-opts) + - [*highlightFile(fullPath[, opts], callback)*](#highlightfilefullpath-opts-callback) + - [opts](#opts) +- [Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples))](#examples-[browse]https://githubcom/thlorenz/cardinal/tree/master/examples) + + +## Installation + +### As library + + npm install cardinal + +### As Commandline Tool + + [sudo] npm install -g cardinal + +**Note:** + +When installed globally, cardinal exposes itself as the `cdl` command. + +## Commandline + +### Highlight a file + + cdl [options] + +**options**: + - `--nonum`: turns off line number printing (relevant if it is turned on inside `~/.cardinalrc` + +### As part of a UNIX pipe + + cat file.js | grep console | cdl + +**Note:** + +Not all code lines may be parsable JavaScript. In these cases the line is printed to the terminal without +highlighting it. + +### Theme + +The default theme will be used for highlighting. + +To use a different theme, include a `.cardinalrc` file in your `HOME` directory. + +This is a JSON file of the following form: + +```json +{ + "theme": "hide-semicolons", + "linenos": true|false +} +``` + +- `theme` can be the name of any of the [built-in themes](https://github.com/thlorenz/cardinal/tree/master/themes) or the +full path to a custom theme anywhere on your computer. +- linenos toggles line number printing + +## API + +### *highlight(code[, opts])* + +- returns the highlighted version of the passed code ({String}) or throws an error if it was not able to parse it +- opts (see below) + +### *highlightFileSync(fullPath[, opts])* + +- returns the highlighted version of the file whose fullPath ({String}) was passed or throws an error if it was not able + to parse it +- opts (see below) + +### *highlightFile(fullPath[, opts], callback)* + +- calls back with the highlighted version of the file whose fullPath ({String}) was passed or with an error if it was not able + to parse it +- opts (see below) +- `callback` ({Function}) has the following signature: `function (err, highlighted) { .. }` + +### opts + +opts is an {Object} with the following properties: + +- `theme` {Object} is used to optionally override the theme used to highlight +- `linenos` {Boolean} if `true` line numbers are included in the highlighted code +- `firstline` {Integer} sets line number of the first line when line numbers are printed +- `json` {Boolean} if `true` highlights JSON in addition to JavaScript (`true` by default if file extension is `.json`) + +## Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples)) + +- [sample .cardinalrc](https://github.com/thlorenz/cardinal/blob/master/examples/.cardinalrc) +- [highlighting a code snippet](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-string.js) via + ***highlight()*** +- [file that highlights itself](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self.js) via + ***highlightFile()*** including line numbers +- [file that highlights itself hiding all + semicolons](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self-hide-semicolons.js) via + ***highlightFileSync()*** + + + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/cardinal/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/bin/cdl.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/bin/cdl.js new file mode 100755 index 0000000..c58eb08 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/bin/cdl.js @@ -0,0 +1,74 @@ +#!/usr/bin/env node +var cardinal = require('..') + , utl = require('../utl') + , settings = require('../settings') + , args = process.argv + , theme = settings.resolveTheme() + , opts = settings.getSettings() + , highlighted + ; + +opts = opts || {}; +opts.theme = theme; + +function usage() { + var msg = [ + 'Usage: cdl [options]' + , '' + , 'Options (~/.cardinalrc overrides):' + , ' --nonum: turn off line printing' + , '' + , 'Unix Pipe Example: cat filename.js | grep console | cdl' + , '' + ].join('\n'); + console.log(msg); +} + +function highlightFile () { + try { + highlighted = cardinal.highlightFileSync(args[2], opts); + console.log(highlighted); + } catch (e) { + console.trace(); + console.error(e); + } +} + +// E.g., "cardinal myfile.js" +if (args.length === 3) return highlightFile(); + +var opt = args[3]; + +// E.g., "cardinal myfile.js --nonum" +if (opt && opt.indexOf('--') === 0 ) { + if ((/^--(nonum|noline)/i).test(opt)) opts.linenos = false; + else { + usage(); + return console.error('Unknown option: ', opt); + } + + return highlightFile(); +} + + +// UNIX pipes e.g., "cat myfile.js | grep console | cardinal +var stdin = process.stdin + , stdout = process.stdout; + +// line numbers don't make sense when we are printing line by line +opts.linenos = false; + +stdin.setEncoding('utf-8'); +stdin.resume(); +stdin + .on('data', function (chunk) { + chunk.split('\n').forEach(function (line) { + try { + stdout.write(cardinal.highlight(line, opts) + '\n'); + } catch (e) { + // line doesn't represent a valid js snippet and therefore cannot be parsed -> just print as is + stdout.write(line + '\n'); + } + }); + }); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/cardinal.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/cardinal.js new file mode 100644 index 0000000..4df4bb4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/cardinal.js @@ -0,0 +1,5 @@ +module.exports = { + highlight: require('./lib/highlight') + , highlightFile: require('./lib/highlightFile') + , highlightFileSync: require('./lib/highlightFileSync') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/.cardinalrc b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/.cardinalrc new file mode 100644 index 0000000..34be5cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/.cardinalrc @@ -0,0 +1,3 @@ +{ + "theme": "hide-semicolons" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/README.md new file mode 100644 index 0000000..a6c2cd9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/README.md @@ -0,0 +1,7 @@ +# Cardinal Examples + +You can run the examples individually or as a demo: + +- install cardinal: `npm install cardinal` +- explore cardinal: `npm explore cardinal` +- run the demo: `npm run demo` diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-json.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-json.js new file mode 100644 index 0000000..3c06e5d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-json.js @@ -0,0 +1,10 @@ +// This file will highlight the passed code using the custom theme when run via: "node highlight-json" + +var cardinal = require('..'); + +var json = JSON.stringify({ + foo: 'bar', + baz: 'quux' +}); + +console.log(cardinal.highlight(json, {json: true})); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self-hide-semicolons.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self-hide-semicolons.js new file mode 100644 index 0000000..bf2c7d6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self-hide-semicolons.js @@ -0,0 +1,22 @@ + /* + * This file will highlight itself using a custom theme when run via: "node highlight-self-hide-semicolons" + * The custom theme highlights semicolons as 'black', thus hiding them. + */ + +var cardinal = require('..') + , hideSemicolonsTheme = require('../themes/hide-semicolons'); + +function highlight () { + + // Using the synchronous highlightFileSync() + // For asynchronous highlighting use: highlightFile() - see highlight-self.js + + try { + var highlighted = cardinal.highlightFileSync(__filename, hideSemicolonsTheme); + console.log(highlighted); + } catch (err) { + console.error(err); + } +} + +highlight(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self.js new file mode 100644 index 0000000..ceeb599 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-self.js @@ -0,0 +1,16 @@ +// This file will highlight itself using the default theme when run via: "node highlight-self" + +var cardinal = require('..'); + +function highlight () { + + // Using the asynchronous highlightFile() + // For synchronous highlighting use: highlightFileSync() - see highlight-self-hide-semicolons.js + + cardinal.highlightFile(__filename, { linenos: true }, function (err, res) { + if (err) return console.error(err); + console.log(res); + }); +} + +highlight(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-string.js new file mode 100644 index 0000000..dcc7b4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/examples/highlight-string.js @@ -0,0 +1,14 @@ +// This file will highlight the passed code using the custom theme when run via: "node highlight-string" + +var cardinal = require('..'); + +var code = '' + + +function add (a, b) { + var sum = a + b; + return sum; +} + + +''; + +console.log(cardinal.highlight(code)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlight.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlight.js new file mode 100644 index 0000000..9c55e2c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlight.js @@ -0,0 +1,83 @@ +var redeyed = require('redeyed') + , theme = require('../themes/default') + , colors = require('ansicolors') + + , colorSurround = colors.brightBlack + , surroundClose = '\u001b[39m' + ; + +function trimEmptyLines(lines) { + + // remove lines from the end until we find a non-empy one + var line = lines.pop(); + while(!line || !line.length) + line = lines.pop(); + + // put the non-empty line back + if (line) lines.push(line); +} + +function addLinenos (highlightedCode, firstline) { + var highlightedLines = highlightedCode.split('\n'); + + trimEmptyLines(highlightedLines); + + var linesLen = highlightedLines.length + , lines = [] + , totalDigits + , lineno + ; + + function getDigits (n) { + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + // this works for up to 99,999 lines - any questions? + return 5; + } + + function pad (n, totalDigits) { + // not pretty, but simple and should perform quite well + var padDigits= totalDigits - getDigits(n); + switch(padDigits) { + case 0: return '' + n; + case 1: return ' ' + n; + case 2: return ' ' + n; + case 3: return ' ' + n; + case 4: return ' ' + n; + case 5: return ' ' + n; + } + } + + totalDigits = getDigits(linesLen + firstline - 1); + + for (var i = 0; i < linesLen; i++) { + // Don't close the escape sequence here in order to not break multi line code highlights like block comments + lineno = colorSurround(pad(i + firstline, totalDigits) + ': ').replace(surroundClose, ''); + lines.push(lineno + highlightedLines[i]); + } + + return lines.join('\n'); +} + +module.exports = function highlight (code, opts) { + opts = opts || { }; + if (opts.json) { + code = '!\n' + code; + } + try { + + var result = redeyed(code, opts.theme || theme) + , firstline = opts.firstline && !isNaN(opts.firstline) ? opts.firstline : 1; + + if (opts.json) { + result.code = result.code.split('\n').slice(1).join('\n'); + } + + return opts.linenos ? addLinenos(result.code, firstline) : result.code; + } catch (e) { + e.message = 'Unable to perform highlight. The code contained syntax errors: ' + e.message; + throw e; + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFile.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFile.js new file mode 100644 index 0000000..bb3271d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFile.js @@ -0,0 +1,26 @@ +var fs = require('fs') + , highlight = require('./highlight'); + +function isFunction (obj) { + return toString.call(obj) == '[object Function]'; +} + +module.exports = function highlightFile (fullPath, opts, cb) { + if (isFunction(opts)) { + cb = opts; + opts = { }; + } + opts = opts || { }; + if (opts.json !== false && fullPath.match(/\.json$/i)) { + opts.json = true; + } + + fs.readFile(fullPath, 'utf-8', function (err, code) { + if (err) return cb(err); + try { + cb(null, highlight(code, opts)); + } catch (e) { + cb(e); + } + }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFileSync.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFileSync.js new file mode 100644 index 0000000..bc33dd4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/lib/highlightFileSync.js @@ -0,0 +1,11 @@ +var fs = require('fs') + , highlight = require('./highlight'); + +module.exports = function highlightFileSync (fullPath, opts) { + var code = fs.readFileSync(fullPath, 'utf-8'); + opts = opts || { }; + if (opts.json !== false && fullPath.match(/\.json$/i)) { + opts.json = true; + } + return highlight(code, opts); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.npmignore new file mode 100644 index 0000000..a72b52e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.travis.yml new file mode 100644 index 0000000..895dbd3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/LICENSE new file mode 100644 index 0000000..41702c5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/README.md new file mode 100644 index 0000000..30b6a52 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/README.md @@ -0,0 +1,42 @@ +# ansicolors [![build status](https://secure.travis-ci.org/thlorenz/ansicolors.png)](http://next.travis-ci.org/thlorenz/ansicolors) + +Functions that surround a string with ansicolor codes so it prints in color. + +## Installation + + npm install ansicolors + +## Usage + +```js +var colors = require('ansicolors'); + +// foreground colors +var redHerring = colors.red('herring'); +var blueMoon = colors.blue('moon'); +var brighBlueMoon = colors.brightBlue('moon'); + +console.log(redHerring); // this will print 'herring' in red +console.log(blueMoon); // this 'moon' in blue +console.log(brightBlueMoon); // I think you got the idea + +// background colors +console.log(colors.bgYellow('printed on yellow background')); +console.log(colors.bgBrightBlue('printed on bright blue background')); + +// mixing background and foreground colors +// below two lines have same result (order in which bg and fg are combined doesn't matter) +console.log(colors.bgYellow(colors.blue('printed on yellow background in blue'))); +console.log(colors.blue(colors.bgYellow('printed on yellow background in blue'))); +``` + +## Tests + +Look at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: + + npm explore ansicolors && npm test + +## Alternatives + +**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, +I'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/ansicolors.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/ansicolors.js new file mode 100644 index 0000000..b0e18f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/ansicolors.js @@ -0,0 +1,55 @@ +// ColorCodes explained: http://www.termsys.demon.co.uk/vtansi.htm +'use strict'; + +var colorNums = { + white : 37 + , black : 30 + , blue : 34 + , cyan : 36 + , green : 32 + , magenta : 35 + , red : 31 + , yellow : 33 + , brightBlack : 90 + , brightRed : 91 + , brightGreen : 92 + , brightYellow : 93 + , brightBlue : 94 + , brightMagenta : 95 + , brightCyan : 96 + , brightWhite : 97 + } + , backgroundColorNums = { + bgBlack : 40 + , bgRed : 41 + , bgGreen : 42 + , bgYellow : 43 + , bgBlue : 44 + , bgMagenta : 45 + , bgCyan : 46 + , bgWhite : 47 + , bgBrightBlack : 100 + , bgBrightRed : 101 + , bgBrightGreen : 102 + , bgBrightYellow : 103 + , bgBrightBlue : 104 + , bgBrightMagenta : 105 + , bgBrightCyan : 106 + , bgBrightWhite : 107 + } + , colors = {}; + + +Object.keys(colorNums).forEach(function (k) { + colors[k] = function (s) { + return '\u001b[' + colorNums[k] + 'm' + s + '\u001b[39m'; + }; +}); + +Object.keys(backgroundColorNums).forEach(function (k) { + colors[k] = function (s) { + return '\u001b[' + backgroundColorNums[k] + 'm' + s + '\u001b[49m'; + }; +}); + +module.exports = colors; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/package.json new file mode 100644 index 0000000..740025d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/package.json @@ -0,0 +1,34 @@ +{ + "name": "ansicolors", + "version": "0.2.1", + "description": "Functions that surround a string with ansicolor codes so it prints in color.", + "main": "ansicolors.js", + "scripts": { + "test": "node test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/ansicolors.git" + }, + "keywords": [ + "ansi", + "colors", + "highlight", + "string" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "license": "MIT", + "readmeFilename": "README.md", + "gitHead": "858847ca28e8b360d9b70eee0592700fa2ab087d", + "readme": "# ansicolors [![build status](https://secure.travis-ci.org/thlorenz/ansicolors.png)](http://next.travis-ci.org/thlorenz/ansicolors)\n\nFunctions that surround a string with ansicolor codes so it prints in color.\n\n## Installation\n\n npm install ansicolors\n\n## Usage\n\n```js\nvar colors = require('ansicolors');\n\n// foreground colors\nvar redHerring = colors.red('herring');\nvar blueMoon = colors.blue('moon');\nvar brighBlueMoon = colors.brightBlue('moon');\n\nconsole.log(redHerring); // this will print 'herring' in red\nconsole.log(blueMoon); // this 'moon' in blue\nconsole.log(brightBlueMoon); // I think you got the idea\n\n// background colors\nconsole.log(colors.bgYellow('printed on yellow background'));\nconsole.log(colors.bgBrightBlue('printed on bright blue background'));\n\n// mixing background and foreground colors\n// below two lines have same result (order in which bg and fg are combined doesn't matter)\nconsole.log(colors.bgYellow(colors.blue('printed on yellow background in blue')));\nconsole.log(colors.blue(colors.bgYellow('printed on yellow background in blue')));\n```\n\n## Tests\n\nLook at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: \n\n npm explore ansicolors && npm test\n\n## Alternatives\n\n**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, \nI'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js).\n", + "bugs": { + "url": "https://github.com/thlorenz/ansicolors/issues" + }, + "homepage": "https://github.com/thlorenz/ansicolors", + "_id": "ansicolors@0.2.1", + "_from": "ansicolors@~0.2.1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/test/ansicolors.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/test/ansicolors.js new file mode 100644 index 0000000..46aec3e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/ansicolors/test/ansicolors.js @@ -0,0 +1,55 @@ +'use strict'; + +var assert = require('assert') + , colors = require('..'); + +console.log('Foreground colors ..'); + +assert.equal(colors.white('printed in white'), '\u001b[37mprinted in white\u001b[39m'); + +assert.equal(colors.black('printed in black'), '\u001b[30mprinted in black\u001b[39m'); +assert.equal(colors.brightBlack('printed in bright black'), '\u001b[90mprinted in bright black\u001b[39m'); + +assert.equal(colors.green('printed in green'), '\u001b[32mprinted in green\u001b[39m'); +assert.equal(colors.brightGreen('printed in bright green'), '\u001b[92mprinted in bright green\u001b[39m'); + +assert.equal(colors.red('printed in red'), '\u001b[31mprinted in red\u001b[39m'); +assert.equal(colors.brightRed('printed in bright red'), '\u001b[91mprinted in bright red\u001b[39m'); + +console.log('OK'); + +console.log('Background colors ..'); + +assert.equal( + colors.bgBlack('printed with black background') + , '\u001b[40mprinted with black background\u001b[49m' +); + +assert.equal( + colors.bgYellow('printed with yellow background') + , '\u001b[43mprinted with yellow background\u001b[49m' +); +assert.equal( + colors.bgBrightYellow('printed with bright yellow background') + , '\u001b[103mprinted with bright yellow background\u001b[49m' +); + +assert.equal( + colors.bgWhite('printed with white background') + , '\u001b[47mprinted with white background\u001b[49m' +); + +console.log('OK'); + +console.log('Mixing background and foreground colors ..'); + +assert.equal( + colors.blue(colors.bgYellow('printed in blue with yellow background')) + , '\u001b[34m\u001b[43mprinted in blue with yellow background\u001b[49m\u001b[39m' +); +assert.equal( + colors.bgYellow(colors.blue('printed in blue with yellow background again')) + , '\u001b[43m\u001b[34mprinted in blue with yellow background again\u001b[39m\u001b[49m' +); + +console.log('OK'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.npmignore new file mode 100644 index 0000000..7dccd97 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.travis.yml new file mode 100644 index 0000000..84fd7ca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.6 + - 0.8 + - 0.9 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/Changelog.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/Changelog.md new file mode 100644 index 0000000..ab1f7bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/Changelog.md @@ -0,0 +1,15 @@ +# Changelog + +### 0.4 +- browser support + +### 0.3 +- passing more information into {Function} config +- API change: returning {Object} with code, ast, comments and tokens attached instead of just a code {String} +- comments support + +### 0.2 +- upgrade to Esprima 1.0.0 + +### 0.1 +- first working version diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/LICENSE new file mode 100644 index 0000000..19c037f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/LICENSE @@ -0,0 +1,23 @@ +Copyright 2012 Thorsten Lorenz. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/README.md new file mode 100644 index 0000000..ee73c75 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/README.md @@ -0,0 +1,192 @@ +# redeyed [![Build Status](https://secure.travis-ci.org/thlorenz/redeyed.png)](http://travis-ci.org/thlorenz/redeyed) + +*Add color to your JavaScript!* + +![frog](http://allaboutfrogs.org/gallery/photos/redeyes/red1.gif) + +[Red Eyed Tree Frog](http://allaboutfrogs.org/info/species/redeye.html) *(Agalychnis callidryas)* + +## What? + +Takes JavaScript code, along with a config and returns the original code with tokens wrapped and/or replaced as configured. + +## Where? + +- server side using nodejs +- in the [browser](#browser-support) + +## What for? + +One usecase is adding metadata to your code that can then be used to apply syntax highlighting. + +## How? + +- copy the [config.js](https://github.com/thlorenz/redeyed/blob/master/config.js) and edit it in order to specify how + certain tokens are to be surrounded/replaced +- replace the `undefined` of each token you want to configure with one of the following + +### {String} config + +`'before:after'` + +wraps the token inside before/after + +### {Object} config + +`{ _before: 'before', _after: 'after' }` + +wraps token inside before/after + +#### Missing before and after resolution for {String} and {Object} config + +For the `{String}` and `{Object}` configurations, 'before' or 'after' may be omitted: + +- `{String}`: + - `'before:'` (omitting 'after') + - `':after'` (omitting 'before') +- `{Object}`: + - `{ _before: 'before' }` (omitting '_after') + - `{ _after: 'after' }` (omitting '_before') + +In these cases the missing half is resolved as follows: + +- from the `parent._default` (i.e., `Keyword._default`) if found +- otherwise from the `config._default` if found +- otherwise `''` (empty string) + +### {Function} config + +`function (tokenString, info) { return {String}|{Object}; }` + +#### Inputs + +- tokenString: the content of the token that is currently being processed +- info: an object with the following structure + +```js +{ + // {Int} + // the index of the token being processed inside tokens + tokenIndex + + // {Array} + // all tokens that are being processed including comments + // (i.e. the result of merging esprima tokens and comments) + , tokens + + // {Object} + // the abstract syntax tree of the parsed code + , ast + + // {String} + // the code that was parsed (same string as the one passed to redeyed(code ..) + , code +} +``` + +In most cases the `tokenString` is all you need. The extra info object is passed in case you need to gather more +information about the `token`'s surroundings in order to decide how to transform it. +See: [replace-log-example](https://github.com/thlorenz/redeyed/blob/master/examples/replace-log.js) + +#### Output + +You can return a {String} or an {Object} from a {Function} config. + +- when returning a {String}, the token value will be replaced with it +- when returning an {Object}, it should be of the following form: + +```js +{ + // {String} + // the string that should be substituted for the value of the current and all skipped tokens + replacement + + // {Object} (Token) + // the token after which processing should continue + // all tokens in between the current one and this one inclusive will be ignored + , skipPastToken +} +``` + +### Transforming JavaScript code + +***redeyed(code, config[, opts])*** + +Invoke redeyed with your **config**uration, a **code** snippet and maybe **opts** as in the below example: + +```javascript +var redeyed = require('redeyed') + , config = require('./path/to/config') + , code = 'var a = 3;' + , result; + +// redeyed will throw an error (caused by the esprima parser) if the code has invalid javascript +try { + result = redeyed(code, config); + console.log(result.code); +} catch(err) { + console.error(err); +} +``` + +***opts***: +```js +{ // {Boolean} + // if true `result.code` is not assigned and therefore `undefined` + // if false (default) `result.code` property contains the result of `split.join` + nojoin: true|false +} +``` + +***return value***: + +```js +{ ast + , tokens + , comments + , splits + , code +} +``` + +- ast `{Array}`: [abstract syntax tree](http://en.wikipedia.org/wiki/Abstract_syntax_tree) as returned by [esprima + parse](http://en.wikipedia.org/wiki/Abstract_syntax_tree) +- tokens `{Array}`: [tokens](http://en.wikipedia.org/wiki/Token_(parser)) provided by esprima (excluding + comments) +- comments `{Array}`: block and line comments as provided by esprima +- splits `{Array}`: code pieces split up, some of which where transformed as configured +- code `{String}`: transformed code, same as `splits.join('')` unless this step has been skipped (see opts) + +## Browser Support + +### AMD + +Ensure to include [esprima](https://github.com/ariya/esprima) as one of your dependencies + +```js +define(['redeyed'], function (redeyed) { + [ .. ] +}); +``` + +### Attached to global window object + +The `redeyed {Function}` will be exposed globally as `window.redeyed` - big surprise! + +```html + + +``` + +## redeyed in the wild + +- [cardinal](https://github.com/thlorenz/cardinal): Syntax highlights JavaScript code with ANSI colors to be printed to + the terminal +- [peacock](http://thlorenz.github.com/peacock/): JavaScript syntax highlighter that generates html that is compatible + with pygments styles. + +## Examples + +- `npm explore redeyed; npm demo` will let you try the [browser example](https://github.com/thlorenz/redeyed/tree/master/examples/browser) +- `npm explore redeyed; npm demo-log` will let you try the [replace log example](https://github.com/thlorenz/redeyed/blob/master/examples/replace-log.js) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/config.js new file mode 100644 index 0000000..ade0de8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/config.js @@ -0,0 +1,137 @@ +/* + * Copy this file and use it as a starting point for your redeyed config. + * Just fill in the tokens you want to surround/replace. + * Keep in mind that more specific configurations override less specific ones. + */ + +module.exports = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : undefined + } + + , 'Identifier': { + _default: undefined + } + + , 'Null': { + _default: undefined + } + + , 'Numeric': { + _default: undefined + } + + , 'String': { + _default: undefined + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : undefined + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : undefined + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : undefined + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : undefined + , 'return' : undefined + , 'switch' : undefined + + , 'this' : undefined + , 'throw' : undefined + , 'try' : undefined + , 'typeof' : undefined + + , 'var' : undefined + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : undefined + } + , 'Punctuator': { + ';': undefined + , '.': undefined + , ',': undefined + + , '{': undefined + , '}': undefined + , '(': undefined + , ')': undefined + , '[': undefined + , ']': undefined + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: undefined + } + + // line comment + , Line: { + _default: undefined + } + + /* block comment */ + , Block: { + _default: undefined + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.css b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.css new file mode 100644 index 0000000..fc9206e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.css @@ -0,0 +1,31 @@ +.code { + width: 500px; + height: 500px; + display: block; +} + +.config { + width: 500px; + height: 400px; + display: block; +} + +.go { + display: block; + float: right; + font-size: 18px; +} + +.result { + width: 500px; + height: 1000px; + display: block; +} + +.edit { + float: left; +} + +.results { + float: left; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.html b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.html new file mode 100644 index 0000000..a20ea4c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.html @@ -0,0 +1,35 @@ + + + + + + + + +
    + Change the config and/or the original code in order to affect the "redeyed" result +
    +
    +
    +

    Redeyed Config

    + + +
    +
    +

    Original Code

    + +
    +
    +
    +

    Result

    + +
    + + + + + + + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.js new file mode 100644 index 0000000..82fd22f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/index.js @@ -0,0 +1,33 @@ +var $code = $('.code') + , $config = $('.config') + , $result = $('.result') + ; + +function go () { + var config; + try { + config = JSON.parse($config.val()); + } catch (e) { + $result.val('In "Redeyed Config": ' + e.toString()); + return; + } + + try { + var code = $code.val() + , result = redeyed(code, config); + + $result.val(result.code); + } catch (e) { + $result.val('In "Original Code": ' + e.toString()); + } +} + +$code.val(window.redeyed.toString()); + +$config.val(JSON.stringify(window.sampleConfig, false, 2)); + +$('.go').click(go); + +go(); + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/sample-config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/sample-config.js new file mode 100644 index 0000000..47456ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/browser/sample-config.js @@ -0,0 +1,131 @@ +window.sampleConfig = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : '?:?' + } + + , 'Identifier': { + _default: '-> : <-' + } + + , 'Null': { + _default: '**:**' + } + + , 'Numeric': { + _default: 'n:N' + } + + , 'String': { + _default: 'string -> :' + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : undefined + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : undefined + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : undefined + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : undefined + , 'return' : undefined + , 'switch' : undefined + + , 'this' : undefined + , 'throw' : undefined + , 'try' : undefined + , 'typeof' : undefined + + , 'var' : undefined + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : ': <- keyword' + } + , 'Punctuator': { + ';': undefined + , '.': undefined + , ',': undefined + + , '{': undefined + , '}': undefined + , '(': undefined + , ')': undefined + , '[': undefined + , ']': undefined + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: undefined + } + + // line comment + , Line: { + _default: undefined + } + + /* block comment */ + , Block: { + _default: undefined + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/replace-log.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/replace-log.js new file mode 100644 index 0000000..4b12ccf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/replace-log.js @@ -0,0 +1,61 @@ +var path = require('path') + , fs = require('fs') + , redeyed = require('..') + , vm = require('vm') + ; + +var samplePath = path.join(__dirname, 'sources', 'log.js') + , origCode = fs.readFileSync(samplePath, 'utf-8') + , kinds = ['silly', 'info', 'warn', 'error' ] + ; + +function replaceConsole(s, info) { + var code = info.code + , idx = info.tokenIndex + , tokens = info.tokens + , next = tokens[idx + 1].value + , kind = tokens[idx + 2].value + , openParen = tokens[idx + 3].value + , firstArgTkn = tokens[idx + 4] + , argIdx = idx + 3 + , open + , tkn + ; + + if (kind === 'log') kind = 'silly'; + + // not a console.xxx(...) statement? -> just return original + if (next !== '.' || !~kinds.indexOf(kind) || openParen !== '(') return s; + + // skip past arguments to console.xxx all args from ( to ) + open = 1; + while (open) { + tkn = tokens[++argIdx]; + + // count open parens vs. closed ones to handle things like console.log(new Error('..')); + if (tkn.value === '(') open++; + if (tkn.value === ')') open--; + } + + // tkn now is the last closing paren + var argsIncludingClosingParen = code.slice(firstArgTkn.range[0], tkn.range[1]) + , result = 'log.' + kind + '("main-logger", ' + argsIncludingClosingParen; + + // tell redeyed to skip the entire console.xxx(..) statement since we are replacing it all + return { replacement: result, skipPastToken: tkn }; +} + +function transformAndRun () { + var config = { + Identifier: { console: replaceConsole } + } + , code = redeyed(origCode, config).code + , context = vm.createContext({ require: require }); + + console.log('Original code:\n', origCode); + console.log('\nlog calls replaced:\n', code); + console.log('\nLets run it:'); + vm.runInContext(code, context, 'transformed-log.vm'); +} + +transformAndRun(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/sources/log.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/sources/log.js new file mode 100644 index 0000000..7994d2f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/examples/sources/log.js @@ -0,0 +1,8 @@ +// First two lines will be needed when we replaced all console.xxx statements with log.xxx +var log = require('npmlog'); +log.level = 'silly'; + +console.info('info ', 1); +console.log('log ', 2); +console.warn('warn ', 3); +console.error('error ', new Error('oh my!')); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esparse b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esparse new file mode 120000 index 0000000..7423b18 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esvalidate b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esvalidate new file mode 120000 index 0000000..16069ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/README.md new file mode 100644 index 0000000..a74bd12 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/README.md @@ -0,0 +1,73 @@ +**Esprima** ([esprima.org](http://esprima.org)) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/ariya/esprima/contributors). + +Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as +[Node.js](http://nodejs.org). + +### Features + +- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262) +- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla +[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) +- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage) +- Optional tracking of syntax node location (index-based and line-column) +- Experimental support for ES6/Harmony (module, class, destructuring, ...) + +Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)). +It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html) +with the new generation of fast parsers. + +### Applications + +Esprima serves as the basis for many popular JavaScript development tools: + +- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul) +- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck) +- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS), +[Sweet.js](http://sweetjs.org/) (macro) +- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr) +- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html)) +- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter), +- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen) + +### Questions? +- [Documentation](http://esprima.org/doc) +- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect) +and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement) +- [Mailing list](http://groups.google.com/group/esprima) +- [Contribution guide](http://esprima.org/doc/index.html#contribution) + +Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the +development updates. +Feedback and contribution are welcomed! + +### License + +Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) + and other contributors. + +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. + +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 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. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esparse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esparse.js new file mode 100755 index 0000000..3e7bb81 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esparse.js @@ -0,0 +1,117 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } +}); + +if (typeof fname !== 'string') { + console.log('Error: no input file.'); + process.exit(1); +} + +try { + content = fs.readFileSync(fname, 'utf-8'); + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, null, 4)); +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esvalidate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esvalidate.js new file mode 100755 index 0000000..e0af3f7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,177 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ + +var fs, esprima, options, fnames, count; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else { + fnames.push(entry); + } +}); + +if (fnames.length === 0) { + console.log('Error: no input file.'); + process.exit(1); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; +fnames.forEach(function (fname) { + var content, timestamp, syntax, name; + try { + content = fs.readFileSync(fname, 'utf-8'); + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log('Error: ' + e.message); + } + } +}); + +if (options.format === 'junit') { + console.log(''); +} + +if (count > 0) { + process.exit(1); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/esprima.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/esprima.js new file mode 100644 index 0000000..f1320da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/esprima.js @@ -0,0 +1,3908 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Mathias Bynens + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Kris Kowal + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint bitwise:true plusplus:true */ +/*global esprima:true, define:true, exports:true, window: true, +throwError: true, createLiteral: true, generateStatement: true, +parseAssignmentExpression: true, parseBlock: true, parseExpression: true, +parseFunctionDeclaration: true, parseFunctionExpression: true, +parseFunctionSourceElements: true, parseVariableIdentifier: true, +parseLeftHandSideExpression: true, +parseStatement: true, parseSourceElement: true */ + +(function (root, factory) { + 'use strict'; + + // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, + // Rhino, and plain browser loading. + if (typeof define === 'function' && define.amd) { + define(['exports'], factory); + } else if (typeof exports !== 'undefined') { + factory(exports); + } else { + factory((root.esprima = {})); + } +}(this, function (exports) { + 'use strict'; + + var Token, + TokenName, + Syntax, + PropertyKind, + Messages, + Regex, + source, + strict, + index, + lineNumber, + lineStart, + length, + buffer, + state, + extra; + + Token = { + BooleanLiteral: 1, + EOF: 2, + Identifier: 3, + Keyword: 4, + NullLiteral: 5, + NumericLiteral: 6, + Punctuator: 7, + StringLiteral: 8 + }; + + TokenName = {}; + TokenName[Token.BooleanLiteral] = 'Boolean'; + TokenName[Token.EOF] = ''; + TokenName[Token.Identifier] = 'Identifier'; + TokenName[Token.Keyword] = 'Keyword'; + TokenName[Token.NullLiteral] = 'Null'; + TokenName[Token.NumericLiteral] = 'Numeric'; + TokenName[Token.Punctuator] = 'Punctuator'; + TokenName[Token.StringLiteral] = 'String'; + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + }; + + PropertyKind = { + Data: 1, + Get: 2, + Set: 4 + }; + + // Error messages should be identical to V8. + Messages = { + UnexpectedToken: 'Unexpected token %0', + UnexpectedNumber: 'Unexpected number', + UnexpectedString: 'Unexpected string', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedEOS: 'Unexpected end of input', + NewlineAfterThrow: 'Illegal newline after throw', + InvalidRegExp: 'Invalid regular expression', + UnterminatedRegExp: 'Invalid regular expression: missing /', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NoCatchOrFinally: 'Missing catch or finally after try', + UnknownLabel: 'Undefined label \'%0\'', + Redeclaration: '%0 \'%1\' has already been declared', + IllegalContinue: 'Illegal continue statement', + IllegalBreak: 'Illegal break statement', + IllegalReturn: 'Illegal return statement', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', + AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', + AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode' + }; + + // See also tools/generate-unicode-regex.py. + Regex = { + NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), + NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') + }; + + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + + function assert(condition, message) { + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + + function sliceSource(from, to) { + return source.slice(from, to); + } + + if (typeof 'esprima'[0] === 'undefined') { + sliceSource = function sliceArraySource(from, to) { + return source.slice(from, to).join(''); + }; + } + + function isDecimalDigit(ch) { + return '0123456789'.indexOf(ch) >= 0; + } + + function isHexDigit(ch) { + return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; + } + + function isOctalDigit(ch) { + return '01234567'.indexOf(ch) >= 0; + } + + + // 7.2 White Space + + function isWhiteSpace(ch) { + return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || + (ch === '\u000C') || (ch === '\u00A0') || + (ch.charCodeAt(0) >= 0x1680 && + '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); + } + + // 7.6 Identifier Names and Identifiers + + function isIdentifierStart(ch) { + return (ch === '$') || (ch === '_') || (ch === '\\') || + (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); + } + + function isIdentifierPart(ch) { + return (ch === '$') || (ch === '_') || (ch === '\\') || + (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + ((ch >= '0') && (ch <= '9')) || + ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); + } + + // 7.6.1.2 Future Reserved Words + + function isFutureReservedWord(id) { + switch (id) { + + // Future reserved words. + case 'class': + case 'enum': + case 'export': + case 'extends': + case 'import': + case 'super': + return true; + } + + return false; + } + + function isStrictModeReservedWord(id) { + switch (id) { + + // Strict Mode reserved words. + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'yield': + case 'let': + return true; + } + + return false; + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + // 7.6.1.1 Keywords + + function isKeyword(id) { + var keyword = false; + switch (id.length) { + case 2: + keyword = (id === 'if') || (id === 'in') || (id === 'do'); + break; + case 3: + keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); + break; + case 4: + keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); + break; + case 5: + keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); + break; + case 6: + keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); + break; + case 7: + keyword = (id === 'default') || (id === 'finally'); + break; + case 8: + keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); + break; + case 10: + keyword = (id === 'instanceof'); + break; + } + + if (keyword) { + return true; + } + + switch (id) { + // Future reserved words. + // 'const' is specialized as Keyword in V8. + case 'const': + return true; + + // For compatiblity to SpiderMonkey and ES.next + case 'yield': + case 'let': + return true; + } + + if (strict && isStrictModeReservedWord(id)) { + return true; + } + + return isFutureReservedWord(id); + } + + // 7.4 Comments + + function skipComment() { + var ch, blockComment, lineComment; + + blockComment = false; + lineComment = false; + + while (index < length) { + ch = source[index]; + + if (lineComment) { + ch = source[index++]; + if (isLineTerminator(ch)) { + lineComment = false; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } + } else if (blockComment) { + if (isLineTerminator(ch)) { + if (ch === '\r' && source[index + 1] === '\n') { + ++index; + } + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + ch = source[index++]; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + if (ch === '*') { + ch = source[index]; + if (ch === '/') { + ++index; + blockComment = false; + } + } + } + } else if (ch === '/') { + ch = source[index + 1]; + if (ch === '/') { + index += 2; + lineComment = true; + } else if (ch === '*') { + index += 2; + blockComment = true; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + break; + } + } else if (isWhiteSpace(ch)) { + ++index; + } else if (isLineTerminator(ch)) { + ++index; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } else { + break; + } + } + } + + function scanHexEscape(prefix) { + var i, len, ch, code = 0; + + len = (prefix === 'u') ? 4 : 2; + for (i = 0; i < len; ++i) { + if (index < length && isHexDigit(source[index])) { + ch = source[index++]; + code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); + } else { + return ''; + } + } + return String.fromCharCode(code); + } + + function scanIdentifier() { + var ch, start, id, restore; + + ch = source[index]; + if (!isIdentifierStart(ch)) { + return; + } + + start = index; + if (ch === '\\') { + ++index; + if (source[index] !== 'u') { + return; + } + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + if (ch === '\\' || !isIdentifierStart(ch)) { + return; + } + id = ch; + } else { + index = restore; + id = 'u'; + } + } else { + id = source[index++]; + } + + while (index < length) { + ch = source[index]; + if (!isIdentifierPart(ch)) { + break; + } + if (ch === '\\') { + ++index; + if (source[index] !== 'u') { + return; + } + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + if (ch === '\\' || !isIdentifierPart(ch)) { + return; + } + id += ch; + } else { + index = restore; + id += 'u'; + } + } else { + id += source[index++]; + } + } + + // There is no keyword or literal with only one character. + // Thus, it must be an identifier. + if (id.length === 1) { + return { + type: Token.Identifier, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (isKeyword(id)) { + return { + type: Token.Keyword, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.1 Null Literals + + if (id === 'null') { + return { + type: Token.NullLiteral, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.2 Boolean Literals + + if (id === 'true' || id === 'false') { + return { + type: Token.BooleanLiteral, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + return { + type: Token.Identifier, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.7 Punctuators + + function scanPunctuator() { + var start = index, + ch1 = source[index], + ch2, + ch3, + ch4; + + // Check for most common single-character punctuators. + + if (ch1 === ';' || ch1 === '{' || ch1 === '}') { + ++index; + return { + type: Token.Punctuator, + value: ch1, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === ',' || ch1 === '(' || ch1 === ')') { + ++index; + return { + type: Token.Punctuator, + value: ch1, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // Dot (.) can also start a floating-point number, hence the need + // to check the next character. + + ch2 = source[index + 1]; + if (ch1 === '.' && !isDecimalDigit(ch2)) { + return { + type: Token.Punctuator, + value: source[index++], + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // Peek more characters. + + ch3 = source[index + 2]; + ch4 = source[index + 3]; + + // 4-character punctuator: >>>= + + if (ch1 === '>' && ch2 === '>' && ch3 === '>') { + if (ch4 === '=') { + index += 4; + return { + type: Token.Punctuator, + value: '>>>=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // 3-character punctuators: === !== >>> <<= >>= + + if (ch1 === '=' && ch2 === '=' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '===', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '!' && ch2 === '=' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '!==', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '>' && ch2 === '>' && ch3 === '>') { + index += 3; + return { + type: Token.Punctuator, + value: '>>>', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '<' && ch2 === '<' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '<<=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '>' && ch2 === '>' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '>>=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 2-character punctuators: <= >= == != ++ -- << >> && || + // += -= *= %= &= |= ^= /= + + if (ch2 === '=') { + if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { + index += 2; + return { + type: Token.Punctuator, + value: ch1 + ch2, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { + if ('+-<>&|'.indexOf(ch2) >= 0) { + index += 2; + return { + type: Token.Punctuator, + value: ch1 + ch2, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // The remaining 1-character punctuators. + + if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { + return { + type: Token.Punctuator, + value: source[index++], + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // 7.8.3 Numeric Literals + + function scanNumericLiteral() { + var number, start, ch; + + ch = source[index]; + assert(isDecimalDigit(ch) || (ch === '.'), + 'Numeric literal must start with a decimal digit or a decimal point'); + + start = index; + number = ''; + if (ch !== '.') { + number = source[index++]; + ch = source[index]; + + // Hex number starts with '0x'. + // Octal number starts with '0'. + if (number === '0') { + if (ch === 'x' || ch === 'X') { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isHexDigit(ch)) { + break; + } + number += source[index++]; + } + + if (number.length <= 2) { + // only 0x + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + return { + type: Token.NumericLiteral, + value: parseInt(number, 16), + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } else if (isOctalDigit(ch)) { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isOctalDigit(ch)) { + break; + } + number += source[index++]; + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch) || isDecimalDigit(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + return { + type: Token.NumericLiteral, + value: parseInt(number, 8), + octal: true, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // decimal number starts with '0' such as '09' is illegal. + if (isDecimalDigit(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } + + if (ch === '.') { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } + + if (ch === 'e' || ch === 'E') { + number += source[index++]; + + ch = source[index]; + if (ch === '+' || ch === '-') { + number += source[index++]; + } + + ch = source[index]; + if (isDecimalDigit(ch)) { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } else { + ch = 'character ' + ch; + if (index >= length) { + ch = ''; + } + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + return { + type: Token.NumericLiteral, + value: parseFloat(number), + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.4 String Literals + + function scanStringLiteral() { + var str = '', quote, start, ch, code, unescaped, restore, octal = false; + + quote = source[index]; + assert((quote === '\'' || quote === '"'), + 'String literal must starts with a quote'); + + start = index; + ++index; + + while (index < length) { + ch = source[index++]; + + if (ch === quote) { + quote = ''; + break; + } else if (ch === '\\') { + ch = source[index++]; + if (!isLineTerminator(ch)) { + switch (ch) { + case 'n': + str += '\n'; + break; + case 'r': + str += '\r'; + break; + case 't': + str += '\t'; + break; + case 'u': + case 'x': + restore = index; + unescaped = scanHexEscape(ch); + if (unescaped) { + str += unescaped; + } else { + index = restore; + str += ch; + } + break; + case 'b': + str += '\b'; + break; + case 'f': + str += '\f'; + break; + case 'v': + str += '\x0B'; + break; + + default: + if (isOctalDigit(ch)) { + code = '01234567'.indexOf(ch); + + // \0 is not octal escape sequence + if (code !== 0) { + octal = true; + } + + if (index < length && isOctalDigit(source[index])) { + octal = true; + code = code * 8 + '01234567'.indexOf(source[index++]); + + // 3 digits are only allowed when string starts + // with 0, 1, 2, 3 + if ('0123'.indexOf(ch) >= 0 && + index < length && + isOctalDigit(source[index])) { + code = code * 8 + '01234567'.indexOf(source[index++]); + } + } + str += String.fromCharCode(code); + } else { + str += ch; + } + break; + } + } else { + ++lineNumber; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + } + } else if (isLineTerminator(ch)) { + break; + } else { + str += ch; + } + } + + if (quote !== '') { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + return { + type: Token.StringLiteral, + value: str, + octal: octal, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + function scanRegExp() { + var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; + + buffer = null; + skipComment(); + + start = index; + ch = source[index]; + assert(ch === '/', 'Regular expression literal must start with a slash'); + str = source[index++]; + + while (index < length) { + ch = source[index++]; + str += ch; + if (ch === '\\') { + ch = source[index++]; + // ECMA-262 7.8.5 + if (isLineTerminator(ch)) { + throwError({}, Messages.UnterminatedRegExp); + } + str += ch; + } else if (classMarker) { + if (ch === ']') { + classMarker = false; + } + } else { + if (ch === '/') { + terminated = true; + break; + } else if (ch === '[') { + classMarker = true; + } else if (isLineTerminator(ch)) { + throwError({}, Messages.UnterminatedRegExp); + } + } + } + + if (!terminated) { + throwError({}, Messages.UnterminatedRegExp); + } + + // Exclude leading and trailing slash. + pattern = str.substr(1, str.length - 2); + + flags = ''; + while (index < length) { + ch = source[index]; + if (!isIdentifierPart(ch)) { + break; + } + + ++index; + if (ch === '\\' && index < length) { + ch = source[index]; + if (ch === 'u') { + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + flags += ch; + str += '\\u'; + for (; restore < index; ++restore) { + str += source[restore]; + } + } else { + index = restore; + flags += 'u'; + str += '\\u'; + } + } else { + str += '\\'; + } + } else { + flags += ch; + str += ch; + } + } + + try { + value = new RegExp(pattern, flags); + } catch (e) { + throwError({}, Messages.InvalidRegExp); + } + + return { + literal: str, + value: value, + range: [start, index] + }; + } + + function isIdentifierName(token) { + return token.type === Token.Identifier || + token.type === Token.Keyword || + token.type === Token.BooleanLiteral || + token.type === Token.NullLiteral; + } + + function advance() { + var ch, token; + + skipComment(); + + if (index >= length) { + return { + type: Token.EOF, + lineNumber: lineNumber, + lineStart: lineStart, + range: [index, index] + }; + } + + token = scanPunctuator(); + if (typeof token !== 'undefined') { + return token; + } + + ch = source[index]; + + if (ch === '\'' || ch === '"') { + return scanStringLiteral(); + } + + if (ch === '.' || isDecimalDigit(ch)) { + return scanNumericLiteral(); + } + + token = scanIdentifier(); + if (typeof token !== 'undefined') { + return token; + } + + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + function lex() { + var token; + + if (buffer) { + index = buffer.range[1]; + lineNumber = buffer.lineNumber; + lineStart = buffer.lineStart; + token = buffer; + buffer = null; + return token; + } + + buffer = null; + return advance(); + } + + function lookahead() { + var pos, line, start; + + if (buffer !== null) { + return buffer; + } + + pos = index; + line = lineNumber; + start = lineStart; + buffer = advance(); + index = pos; + lineNumber = line; + lineStart = start; + + return buffer; + } + + // Return true if there is a line terminator before the next token. + + function peekLineTerminator() { + var pos, line, start, found; + + pos = index; + line = lineNumber; + start = lineStart; + skipComment(); + found = lineNumber !== line; + index = pos; + lineNumber = line; + lineStart = start; + + return found; + } + + // Throw an exception + + function throwError(token, messageFormat) { + var error, + args = Array.prototype.slice.call(arguments, 2), + msg = messageFormat.replace( + /%(\d)/g, + function (whole, index) { + return args[index] || ''; + } + ); + + if (typeof token.lineNumber === 'number') { + error = new Error('Line ' + token.lineNumber + ': ' + msg); + error.index = token.range[0]; + error.lineNumber = token.lineNumber; + error.column = token.range[0] - lineStart + 1; + } else { + error = new Error('Line ' + lineNumber + ': ' + msg); + error.index = index; + error.lineNumber = lineNumber; + error.column = index - lineStart + 1; + } + + throw error; + } + + function throwErrorTolerant() { + try { + throwError.apply(null, arguments); + } catch (e) { + if (extra.errors) { + extra.errors.push(e); + } else { + throw e; + } + } + } + + + // Throw an exception because of the token. + + function throwUnexpected(token) { + if (token.type === Token.EOF) { + throwError(token, Messages.UnexpectedEOS); + } + + if (token.type === Token.NumericLiteral) { + throwError(token, Messages.UnexpectedNumber); + } + + if (token.type === Token.StringLiteral) { + throwError(token, Messages.UnexpectedString); + } + + if (token.type === Token.Identifier) { + throwError(token, Messages.UnexpectedIdentifier); + } + + if (token.type === Token.Keyword) { + if (isFutureReservedWord(token.value)) { + throwError(token, Messages.UnexpectedReserved); + } else if (strict && isStrictModeReservedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictReservedWord); + return; + } + throwError(token, Messages.UnexpectedToken, token.value); + } + + // BooleanLiteral, NullLiteral, or Punctuator. + throwError(token, Messages.UnexpectedToken, token.value); + } + + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + + function expect(value) { + var token = lex(); + if (token.type !== Token.Punctuator || token.value !== value) { + throwUnexpected(token); + } + } + + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + + function expectKeyword(keyword) { + var token = lex(); + if (token.type !== Token.Keyword || token.value !== keyword) { + throwUnexpected(token); + } + } + + // Return true if the next token matches the specified punctuator. + + function match(value) { + var token = lookahead(); + return token.type === Token.Punctuator && token.value === value; + } + + // Return true if the next token matches the specified keyword + + function matchKeyword(keyword) { + var token = lookahead(); + return token.type === Token.Keyword && token.value === keyword; + } + + // Return true if the next token is an assignment operator + + function matchAssign() { + var token = lookahead(), + op = token.value; + + if (token.type !== Token.Punctuator) { + return false; + } + return op === '=' || + op === '*=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + } + + function consumeSemicolon() { + var token, line; + + // Catch the very common case first. + if (source[index] === ';') { + lex(); + return; + } + + line = lineNumber; + skipComment(); + if (lineNumber !== line) { + return; + } + + if (match(';')) { + lex(); + return; + } + + token = lookahead(); + if (token.type !== Token.EOF && !match('}')) { + throwUnexpected(token); + } + } + + // Return true if provided expression is LeftHandSideExpression + + function isLeftHandSide(expr) { + return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; + } + + // 11.1.4 Array Initialiser + + function parseArrayInitialiser() { + var elements = []; + + expect('['); + + while (!match(']')) { + if (match(',')) { + lex(); + elements.push(null); + } else { + elements.push(parseAssignmentExpression()); + + if (!match(']')) { + expect(','); + } + } + } + + expect(']'); + + return { + type: Syntax.ArrayExpression, + elements: elements + }; + } + + // 11.1.5 Object Initialiser + + function parsePropertyFunction(param, first) { + var previousStrict, body; + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (first && strict && isRestrictedWord(param[0].name)) { + throwErrorTolerant(first, Messages.StrictParamName); + } + strict = previousStrict; + + return { + type: Syntax.FunctionExpression, + id: null, + params: param, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + function parseObjectPropertyKey() { + var token = lex(); + + // Note: This function is called only from parseObjectProperty(), where + // EOF and Punctuator tokens are already filtered out. + + if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { + if (strict && token.octal) { + throwErrorTolerant(token, Messages.StrictOctalLiteral); + } + return createLiteral(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseObjectProperty() { + var token, key, id, param; + + token = lookahead(); + + if (token.type === Token.Identifier) { + + id = parseObjectPropertyKey(); + + // Property Assignment: Getter and Setter. + + if (token.value === 'get' && !match(':')) { + key = parseObjectPropertyKey(); + expect('('); + expect(')'); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction([]), + kind: 'get' + }; + } else if (token.value === 'set' && !match(':')) { + key = parseObjectPropertyKey(); + expect('('); + token = lookahead(); + if (token.type !== Token.Identifier) { + expect(')'); + throwErrorTolerant(token, Messages.UnexpectedToken, token.value); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction([]), + kind: 'set' + }; + } else { + param = [ parseVariableIdentifier() ]; + expect(')'); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction(param, token), + kind: 'set' + }; + } + } else { + expect(':'); + return { + type: Syntax.Property, + key: id, + value: parseAssignmentExpression(), + kind: 'init' + }; + } + } else if (token.type === Token.EOF || token.type === Token.Punctuator) { + throwUnexpected(token); + } else { + key = parseObjectPropertyKey(); + expect(':'); + return { + type: Syntax.Property, + key: key, + value: parseAssignmentExpression(), + kind: 'init' + }; + } + } + + function parseObjectInitialiser() { + var properties = [], property, name, kind, map = {}, toString = String; + + expect('{'); + + while (!match('}')) { + property = parseObjectProperty(); + + if (property.key.type === Syntax.Identifier) { + name = property.key.name; + } else { + name = toString(property.key.value); + } + kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; + if (Object.prototype.hasOwnProperty.call(map, name)) { + if (map[name] === PropertyKind.Data) { + if (strict && kind === PropertyKind.Data) { + throwErrorTolerant({}, Messages.StrictDuplicateProperty); + } else if (kind !== PropertyKind.Data) { + throwErrorTolerant({}, Messages.AccessorDataProperty); + } + } else { + if (kind === PropertyKind.Data) { + throwErrorTolerant({}, Messages.AccessorDataProperty); + } else if (map[name] & kind) { + throwErrorTolerant({}, Messages.AccessorGetSet); + } + } + map[name] |= kind; + } else { + map[name] = kind; + } + + properties.push(property); + + if (!match('}')) { + expect(','); + } + } + + expect('}'); + + return { + type: Syntax.ObjectExpression, + properties: properties + }; + } + + // 11.1.6 The Grouping Operator + + function parseGroupExpression() { + var expr; + + expect('('); + + expr = parseExpression(); + + expect(')'); + + return expr; + } + + + // 11.1 Primary Expressions + + function parsePrimaryExpression() { + var token = lookahead(), + type = token.type; + + if (type === Token.Identifier) { + return { + type: Syntax.Identifier, + name: lex().value + }; + } + + if (type === Token.StringLiteral || type === Token.NumericLiteral) { + if (strict && token.octal) { + throwErrorTolerant(token, Messages.StrictOctalLiteral); + } + return createLiteral(lex()); + } + + if (type === Token.Keyword) { + if (matchKeyword('this')) { + lex(); + return { + type: Syntax.ThisExpression + }; + } + + if (matchKeyword('function')) { + return parseFunctionExpression(); + } + } + + if (type === Token.BooleanLiteral) { + lex(); + token.value = (token.value === 'true'); + return createLiteral(token); + } + + if (type === Token.NullLiteral) { + lex(); + token.value = null; + return createLiteral(token); + } + + if (match('[')) { + return parseArrayInitialiser(); + } + + if (match('{')) { + return parseObjectInitialiser(); + } + + if (match('(')) { + return parseGroupExpression(); + } + + if (match('/') || match('/=')) { + return createLiteral(scanRegExp()); + } + + return throwUnexpected(lex()); + } + + // 11.2 Left-Hand-Side Expressions + + function parseArguments() { + var args = []; + + expect('('); + + if (!match(')')) { + while (index < length) { + args.push(parseAssignmentExpression()); + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + return args; + } + + function parseNonComputedProperty() { + var token = lex(); + + if (!isIdentifierName(token)) { + throwUnexpected(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseNonComputedMember() { + expect('.'); + + return parseNonComputedProperty(); + } + + function parseComputedMember() { + var expr; + + expect('['); + + expr = parseExpression(); + + expect(']'); + + return expr; + } + + function parseNewExpression() { + var expr; + + expectKeyword('new'); + + expr = { + type: Syntax.NewExpression, + callee: parseLeftHandSideExpression(), + 'arguments': [] + }; + + if (match('(')) { + expr['arguments'] = parseArguments(); + } + + return expr; + } + + function parseLeftHandSideExpressionAllowCall() { + var expr; + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[') || match('(')) { + if (match('(')) { + expr = { + type: Syntax.CallExpression, + callee: expr, + 'arguments': parseArguments() + }; + } else if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + } + } + + return expr; + } + + + function parseLeftHandSideExpression() { + var expr; + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[')) { + if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + } + } + + return expr; + } + + // 11.3 Postfix Expressions + + function parsePostfixExpression() { + var expr = parseLeftHandSideExpressionAllowCall(), token; + + token = lookahead(); + if (token.type !== Token.Punctuator) { + return expr; + } + + if ((match('++') || match('--')) && !peekLineTerminator()) { + // 11.3.1, 11.3.2 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant({}, Messages.StrictLHSPostfix); + } + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + expr = { + type: Syntax.UpdateExpression, + operator: lex().value, + argument: expr, + prefix: false + }; + } + + return expr; + } + + // 11.4 Unary Operators + + function parseUnaryExpression() { + var token, expr; + + token = lookahead(); + if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { + return parsePostfixExpression(); + } + + if (match('++') || match('--')) { + token = lex(); + expr = parseUnaryExpression(); + // 11.4.4, 11.4.5 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant({}, Messages.StrictLHSPrefix); + } + + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + expr = { + type: Syntax.UpdateExpression, + operator: token.value, + argument: expr, + prefix: true + }; + return expr; + } + + if (match('+') || match('-') || match('~') || match('!')) { + expr = { + type: Syntax.UnaryExpression, + operator: lex().value, + argument: parseUnaryExpression(), + prefix: true + }; + return expr; + } + + if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { + expr = { + type: Syntax.UnaryExpression, + operator: lex().value, + argument: parseUnaryExpression(), + prefix: true + }; + if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { + throwErrorTolerant({}, Messages.StrictDelete); + } + return expr; + } + + return parsePostfixExpression(); + } + + // 11.5 Multiplicative Operators + + function parseMultiplicativeExpression() { + var expr = parseUnaryExpression(); + + while (match('*') || match('/') || match('%')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseUnaryExpression() + }; + } + + return expr; + } + + // 11.6 Additive Operators + + function parseAdditiveExpression() { + var expr = parseMultiplicativeExpression(); + + while (match('+') || match('-')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseMultiplicativeExpression() + }; + } + + return expr; + } + + // 11.7 Bitwise Shift Operators + + function parseShiftExpression() { + var expr = parseAdditiveExpression(); + + while (match('<<') || match('>>') || match('>>>')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseAdditiveExpression() + }; + } + + return expr; + } + // 11.8 Relational Operators + + function parseRelationalExpression() { + var expr, previousAllowIn; + + previousAllowIn = state.allowIn; + state.allowIn = true; + + expr = parseShiftExpression(); + + while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseShiftExpression() + }; + } + + state.allowIn = previousAllowIn; + return expr; + } + + // 11.9 Equality Operators + + function parseEqualityExpression() { + var expr = parseRelationalExpression(); + + while (match('==') || match('!=') || match('===') || match('!==')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseRelationalExpression() + }; + } + + return expr; + } + + // 11.10 Binary Bitwise Operators + + function parseBitwiseANDExpression() { + var expr = parseEqualityExpression(); + + while (match('&')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '&', + left: expr, + right: parseEqualityExpression() + }; + } + + return expr; + } + + function parseBitwiseXORExpression() { + var expr = parseBitwiseANDExpression(); + + while (match('^')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '^', + left: expr, + right: parseBitwiseANDExpression() + }; + } + + return expr; + } + + function parseBitwiseORExpression() { + var expr = parseBitwiseXORExpression(); + + while (match('|')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '|', + left: expr, + right: parseBitwiseXORExpression() + }; + } + + return expr; + } + + // 11.11 Binary Logical Operators + + function parseLogicalANDExpression() { + var expr = parseBitwiseORExpression(); + + while (match('&&')) { + lex(); + expr = { + type: Syntax.LogicalExpression, + operator: '&&', + left: expr, + right: parseBitwiseORExpression() + }; + } + + return expr; + } + + function parseLogicalORExpression() { + var expr = parseLogicalANDExpression(); + + while (match('||')) { + lex(); + expr = { + type: Syntax.LogicalExpression, + operator: '||', + left: expr, + right: parseLogicalANDExpression() + }; + } + + return expr; + } + + // 11.12 Conditional Operator + + function parseConditionalExpression() { + var expr, previousAllowIn, consequent; + + expr = parseLogicalORExpression(); + + if (match('?')) { + lex(); + previousAllowIn = state.allowIn; + state.allowIn = true; + consequent = parseAssignmentExpression(); + state.allowIn = previousAllowIn; + expect(':'); + + expr = { + type: Syntax.ConditionalExpression, + test: expr, + consequent: consequent, + alternate: parseAssignmentExpression() + }; + } + + return expr; + } + + // 11.13 Assignment Operators + + function parseAssignmentExpression() { + var token, expr; + + token = lookahead(); + expr = parseConditionalExpression(); + + if (matchAssign()) { + // LeftHandSideExpression + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + // 11.13.1 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant(token, Messages.StrictLHSAssignment); + } + + expr = { + type: Syntax.AssignmentExpression, + operator: lex().value, + left: expr, + right: parseAssignmentExpression() + }; + } + + return expr; + } + + // 11.14 Comma Operator + + function parseExpression() { + var expr = parseAssignmentExpression(); + + if (match(',')) { + expr = { + type: Syntax.SequenceExpression, + expressions: [ expr ] + }; + + while (index < length) { + if (!match(',')) { + break; + } + lex(); + expr.expressions.push(parseAssignmentExpression()); + } + + } + return expr; + } + + // 12.1 Block + + function parseStatementList() { + var list = [], + statement; + + while (index < length) { + if (match('}')) { + break; + } + statement = parseSourceElement(); + if (typeof statement === 'undefined') { + break; + } + list.push(statement); + } + + return list; + } + + function parseBlock() { + var block; + + expect('{'); + + block = parseStatementList(); + + expect('}'); + + return { + type: Syntax.BlockStatement, + body: block + }; + } + + // 12.2 Variable Statement + + function parseVariableIdentifier() { + var token = lex(); + + if (token.type !== Token.Identifier) { + throwUnexpected(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseVariableDeclaration(kind) { + var id = parseVariableIdentifier(), + init = null; + + // 12.2.1 + if (strict && isRestrictedWord(id.name)) { + throwErrorTolerant({}, Messages.StrictVarName); + } + + if (kind === 'const') { + expect('='); + init = parseAssignmentExpression(); + } else if (match('=')) { + lex(); + init = parseAssignmentExpression(); + } + + return { + type: Syntax.VariableDeclarator, + id: id, + init: init + }; + } + + function parseVariableDeclarationList(kind) { + var list = []; + + do { + list.push(parseVariableDeclaration(kind)); + if (!match(',')) { + break; + } + lex(); + } while (index < length); + + return list; + } + + function parseVariableStatement() { + var declarations; + + expectKeyword('var'); + + declarations = parseVariableDeclarationList(); + + consumeSemicolon(); + + return { + type: Syntax.VariableDeclaration, + declarations: declarations, + kind: 'var' + }; + } + + // kind may be `const` or `let` + // Both are experimental and not in the specification yet. + // see http://wiki.ecmascript.org/doku.php?id=harmony:const + // and http://wiki.ecmascript.org/doku.php?id=harmony:let + function parseConstLetDeclaration(kind) { + var declarations; + + expectKeyword(kind); + + declarations = parseVariableDeclarationList(kind); + + consumeSemicolon(); + + return { + type: Syntax.VariableDeclaration, + declarations: declarations, + kind: kind + }; + } + + // 12.3 Empty Statement + + function parseEmptyStatement() { + expect(';'); + + return { + type: Syntax.EmptyStatement + }; + } + + // 12.4 Expression Statement + + function parseExpressionStatement() { + var expr = parseExpression(); + + consumeSemicolon(); + + return { + type: Syntax.ExpressionStatement, + expression: expr + }; + } + + // 12.5 If statement + + function parseIfStatement() { + var test, consequent, alternate; + + expectKeyword('if'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + consequent = parseStatement(); + + if (matchKeyword('else')) { + lex(); + alternate = parseStatement(); + } else { + alternate = null; + } + + return { + type: Syntax.IfStatement, + test: test, + consequent: consequent, + alternate: alternate + }; + } + + // 12.6 Iteration Statements + + function parseDoWhileStatement() { + var body, test, oldInIteration; + + expectKeyword('do'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + expectKeyword('while'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + if (match(';')) { + lex(); + } + + return { + type: Syntax.DoWhileStatement, + body: body, + test: test + }; + } + + function parseWhileStatement() { + var test, body, oldInIteration; + + expectKeyword('while'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + return { + type: Syntax.WhileStatement, + test: test, + body: body + }; + } + + function parseForVariableDeclaration() { + var token = lex(); + + return { + type: Syntax.VariableDeclaration, + declarations: parseVariableDeclarationList(), + kind: token.value + }; + } + + function parseForStatement() { + var init, test, update, left, right, body, oldInIteration; + + init = test = update = null; + + expectKeyword('for'); + + expect('('); + + if (match(';')) { + lex(); + } else { + if (matchKeyword('var') || matchKeyword('let')) { + state.allowIn = false; + init = parseForVariableDeclaration(); + state.allowIn = true; + + if (init.declarations.length === 1 && matchKeyword('in')) { + lex(); + left = init; + right = parseExpression(); + init = null; + } + } else { + state.allowIn = false; + init = parseExpression(); + state.allowIn = true; + + if (matchKeyword('in')) { + // LeftHandSideExpression + if (!isLeftHandSide(init)) { + throwErrorTolerant({}, Messages.InvalidLHSInForIn); + } + + lex(); + left = init; + right = parseExpression(); + init = null; + } + } + + if (typeof left === 'undefined') { + expect(';'); + } + } + + if (typeof left === 'undefined') { + + if (!match(';')) { + test = parseExpression(); + } + expect(';'); + + if (!match(')')) { + update = parseExpression(); + } + } + + expect(')'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + if (typeof left === 'undefined') { + return { + type: Syntax.ForStatement, + init: init, + test: test, + update: update, + body: body + }; + } + + return { + type: Syntax.ForInStatement, + left: left, + right: right, + body: body, + each: false + }; + } + + // 12.7 The continue statement + + function parseContinueStatement() { + var token, label = null; + + expectKeyword('continue'); + + // Optimize the most common form: 'continue;'. + if (source[index] === ';') { + lex(); + + if (!state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: null + }; + } + + if (peekLineTerminator()) { + if (!state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: null + }; + } + + token = lookahead(); + if (token.type === Token.Identifier) { + label = parseVariableIdentifier(); + + if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { + throwError({}, Messages.UnknownLabel, label.name); + } + } + + consumeSemicolon(); + + if (label === null && !state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: label + }; + } + + // 12.8 The break statement + + function parseBreakStatement() { + var token, label = null; + + expectKeyword('break'); + + // Optimize the most common form: 'break;'. + if (source[index] === ';') { + lex(); + + if (!(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: null + }; + } + + if (peekLineTerminator()) { + if (!(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: null + }; + } + + token = lookahead(); + if (token.type === Token.Identifier) { + label = parseVariableIdentifier(); + + if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { + throwError({}, Messages.UnknownLabel, label.name); + } + } + + consumeSemicolon(); + + if (label === null && !(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: label + }; + } + + // 12.9 The return statement + + function parseReturnStatement() { + var token, argument = null; + + expectKeyword('return'); + + if (!state.inFunctionBody) { + throwErrorTolerant({}, Messages.IllegalReturn); + } + + // 'return' followed by a space and an identifier is very common. + if (source[index] === ' ') { + if (isIdentifierStart(source[index + 1])) { + argument = parseExpression(); + consumeSemicolon(); + return { + type: Syntax.ReturnStatement, + argument: argument + }; + } + } + + if (peekLineTerminator()) { + return { + type: Syntax.ReturnStatement, + argument: null + }; + } + + if (!match(';')) { + token = lookahead(); + if (!match('}') && token.type !== Token.EOF) { + argument = parseExpression(); + } + } + + consumeSemicolon(); + + return { + type: Syntax.ReturnStatement, + argument: argument + }; + } + + // 12.10 The with statement + + function parseWithStatement() { + var object, body; + + if (strict) { + throwErrorTolerant({}, Messages.StrictModeWith); + } + + expectKeyword('with'); + + expect('('); + + object = parseExpression(); + + expect(')'); + + body = parseStatement(); + + return { + type: Syntax.WithStatement, + object: object, + body: body + }; + } + + // 12.10 The swith statement + + function parseSwitchCase() { + var test, + consequent = [], + statement; + + if (matchKeyword('default')) { + lex(); + test = null; + } else { + expectKeyword('case'); + test = parseExpression(); + } + expect(':'); + + while (index < length) { + if (match('}') || matchKeyword('default') || matchKeyword('case')) { + break; + } + statement = parseStatement(); + if (typeof statement === 'undefined') { + break; + } + consequent.push(statement); + } + + return { + type: Syntax.SwitchCase, + test: test, + consequent: consequent + }; + } + + function parseSwitchStatement() { + var discriminant, cases, clause, oldInSwitch, defaultFound; + + expectKeyword('switch'); + + expect('('); + + discriminant = parseExpression(); + + expect(')'); + + expect('{'); + + cases = []; + + if (match('}')) { + lex(); + return { + type: Syntax.SwitchStatement, + discriminant: discriminant, + cases: cases + }; + } + + oldInSwitch = state.inSwitch; + state.inSwitch = true; + defaultFound = false; + + while (index < length) { + if (match('}')) { + break; + } + clause = parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + throwError({}, Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + + state.inSwitch = oldInSwitch; + + expect('}'); + + return { + type: Syntax.SwitchStatement, + discriminant: discriminant, + cases: cases + }; + } + + // 12.13 The throw statement + + function parseThrowStatement() { + var argument; + + expectKeyword('throw'); + + if (peekLineTerminator()) { + throwError({}, Messages.NewlineAfterThrow); + } + + argument = parseExpression(); + + consumeSemicolon(); + + return { + type: Syntax.ThrowStatement, + argument: argument + }; + } + + // 12.14 The try statement + + function parseCatchClause() { + var param; + + expectKeyword('catch'); + + expect('('); + if (match(')')) { + throwUnexpected(lookahead()); + } + + param = parseVariableIdentifier(); + // 12.14.1 + if (strict && isRestrictedWord(param.name)) { + throwErrorTolerant({}, Messages.StrictCatchVariable); + } + + expect(')'); + + return { + type: Syntax.CatchClause, + param: param, + body: parseBlock() + }; + } + + function parseTryStatement() { + var block, handlers = [], finalizer = null; + + expectKeyword('try'); + + block = parseBlock(); + + if (matchKeyword('catch')) { + handlers.push(parseCatchClause()); + } + + if (matchKeyword('finally')) { + lex(); + finalizer = parseBlock(); + } + + if (handlers.length === 0 && !finalizer) { + throwError({}, Messages.NoCatchOrFinally); + } + + return { + type: Syntax.TryStatement, + block: block, + guardedHandlers: [], + handlers: handlers, + finalizer: finalizer + }; + } + + // 12.15 The debugger statement + + function parseDebuggerStatement() { + expectKeyword('debugger'); + + consumeSemicolon(); + + return { + type: Syntax.DebuggerStatement + }; + } + + // 12 Statements + + function parseStatement() { + var token = lookahead(), + expr, + labeledBody; + + if (token.type === Token.EOF) { + throwUnexpected(token); + } + + if (token.type === Token.Punctuator) { + switch (token.value) { + case ';': + return parseEmptyStatement(); + case '{': + return parseBlock(); + case '(': + return parseExpressionStatement(); + default: + break; + } + } + + if (token.type === Token.Keyword) { + switch (token.value) { + case 'break': + return parseBreakStatement(); + case 'continue': + return parseContinueStatement(); + case 'debugger': + return parseDebuggerStatement(); + case 'do': + return parseDoWhileStatement(); + case 'for': + return parseForStatement(); + case 'function': + return parseFunctionDeclaration(); + case 'if': + return parseIfStatement(); + case 'return': + return parseReturnStatement(); + case 'switch': + return parseSwitchStatement(); + case 'throw': + return parseThrowStatement(); + case 'try': + return parseTryStatement(); + case 'var': + return parseVariableStatement(); + case 'while': + return parseWhileStatement(); + case 'with': + return parseWithStatement(); + default: + break; + } + } + + expr = parseExpression(); + + // 12.12 Labelled Statements + if ((expr.type === Syntax.Identifier) && match(':')) { + lex(); + + if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { + throwError({}, Messages.Redeclaration, 'Label', expr.name); + } + + state.labelSet[expr.name] = true; + labeledBody = parseStatement(); + delete state.labelSet[expr.name]; + + return { + type: Syntax.LabeledStatement, + label: expr, + body: labeledBody + }; + } + + consumeSemicolon(); + + return { + type: Syntax.ExpressionStatement, + expression: expr + }; + } + + // 13 Function Definition + + function parseFunctionSourceElements() { + var sourceElement, sourceElements = [], token, directive, firstRestricted, + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; + + expect('{'); + + while (index < length) { + token = lookahead(); + if (token.type !== Token.StringLiteral) { + break; + } + + sourceElement = parseSourceElement(); + sourceElements.push(sourceElement); + if (sourceElement.expression.type !== Syntax.Literal) { + // this is not directive + break; + } + directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + if (directive === 'use strict') { + strict = true; + if (firstRestricted) { + throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + } + } else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + + oldLabelSet = state.labelSet; + oldInIteration = state.inIteration; + oldInSwitch = state.inSwitch; + oldInFunctionBody = state.inFunctionBody; + + state.labelSet = {}; + state.inIteration = false; + state.inSwitch = false; + state.inFunctionBody = true; + + while (index < length) { + if (match('}')) { + break; + } + sourceElement = parseSourceElement(); + if (typeof sourceElement === 'undefined') { + break; + } + sourceElements.push(sourceElement); + } + + expect('}'); + + state.labelSet = oldLabelSet; + state.inIteration = oldInIteration; + state.inSwitch = oldInSwitch; + state.inFunctionBody = oldInFunctionBody; + + return { + type: Syntax.BlockStatement, + body: sourceElements + }; + } + + function parseFunctionDeclaration() { + var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; + + expectKeyword('function'); + token = lookahead(); + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + + expect('('); + + if (!match(')')) { + paramSet = {}; + while (index < length) { + token = lookahead(); + param = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + stricted = token; + message = Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + stricted = token; + message = Messages.StrictParamDupe; + } + } else if (!firstRestricted) { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + firstRestricted = token; + message = Messages.StrictParamDupe; + } + } + params.push(param); + paramSet[param.name] = true; + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (strict && firstRestricted) { + throwError(firstRestricted, message); + } + if (strict && stricted) { + throwErrorTolerant(stricted, message); + } + strict = previousStrict; + + return { + type: Syntax.FunctionDeclaration, + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + function parseFunctionExpression() { + var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; + + expectKeyword('function'); + + if (!match('(')) { + token = lookahead(); + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + } + + expect('('); + + if (!match(')')) { + paramSet = {}; + while (index < length) { + token = lookahead(); + param = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + stricted = token; + message = Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + stricted = token; + message = Messages.StrictParamDupe; + } + } else if (!firstRestricted) { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + firstRestricted = token; + message = Messages.StrictParamDupe; + } + } + params.push(param); + paramSet[param.name] = true; + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (strict && firstRestricted) { + throwError(firstRestricted, message); + } + if (strict && stricted) { + throwErrorTolerant(stricted, message); + } + strict = previousStrict; + + return { + type: Syntax.FunctionExpression, + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + // 14 Program + + function parseSourceElement() { + var token = lookahead(); + + if (token.type === Token.Keyword) { + switch (token.value) { + case 'const': + case 'let': + return parseConstLetDeclaration(token.value); + case 'function': + return parseFunctionDeclaration(); + default: + return parseStatement(); + } + } + + if (token.type !== Token.EOF) { + return parseStatement(); + } + } + + function parseSourceElements() { + var sourceElement, sourceElements = [], token, directive, firstRestricted; + + while (index < length) { + token = lookahead(); + if (token.type !== Token.StringLiteral) { + break; + } + + sourceElement = parseSourceElement(); + sourceElements.push(sourceElement); + if (sourceElement.expression.type !== Syntax.Literal) { + // this is not directive + break; + } + directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + if (directive === 'use strict') { + strict = true; + if (firstRestricted) { + throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + } + } else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + + while (index < length) { + sourceElement = parseSourceElement(); + if (typeof sourceElement === 'undefined') { + break; + } + sourceElements.push(sourceElement); + } + return sourceElements; + } + + function parseProgram() { + var program; + strict = false; + program = { + type: Syntax.Program, + body: parseSourceElements() + }; + return program; + } + + // The following functions are needed only when the option to preserve + // the comments is active. + + function addComment(type, value, start, end, loc) { + assert(typeof start === 'number', 'Comment must have valid position'); + + // Because the way the actual token is scanned, often the comments + // (if any) are skipped twice during the lexical analysis. + // Thus, we need to skip adding a comment if the comment array already + // handled it. + if (extra.comments.length > 0) { + if (extra.comments[extra.comments.length - 1].range[1] > start) { + return; + } + } + + extra.comments.push({ + type: type, + value: value, + range: [start, end], + loc: loc + }); + } + + function scanComment() { + var comment, ch, loc, start, blockComment, lineComment; + + comment = ''; + blockComment = false; + lineComment = false; + + while (index < length) { + ch = source[index]; + + if (lineComment) { + ch = source[index++]; + if (isLineTerminator(ch)) { + loc.end = { + line: lineNumber, + column: index - lineStart - 1 + }; + lineComment = false; + addComment('Line', comment, start, index - 1, loc); + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + comment = ''; + } else if (index >= length) { + lineComment = false; + comment += ch; + loc.end = { + line: lineNumber, + column: length - lineStart + }; + addComment('Line', comment, start, length, loc); + } else { + comment += ch; + } + } else if (blockComment) { + if (isLineTerminator(ch)) { + if (ch === '\r' && source[index + 1] === '\n') { + ++index; + comment += '\r\n'; + } else { + comment += ch; + } + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + ch = source[index++]; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + comment += ch; + if (ch === '*') { + ch = source[index]; + if (ch === '/') { + comment = comment.substr(0, comment.length - 1); + blockComment = false; + ++index; + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Block', comment, start, index, loc); + comment = ''; + } + } + } + } else if (ch === '/') { + ch = source[index + 1]; + if (ch === '/') { + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + start = index; + index += 2; + lineComment = true; + if (index >= length) { + loc.end = { + line: lineNumber, + column: index - lineStart + }; + lineComment = false; + addComment('Line', comment, start, index, loc); + } + } else if (ch === '*') { + start = index; + index += 2; + blockComment = true; + loc = { + start: { + line: lineNumber, + column: index - lineStart - 2 + } + }; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + break; + } + } else if (isWhiteSpace(ch)) { + ++index; + } else if (isLineTerminator(ch)) { + ++index; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } else { + break; + } + } + } + + function filterCommentLocation() { + var i, entry, comment, comments = []; + + for (i = 0; i < extra.comments.length; ++i) { + entry = extra.comments[i]; + comment = { + type: entry.type, + value: entry.value + }; + if (extra.range) { + comment.range = entry.range; + } + if (extra.loc) { + comment.loc = entry.loc; + } + comments.push(comment); + } + + extra.comments = comments; + } + + function collectToken() { + var start, loc, token, range, value; + + skipComment(); + start = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + token = extra.advance(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + if (token.type !== Token.EOF) { + range = [token.range[0], token.range[1]]; + value = sliceSource(token.range[0], token.range[1]); + extra.tokens.push({ + type: TokenName[token.type], + value: value, + range: range, + loc: loc + }); + } + + return token; + } + + function collectRegex() { + var pos, loc, regex, token; + + skipComment(); + + pos = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + regex = extra.scanRegExp(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + // Pop the previous token, which is likely '/' or '/=' + if (extra.tokens.length > 0) { + token = extra.tokens[extra.tokens.length - 1]; + if (token.range[0] === pos && token.type === 'Punctuator') { + if (token.value === '/' || token.value === '/=') { + extra.tokens.pop(); + } + } + } + + extra.tokens.push({ + type: 'RegularExpression', + value: regex.literal, + range: [pos, index], + loc: loc + }); + + return regex; + } + + function filterTokenLocation() { + var i, entry, token, tokens = []; + + for (i = 0; i < extra.tokens.length; ++i) { + entry = extra.tokens[i]; + token = { + type: entry.type, + value: entry.value + }; + if (extra.range) { + token.range = entry.range; + } + if (extra.loc) { + token.loc = entry.loc; + } + tokens.push(token); + } + + extra.tokens = tokens; + } + + function createLiteral(token) { + return { + type: Syntax.Literal, + value: token.value + }; + } + + function createRawLiteral(token) { + return { + type: Syntax.Literal, + value: token.value, + raw: sliceSource(token.range[0], token.range[1]) + }; + } + + function createLocationMarker() { + var marker = {}; + + marker.range = [index, index]; + marker.loc = { + start: { + line: lineNumber, + column: index - lineStart + }, + end: { + line: lineNumber, + column: index - lineStart + } + }; + + marker.end = function () { + this.range[1] = index; + this.loc.end.line = lineNumber; + this.loc.end.column = index - lineStart; + }; + + marker.applyGroup = function (node) { + if (extra.range) { + node.groupRange = [this.range[0], this.range[1]]; + } + if (extra.loc) { + node.groupLoc = { + start: { + line: this.loc.start.line, + column: this.loc.start.column + }, + end: { + line: this.loc.end.line, + column: this.loc.end.column + } + }; + } + }; + + marker.apply = function (node) { + if (extra.range) { + node.range = [this.range[0], this.range[1]]; + } + if (extra.loc) { + node.loc = { + start: { + line: this.loc.start.line, + column: this.loc.start.column + }, + end: { + line: this.loc.end.line, + column: this.loc.end.column + } + }; + } + }; + + return marker; + } + + function trackGroupExpression() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + expect('('); + + expr = parseExpression(); + + expect(')'); + + marker.end(); + marker.applyGroup(expr); + + return expr; + } + + function trackLeftHandSideExpression() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[')) { + if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + marker.end(); + marker.apply(expr); + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + marker.end(); + marker.apply(expr); + } + } + + return expr; + } + + function trackLeftHandSideExpressionAllowCall() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[') || match('(')) { + if (match('(')) { + expr = { + type: Syntax.CallExpression, + callee: expr, + 'arguments': parseArguments() + }; + marker.end(); + marker.apply(expr); + } else if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + marker.end(); + marker.apply(expr); + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + marker.end(); + marker.apply(expr); + } + } + + return expr; + } + + function filterGroup(node) { + var n, i, entry; + + n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; + for (i in node) { + if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { + entry = node[i]; + if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { + n[i] = entry; + } else { + n[i] = filterGroup(entry); + } + } + } + return n; + } + + function wrapTrackingFunction(range, loc) { + + return function (parseFunction) { + + function isBinary(node) { + return node.type === Syntax.LogicalExpression || + node.type === Syntax.BinaryExpression; + } + + function visit(node) { + var start, end; + + if (isBinary(node.left)) { + visit(node.left); + } + if (isBinary(node.right)) { + visit(node.right); + } + + if (range) { + if (node.left.groupRange || node.right.groupRange) { + start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; + end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; + node.range = [start, end]; + } else if (typeof node.range === 'undefined') { + start = node.left.range[0]; + end = node.right.range[1]; + node.range = [start, end]; + } + } + if (loc) { + if (node.left.groupLoc || node.right.groupLoc) { + start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; + end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; + node.loc = { + start: start, + end: end + }; + } else if (typeof node.loc === 'undefined') { + node.loc = { + start: node.left.loc.start, + end: node.right.loc.end + }; + } + } + } + + return function () { + var marker, node; + + skipComment(); + + marker = createLocationMarker(); + node = parseFunction.apply(null, arguments); + marker.end(); + + if (range && typeof node.range === 'undefined') { + marker.apply(node); + } + + if (loc && typeof node.loc === 'undefined') { + marker.apply(node); + } + + if (isBinary(node)) { + visit(node); + } + + return node; + }; + }; + } + + function patch() { + + var wrapTracking; + + if (extra.comments) { + extra.skipComment = skipComment; + skipComment = scanComment; + } + + if (extra.raw) { + extra.createLiteral = createLiteral; + createLiteral = createRawLiteral; + } + + if (extra.range || extra.loc) { + + extra.parseGroupExpression = parseGroupExpression; + extra.parseLeftHandSideExpression = parseLeftHandSideExpression; + extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; + parseGroupExpression = trackGroupExpression; + parseLeftHandSideExpression = trackLeftHandSideExpression; + parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; + + wrapTracking = wrapTrackingFunction(extra.range, extra.loc); + + extra.parseAdditiveExpression = parseAdditiveExpression; + extra.parseAssignmentExpression = parseAssignmentExpression; + extra.parseBitwiseANDExpression = parseBitwiseANDExpression; + extra.parseBitwiseORExpression = parseBitwiseORExpression; + extra.parseBitwiseXORExpression = parseBitwiseXORExpression; + extra.parseBlock = parseBlock; + extra.parseFunctionSourceElements = parseFunctionSourceElements; + extra.parseCatchClause = parseCatchClause; + extra.parseComputedMember = parseComputedMember; + extra.parseConditionalExpression = parseConditionalExpression; + extra.parseConstLetDeclaration = parseConstLetDeclaration; + extra.parseEqualityExpression = parseEqualityExpression; + extra.parseExpression = parseExpression; + extra.parseForVariableDeclaration = parseForVariableDeclaration; + extra.parseFunctionDeclaration = parseFunctionDeclaration; + extra.parseFunctionExpression = parseFunctionExpression; + extra.parseLogicalANDExpression = parseLogicalANDExpression; + extra.parseLogicalORExpression = parseLogicalORExpression; + extra.parseMultiplicativeExpression = parseMultiplicativeExpression; + extra.parseNewExpression = parseNewExpression; + extra.parseNonComputedProperty = parseNonComputedProperty; + extra.parseObjectProperty = parseObjectProperty; + extra.parseObjectPropertyKey = parseObjectPropertyKey; + extra.parsePostfixExpression = parsePostfixExpression; + extra.parsePrimaryExpression = parsePrimaryExpression; + extra.parseProgram = parseProgram; + extra.parsePropertyFunction = parsePropertyFunction; + extra.parseRelationalExpression = parseRelationalExpression; + extra.parseStatement = parseStatement; + extra.parseShiftExpression = parseShiftExpression; + extra.parseSwitchCase = parseSwitchCase; + extra.parseUnaryExpression = parseUnaryExpression; + extra.parseVariableDeclaration = parseVariableDeclaration; + extra.parseVariableIdentifier = parseVariableIdentifier; + + parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); + parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); + parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); + parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); + parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); + parseBlock = wrapTracking(extra.parseBlock); + parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); + parseCatchClause = wrapTracking(extra.parseCatchClause); + parseComputedMember = wrapTracking(extra.parseComputedMember); + parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); + parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); + parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); + parseExpression = wrapTracking(extra.parseExpression); + parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); + parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); + parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); + parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); + parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); + parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); + parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); + parseNewExpression = wrapTracking(extra.parseNewExpression); + parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); + parseObjectProperty = wrapTracking(extra.parseObjectProperty); + parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); + parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); + parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); + parseProgram = wrapTracking(extra.parseProgram); + parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); + parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); + parseStatement = wrapTracking(extra.parseStatement); + parseShiftExpression = wrapTracking(extra.parseShiftExpression); + parseSwitchCase = wrapTracking(extra.parseSwitchCase); + parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); + parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); + parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); + } + + if (typeof extra.tokens !== 'undefined') { + extra.advance = advance; + extra.scanRegExp = scanRegExp; + + advance = collectToken; + scanRegExp = collectRegex; + } + } + + function unpatch() { + if (typeof extra.skipComment === 'function') { + skipComment = extra.skipComment; + } + + if (extra.raw) { + createLiteral = extra.createLiteral; + } + + if (extra.range || extra.loc) { + parseAdditiveExpression = extra.parseAdditiveExpression; + parseAssignmentExpression = extra.parseAssignmentExpression; + parseBitwiseANDExpression = extra.parseBitwiseANDExpression; + parseBitwiseORExpression = extra.parseBitwiseORExpression; + parseBitwiseXORExpression = extra.parseBitwiseXORExpression; + parseBlock = extra.parseBlock; + parseFunctionSourceElements = extra.parseFunctionSourceElements; + parseCatchClause = extra.parseCatchClause; + parseComputedMember = extra.parseComputedMember; + parseConditionalExpression = extra.parseConditionalExpression; + parseConstLetDeclaration = extra.parseConstLetDeclaration; + parseEqualityExpression = extra.parseEqualityExpression; + parseExpression = extra.parseExpression; + parseForVariableDeclaration = extra.parseForVariableDeclaration; + parseFunctionDeclaration = extra.parseFunctionDeclaration; + parseFunctionExpression = extra.parseFunctionExpression; + parseGroupExpression = extra.parseGroupExpression; + parseLeftHandSideExpression = extra.parseLeftHandSideExpression; + parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; + parseLogicalANDExpression = extra.parseLogicalANDExpression; + parseLogicalORExpression = extra.parseLogicalORExpression; + parseMultiplicativeExpression = extra.parseMultiplicativeExpression; + parseNewExpression = extra.parseNewExpression; + parseNonComputedProperty = extra.parseNonComputedProperty; + parseObjectProperty = extra.parseObjectProperty; + parseObjectPropertyKey = extra.parseObjectPropertyKey; + parsePrimaryExpression = extra.parsePrimaryExpression; + parsePostfixExpression = extra.parsePostfixExpression; + parseProgram = extra.parseProgram; + parsePropertyFunction = extra.parsePropertyFunction; + parseRelationalExpression = extra.parseRelationalExpression; + parseStatement = extra.parseStatement; + parseShiftExpression = extra.parseShiftExpression; + parseSwitchCase = extra.parseSwitchCase; + parseUnaryExpression = extra.parseUnaryExpression; + parseVariableDeclaration = extra.parseVariableDeclaration; + parseVariableIdentifier = extra.parseVariableIdentifier; + } + + if (typeof extra.scanRegExp === 'function') { + advance = extra.advance; + scanRegExp = extra.scanRegExp; + } + } + + function stringToArray(str) { + var length = str.length, + result = [], + i; + for (i = 0; i < length; ++i) { + result[i] = str.charAt(i); + } + return result; + } + + function parse(code, options) { + var program, toString; + + toString = String; + if (typeof code !== 'string' && !(code instanceof String)) { + code = toString(code); + } + + source = code; + index = 0; + lineNumber = (source.length > 0) ? 1 : 0; + lineStart = 0; + length = source.length; + buffer = null; + state = { + allowIn: true, + labelSet: {}, + inFunctionBody: false, + inIteration: false, + inSwitch: false + }; + + extra = {}; + if (typeof options !== 'undefined') { + extra.range = (typeof options.range === 'boolean') && options.range; + extra.loc = (typeof options.loc === 'boolean') && options.loc; + extra.raw = (typeof options.raw === 'boolean') && options.raw; + if (typeof options.tokens === 'boolean' && options.tokens) { + extra.tokens = []; + } + if (typeof options.comment === 'boolean' && options.comment) { + extra.comments = []; + } + if (typeof options.tolerant === 'boolean' && options.tolerant) { + extra.errors = []; + } + } + + if (length > 0) { + if (typeof source[0] === 'undefined') { + // Try first to convert to a string. This is good as fast path + // for old IE which understands string indexing for string + // literals only and not for string object. + if (code instanceof String) { + source = code.valueOf(); + } + + // Force accessing the characters via an array. + if (typeof source[0] === 'undefined') { + source = stringToArray(code); + } + } + } + + patch(); + try { + program = parseProgram(); + if (typeof extra.comments !== 'undefined') { + filterCommentLocation(); + program.comments = extra.comments; + } + if (typeof extra.tokens !== 'undefined') { + filterTokenLocation(); + program.tokens = extra.tokens; + } + if (typeof extra.errors !== 'undefined') { + program.errors = extra.errors; + } + if (extra.range || extra.loc) { + program.body = filterGroup(program.body); + } + } catch (e) { + throw e; + } finally { + unpatch(); + extra = {}; + } + + return program; + } + + // Sync with package.json. + exports.version = '1.0.4'; + + exports.parse = parse; + + // Deep copy. + exports.Syntax = (function () { + var name, types = {}; + + if (typeof Object.create === 'function') { + types = Object.create(null); + } + + for (name in Syntax) { + if (Syntax.hasOwnProperty(name)) { + types[name] = Syntax[name]; + } + } + + if (typeof Object.freeze === 'function') { + Object.freeze(types); + } + + return types; + }()); + +})); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json new file mode 100644 index 0000000..d334e35 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json @@ -0,0 +1,59 @@ +{ + "name": "esprima", + "description": "ECMAScript parsing infrastructure for multipurpose analysis", + "homepage": "http://esprima.org", + "main": "esprima.js", + "bin": { + "esparse": "./bin/esparse.js", + "esvalidate": "./bin/esvalidate.js" + }, + "files": [ + "bin", + "test/run.js", + "test/runner.js", + "test/test.js", + "test/compat.js", + "test/reflect.js", + "esprima.js" + ], + "version": "1.0.4", + "engines": { + "node": ">=0.4.0" + }, + "maintainers": [ + { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com", + "url": "http://ariya.ofilabs.com" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/ariya/esprima.git" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD" + } + ], + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax" + ], + "scripts": { + "test": "node test/run.js", + "benchmark": "node test/benchmarks.js", + "benchmark-quick": "node test/benchmarks.js quick" + }, + "readme": "**Esprima** ([esprima.org](http://esprima.org)) is a high performance,\nstandard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\nparser written in ECMAScript (also popularly known as\n[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).\nEsprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),\nwith the help of [many contributors](https://github.com/ariya/esprima/contributors).\n\nEsprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as\n[Node.js](http://nodejs.org).\n\n### Features\n\n- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262)\n- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla\n[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\n- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage)\n- Optional tracking of syntax node location (index-based and line-column)\n- Experimental support for ES6/Harmony (module, class, destructuring, ...)\n\nEsprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)).\nIt is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html)\nwith the new generation of fast parsers.\n\n### Applications\n\nEsprima serves as the basis for many popular JavaScript development tools:\n\n- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul)\n- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck)\n- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS),\n[Sweet.js](http://sweetjs.org/) (macro)\n- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr)\n- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html))\n- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter),\n- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen)\n\n### Questions?\n- [Documentation](http://esprima.org/doc)\n- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect)\nand [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement)\n- [Mailing list](http://groups.google.com/group/esprima)\n- [Contribution guide](http://esprima.org/doc/index.html#contribution)\n\nFollow [@Esprima](http://twitter.com/Esprima) on Twitter to get the\ndevelopment updates.\nFeedback and contribution are welcomed!\n\n### License\n\nCopyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)\n and other contributors.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/ariya/esprima/issues" + }, + "_id": "esprima@1.0.4", + "_from": "esprima@~1.0.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/compat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/compat.js new file mode 100644 index 0000000..ee3a629 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/compat.js @@ -0,0 +1,239 @@ +/* + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint node: true */ +/*global document: true, window:true, esprima: true, testReflect: true */ + +var runTests; + +function getContext(esprima, reportCase, reportFailure) { + 'use strict'; + + var Reflect, Pattern; + + // Maps Mozilla Reflect object to our Esprima parser. + Reflect = { + parse: function (code) { + var result; + + reportCase(code); + + try { + result = esprima.parse(code); + } catch (error) { + result = error; + } + + return result; + } + }; + + // This is used by Reflect test suite to match a syntax tree. + Pattern = function (obj) { + var pattern; + + // Poor man's deep object cloning. + pattern = JSON.parse(JSON.stringify(obj)); + + // Special handling for regular expression literal since we need to + // convert it to a string literal, otherwise it will be decoded + // as object "{}" and the regular expression would be lost. + if (obj.type && obj.type === 'Literal') { + if (obj.value instanceof RegExp) { + pattern = { + type: obj.type, + value: obj.value.toString() + }; + } + } + + // Special handling for branch statement because SpiderMonkey + // prefers to put the 'alternate' property before 'consequent'. + if (obj.type && obj.type === 'IfStatement') { + pattern = { + type: pattern.type, + test: pattern.test, + consequent: pattern.consequent, + alternate: pattern.alternate + }; + } + + // Special handling for do while statement because SpiderMonkey + // prefers to put the 'test' property before 'body'. + if (obj.type && obj.type === 'DoWhileStatement') { + pattern = { + type: pattern.type, + body: pattern.body, + test: pattern.test + }; + } + + function adjustRegexLiteralAndRaw(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } else if (key === 'raw' && typeof value === "string") { + // Ignore Esprima-specific 'raw' property. + return undefined; + } + return value; + } + + if (obj.type && (obj.type === 'Program')) { + pattern.assert = function (tree) { + var actual, expected; + actual = JSON.stringify(tree, adjustRegexLiteralAndRaw, 4); + expected = JSON.stringify(obj, null, 4); + + if (expected !== actual) { + reportFailure(expected, actual); + } + }; + } + + return pattern; + }; + + return { + Reflect: Reflect, + Pattern: Pattern + }; +} + +if (typeof window !== 'undefined') { + // Run all tests in a browser environment. + runTests = function () { + 'use strict'; + + var total = 0, + failures = 0; + + function setText(el, str) { + if (typeof el.innerText === 'string') { + el.innerText = str; + } else { + el.textContent = str; + } + } + + function reportCase(code) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + total += 1; + } + + function reportFailure(expected, actual) { + var report, e; + + failures += 1; + + report = document.getElementById('report'); + + e = document.createElement('p'); + setText(e, 'Expected'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'expected'); + setText(e, expected); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Actual'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'actual'); + setText(e, actual); + report.appendChild(e); + } + + setText(document.getElementById('version'), esprima.version); + + window.setTimeout(function () { + var tick, context = getContext(esprima, reportCase, reportFailure); + + tick = new Date(); + testReflect(context.Reflect, context.Pattern); + tick = (new Date()) - tick; + + if (failures > 0) { + setText(document.getElementById('status'), total + ' tests. ' + + 'Failures: ' + failures + '. ' + tick + ' ms'); + } else { + setText(document.getElementById('status'), total + ' tests. ' + + 'No failure. ' + tick + ' ms'); + } + }, 513); + }; +} else { + (function (global) { + 'use strict'; + var esprima = require('../esprima'), + tick, + total = 0, + failures = [], + header, + current, + context; + + function reportCase(code) { + total += 1; + current = code; + } + + function reportFailure(expected, actual) { + failures.push({ + source: current, + expected: expected.toString(), + actual: actual.toString() + }); + } + + context = getContext(esprima, reportCase, reportFailure); + + tick = new Date(); + require('./reflect').testReflect(context.Reflect, context.Pattern); + tick = (new Date()) - tick; + + header = total + ' tests. ' + failures.length + ' failures. ' + + tick + ' ms'; + if (failures.length) { + console.error(header); + failures.forEach(function (failure) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + }); + } else { + console.log(header); + } + process.exit(failures.length === 0 ? 0 : 1); + }(this)); +} +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/reflect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/reflect.js new file mode 100644 index 0000000..dba1ba8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/reflect.js @@ -0,0 +1,422 @@ +// This is modified from Mozilla Reflect.parse test suite (the file is located +// at js/src/tests/js1_8_5/extensions/reflect-parse.js in the source tree). +// +// Some notable changes: +// * Removed unsupported features (destructuring, let, comprehensions...). +// * Removed tests for E4X (ECMAScript for XML). +// * Removed everything related to builder. +// * Enclosed every 'Pattern' construct with a scope. +// * Tweaked some expected tree to remove generator field. +// * Removed the test for bug 632030 and bug 632024. + +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +(function (exports) { + +function testReflect(Reflect, Pattern) { + +function program(elts) { return Pattern({ type: "Program", body: elts }) } +function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } +function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } +function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } +function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } +function lit(val) { return Pattern({ type: "Literal", value: val }) } +var thisExpr = Pattern({ type: "ThisExpression" }); +function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } +function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } +function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } +function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } +function ident(name) { return Pattern({ type: "Identifier", name: name }) } +function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } +function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } +function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } +function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } +function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } +function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } +function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } +function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } +var emptyStmt = Pattern({ type: "EmptyStatement" }); +function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } +function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } +function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } +function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } +function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } +function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } +function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } +function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } +function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } +function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }) } +function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } +function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", + id: id, + params: args, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", + id: id, + params: args, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } + +function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } +function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } +function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } +function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } +function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } + +function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } +function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } +function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } +function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } +function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } +function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } +function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } + +function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } +function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } + +function localSrc(src) { return "(function(){ " + src + " })" } +function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } +function blockSrc(src) { return "(function(){ { " + src + " } })" } +function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } + +function assertBlockStmt(src, patt) { + blockPatt(patt).assert(Reflect.parse(blockSrc(src))); +} + +function assertBlockExpr(src, patt) { + assertBlockStmt(src, exprStmt(patt)); +} + +function assertBlockDecl(src, patt, builder) { + blockPatt(patt).assert(Reflect.parse(blockSrc(src), {builder: builder})); +} + +function assertLocalStmt(src, patt) { + localPatt(patt).assert(Reflect.parse(localSrc(src))); +} + +function assertLocalExpr(src, patt) { + assertLocalStmt(src, exprStmt(patt)); +} + +function assertLocalDecl(src, patt) { + localPatt(patt).assert(Reflect.parse(localSrc(src))); +} + +function assertGlobalStmt(src, patt, builder) { + program([patt]).assert(Reflect.parse(src, {builder: builder})); +} + +function assertGlobalExpr(src, patt, builder) { + program([exprStmt(patt)]).assert(Reflect.parse(src, {builder: builder})); + //assertStmt(src, exprStmt(patt)); +} + +function assertGlobalDecl(src, patt) { + program([patt]).assert(Reflect.parse(src)); +} + +function assertProg(src, patt) { + program(patt).assert(Reflect.parse(src)); +} + +function assertStmt(src, patt) { + assertLocalStmt(src, patt); + assertGlobalStmt(src, patt); + assertBlockStmt(src, patt); +} + +function assertExpr(src, patt) { + assertLocalExpr(src, patt); + assertGlobalExpr(src, patt); + assertBlockExpr(src, patt); +} + +function assertDecl(src, patt) { + assertLocalDecl(src, patt); + assertGlobalDecl(src, patt); + assertBlockDecl(src, patt); +} + +function assertError(src, errorType) { + try { + Reflect.parse(src); + } catch (e) { + return; + } + throw new Error("expected " + errorType.name + " for " + uneval(src)); +} + + +// general tests + +// NB: These are useful but for now jit-test doesn't do I/O reliably. + +//program(_).assert(Reflect.parse(snarf('data/flapjax.txt'))); +//program(_).assert(Reflect.parse(snarf('data/jquery-1.4.2.txt'))); +//program(_).assert(Reflect.parse(snarf('data/prototype.js'))); +//program(_).assert(Reflect.parse(snarf('data/dojo.js.uncompressed.js'))); +//program(_).assert(Reflect.parse(snarf('data/mootools-1.2.4-core-nc.js'))); + + +// declarations + +assertDecl("var x = 1, y = 2, z = 3", + varDecl([declarator(ident("x"), lit(1)), + declarator(ident("y"), lit(2)), + declarator(ident("z"), lit(3))])); +assertDecl("var x, y, z", + varDecl([declarator(ident("x"), null), + declarator(ident("y"), null), + declarator(ident("z"), null)])); +assertDecl("function foo() { }", + funDecl(ident("foo"), [], blockStmt([]))); +assertDecl("function foo() { return 42 }", + funDecl(ident("foo"), [], blockStmt([returnStmt(lit(42))]))); + + +// Bug 591437: rebound args have their defs turned into uses +assertDecl("function f(a) { function a() { } }", + funDecl(ident("f"), [ident("a")], blockStmt([funDecl(ident("a"), [], blockStmt([]))]))); +assertDecl("function f(a,b,c) { function b() { } }", + funDecl(ident("f"), [ident("a"),ident("b"),ident("c")], blockStmt([funDecl(ident("b"), [], blockStmt([]))]))); + +// expressions + +assertExpr("true", lit(true)); +assertExpr("false", lit(false)); +assertExpr("42", lit(42)); +assertExpr("(/asdf/)", lit(/asdf/)); +assertExpr("this", thisExpr); +assertExpr("foo", ident("foo")); +assertExpr("foo.bar", dotExpr(ident("foo"), ident("bar"))); +assertExpr("foo[bar]", memExpr(ident("foo"), ident("bar"))); +assertExpr("(function(){})", funExpr(null, [], blockStmt([]))); +assertExpr("(function f() {})", funExpr(ident("f"), [], blockStmt([]))); +assertExpr("(function f(x,y,z) {})", funExpr(ident("f"), [ident("x"),ident("y"),ident("z")], blockStmt([]))); +assertExpr("(++x)", updExpr("++", ident("x"), true)); +assertExpr("(x++)", updExpr("++", ident("x"), false)); +assertExpr("(+x)", unExpr("+", ident("x"))); +assertExpr("(-x)", unExpr("-", ident("x"))); +assertExpr("(!x)", unExpr("!", ident("x"))); +assertExpr("(~x)", unExpr("~", ident("x"))); +assertExpr("(delete x)", unExpr("delete", ident("x"))); +assertExpr("(typeof x)", unExpr("typeof", ident("x"))); +assertExpr("(void x)", unExpr("void", ident("x"))); +assertExpr("(x == y)", binExpr("==", ident("x"), ident("y"))); +assertExpr("(x != y)", binExpr("!=", ident("x"), ident("y"))); +assertExpr("(x === y)", binExpr("===", ident("x"), ident("y"))); +assertExpr("(x !== y)", binExpr("!==", ident("x"), ident("y"))); +assertExpr("(x < y)", binExpr("<", ident("x"), ident("y"))); +assertExpr("(x <= y)", binExpr("<=", ident("x"), ident("y"))); +assertExpr("(x > y)", binExpr(">", ident("x"), ident("y"))); +assertExpr("(x >= y)", binExpr(">=", ident("x"), ident("y"))); +assertExpr("(x << y)", binExpr("<<", ident("x"), ident("y"))); +assertExpr("(x >> y)", binExpr(">>", ident("x"), ident("y"))); +assertExpr("(x >>> y)", binExpr(">>>", ident("x"), ident("y"))); +assertExpr("(x + y)", binExpr("+", ident("x"), ident("y"))); +assertExpr("(w + x + y + z)", binExpr("+", binExpr("+", binExpr("+", ident("w"), ident("x")), ident("y")), ident("z"))); +assertExpr("(x - y)", binExpr("-", ident("x"), ident("y"))); +assertExpr("(w - x - y - z)", binExpr("-", binExpr("-", binExpr("-", ident("w"), ident("x")), ident("y")), ident("z"))); +assertExpr("(x * y)", binExpr("*", ident("x"), ident("y"))); +assertExpr("(x / y)", binExpr("/", ident("x"), ident("y"))); +assertExpr("(x % y)", binExpr("%", ident("x"), ident("y"))); +assertExpr("(x | y)", binExpr("|", ident("x"), ident("y"))); +assertExpr("(x ^ y)", binExpr("^", ident("x"), ident("y"))); +assertExpr("(x & y)", binExpr("&", ident("x"), ident("y"))); +assertExpr("(x in y)", binExpr("in", ident("x"), ident("y"))); +assertExpr("(x instanceof y)", binExpr("instanceof", ident("x"), ident("y"))); +assertExpr("(x = y)", aExpr("=", ident("x"), ident("y"))); +assertExpr("(x += y)", aExpr("+=", ident("x"), ident("y"))); +assertExpr("(x -= y)", aExpr("-=", ident("x"), ident("y"))); +assertExpr("(x *= y)", aExpr("*=", ident("x"), ident("y"))); +assertExpr("(x /= y)", aExpr("/=", ident("x"), ident("y"))); +assertExpr("(x %= y)", aExpr("%=", ident("x"), ident("y"))); +assertExpr("(x <<= y)", aExpr("<<=", ident("x"), ident("y"))); +assertExpr("(x >>= y)", aExpr(">>=", ident("x"), ident("y"))); +assertExpr("(x >>>= y)", aExpr(">>>=", ident("x"), ident("y"))); +assertExpr("(x |= y)", aExpr("|=", ident("x"), ident("y"))); +assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); +assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); +assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); +assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); +assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) +assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); +assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) +assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) +assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); +assertExpr("(new Object)", newExpr(ident("Object"), [])); +assertExpr("(new Object())", newExpr(ident("Object"), [])); +assertExpr("(new Object(42))", newExpr(ident("Object"), [lit(42)])); +assertExpr("(new Object(1,2,3))", newExpr(ident("Object"), [lit(1),lit(2),lit(3)])); +assertExpr("(String())", callExpr(ident("String"), [])); +assertExpr("(String(42))", callExpr(ident("String"), [lit(42)])); +assertExpr("(String(1,2,3))", callExpr(ident("String"), [lit(1),lit(2),lit(3)])); +assertExpr("[]", arrExpr([])); +assertExpr("[1]", arrExpr([lit(1)])); +assertExpr("[1,2]", arrExpr([lit(1),lit(2)])); +assertExpr("[1,2,3]", arrExpr([lit(1),lit(2),lit(3)])); +assertExpr("[1,,2,3]", arrExpr([lit(1),,lit(2),lit(3)])); +assertExpr("[1,,,2,3]", arrExpr([lit(1),,,lit(2),lit(3)])); +assertExpr("[1,,,2,,3]", arrExpr([lit(1),,,lit(2),,lit(3)])); +assertExpr("[1,,,2,,,3]", arrExpr([lit(1),,,lit(2),,,lit(3)])); +assertExpr("[,1,2,3]", arrExpr([,lit(1),lit(2),lit(3)])); +assertExpr("[,,1,2,3]", arrExpr([,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3]", arrExpr([,,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3,]", arrExpr([,,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined])); +assertExpr("[,,,1,2,3,,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined,undefined])); +assertExpr("[,,,,,]", arrExpr([undefined,undefined,undefined,undefined,undefined])); +assertExpr("({})", objExpr([])); +assertExpr("({x:1})", objExpr([objProp(ident("x"), lit(1), "init")])); +assertExpr("({x:1, y:2})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(ident("y"), lit(2), "init")])); +assertExpr("({x:1, y:2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(ident("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({x:1, 'y':2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({'x':1, 'y':2, z:3})", objExpr([objProp(lit("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({'x':1, 'y':2, 3:3})", objExpr([objProp(lit("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(lit(3), lit(3), "init") ])); + +// Bug 571617: eliminate constant-folding +assertExpr("2 + 3", binExpr("+", lit(2), lit(3))); + +// Bug 632026: constant-folding +assertExpr("typeof(0?0:a)", unExpr("typeof", condExpr(lit(0), lit(0), ident("a")))); + +// Bug 632056: constant-folding +program([exprStmt(ident("f")), + ifStmt(lit(1), + funDecl(ident("f"), [], blockStmt([])), + null)]).assert(Reflect.parse("f; if (1) function f(){}")); + +// statements + +assertStmt("throw 42", throwStmt(lit(42))); +assertStmt("for (;;) break", forStmt(null, null, null, breakStmt(null))); +assertStmt("for (x; y; z) break", forStmt(ident("x"), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (var x; y; z) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (x; ; z) break", forStmt(ident("x"), null, ident("z"), breakStmt(null))); +assertStmt("for (var x; ; z) break", forStmt(varDecl([declarator(ident("x"), null)]), null, ident("z"), breakStmt(null))); +assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), null, ident("z"), breakStmt(null))); +assertStmt("for (x; y; ) break", forStmt(ident("x"), ident("y"), null, breakStmt(null))); +assertStmt("for (var x; y; ) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), null, breakStmt(null))); +assertStmt("for (var x = 42; y; ) break", forStmt(varDecl([declarator(ident("x"),lit(42))]), ident("y"), null, breakStmt(null))); +assertStmt("for (var x in y) break", forInStmt(varDecl([declarator(ident("x"),null)]), ident("y"), breakStmt(null))); +assertStmt("for (x in y) break", forInStmt(ident("x"), ident("y"), breakStmt(null))); +assertStmt("{ }", blockStmt([])); +assertStmt("{ throw 1; throw 2; throw 3; }", blockStmt([ throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))])); +assertStmt(";", emptyStmt); +assertStmt("if (foo) throw 42;", ifStmt(ident("foo"), throwStmt(lit(42)), null)); +assertStmt("if (foo) throw 42; else true;", ifStmt(ident("foo"), throwStmt(lit(42)), exprStmt(lit(true)))); +assertStmt("if (foo) { throw 1; throw 2; throw 3; }", + ifStmt(ident("foo"), + blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), + null)); +assertStmt("if (foo) { throw 1; throw 2; throw 3; } else true;", + ifStmt(ident("foo"), + blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), + exprStmt(lit(true)))); +assertStmt("foo: for(;;) break foo;", labStmt(ident("foo"), forStmt(null, null, null, breakStmt(ident("foo"))))); +assertStmt("foo: for(;;) continue foo;", labStmt(ident("foo"), forStmt(null, null, null, continueStmt(ident("foo"))))); +assertStmt("with (obj) { }", withStmt(ident("obj"), blockStmt([]))); +assertStmt("with (obj) { obj; }", withStmt(ident("obj"), blockStmt([exprStmt(ident("obj"))]))); +assertStmt("while (foo) { }", whileStmt(ident("foo"), blockStmt([]))); +assertStmt("while (foo) { foo; }", whileStmt(ident("foo"), blockStmt([exprStmt(ident("foo"))]))); +assertStmt("do { } while (foo);", doStmt(blockStmt([]), ident("foo"))); +assertStmt("do { foo; } while (foo)", doStmt(blockStmt([exprStmt(ident("foo"))]), ident("foo"))); +assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; }", + switchStmt(ident("foo"), + [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), + caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), + defaultClause([ exprStmt(lit(3)) ]) ])); +assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; case 42: 42; }", + switchStmt(ident("foo"), + [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), + caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), + defaultClause([ exprStmt(lit(3)) ]), + caseClause(lit(42), [ exprStmt(lit(42)) ]) ])); +assertStmt("try { } catch (e) { }", + tryStmt(blockStmt([]), + [], + [ catchClause(ident("e"), null, blockStmt([])) ], + null)); +assertStmt("try { } catch (e) { } finally { }", + tryStmt(blockStmt([]), + [], + [ catchClause(ident("e"), null, blockStmt([])) ], + blockStmt([]))); +assertStmt("try { } finally { }", + tryStmt(blockStmt([]), + [], + [], + blockStmt([]))); + +// redeclarations (TOK_NAME nodes with lexdef) + +assertStmt("function f() { function g() { } function g() { } }", + funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), + funDecl(ident("g"), [], blockStmt([]))]))); + +assertStmt("function f() { function g() { } function g() { return 42 } }", + funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), + funDecl(ident("g"), [], blockStmt([returnStmt(lit(42))]))]))); + +assertStmt("function f() { var x = 42; var x = 43; }", + funDecl(ident("f"), [], blockStmt([varDecl([declarator(ident("x"),lit(42))]), + varDecl([declarator(ident("x"),lit(43))])]))); + +// getters and setters + + assertExpr("({ get x() { return 42 } })", + objExpr([ objProp(ident("x"), + funExpr(null, [], blockStmt([returnStmt(lit(42))])), + "get" ) ])); + assertExpr("({ set x(v) { return 42 } })", + objExpr([ objProp(ident("x"), + funExpr(null, [ident("v")], blockStmt([returnStmt(lit(42))])), + "set" ) ])); + +} + +exports.testReflect = testReflect; + +}(typeof exports === 'undefined' ? this : exports)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/run.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/run.js new file mode 100644 index 0000000..32ca3fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/run.js @@ -0,0 +1,66 @@ +/* + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint node:true */ + +(function () { + 'use strict'; + + var child = require('child_process'), + nodejs = '"' + process.execPath + '"', + ret = 0, + suites, + index; + + suites = [ + 'runner', + 'compat' + ]; + + function nextTest() { + var suite = suites[index]; + + if (index < suites.length) { + child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) { + if (stdout) { + process.stdout.write(suite + ': ' + stdout); + } + if (stderr) { + process.stderr.write(suite + ': ' + stderr); + } + if (err) { + ret = err.code; + } + index += 1; + nextTest(); + }); + } else { + process.exit(ret); + } + } + + index = 0; + nextTest(); +}()); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/runner.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/runner.js new file mode 100644 index 0000000..c1a3fc9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/runner.js @@ -0,0 +1,387 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Yusuke Suzuki + Copyright (C) 2011 Arpad Borsos + + 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. + + 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 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. +*/ + +/*jslint browser:true node:true */ +/*global esprima:true, testFixture:true */ + +var runTests; + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + 'use strict'; + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +function NotMatchingError(expected, actual) { + 'use strict'; + Error.call(this, 'Expected '); + this.expected = expected; + this.actual = actual; +} +NotMatchingError.prototype = new Error(); + +function errorToObject(e) { + 'use strict'; + var msg = e.toString(); + + // Opera 9.64 produces an non-standard string in toString(). + if (msg.substr(0, 6) !== 'Error:') { + if (typeof e.message === 'string') { + msg = 'Error: ' + e.message; + } + } + + return { + index: e.index, + lineNumber: e.lineNumber, + column: e.column, + message: msg + }; +} + +function testParse(esprima, code, syntax) { + 'use strict'; + var expected, tree, actual, options, StringObject, i, len, err; + + // alias, so that JSLint does not complain. + StringObject = String; + + options = { + comment: (typeof syntax.comments !== 'undefined'), + range: true, + loc: true, + tokens: (typeof syntax.tokens !== 'undefined'), + raw: true, + tolerant: (typeof syntax.errors !== 'undefined') + }; + + if (typeof syntax.tokens !== 'undefined') { + if (syntax.tokens.length > 0) { + options.range = (typeof syntax.tokens[0].range !== 'undefined'); + options.loc = (typeof syntax.tokens[0].loc !== 'undefined'); + } + } + + if (typeof syntax.comments !== 'undefined') { + if (syntax.comments.length > 0) { + options.range = (typeof syntax.comments[0].range !== 'undefined'); + options.loc = (typeof syntax.comments[0].loc !== 'undefined'); + } + } + + expected = JSON.stringify(syntax, null, 4); + try { + tree = esprima.parse(code, options); + tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; + + if (options.tolerant) { + for (i = 0, len = tree.errors.length; i < len; i += 1) { + tree.errors[i] = errorToObject(tree.errors[i]); + } + } + + actual = JSON.stringify(tree, adjustRegexLiteral, 4); + + // Only to ensure that there is no error when using string object. + esprima.parse(new StringObject(code), options); + + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } + + function filter(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return (key === 'loc' || key === 'range') ? undefined : value; + } + + if (options.tolerant) { + return; + } + + + // Check again without any location info. + options.range = false; + options.loc = false; + expected = JSON.stringify(syntax, filter, 4); + try { + tree = esprima.parse(code, options); + tree = (options.comment || options.tokens) ? tree : tree.body[0]; + + if (options.tolerant) { + for (i = 0, len = tree.errors.length; i < len; i += 1) { + tree.errors[i] = errorToObject(tree.errors[i]); + } + } + + actual = JSON.stringify(tree, filter, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + +function testError(esprima, code, exception) { + 'use strict'; + var i, options, expected, actual, handleInvalidRegexFlag; + + // Different parsing options should give the same error. + options = [ + {}, + { comment: true }, + { raw: true }, + { raw: true, comment: true } + ]; + + // If handleInvalidRegexFlag is true, an invalid flag in a regular expression + // will throw an exception. In some old version V8, this is not the case + // and hence handleInvalidRegexFlag is false. + handleInvalidRegexFlag = false; + try { + 'test'.match(new RegExp('[a-z]', 'x')); + } catch (e) { + handleInvalidRegexFlag = true; + } + + expected = JSON.stringify(exception); + + for (i = 0; i < options.length; i += 1) { + + try { + esprima.parse(code, options[i]); + } catch (e) { + actual = JSON.stringify(errorToObject(e)); + } + + if (expected !== actual) { + + // Compensate for old V8 which does not handle invalid flag. + if (exception.message.indexOf('Invalid regular expression') > 0) { + if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { + return; + } + } + + throw new NotMatchingError(expected, actual); + } + + } +} + +function testAPI(esprima, code, result) { + 'use strict'; + var expected, res, actual; + + expected = JSON.stringify(result.result, null, 4); + try { + if (typeof result.property !== 'undefined') { + res = esprima[result.property]; + } else { + res = esprima[result.call].apply(esprima, result.args); + } + actual = JSON.stringify(res, adjustRegexLiteral, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + +function runTest(esprima, code, result) { + 'use strict'; + if (result.hasOwnProperty('lineNumber')) { + testError(esprima, code, result); + } else if (result.hasOwnProperty('result')) { + testAPI(esprima, code, result); + } else { + testParse(esprima, code, result); + } +} + +if (typeof window !== 'undefined') { + // Run all tests in a browser environment. + runTests = function () { + 'use strict'; + var total = 0, + failures = 0, + category, + fixture, + source, + tick, + expected, + index, + len; + + function setText(el, str) { + if (typeof el.innerText === 'string') { + el.innerText = str; + } else { + el.textContent = str; + } + } + + function startCategory(category) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('h4'); + setText(e, category); + report.appendChild(e); + } + + function reportSuccess(code) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + } + + function reportFailure(code, expected, actual) { + var report, e; + + report = document.getElementById('report'); + + e = document.createElement('p'); + setText(e, 'Code:'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Expected'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'expected'); + setText(e, expected); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Actual'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'actual'); + setText(e, actual); + report.appendChild(e); + } + + setText(document.getElementById('version'), esprima.version); + + tick = new Date(); + for (category in testFixture) { + if (testFixture.hasOwnProperty(category)) { + startCategory(category); + fixture = testFixture[category]; + for (source in fixture) { + if (fixture.hasOwnProperty(source)) { + expected = fixture[source]; + total += 1; + try { + runTest(esprima, source, expected); + reportSuccess(source, JSON.stringify(expected, null, 4)); + } catch (e) { + failures += 1; + reportFailure(source, e.expected, e.actual); + } + } + } + } + } + tick = (new Date()) - tick; + + if (failures > 0) { + setText(document.getElementById('status'), total + ' tests. ' + + 'Failures: ' + failures + '. ' + tick + ' ms'); + } else { + setText(document.getElementById('status'), total + ' tests. ' + + 'No failure. ' + tick + ' ms'); + } + }; +} else { + (function () { + 'use strict'; + + var esprima = require('../esprima'), + vm = require('vm'), + fs = require('fs'), + total = 0, + failures = [], + tick = new Date(), + expected, + header; + + vm.runInThisContext(fs.readFileSync(__dirname + '/test.js', 'utf-8')); + + Object.keys(testFixture).forEach(function (category) { + Object.keys(testFixture[category]).forEach(function (source) { + total += 1; + expected = testFixture[category][source]; + try { + runTest(esprima, source, expected); + } catch (e) { + e.source = source; + failures.push(e); + } + }); + }); + tick = (new Date()) - tick; + + header = total + ' tests. ' + failures.length + ' failures. ' + + tick + ' ms'; + if (failures.length) { + console.error(header); + failures.forEach(function (failure) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + }); + } else { + console.log(header); + } + process.exit(failures.length === 0 ? 0 : 1); + }()); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/test.js new file mode 100644 index 0000000..8ceee54 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/test/test.js @@ -0,0 +1,20238 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Yusuke Suzuki + Copyright (C) 2011 Arpad Borsos + + 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. + + 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 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. +*/ + +var testFixture = { + + 'Primary Expression': { + + 'this\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ThisExpression', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + }, + tokens: [{ + type: 'Keyword', + value: 'this', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + 'null\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: null, + raw: 'null', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + }, + tokens: [{ + type: 'Null', + value: 'null', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + '\n 42\n\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [5, 9], + loc: { + start: { line: 2, column: 4 }, + end: { line: 4, column: 0 } + } + }], + range: [5, 9], + loc: { + start: { line: 2, column: 4 }, + end: { line: 4, column: 0 } + }, + tokens: [{ + type: 'Numeric', + value: '42', + range: [5, 7], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }] + }, + + '(1 + 2 ) * 3': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [1, 6], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Literal', + value: 3, + raw: '3', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + } + + }, + + 'Grouping Operator': { + + '(1) + (2 ) + 3': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + right: { + type: 'Literal', + value: 3, + raw: '3', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '4 + 5 << (6)': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 4, + raw: '4', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 5, + raw: '5', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 6, + raw: '6', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + } + + }, + + 'Array Initializer': { + + 'x = []': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + }, + tokens: [{ + type: 'Identifier', + value: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: 'Punctuator', + value: '=', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Punctuator', + value: '[', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: ']', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }] + }, + + 'x = [ ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x = [ 42 ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }], + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'x = [ 42, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }], + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x = [ ,, 42 ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [ + null, + null, + { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'x = [ 1, 2, 3, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Literal', + value: 2, + raw: '2', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = [ 1, 2,, 3, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Literal', + value: 2, + raw: '2', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, null, { + type: 'Literal', + value: 3, + raw: '3', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + '日本語 = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '日本語', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'T\u203F = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u203F', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'T\u200C = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u200C', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'T\u200D = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u200D', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\u2163\u2161 = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '\u2163\u2161', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\u2163\u2161\u200A=\u2009[]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '\u2163\u2161', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Object Initializer': { + + 'x = {}': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x = { }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x = { answer: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'answer', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + kind: 'init', + range: [6, 16], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 16 } + } + }], + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'x = { if: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + kind: 'init', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x = { true: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + kind: 'init', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = { false: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'x = { null: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + kind: 'init', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = { "answer": 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'answer', + raw: '"answer"', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [16, 18], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'x = { x: 1, x: 2 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [ + { + type: 'Property', + key: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + kind: 'init', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + { + type: 'Property', + key: { + type: 'Identifier', + name: 'x', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + kind: 'init', + range: [12, 16], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 16 } + } + } + ], + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'x = { get width() { return m_width } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'm_width', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + range: [20, 35], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 35 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + kind: 'get', + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }], + range: [4, 38], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'x = { get undef() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'undef', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'get', + range: [6, 20], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } + } + }], + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'x = { get if() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + kind: 'get', + range: [6, 17], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 17 } + } + }], + range: [4, 19], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'x = { get true() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + kind: 'get', + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'x = { get false() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'get', + range: [6, 20], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } + } + }], + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'x = { get null() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + kind: 'get', + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'x = { get "undef"() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'undef', + raw: '"undef"', + range: [10, 17], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + kind: 'get', + range: [6, 22], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } + } + }], + range: [4, 24], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'x = { get 10() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 10, + raw: '10', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + kind: 'get', + range: [6, 17], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 17 } + } + }], + range: [4, 19], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'x = { set width(w) { m_width = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_width', + range: [21, 28], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set if(w) { m_if = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_if', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + range: [18, 26], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 26 } + } + }, + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + range: [16, 28], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [16, 28], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 28 } + } + }, + kind: 'set', + range: [6, 28], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 28 } + } + }], + range: [4, 30], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'x = { set true(w) { m_true = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_true', + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + kind: 'set', + range: [6, 32], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 32 } + } + }], + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'x = { set false(w) { m_false = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_false', + range: [21, 28], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set null(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + kind: 'set', + range: [6, 32], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 32 } + } + }], + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'x = { set "null"(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'null', + raw: '"null"', + range: [10, 16], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [22, 28], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [22, 32], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 32 } + } + }, + range: [22, 33], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 33 } + } + }], + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set 10(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 10, + raw: '10', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [18, 24], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 24 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }], + range: [16, 30], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [16, 30], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 30 } + } + }, + kind: 'set', + range: [6, 30], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 30 } + } + }], + range: [4, 32], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 32 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'x = { get: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'get', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + kind: 'init', + range: [6, 13], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + 'x = { set: 43 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'set', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'Literal', + value: 43, + raw: '43', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + kind: 'init', + range: [6, 13], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + } + + }, + + 'Comments': { + + '/* block comment */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + + '42 /*The*/ /*Answer*/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + comments: [{ + type: 'Block', + value: 'The', + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Block', + value: 'Answer', + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }] + }, + + '42 /*the*/ /*answer*/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2] + }, + range: [0, 21] + }], + range: [0, 21], + comments: [{ + type: 'Block', + value: 'the', + range: [3, 10] + }, { + type: 'Block', + value: 'answer', + range: [11, 21] + }] + }, + + '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + + '/*a\r\nb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\r\nb', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\rb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\rb', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\nb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nb', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\nc*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nc', + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '// line comment\n42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [16, 18], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [16, 18], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + + '42 // line comment': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + comments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } + }] + }, + + '// Hello, world!\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '// Hello, world!\n': { + type: 'Program', + body: [], + range: [17, 17], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '// Hallo, world!\n': { + type: 'Program', + body: [], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hallo, world!', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '//\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }, + + '//': { + type: 'Program', + body: [], + range: [2, 2], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }, + + '// ': { + type: 'Program', + body: [], + range: [3, 3], + comments: [{ + type: 'Line', + value: ' ', + range: [0, 3] + }] + }, + + '/**/42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + comments: [{ + type: 'Block', + value: '', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + '// Hello, world!\n\n// Another hello\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }, + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }], + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], + loc: { + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } + } + }] + }, + + 'if (x) { // Some comment\ndoThat(); }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [25, 31], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }, + 'arguments': [], + range: [25, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 8 } + } + }, + range: [25, 34], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 9 } + } + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 11 } + } + }, + alternate: null, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 11 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] + }, + + 'switch (answer) { case 42: /* perfect */ bingo() }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + 'arguments': [], + range: [41, 48], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 48 } + } + }, + range: [41, 49], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 49 } + } + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 50 } + } + }], + range: [0, 50], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 50 } + }, + comments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] + } + + }, + + 'Numeric Literals': { + + '0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + '42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '3': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1] + }, + range: [0, 1] + }], + range: [0, 1], + tokens: [{ + type: 'Numeric', + value: '3', + range: [0, 1] + }] + }, + + '5': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 5, + raw: '5', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + tokens: [{ + type: 'Numeric', + value: '5', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }] + }, + + '.14': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0.14, + raw: '.14', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '3.14159': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3.14159, + raw: '3.14159', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '6.02214179e+23': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 6.02214179e+23, + raw: '6.02214179e+23', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '1.492417830e-10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 1.49241783e-10, + raw: '1.492417830e-10', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '0x0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '0e+100': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '0xabc': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0xabc, + raw: '0xabc', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0xdef': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0xdef, + raw: '0xdef', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0X1A': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x1A, + raw: '0X1A', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '0x10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x10, + raw: '0x10', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '0x100': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x100, + raw: '0x100', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0X04': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0X04, + raw: '0X04', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '02': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '02', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '012': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 10, + raw: '012', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '0012': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 10, + raw: '0012', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + } + + }, + + 'String Literals': { + + '"Hello"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello', + raw: '"Hello"', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '\n\r\t\x0B\b\f\\\'"\x00', + raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '"\\u0061"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'a', + raw: '"\\u0061"', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + '"\\x61"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'a', + raw: '"\\x61"', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '"\\u00"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'u00', + raw: '"\\u00"', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '"\\xt"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'xt', + raw: '"\\xt"', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '"Hello\\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\nworld', + raw: '"Hello\\nworld"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '"Hello\\\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\nworld"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 14 } + } + }, + + '"Hello\\02World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0002World', + raw: '"Hello\\02World"', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '"Hello\\012World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u000AWorld', + raw: '"Hello\\012World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\122World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\122World', + raw: '"Hello\\122World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\0122World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u000A2World', + raw: '"Hello\\0122World"', + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + '"Hello\\312World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u00CAWorld', + raw: '"Hello\\312World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\412World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\412World', + raw: '"Hello\\412World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\812World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello812World', + raw: '"Hello\\812World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\712World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\712World', + raw: '"Hello\\712World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\0World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0000World', + raw: '"Hello\\0World"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '"Hello\\\r\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\r\nworld"', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '"Hello\\1World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0001World', + raw: '"Hello\\1World"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + }, + + 'Regular Expression Literals': { + + 'var x = /[a-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-z]/i', + raw: '/[a-z]/i', + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }], + kind: 'var', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/i', + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] + }, + + 'var x = /[x-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5] + }, + init: { + type: 'Literal', + value: '/[x-z]/i', + raw: '/[x-z]/i', + range: [8, 16] + }, + range: [4, 16] + }], + kind: 'var', + range: [0, 16] + }], + range: [0, 16], + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3] + }, { + type: 'Identifier', + value: 'x', + range: [4, 5] + }, { + type: 'Punctuator', + value: '=', + range: [6, 7] + }, { + type: 'RegularExpression', + value: '/[x-z]/i', + range: [8, 16] + }] + }, + + 'var x = /[a-c]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-c]/i', + raw: '/[a-c]/i', + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }], + kind: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-c]/i', + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] + }, + + 'var x = /[P QR]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/i', + raw: '/[P QR]/i', + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }, + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }], + kind: 'var', + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }], + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/i', + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }] + }, + + 'var x = /[\\]/]/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: new RegExp('[\\]/]').toString(), + raw: '/[\\]/]/', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\]/]/', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }] + }, + + 'var x = /foo\\/bar/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/foo\\/bar/', + raw: '/foo\\/bar/', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/foo\\/bar/', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] + }, + + 'var x = /=([^=\\s])+/g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/=([^=\\s])+/g', + raw: '/=([^=\\s])+/g', + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }, + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }], + kind: 'var', + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/=([^=\\s])+/g', + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }] + }, + + 'var x = /[P QR]/\\u0067': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/g', + raw: '/[P QR]/\\u0067', + range: [8, 22], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 22 } + } + }, + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/\\u0067', + range: [8, 22], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 22 } + } + }] + }, + + 'var x = /[P QR]/\\g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/g', + raw: '/[P QR]/\\g', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/\\g', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] + } + + }, + + 'Left-Hand-Side Expression': { + + 'new Button': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'Button', + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + 'arguments': [], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'new Button()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'Button', + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + 'arguments': [], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + 'new new foo': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'new new foo()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'new foo().bar()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + 'arguments': [], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + 'new foo[bar]': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + range: [4, 12], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + 'new foo.bar()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + '( new foo).bar()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + 'arguments': [], + range: [2, 9], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 9 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + 'arguments': [], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'foo(bar, baz)': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'bar', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Identifier', + name: 'baz', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + '( foo )()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'universe.milkyway': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'universe.milkyway.solarsystem': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + property: { + type: 'Identifier', + name: 'solarsystem', + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'universe.milkyway.solarsystem.Earth': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + property: { + type: 'Identifier', + name: 'solarsystem', + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + property: { + type: 'Identifier', + name: 'Earth', + range: [30, 35], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'universe[galaxyName, otherUselessName]': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'galaxyName', + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, { + type: 'Identifier', + name: 'otherUselessName', + range: [21, 37], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 37 } + } + }], + range: [9, 37], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'universe[galaxyName]': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'galaxyName', + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'universe[42].galaxies': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'universe(42).galaxies': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'universe(42).galaxies(14, 3, 77).milkyway': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 14, + raw: '14', + range: [22, 24], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 24 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: 'Literal', + value: 77, + raw: '77', + range: [29, 31], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'earth.asia.Indonesia.prepareForElection(2014)': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'earth', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + property: { + type: 'Identifier', + name: 'asia', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + property: { + type: 'Identifier', + name: 'Indonesia', + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + property: { + type: 'Identifier', + name: 'prepareForElection', + range: [21, 39], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 39 } + } + }, + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 2014, + raw: '2014', + range: [40, 44], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 44 } + } + }], + range: [0, 45], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 45 } + } + }, + range: [0, 45], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 45 } + } + }, + + 'universe.if': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'if', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'universe.true': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'true', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'universe.false': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'false', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'universe.null': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'null', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + } + + }, + + 'Postfix Expressions': { + + 'x++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'x--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'eval++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + prefix: false, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'eval--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + prefix: false, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'arguments++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + prefix: false, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'arguments--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + prefix: false, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + } + + }, + + 'Unary Operators': { + + '++x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '--x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '++eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '--eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '++arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, + prefix: true, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '--arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, + prefix: true, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '+x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '+', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '-x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '-', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '~x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '~', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '!x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '!', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + 'void x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'void', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'delete x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + prefix: true, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'typeof x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'typeof', + argument: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + prefix: true, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + + }, + + 'Multiplicative Operators': { + + 'x * y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x / y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x % y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Additive Operators': { + + 'x + y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x - y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Bitwise Shift Operator': { + + 'x << y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >>> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Relational Operators': { + + 'x < y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x > y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x <= y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >= y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x in y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x instanceof y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: 'instanceof', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x < y < z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Equality Operators': { + + 'x == y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x != y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x === y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '===', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x !== y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Binary Bitwise Operators': { + + 'x & y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x ^ y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x | y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Binary Expressions': { + + 'x + y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x % y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x << y << z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x | y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x ^ y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Binary Logical Operators': { + + 'x || y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x && y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x || y || z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x && y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + } + + }, + + 'Conditional Operator': { + + 'y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'Identifier', + name: 'y', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x && y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + + }, + + 'Assignment Operators': { + + 'x = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'eval = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'arguments = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x *= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '*=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x /= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '/=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x %= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '%=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x += 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '+=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x -= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '-=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x <<= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '<<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x &= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '&=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x ^= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '^=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x |= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '|=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Block': { + + '{ foo }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'foo', + range: [2, 5], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } + } + }, + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '{ doThis(); doThat(); }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThis', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [], + range: [2, 10], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 10 } + } + }, + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [12, 18], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 18 } + } + }, + 'arguments': [], + range: [12, 20], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 20 } + } + }, + range: [12, 21], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '{}': { + type: 'BlockStatement', + body: [], + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + } + + }, + + 'Variable Statement': { + + 'var x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'var x, y;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + init: null, + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], + kind: 'var', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'var x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }, + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'var eval = 42, arguments = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [4, 8], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var x = 14, y = 3, z = 1977': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }, + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [12, 17], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 17 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + kind: 'var', + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'var implements, interface, package': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'implements', + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, + init: null, + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'interface', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + init: null, + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'package', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + init: null, + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var private, protected, public, static': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'private', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + init: null, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'protected', + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'public', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + init: null, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'static', + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }, + init: null, + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + 'Let Statement': { + + 'let x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'let', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '{ let x }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: null, + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }], + kind: 'let', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + '{ let x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'let', + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }], + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '{ let x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }, + range: [21, 29], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 29 } + } + }], + kind: 'let', + range: [2, 30], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 30 } + } + }], + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + } + + }, + + 'Const Statement': { + + 'const x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'const', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + '{ const x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }], + kind: 'const', + range: [2, 15], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 15 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '{ const x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + kind: 'const', + range: [2, 32], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 32 } + } + }], + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + } + + }, + + 'Empty Statement': { + + ';': { + type: 'EmptyStatement', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + } + + }, + + 'Expression Statement': { + + 'x': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + 'x, y': { + type: 'ExpressionStatement', + expression: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: 'Identifier', + name: 'y', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }], + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'a', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'a\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\\ua': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'ua', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'a\\u': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'au', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + } + + }, + + 'If Statement': { + + 'if (morning) goodMorning()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + alternate: null, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'if (morning) (function(){})': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [24, 26], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 26 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: null, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'if (morning) var x = 0;': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [17, 22], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [13, 23], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 23 } + } + }, + alternate: null, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + 'if (morning) function a(){}': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'a', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: null, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'if (morning) goodMorning(); else goodDay()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodDay', + range: [33, 40], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 42], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 42 } + } + } + + }, + + 'Iteration Statements': { + + 'do keep(); while (true)': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + 'do keep(); while (true);': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'do { x++; y--; } while (x < 10)': { + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: false, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + prefix: false, + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }], + range: [3, 16], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 16 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [28, 30], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 30 } + } + }, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + '{ do { } while (false) false }': { + type: 'BlockStatement', + body: [{ + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [], + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + test: { + type: 'Literal', + value: false, + raw: 'false', + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, + range: [2, 22], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 22 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: false, + raw: 'false', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + range: [23, 29], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 29 } + } + }], + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'while (true) doSomething()': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doSomething', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (x < 10) { x++; y--; }': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [22, 25], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 25 } + } + }, + range: [22, 26], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 26 } + } + }], + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'for(;;);': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'for(;;){}': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BlockStatement', + body: [], + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'for(x = 0;;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'for(var x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'var', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'for(let x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'let', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'for(var x = 0, y = 1;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }], + kind: 'var', + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: null, + body: { + type: 'EmptyStatement', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'for(x = 0; x < 42; x++);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42; x++) process(x);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [24, 31], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 31 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'for(x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [15, 22], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 22 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }], + range: [15, 25], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 25 } + } + }, + range: [15, 26], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 26 } + } + }, + each: false, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'for (var x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (let x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'let', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (let x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'let', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (var i = function() { return 10 in [] } in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'i', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Literal', + value: 10, + raw: '10', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 43], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + range: [9, 43], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [5, 43], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 43 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [47, 51], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 51 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [53, 60], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 60 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [61, 62], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 62 } + } + }], + range: [53, 63], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 63 } + } + }, + range: [53, 64], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 64 } + } + }, + each: false, + range: [0, 64], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 64 } + } + } + + }, + + 'continue statement': { + + 'while (true) { continue; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (true) { continue }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 25], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 25 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'done: while (true) { continue done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 36], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 36 } + } + }, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'done: while (true) { continue done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 37], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 37 } + } + }, + range: [6, 37], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + } + + }, + + 'break statement': { + + 'while (true) { break }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: null, + range: [15, 21], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 21 } + } + } + ], + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'done: while (true) { break done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 33], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 33 } + } + }, + range: [6, 33], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 33 } + } + }, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'done: while (true) { break done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + } + + }, + + 'return statement': { + + '(function(){ return })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 21], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '(function(){ return; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 22], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 22], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function(){ return x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + '(function(){ return x * y })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + } + ], + range: [11, 27], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 27], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + } + }, + + 'with statement': { + + 'with (x) foo = bar': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'with (x) foo = bar;': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'with (x) { foo = bar }': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }], + range: [9, 22], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + } + + }, + + 'switch statement': { + + 'switch (x) {}': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + cases:[], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'switch (answer) { case 42: hi(); break; }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'switch (answer) { case 42: hi(); break; default: break }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }, { + type: 'SwitchCase', + test: null, + consequent: [{ + type: 'BreakStatement', + label: null, + range: [49, 55], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 55 } + } + }], + range: [40, 55], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 56], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 56 } + } + } + + }, + + 'Labelled Statements': { + + 'start: for (;;) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + range: [16, 27], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 27 } + } + }, + range: [7, 27], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'start: while (true) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + range: [7, 31], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 31 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + } + + }, + + 'throw statement': { + + 'throw x;': { + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'throw x * y': { + type: 'ThrowStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'throw { message: "Error" }': { + type: 'ThrowStatement', + argument: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'message', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 'Error', + raw: '"Error"', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + kind: 'init', + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + range: [6, 26], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + } + + }, + + 'try statement': { + + 'try { } catch (e) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [18, 21], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } + } + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }], + finalizer: null, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'try { } catch (eval) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [15, 19], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + finalizer: null, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'try { } catch (arguments) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, + range: [8, 29], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 29 } + } + }], + finalizer: null, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'try { } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }], + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [8, 28], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 28 } + } + }], + finalizer: null, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'try { } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [18, 25], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }], + range: [16, 34], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'try { doThat(); } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: null, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [49, 56], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 56 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [57, 62], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 62 } + } + }], + range: [49, 63], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 63 } + } + }, + range: [49, 64], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 64 } + } + }], + range: [47, 65], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 65 } + } + }, + range: [0, 65], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 65 } + } + } + + }, + + 'debugger statement': { + + 'debugger;': { + type: 'DebuggerStatement', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Function Definition': { + + 'function hello() { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [19, 24], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [19, 26], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'function eval() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'function arguments() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'function test(t, t) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, { + type: 'Identifier', + name: 't', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function test(t, t) { })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'test', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 't', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'function eval() { function inner() { "use strict" } }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'inner', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\"use strict\"', + range: [37, 49], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 49 } + } + }, + range: [37, 50], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 50 } + } + }], + range: [35, 51], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 51 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 51], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 51 } + } + }], + range: [16, 53], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 53 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 53], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 53 } + } + }, + + 'function hello(a) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [], + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + range: [20, 28], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 28 } + } + }], + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'function hello(a, b) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 'b', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + 'arguments': [], + range: [23, 30], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 30 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'var hi = function() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [], + range: [22, 29], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 29 } + } + }, + range: [22, 30], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 30 } + } + }], + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 31], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 31 } + } + }, + range: [4, 31], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'var hi = function eval() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 28], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 28 } + } + }, + range: [4, 28], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var hi = function arguments() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 33], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 33 } + } + }, + range: [4, 33], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 33 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var hello = function hi() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hello', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'hi', + range: [21, 23], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [], + range: [28, 35], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 35 } + } + }, + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }], + range: [26, 37], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 37], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 37 } + } + }, + range: [4, 37], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 37 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + '(function(){})': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 13], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + + }, + + 'Automatic semicolon insertion': { + + '{ x\n++y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '{ x\n--y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + 'var x /* comment */;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + '{ var x = 14, y = 3\nz; }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }], + kind: 'var', + range: [2, 20], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'z', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 4 } + } + }, + + 'while (true) { continue\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 32], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [35, 40], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [35, 41], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [47, 52], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [47, 53], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 55], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + 'while (true) { break\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [21, 26], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [21, 27], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [32, 37], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [32, 38], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [44, 49], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [44, 50], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 52], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 52], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + '(function(){ return\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return // Comment\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [31, 32], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [31, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 35], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 35], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return/* Multiline\nComment */x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [42, 43], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 11 } + } + }, + range: [42, 44], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 12 } + } + } + ], + range: [11, 46], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 46], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '{ throw error\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 14], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [14, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [14, 20], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error// Comment\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 24], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error/* Multiline\nComment */error; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 36], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 10 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [36, 41], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [36, 42], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + } + + }, + + 'Source elements': { + + '': { + type: 'Program', + body: [], + range: [0, 0], + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 } + }, + tokens: [] + } + }, + + 'Invalid syntax': { + + '{': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '}': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token }' + }, + + '3ea': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in []': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e+': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e-': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x0': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '09': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '018': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '01a': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in[]': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x3in[]': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"Hello\nWorld"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u005c': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u002a': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /(s/g': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Invalid regular expression' + }, + + '/': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\ux': { + index: 18, + lineNumber: 1, + column: 19, + message: 'Error: Line 1: Invalid regular expression' + }, + + '3 = 4': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'func() = 4': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '(1 + 1) = 10': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1++': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1--': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '++1': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '--1': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'for((1 + 1) in list) process(x);': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + '[': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '[,': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + {': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + { t:t ': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + { t:t,': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'var x = /\n/': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = "\n': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var if = 42': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token if' + }, + + 'i + 2 = 42': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '+i = 42': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1 + (': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + '\n\n\n{': { + index: 4, + lineNumber: 4, + column: 2, + message: 'Error: Line 4: Unexpected end of input' + }, + + '\n/* Some multiline\ncomment */\n)': { + index: 30, + lineNumber: 4, + column: 1, + message: 'Error: Line 4: Unexpected token )' + }, + + '{ set 1 }': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + '{ get 2 }': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + '({ set: s(if) { } })': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token if' + }, + + '({ set s(.) { } })': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token .' + }, + + '({ set s() { } })': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token )' + }, + + '({ set: s() { } })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ set: s(a, b) { } })': { + index: 16, + lineNumber: 1, + column: 17, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ get: g(d) { } })': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ get i() { }, i: 42 })': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ i: 42, get i() { } })': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ set i(x) { }, i: 42 })': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ i: 42, set i(x) { } })': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ get i() { }, get i() { } })': { + index: 27, + lineNumber: 1, + column: 28, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }, + + '({ set i(x) { }, set i(x) { } })': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }, + + 'function t(if) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token if' + }, + + 'function t(true) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token true' + }, + + 'function t(false) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token false' + }, + + 'function t(null) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token null' + }, + + 'function null() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token null' + }, + + 'function true() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token true' + }, + + 'function false() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token false' + }, + + 'function if() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token if' + }, + + 'a b;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected identifier' + }, + + 'if.a;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token .' + }, + + 'a if;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token if' + }, + + 'a class;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected reserved word' + }, + + 'break\n': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal break statement' + }, + + 'break 1;': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + 'continue\n': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'continue 2;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected number' + }, + + 'throw': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'throw;': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'throw\n': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal newline after throw' + }, + + 'for (var i, i2 in {});': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Unexpected token in' + }, + + 'for ((i in {}));': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token )' + }, + + 'for (i + 1 in {});': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + 'for (+i in {});': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + 'if(false)': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'if(false) doThis(); else': { + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'do': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'while(false)': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'for(;;)': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'with(x)': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'try { }': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Missing catch or finally after try' + }, + + 'try {} catch (42) {} ': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected number' + }, + + 'try {} catch (answer()) {} ': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Unexpected token (' + }, + + 'try {} catch (-x) {} ': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token -' + }, + + + '\u203F = 10': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'const x = 12, y;': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'const x, y = 12;': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ,' + }, + + 'const x;': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'if(true) let a = 1;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token let' + }, + + 'if(true) const a = 1;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token const' + }, + + 'switch (c) { default: default: }': { + index: 30, + lineNumber: 1, + column: 31, + message: 'Error: Line 1: More than one default clause in switch statement' + }, + + 'new X()."s"': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Unexpected string' + }, + + '/*': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*\n\n\n': { + index: 5, + lineNumber: 4, + column: 1, + message: 'Error: Line 4: Unexpected token ILLEGAL' + }, + + '/**': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*\n\n*': { + index: 5, + lineNumber: 3, + column: 2, + message: 'Error: Line 3: Unexpected token ILLEGAL' + }, + + '/*hello': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*hello *': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\n]': { + index: 1, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\r]': { + index: 1, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\r\n]': { + index: 2, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\n\r]': { + index: 2, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '//\r\n]': { + index: 4, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '//\n\r]': { + index: 4, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/a\\\n/': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '//\r \n]': { + index: 5, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/*\r\n*/]': { + index: 6, + lineNumber: 2, + column: 3, + message: 'Error: Line 2: Unexpected token ]' + }, + + '/*\n\r*/]': { + index: 6, + lineNumber: 3, + column: 3, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/*\r \n*/]': { + index: 7, + lineNumber: 3, + column: 3, + message: 'Error: Line 3: Unexpected token ]' + }, + + '\\\\': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\u005c': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + + '\\x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\u0000': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\u200C = []': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\u200D = []': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'try { } catch() {}': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token )' + }, + + 'return': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Illegal return statement' + }, + + 'break': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal break statement' + }, + + 'continue': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'switch (x) { default: continue; }': { + index: 31, + lineNumber: 1, + column: 32, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'do { x } *': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token *' + }, + + 'while (true) { break x; }': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'while (true) { continue x; }': { + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { break x; }); }': { + index: 40, + lineNumber: 1, + column: 41, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { continue x; }); }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { break; }); }': { + index: 39, + lineNumber: 1, + column: 40, + message: 'Error: Line 1: Illegal break statement' + }, + + 'x: while (true) { (function () { continue; }); }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'x: while (true) { x: while (true) { } }': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Label \'x\' has already been declared' + }, + + '(function () { \'use strict\'; delete i; }())': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' + }, + + '(function () { \'use strict\'; with (i); }())': { + index: 28, + lineNumber: 1, + column: 29, + message: 'Error: Line 1: Strict mode code may not include a with statement' + }, + + 'function hello() {\'use strict\'; ({ i: 42, i: 42 }) }': { + index: 47, + lineNumber: 1, + column: 48, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ hasOwnProperty: 42, hasOwnProperty: 42 }) }': { + index: 73, + lineNumber: 1, + column: 74, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; var eval = 10; }': { + index: 40, + lineNumber: 1, + column: 41, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; var arguments = 10; }': { + index: 45, + lineNumber: 1, + column: 46, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; try { } catch (eval) { } }': { + index: 51, + lineNumber: 1, + column: 52, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; try { } catch (arguments) { } }': { + index: 56, + lineNumber: 1, + column: 57, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; eval = 10; }': { + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; arguments = 10; }': { + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ++eval; }': { + index: 38, + lineNumber: 1, + column: 39, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; --eval; }': { + index: 38, + lineNumber: 1, + column: 39, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; ++arguments; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; --arguments; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; eval++; }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; eval--; }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; arguments++; }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; arguments--; }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; function eval() { } }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; function arguments() { } }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function eval() {\'use strict\'; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function arguments() {\'use strict\'; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; (function eval() { }()) }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; (function arguments() { }()) }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function eval() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function arguments() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; ({ s: function eval() { } }); }': { + index: 47, + lineNumber: 1, + column: 48, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function package() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() {\'use strict\'; ({ i: 10, set s(eval) { } }); }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ set s(eval) { } }); }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ s: function s(eval) { } }); }': { + index: 49, + lineNumber: 1, + column: 50, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello(eval) {\'use strict\';}': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello(arguments) {\'use strict\';}': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() { \'use strict\'; function inner(eval) {} }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() { \'use strict\'; function inner(arguments) {} }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + ' "\\1"; \'use strict\';': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; "\\1"; }': { + index: 33, + lineNumber: 1, + column: 34, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; 021; }': { + index: 33, + lineNumber: 1, + column: 34, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; ({ "\\1": 42 }); }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; ({ 021: 42 }); }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "octal directive\\1"; "use strict"; }': { + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "octal directive\\1"; "octal directive\\2"; "use strict"; }': { + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "use strict"; function inner() { "octal directive\\1"; } }': { + index: 52, + lineNumber: 1, + column: 53, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "use strict"; var implements; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var interface; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var package; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var private; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var protected; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var public; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var static; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var yield; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var let; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello(static) { "use strict"; }': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function static() { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'var yield': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token yield' + }, + + 'var let': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token let' + }, + + '"use strict"; function static() { }': { + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a(t, t) { "use strict"; }': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a(eval) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function a(package) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a() { "use strict"; function b(t, t) { }; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '(function a(t, t) { "use strict"; })': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a() { "use strict"; (function b(t, t) { }); }': { + index: 44, + lineNumber: 1, + column: 45, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '(function a(eval) { "use strict"; })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(function a(package) { "use strict"; })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'var': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'let': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'const': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + } + + }, + + 'API': { + 'parse()': { + call: 'parse', + args: [], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(null)': { + call: 'parse', + args: [null], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: null + } + }] + } + }, + + 'parse(42)': { + call: 'parse', + args: [42], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42 + } + }] + } + }, + + 'parse(true)': { + call: 'parse', + args: [true], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true + } + }] + } + }, + + 'parse(undefined)': { + call: 'parse', + args: [void 0], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(new String("test"))': { + call: 'parse', + args: [new String('test')], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test' + } + }] + } + }, + + 'parse(new Number(42))': { + call: 'parse', + args: [new Number(42)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42 + } + }] + } + }, + + 'parse(new Boolean(true))': { + call: 'parse', + args: [new Boolean(true)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true + } + }] + } + }, + + 'Syntax': { + property: 'Syntax', + result: { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + } + } + + }, + + 'Tolerant parse': { + 'return': { + type: 'Program', + body: [{ + type: 'ReturnStatement', + 'argument': null, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + }, + errors: [{ + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Illegal return statement' + }] + }, + + '(function () { \'use strict\'; with (i); }())': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [15, 27], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 27 } + } + }, + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + body: { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + range: [29, 38], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 38 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 40 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 40], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [1, 42], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + } + }], + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + }, + errors: [{ + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Strict mode code may not include a with statement' + }] + }, + + '(function () { \'use strict\'; 021 }())': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [15, 27], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 27 } + } + }, + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 17, + raw: "021", + range: [29, 32], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 32 } + } + }, + range: [29, 33], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 33 } + } + }], + range: [13, 34], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 34], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 34 } + } + }, + 'arguments': [], + range: [1, 36], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + }], + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + }, + errors: [{ + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; delete x': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { + type: 'Identifier', + name: 'x', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + prefix: true, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + }, + errors: [{ + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' + }] + }, + + '"use strict"; try {} catch (eval) {}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [28, 32], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 32 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [34, 36], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 36 } + } + }, + range: [21, 36], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 36 } + } + }], + finalizer: null, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; try {} catch (arguments) {}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [28, 37], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 37 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [21, 41], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 41 } + } + }], + finalizer: null, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; var eval;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; var arguments;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + init: null, + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + kind: 'var', + range: [14, 28], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 28 } + } + }], + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + }, + errors: [{ + index: 27, + lineNumber: 1, + column: 28, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; eval = 0;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; eval++;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [14, 20], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 20 } + } + }, + range: [14, 21], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + errors: [{ + index: 18, + lineNumber: 1, + column: 19, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; --eval;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [16, 20], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 20 } + } + }, + prefix: true, + range: [14, 20], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 20 } + } + }, + range: [14, 21], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + errors: [{ + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; arguments = 0;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'arguments', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + } + }, + range: [14, 28], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 28 } + } + }], + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + }, + errors: [{ + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; arguments--;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [14, 25], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 25 } + } + }, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }], + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; ++arguments;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + prefix: true, + range: [14, 25], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 25 } + } + }, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }], + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + + '"use strict";x={y:1,y:1}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + kind: 'init', + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + kind: 'init', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }], + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }] + }, + + '"use strict"; function eval() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 32], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 32], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 32 } + } + }, { + type: 'EmptyStatement', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; function arguments() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [23, 32], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [35, 37], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 37], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 37 } + } + }, { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }], + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; function interface() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'interface', + range: [23, 32], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [35, 37], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 37], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 37 } + } + }, { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }], + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }] + }, + + '"use strict"; (function eval() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [24, 28], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 28 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [31, 33], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 33], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 33 } + } + }, + range: [14, 35], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 35 } + } + }], + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; (function arguments() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [24, 33], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 33 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 38], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 38 } + } + }, + range: [14, 40], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 40 } + } + }], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; (function interface() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'interface', + range: [24, 33], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 33 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 38], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 38 } + } + }, + range: [14, 40], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 40 } + } + }], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }] + }, + + '"use strict"; function f(eval) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'eval', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [31, 33], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 33], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 33 } + } + }, { + type: 'EmptyStatement', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; function f(arguments) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'arguments', + range: [25, 34], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 34 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 38], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 38 } + } + }, { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; function f(foo, foo) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'foo', + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, { + type: 'Identifier', + name: 'foo', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 38], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 38 } + } + }, { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + }, + errors: [{ + index: 31, + lineNumber: 1, + column: 32, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }] + }, + + '"use strict"; (function f(eval) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'eval', + range: [26, 30], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 30 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 34], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 34 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + + '"use strict"; (function f(arguments) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'arguments', + range: [26, 35], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 35 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [37, 39], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 39 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 39], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 39 } + } + }, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; (function f(foo, foo) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'foo', + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, { + type: 'Identifier', + name: 'foo', + range: [32, 35], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 35 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [37, 39], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 39 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 39], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 39 } + } + }, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }] + }, + + '"use strict"; x = { set f(eval) {} }' : { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + value : { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [26, 30], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 30 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + 'function hello() { "octal directive\\1"; "use strict"; }': { + type: 'Program', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'octal directive\u0001', + raw: '"octal directive\\1"', + range: [19, 38], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 38 } + } + }, + range: [19, 39], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 39 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [40, 52], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 52 } + } + }, + range: [40, 53], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 53 } + } + }], + range: [17, 55], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 55 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 55 } + }, + errors: [{ + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"\\1"; \'use strict\';': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '\u0001', + raw: '"\\1"', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }, + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + }, + errors: [{ + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; var x = { 014: 3}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 12, + raw: '014', + range: [24, 27], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 27 } + } + }, + value: { + type: 'Literal', + value: 3, + raw: '3', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + kind: 'init', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }], + range: [22, 31], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 31 } + } + }, + range: [18, 31], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [14, 31], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; var x = { get i() {}, get i() {} }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + kind: 'get', + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [44, 46], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 46 } + } + }, + rest: null, + generator: false, + expression: false, + range: [44, 46], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 46 } + } + }, + kind: 'get', + range: [36, 46], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 46 } + } + }], + range: [22, 48], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 48 } + } + }, + range: [18, 48], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 48 } + } + }], + kind: 'var', + range: [14, 48], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 48 } + } + }], + range: [0, 48], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 48 } + }, + errors: [{ + index: 46, + lineNumber: 1, + column: 47, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }] + }, + + '"use strict"; var x = { i: 42, get i() {} }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + kind: 'init', + range: [24, 29], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 29 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + rest: null, + generator: false, + expression: false, + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + kind: 'get', + range: [31, 41], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 41 } + } + }], + range: [22, 43], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 43 } + } + }, + range: [18, 43], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [14, 43], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 43 } + } + }], + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + }, + errors: [{ + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }] + }, + + '"use strict"; var x = { set i(x) {}, i: 42 }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [30, 31], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 31 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + rest: null, + generator: false, + expression: false, + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + kind: 'set', + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [40, 42], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 42 } + } + }, + kind: 'init', + range: [37, 42], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 42 } + } + }], + range: [22, 44], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 44 } + } + }, + range: [18, 44], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 44 } + } + }], + kind: 'var', + range: [14, 44], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 44 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + errors: [{ + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }] + + + }, + + '({ set s() { } })': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 's', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + kind: 'set', + range: [3, 14], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 14 } + } + }], + range: [1, 16], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }], + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + }, + errors: [{ + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token )' + }] + }, + + 'foo("bar") = baz': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 'bar', + raw: '"bar"', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'baz', + range: [13, 16], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + errors: [{ + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '1 = 2': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + }, + errors: [{ + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '3++': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + }, + errors: [{ + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '--4': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Literal', + value: 4, + raw: '4', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + }, + errors: [{ + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + 'for (5 in []) {}': { + type: 'Program', + body: [{ + type: 'ForInStatement', + left: { + type: 'Literal', + value: 5, + raw: '5', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + each: false, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + errors: [{ + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }] + } + + + } +}; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/package.json new file mode 100644 index 0000000..0d9ddb2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/package.json @@ -0,0 +1,45 @@ +{ + "name": "redeyed", + "version": "0.4.2", + "description": "Takes JavaScript code, along with a config and returns the original code with tokens wrapped as configured.", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "main": "redeyed.js", + "scripts": { + "test": "tap test/*.js", + "demo-log": "node examples/replace-log", + "demo": "cd examples/browser; open index.html" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/redeyed.git" + }, + "keywords": [ + "ast", + "syntax", + "tree", + "source", + "wrap", + "metadata" + ], + "license": "MIT", + "devDependencies": { + "tap": "git://github.com/thlorenz/node-tap.git", + "readdirp": "~0.2.1", + "cardinal": "~0.2.0" + }, + "dependencies": { + "esprima": "~1.0.0" + }, + "readme": "# redeyed [![Build Status](https://secure.travis-ci.org/thlorenz/redeyed.png)](http://travis-ci.org/thlorenz/redeyed)\n\n*Add color to your JavaScript!*\n\n![frog](http://allaboutfrogs.org/gallery/photos/redeyes/red1.gif)\n\n[Red Eyed Tree Frog](http://allaboutfrogs.org/info/species/redeye.html) *(Agalychnis callidryas)*\n\n## What?\n\nTakes JavaScript code, along with a config and returns the original code with tokens wrapped and/or replaced as configured.\n\n## Where?\n\n- server side using nodejs\n- in the [browser](#browser-support)\n\n## What for?\n\nOne usecase is adding metadata to your code that can then be used to apply syntax highlighting.\n\n## How?\n\n- copy the [config.js](https://github.com/thlorenz/redeyed/blob/master/config.js) and edit it in order to specify how\n certain tokens are to be surrounded/replaced\n- replace the `undefined` of each token you want to configure with one of the following\n\n### {String} config\n\n`'before:after'`\n\nwraps the token inside before/after \n\n### {Object} config\n\n`{ _before: 'before', _after: 'after' }`\n\nwraps token inside before/after\n\n#### Missing before and after resolution for {String} and {Object} config\n\nFor the `{String}` and `{Object}` configurations, 'before' or 'after' may be omitted:\n\n- `{String}`: \n - `'before:'` (omitting 'after')\n - `':after'` (omitting 'before')\n- `{Object}`: \n - `{ _before: 'before' }` (omitting '_after')\n - `{ _after: 'after' }` (omitting '_before')\n\nIn these cases the missing half is resolved as follows:\n\n- from the `parent._default` (i.e., `Keyword._default`) if found\n- otherwise from the `config._default` if found\n- otherwise `''` (empty string)\n\n### {Function} config\n\n`function (tokenString, info) { return {String}|{Object}; }`\n\n#### Inputs\n\n- tokenString: the content of the token that is currently being processed\n- info: an object with the following structure\n\n```js\n{\n // {Int}\n // the index of the token being processed inside tokens\n tokenIndex\n\n // {Array}\n // all tokens that are being processed including comments \n // (i.e. the result of merging esprima tokens and comments)\n , tokens \n\n // {Object} \n // the abstract syntax tree of the parsed code\n , ast \n\n // {String}\n // the code that was parsed (same string as the one passed to redeyed(code ..)\n , code\n}\n```\n\nIn most cases the `tokenString` is all you need. The extra info object is passed in case you need to gather more\ninformation about the `token`'s surroundings in order to decide how to transform it. \nSee: [replace-log-example](https://github.com/thlorenz/redeyed/blob/master/examples/replace-log.js)\n\n#### Output\n\nYou can return a {String} or an {Object} from a {Function} config.\n\n- when returning a {String}, the token value will be replaced with it\n- when returning an {Object}, it should be of the following form:\n\n```js\n{\n // {String}\n // the string that should be substituted for the value of the current and all skipped tokens\n replacement\n\n // {Object} (Token)\n // the token after which processing should continue\n // all tokens in between the current one and this one inclusive will be ignored\n , skipPastToken\n}\n```\n\n### Transforming JavaScript code\n\n***redeyed(code, config[, opts])***\n\nInvoke redeyed with your **config**uration, a **code** snippet and maybe **opts** as in the below example:\n\n```javascript\nvar redeyed = require('redeyed')\n , config = require('./path/to/config')\n , code = 'var a = 3;'\n , result;\n\n// redeyed will throw an error (caused by the esprima parser) if the code has invalid javascript\ntry {\n result = redeyed(code, config);\n console.log(result.code);\n} catch(err) {\n console.error(err);\n}\n```\n\n***opts***:\n```js\n{ // {Boolean}\n // if true `result.code` is not assigned and therefore `undefined`\n // if false (default) `result.code` property contains the result of `split.join`\n nojoin: true|false\n}\n```\n\n***return value***:\n\n```js\n{ ast \n , tokens \n , comments \n , splits \n , code \n}\n```\n\n- ast `{Array}`: [abstract syntax tree](http://en.wikipedia.org/wiki/Abstract_syntax_tree) as returned by [esprima\n parse](http://en.wikipedia.org/wiki/Abstract_syntax_tree)\n- tokens `{Array}`: [tokens](http://en.wikipedia.org/wiki/Token_(parser)) provided by esprima (excluding\n comments)\n- comments `{Array}`: block and line comments as provided by esprima\n- splits `{Array}`: code pieces split up, some of which where transformed as configured\n- code `{String}`: transformed code, same as `splits.join('')` unless this step has been skipped (see opts)\n\n## Browser Support\n\n### AMD\n\nEnsure to include [esprima](https://github.com/ariya/esprima) as one of your dependencies\n\n```js\ndefine(['redeyed'], function (redeyed) {\n [ .. ]\n});\n```\n\n### Attached to global window object\n\nThe `redeyed {Function}` will be exposed globally as `window.redeyed` - big surprise!\n\n```html\n\n\n```\n\n## redeyed in the wild\n\n- [cardinal](https://github.com/thlorenz/cardinal): Syntax highlights JavaScript code with ANSI colors to be printed to\n the terminal\n- [peacock](http://thlorenz.github.com/peacock/): JavaScript syntax highlighter that generates html that is compatible\n with pygments styles.\n\n## Examples\n\n- `npm explore redeyed; npm demo` will let you try the [browser example](https://github.com/thlorenz/redeyed/tree/master/examples/browser)\n- `npm explore redeyed; npm demo-log` will let you try the [replace log example](https://github.com/thlorenz/redeyed/blob/master/examples/replace-log.js)\n\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/thlorenz/redeyed/issues" + }, + "homepage": "https://github.com/thlorenz/redeyed", + "_id": "redeyed@0.4.2", + "_from": "redeyed@~0.4.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/redeyed.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/redeyed.js new file mode 100644 index 0000000..2347a34 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/redeyed.js @@ -0,0 +1,290 @@ +;(function () { + +'use strict'; +/*jshint laxbreak: true, browser:true */ +/*global define*/ + +var esprima + , exportFn + , toString = Object.prototype.toString + ; + +if (typeof module === 'object' && typeof module.exports === 'object' && typeof require === 'function') { + // server side + esprima = require('esprima'); + exportFn = function (redeyed) { module.exports = redeyed; }; + bootstrap(esprima, exportFn); +} else if (typeof define === 'function' && define.amd) { + // client side + // amd + define(['esprima'], function (esprima) { + return bootstrap(esprima); + }); +} else if (typeof window === 'object') { + // no amd -> attach to window if it exists + // Note that this requires 'esprima' to be defined on the window, so that script has to be loaded first + window.redeyed = bootstrap(window.esprima); +} + +function bootstrap(esprima, exportFn) { + + function isFunction (obj) { + return toString.call(obj) === '[object Function]'; + } + + function isString (obj) { + return toString.call(obj) === '[object String]'; + } + + function isNumber (obj) { + return toString.call(obj) === '[object Number]'; + } + + function isObject (obj) { + return toString.call(obj) === '[object Object]'; + } + + function surroundWith (before, after) { + return function (s) { return before + s + after; }; + } + + function isNonCircular(key) { + return key !== '_parent'; + } + + function objectizeString (value) { + var vals = value.split(':'); + + if (0 === vals.length || vals.length > 2) + throw new Error( + 'illegal string config: ' + value + + '\nShould be of format "before:after"' + ); + + if (vals.length === 1 || vals[1].length === 0) { + return vals.indexOf(':') < 0 ? { _before: vals[0] } : { _after: vals[0] }; + } else { + return { _before: vals[0], _after: vals[1] }; + } + } + + function objectize (node) { + + // Converts 'bef:aft' to { _before: bef, _after: aft } + // and resolves undefined before/after from parent or root + + function resolve (value, key) { + // resolve before/after from root or parent if it isn't present on the current node + if (!value._parent) return undefined; + + // Immediate parent + if (value._parent._default && value._parent._default[key]) return value._parent._default[key]; + + // Root + var root = value._parent._parent; + if (!root) return undefined; + + return root._default ? root._default[key] : undefined; + } + + function process (key) { + var value = node[key]; + + if (!value) return; + if (isFunction(value)) return; + + // normalize all strings to objects + if (isString(value)) { + node[key] = value = objectizeString(value); + } + + value._parent = node; + if (isObject(value)) { + if (!value._before && !value._after) return objectize (value); + + // resolve missing _before or _after from parent(s) + // in case we only have either one on this node + value._before = value._before || resolve(value, '_before'); + value._after = value._after || resolve(value, '_after'); + + return; + } + + throw new Error('nodes need to be either {String}, {Object} or {Function}.' + value + ' is neither.'); + } + + // Process _default ones first so children can resolve missing before/after from them + if (node._default) process('_default'); + + Object.keys(node) + .filter(function (key) { + return isNonCircular(key) + && node.hasOwnProperty(key) + && key !== '_before' + && key !== '_after' + && key !== '_default'; + }) + .forEach(process); + } + + function functionize (node) { + Object.keys(node) + .filter(function (key) { + return isNonCircular(key) && node.hasOwnProperty(key); + }) + .forEach(function (key) { + var value = node[key]; + + if (isFunction(value)) return; + + if (isObject(value)) { + + if (!value._before && !value._after) return functionize(value); + + // at this point before/after were "inherited" from the parent or root + // (see objectize) + var before = value._before || ''; + var after = value._after || ''; + + return node[key] = surroundWith (before, after); + } + }); + } + + function normalize (root) { + objectize(root); + functionize(root); + } + + function mergeTokensAndComments(tokens, comments) { + var all = {}; + + function addToAllByRangeStart(t) { all[ t.range[0] ] = t; } + + tokens.forEach(addToAllByRangeStart); + comments.forEach(addToAllByRangeStart); + + // keys are sorted automatically + return Object.keys(all) + .map(function (k) { return all[k]; }); + } + + function redeyed (code, config, opts) { + opts = opts || {}; + + // remove shebang + code = code.replace(/^\#\!.*/, ''); + + var ast = esprima.parse(code, { tokens: true, comment: true, range: true, tolerant: true }) + , tokens = ast.tokens + , comments = ast.comments + , lastSplitEnd = 0 + , splits = [] + , transformedCode + , all + , info + ; + + normalize(config); + + function tokenIndex(tokens, tkn, start) { + var current + , rangeStart = tkn.range[0]; + + for (current = start; current < tokens.length; current++) { + if (tokens[current].range[0] === rangeStart) return current; + } + + throw new Error('Token %s not found at or after index: %d', tkn, start); + } + + function process(surround) { + var result + , currentIndex + , nextIndex + , skip = 0 + , splitEnd + ; + + result = surround(code.slice(start, end), info); + if (isObject(result)) { + splits.push(result.replacement); + + currentIndex = info.tokenIndex; + nextIndex = tokenIndex(info.tokens, result.skipPastToken, currentIndex); + skip = nextIndex - currentIndex; + splitEnd = skip > 0 ? tokens[nextIndex - 1].range[1] : end; + } else { + splits.push(result); + splitEnd = end; + } + + return { skip: skip, splitEnd: splitEnd }; + } + + function addSplit (start, end, surround, info) { + var result + , nextIndex + , skip = 0 + ; + + if (start >= end) return; + if (surround) { + result = process(surround); + skip = result.skip; + lastSplitEnd = result.splitEnd; + } else { + splits.push(code.slice(start, end)); + lastSplitEnd = end; + } + + return skip; + } + + all = mergeTokensAndComments(tokens, comments); + for (var tokenIdx = 0; tokenIdx < all.length; tokenIdx++) { + var token = all[tokenIdx] + , surroundForType = config[token.type] + , surround + , start + , end; + + // At least the type (e.g., 'Keyword') needs to be specified for the token to be surrounded + if (surroundForType) { + + // root defaults are only taken into account while resolving before/after otherwise + // a root default would apply to everything, even if no type default was specified + surround = surroundForType + && surroundForType.hasOwnProperty(token.value) + && surroundForType[token.value] + && isFunction(surroundForType[token.value]) + ? surroundForType[token.value] + : surroundForType._default; + + start = token.range[0]; + end = token.range[1]; + + addSplit(lastSplitEnd, start); + info = { tokenIndex: tokenIdx, tokens: all, ast: ast, code: code }; + tokenIdx += addSplit(start, end, surround, info); + } + } + + if (lastSplitEnd < code.length) { + addSplit(lastSplitEnd, code.length); + } + + transformedCode = opts.nojoin ? undefined : splits.join(''); + + return { + ast : ast + , tokens : tokens + , comments : comments + , splits : splits + , code : transformedCode + }; + } + + return exportFn ? exportFn(redeyed) : redeyed; +} +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-before-after-config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-before-after-config.js new file mode 100644 index 0000000..d0f8284 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-before-after-config.js @@ -0,0 +1,54 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var result = redeyed(code, opts).code + this.equals(result, expected, inspect(code) + ' => ' + inspect(expected)) + return this; + } + + t.end() +}) +test('\nbefore/after config, keywords', function (t) { + + var opts001 = { Keyword: { _default: { _before: '*', _after: '&' } } }; + t.test('\n# ' + inspect(opts001), function (t) { + t.assertSurrounds('this', opts001, '*this&') + t.assertSurrounds('if (a == 1) return', opts001, '*if& (a == 1) *return&') + t.assertSurrounds('var n = new Test();', opts001, '*var& n = *new& Test();') + t.end() + }) + + var opts002 = { + Keyword: { + 'function': { _before: '^' } + , 'return': { _before: '(', _after: ')' } + , _default: { _before: '*' , _after: '&' } + } + }; + + t.test('\n# ' + inspect(opts002), function (t) { + t.assertSurrounds( + [ 'function foo (bar) {' + , ' var a = 3;' + , ' return bar + a;' + , '}' + ].join('\n') + , opts002 + , [ '^function& foo (bar) {' + , ' *var& a = 3;' + , ' (return) bar + a;' + , '}' + ].join('\n')) + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-browser.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-browser.js new file mode 100644 index 0000000..ddb25ce --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-browser.js @@ -0,0 +1,69 @@ +'use strict' +/*jshint asi: true, browser: true*/ +/*global define window */ + +var test = require('tap').test + , util = require('util') + , redeyedExport = require('..') + , redeyedkey = require.resolve('..') + , esprima = require('esprima') + +function setup() { + // remove redeyed from require cache to force re-require for each test + delete require.cache[redeyedkey]; + + // remove globals + delete global.window; + delete global.define; +} + +// TODO: need to run in vm in order to properly simulate require and module not being present +return; +test('define and window exist', function (t) { + var defineCb + , deps + + setup() + + // declare browser globals + global.window = { } + + global.define = function (deps_, cb) { + deps_ = deps + defineCb = cb + } + + define.amd = true + + var redeyed = require('..') + , definedredeyed = defineCb(esprima) + + t.equal(window.redeyed, undefined, 'redeyed is not attached to window') + t.notEqual(redeyed.toString(), redeyedExport.toString(), 'redeyed is not exported') + t.equal(definedredeyed.toString(), redeyedExport.toString(), 'redeyed is defined') + + t.end() +}) + +test('window exists, but define doesn\'t', function (t) { + setup() + + // declare browser globals + global.window = { esprima: esprima } + + var redeyed = require('..') + + t.equal(window.redeyed.toString(), redeyedExport.toString(), 'redeyed is attached to window') + t.notEqual(redeyed.toString(), redeyedExport.toString(), 'redeyed is not exported') + t.end() +}) + +test('neither window nor define exist', function (t) { + setup() + + var redeyed = require('..') + + t.equal(redeyed.toString(), redeyedExport.toString(), 'redeyed is exported') + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-comments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-comments.js new file mode 100644 index 0000000..09392cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-comments.js @@ -0,0 +1,71 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var result = redeyed(code, opts) + this.equals(result.code, expected, inspect(code) + ' => ' + inspect(expected)) + return this; + } + + t.end() +}) + +test('\nstring config, Line comments', function (t) { + var opts = { Line: { _default: '*:&' } }; + t.test('\n# ' + inspect(opts), function (t) { + + t.assertSurrounds( + '// a comment' + , opts + , '*// a comment&' + ) + t.assertSurrounds( + '// comment then new line\nif (a == 1) return' + , opts + , '*// comment then new line&\nif (a == 1) return' + ) + t.assertSurrounds( + 'var n = new Test();// some comment after\n//more comment\nvar s = 3;' + , opts + , 'var n = new Test();*// some comment after&\n*//more comment&\nvar s = 3;' + ) + t.end() + }) +}) + +test('\nstring config, Block comments', function (t) { + var opts = { Block: { _default: '_:-' } }; + t.test('\n# ' + inspect(opts), function (t) { + + t.assertSurrounds( + '/* a comment */' + , opts + , '_/* a comment */-' + ) + t.assertSurrounds( + '/* comment then new line*/\nif (a == 1) /* inline */ return' + , opts + , '_/* comment then new line*/-\nif (a == 1) _/* inline */- return' + ) + t.assertSurrounds( + 'var n = new Test();/* some comment after*/\n/*more comment*/\nvar s = 3;' + , opts + , 'var n = new Test();_/* some comment after*/-\n_/*more comment*/-\nvar s = 3;' + ) + t.assertSurrounds( + 'var a = 4;\n/* Multi line comment\n * Next line\n * and another\n*/ var morecode = "here";' + , opts + , 'var a = 4;\n_/* Multi line comment\n * Next line\n * and another\n*/- var morecode = "here";' + ) + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-config-with-undefineds.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-config-with-undefineds.js new file mode 100644 index 0000000..5ddc40d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-config-with-undefineds.js @@ -0,0 +1,60 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var optsi = inspect(opts); + var result = redeyed(code, opts).code + + this.equals( result + , expected + , util.format('%s: %s => %s', optsi, inspect(code), inspect(expected)) + ) + return this; + } + + t.end() +}) + +test('\n undefineds only', function (t) { + t.assertSurrounds('1 + 2', { Numeric: { _default: undefined } }, '1 + 2') + t.assertSurrounds('1 + 2', { Numeric: { _default: undefined }, _default: undefined }, '1 + 2') + + t.assertSurrounds( + 'return true' + , { 'Boolean': { 'true': undefined, 'false': undefined, _default: undefined } , _default: undefined } + , 'return true' + ) + + t.end() +}) + +test('\n mixed', function (t) { + t.assertSurrounds( + 'return true || false' + , { 'Boolean': { 'true': '&:', 'false': undefined, _default: undefined } , _default: undefined } + , 'return &true || false' + ) + + t.assertSurrounds( + 'return true || false' + , { 'Boolean': { 'true': '&:', 'false': undefined, _default: ':?' } , _default: undefined } + , 'return &true? || false?' + ) + + t.assertSurrounds( + 'return true || false' + , { 'Boolean': { 'true': '&:', 'false': undefined, _default: undefined } , _default: ':?' } + , 'return &true? || false' + ) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-extra-params.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-extra-params.js new file mode 100644 index 0000000..f962b7c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-extra-params.js @@ -0,0 +1,57 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('function - config passing idx and tokens', function (t) { + + var args = [] + , opts001 = { + Boolean: { + _default: identity + } + , Keyword: { + _default: identity + } + , Identifier: { + _default: identity + } + , Punctuator: { + _default: identity + } + } + , code = 'var fn = function () { return true; }' + + function identity (s, info) { + args.push( { value: s, idx: info.tokenIndex, tokens: info.tokens, code: info.code }) + // returning unchanged string will keep the splits be equal to the original tokens + return s + } + + function tokenValue (t) { return t.value; } + + t.test(inspect(opts001) + ' -- ' + code, function (t) { + + var result = redeyed(code, opts001, { splits: true }) + , tokens = result.tokens + + t.equals(args.length, tokens.length, 'called with all tokens') + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + , arg = args[i] + + t.equals(arg.value, token.value, 'passes correct value: ' + inspect([ arg.value, token.value ])) + t.equals(arg.idx, i, 'passes correct index') + t.equals(arg.code, code, 'passes code') + t.deepEquals(arg.tokens, tokens, 'passes all tokens') + } + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-skipping-tokens.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-skipping-tokens.js new file mode 100644 index 0000000..ff14273 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config-skipping-tokens.js @@ -0,0 +1,89 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + + +test('given i skip 2 more tokens after each semicolon', function (t) { + var calls = 0 + , opts = { + Punctuator: { + ';': function identity (s, info) { + // tell it to skip past second to last token that is 2 ahead of the current one + calls++ + var skipToken = info.tokens[info.tokenIndex + 2] + return skipToken ? { replacement: s, skipPastToken: skipToken } : s; + } + } + } + ; + + [ { code: ';;;' , expectedCalls: 1 } + , { code: ';;;;' , expectedCalls: 2 } + , { code: '; ; ; ;' , expectedCalls: 2 } + , { code: ';;; ;;; ;;; ;' , expectedCalls: 4 } + , { code: ';;; ;;; ;;; ;;; ;' , expectedCalls: 5 } + , { code: ';;; ;;; ;;; ;;; ;;;' , expectedCalls: 5 } + , { code: ';;; ;;; ;;; ;;; ;;; ;' , expectedCalls: 6 } + ].forEach(function (x) { + calls = 0 + redeyed(x.code, opts); + t.equals(calls, x.expectedCalls, 'calls ' + x.expectedCalls + ' times for ' + x.code) + }); + t.end() +}) + +test('replace log', function (t) { + var kinds = [ 'info', 'warn', 'error' ] + , opts = { + Identifier: { + console: function replaceLog(s, info) { + var code = info.code + , idx = info.tokenIndex + , tokens = info.tokens + , kind = tokens[idx + 2].value + , openParen = tokens[idx + 3].value + , firstArgTkn = tokens[idx + 4] + , argIdx = idx + 3 + , open + , tkn + ; + + open = 1; + while (open) { + tkn = tokens[++argIdx]; + + if (tkn.value === '(') open++; + if (tkn.value === ')') open--; + } + + var argsIncludingClosingParen = code.slice(firstArgTkn.range[0], tkn.range[1]) + , result = 'log.' + kind + '("main-logger", ' + argsIncludingClosingParen; + + return { replacement: result, skipPastToken: tkn }; + } + } + } + + , origCode = [ + 'console.info("info ", 1);' + , 'console.warn("warn ", 3);' + , 'console.error("error ", new Error("oh my!"));' + ].join('\n') + + , expectedCode = [ + 'log.info("main-logger", "info ", 1));' + , 'log.warn("main-logger", "warn ", 3));' + , 'log.error("main-logger", "error ", new Error("oh my!")));' + ].join('\n') + , code = redeyed(origCode, opts).code + + t.equals(code, expectedCode, 'transforms all log statements') + t.end() +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config.js new file mode 100644 index 0000000..6c5ed29 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-function-config.js @@ -0,0 +1,142 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var result = redeyed(code, opts).code + this.equals(result, expected, inspect(code) + ' => ' + inspect(expected)) + return this; + } + + t.end() +}) + +test('\nfunction config, keywords', function (t) { + + var opts001 = { Keyword: { _default: function (s) { return '*' + s + '&'; } } }; + t.test('\n# ' + inspect(opts001), function (t) { + t.assertSurrounds('this', opts001, '*this&') + + t.assertSurrounds('this ', opts001, '*this& ') + t.assertSurrounds(' this', opts001, ' *this&') + t.assertSurrounds(' this ', opts001, ' *this& ') + t.assertSurrounds('if (a == 1) return', opts001, '*if& (a == 1) *return&') + t.assertSurrounds('var n = new Test();', opts001, '*var& n = *new& Test();') + t.assertSurrounds( + [ 'function foo (bar) {' + , ' var a = 3;' + , ' return bar + a;' + , '}' + ].join('\n') + , opts001 + , [ '*function& foo (bar) {' + , ' *var& a = 3;' + , ' *return& bar + a;' + , '}' + ].join('\n')) + t.end() + }) + + var opts002 = { + Keyword: { + 'function': function (s) { return '^' + s + '&' } + , 'return': function (s) { return '(' + s + ')' } + , _default: function (s) { return '*' + s + '&' } + } + }; + + t.test('\n# ' + inspect(opts002), function (t) { + t.assertSurrounds( + [ 'function foo (bar) {' + , ' var a = 3;' + , ' return bar + a;' + , '}' + ].join('\n') + , opts002 + , [ '^function& foo (bar) {' + , ' *var& a = 3;' + , ' (return) bar + a;' + , '}' + ].join('\n')) + t.end() + }) +}) + +test('#\n functin config - resolving', function (t) { + var opts001 = { + Keyword: { + 'var': function (s) { return '^' + s + '&' } + } + , _default: function (s) { return '*' + s + '&' } + }; + t.test('\n# specific but no type default and root default - root default not applied' + inspect(opts001), function (t) { + t.assertSurrounds('var n = new Test();', opts001, '^var& n = new Test();').end(); + }) + + var opts002 = { + Keyword: { + 'var': function (s) { return '^' + s + '&' } + , _default: function (s) { return '*' + s + '&' } + } + , _default: function (s) { return '(' + s + ')' } + }; + t.test('\n# no type default but root default' + inspect(opts002), function (t) { + t.assertSurrounds('var n = new Test();', opts002, '^var& n = *new& Test();').end(); + }) +}) + +test('#\n function config - replacing', function (t) { + var opts001 = { + Keyword: { + 'var': function () { return 'const' } + } + }; + t.test('\n# type default and root default (type wins)' + inspect(opts001), function (t) { + t.assertSurrounds('var n = new Test();', opts001, 'const n = new Test();').end(); + }) + + var opts002 = { + Keyword: { + _default: function () { return 'const' } + } + }; + t.test('\n# type default' + inspect(opts002), function (t) { + t.assertSurrounds('var n = new Test();', opts002, 'const n = const Test();').end(); + }) + + var opts003 = { + Keyword: { + 'new': function () { return 'NEW'; } + , _default: function () { return 'const' } + } + }; + t.test('\n# specific and type default' + inspect(opts003), function (t) { + t.assertSurrounds('var n = new Test();', opts003, 'const n = NEW Test();').end(); + }) + + var opts004 = { + Keyword: { + _default: function (s) { return s.toUpperCase() } + } + , _default: function (s) { return 'not applied'; } + }; + t.test('\n# type default and root default (type wins)' + inspect(opts004), function (t) { + t.assertSurrounds('var n = new Test();', opts004, 'VAR n = NEW Test();').end(); + }) + + var opts005 = { + Keyword: { } + , _default: function (s) { return s.toUpperCase() } + }; + t.test('\n# no type default only root default - not applied' + inspect(opts005), function (t) { + t.assertSurrounds('var n = new Test();', opts005, 'var n = new Test();').end(); + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-mixed.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-mixed.js new file mode 100644 index 0000000..2346ba9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-mixed.js @@ -0,0 +1,46 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var result = redeyed(code, opts).code + this.equals(result, expected, inspect(code) + ' => ' + inspect(expected)) + return this; + } + + t.end() +}) + +test('\nmixed config, keywords', function (t) { + var opts001 = { + Keyword: { + 'this': function (s) { return '_' + s; } + , 'if': { _before: '^' } + , _default: '*:&' + } + }; + t.test('\n# ' + inspect(opts001), function (t) { + t.assertSurrounds('if (this.hello) return "world";', opts001, '^if& (_this.hello) *return& "world";').end() + }) + + var opts002 = { + Keyword: { + 'this': function (s) { return '_' + s; } + , 'if': { _before: '^' } + , 'return': ':)' + , _default: ':&' + } + , _default: '*:&' + }; + t.test('\n# ' + inspect(opts002), function (t) { + t.assertSurrounds('if (this.hello) return "world";', opts002, '^if& (_this.hello) *return) "world";').end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-result.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-result.js new file mode 100644 index 0000000..9a138dc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-result.js @@ -0,0 +1,48 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + , esprima = require('esprima') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('redeyed result has esprima ast, tokens, comments and splits and transformed code', function (t) { + var code = '// a comment\nvar a = 3;' + , conf = { Keyword: { _default: '_:-' } } + + , ast = esprima.parse(code, { tokens: true, comment: true, range: true, tolerant: true }) + , tokens = ast.tokens + , comments = ast.comments + + , result = redeyed(code, conf) + + console.log(ast) + t.deepEquals(result.ast, ast, 'ast') + t.deepEquals(result.tokens, tokens, 'tokens') + t.deepEquals(result.comments, comments, 'comments') + t.notEquals(result.code, undefined, 'code') + + t.end() +}); + +test('redeyed result - { nojoin } has esprima ast, tokens, comments and splits but no transformed code', function (t) { + var code = '// a comment\nvar a = 3;' + , conf = { Keyword: { _default: '_:-' } } + + , ast = esprima.parse(code, { tokens: true, comment: true, range: true, tolerant: true }) + , tokens = ast.tokens + , comments = ast.comments + + , result = redeyed(code, conf, { nojoin: true }) + + t.deepEquals(result.ast, ast, 'ast') + t.deepEquals(result.tokens, tokens, 'tokens') + t.deepEquals(result.comments, comments, 'comments') + t.equals(result.code, undefined, 'code') + + t.end() +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-shebang.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-shebang.js new file mode 100644 index 0000000..f94ee39 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-shebang.js @@ -0,0 +1,23 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('removes shebang from the code before parsing it', function (t) { + var code = [ + '#!/usr/bin/env node' + , 'var util = require("util");' + ].join('\n') + , opts = { Keyword: { 'var': '%:^' } } + , expected = '\n%var^ util = require("util");' + , res = redeyed(code, opts).code + + t.equals(res, expected, inspect(code) + ' opts: ' + inspect(opts) + ' => ' + inspect(expected)) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js new file mode 100644 index 0000000..cf6c81b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js @@ -0,0 +1,57 @@ +'use strict'; +/*jshint asi: true*/ + +// applying redeyed to a bunch of files of contained libraries as a smoke test +var test = require('tap').test + , path = require('path') + , fs = require('fs') + , readdirp = require('readdirp') + , redeyed = require('..') + , node_modules = path.join(__dirname, '..', 'node_modules') + , tapdir = path.join(node_modules, 'tap') + , esprimadir = path.join(node_modules, 'esprima') + +test('tap', function (t) { + var invalidTapFiles = [ + 'async-map-ordered.js' + , 'prof.js' + ] + + readdirp({ root: tapdir, fileFilter: '*.js' }) + .on('data', function (entry) { + + if (~invalidTapFiles.indexOf(entry.name)) return + + var code = fs.readFileSync(entry.fullPath, 'utf-8') + , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code + + t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path) + }) + .on('end', t.end.bind(t)) +}) + +test('esprima', function (t) { + + readdirp({ root: esprimadir, fileFilter: '*.js' }) + .on('data', function (entry) { + + var code = fs.readFileSync(entry.fullPath, 'utf-8') + , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code + + t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path) + }) + .on('end', t.end.bind(t)) +}) + +test('redeyed', function (t) { + + readdirp({ root: path.join(__dirname, '..'), fileFilter: '*.js', directoryFilter: ['!.git', '!node_modules' ] }) + .on('data', function (entry) { + + var code = fs.readFileSync(entry.fullPath, 'utf-8') + , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code + + t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path) + }) + .on('end', t.end.bind(t)) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-string-config.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-string-config.js new file mode 100644 index 0000000..25a8953 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-string-config.js @@ -0,0 +1,124 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var result = redeyed(code, opts).code + this.equals(result, expected, inspect(code) + ' => ' + inspect(expected)) + return this; + } + + t.end() +}) + +test('\nstring config, keywords', function (t) { + + var opts001 = { Keyword: { _default: '*:&' } }; + t.test('\n# ' + inspect(opts001), function (t) { + t.assertSurrounds('this', opts001, '*this&') + t.assertSurrounds('if (a == 1) return', opts001, '*if& (a == 1) *return&') + t.assertSurrounds('var n = new Test();', opts001, '*var& n = *new& Test();') + t.end() + }) + + var opts002 = { + Keyword: { + 'function': '^:' + , 'return': '(:)' + , _default: '*:&' + } + }; + + t.test('\n# ' + inspect(opts002), function (t) { + t.assertSurrounds( + [ 'function foo (bar) {' + , ' var a = 3;' + , ' return bar + a;' + , '}' + ].join('\n') + , opts002 + , [ '^function& foo (bar) {' + , ' *var& a = 3;' + , ' (return) bar + a;' + , '}' + ].join('\n')) + t.end() + }) +}) + +test('\nstring configs resolve from type and root', function (t) { + var code = 'var a = new Test();' + + function run(t, conf, expected, code_) { + t.test('\n# ' + inspect(conf), function (t) { + t.assertSurrounds(code_ || code, conf, expected); + t.end() + }) + } + + // at least the token kind has to be configured in order for the root_default to be applied + // otherwise a root._default would affect all tokens, even the ones we want to leave unchanged + run(t, { _default: '*:' }, 'var a = new Test();') + + t.test('\n\n# only before or after specified, but no root._default', function (t) { + run(t, { Keyword: { _default: '*:' } }, '*var a = *new Test();') + run(t, { Keyword: { _default: ':-' } }, 'var- a = new- Test();') + t.end() + }) + + t.test('\n\n# resolve missing from root._default', function (t) { + run(t, { Keyword: { _default: '*:' }, _default: '(:-' }, '*var- a = *new- Test();') + run(t, { Keyword: { _default: ':-' }, _default: '*:)' }, '*var- a = *new- Test();') + t.end() + }) + + t.test('\n\n# no resolve if all specified', function (t) { + run(t, { Keyword: { _default: '+:-' }, _default: '*:)' }, '+var- a = +new- Test();') + run(t, { Keyword: { _default: ':-' }, _default: ':)' }, 'var- a = new- Test();') + t.end() + }) + + t.test('\n\n# resolve specific token no defaults', function (t) { + run(t, { Keyword: { 'var': '*:' } }, '*var a = new Test();') + run(t, { Keyword: { 'var': ':-' } }, 'var- a = new Test();') + t.end() + }) + + t.test('\n\n# resolve specific token with type defaults', function (t) { + run(t, { Keyword: { 'var': '*:', _default: ':-' } }, '*var- a = new- Test();') + run(t, { Keyword: { 'var': '*:', _default: '(:-' } }, '*var- a = (new- Test();') + run(t, { Keyword: { 'var': ':-', _default: '*:' } }, '*var- a = *new Test();') + run(t, { Keyword: { 'var': ':-', _default: '*:)' } }, '*var- a = *new) Test();') + run(t, { Keyword: { 'var': ':-', 'new': ':&', _default: '*:' } }, '*var- a = *new& Test();') + t.end() + }) + + t.test( + '\n\n# resolve specific token with root defaults, but no type default - root default not applied to unspecified tokens' + , function (t) { + run(t, { Keyword: { 'var': '*:' }, _default: ':-' }, '*var- a = new Test();') + run(t, { Keyword: { 'var': ':-' }, _default: '*:' }, '*var- a = new Test();') + t.end() + } + ) + + t.test('\n\n# resolve specific token with type and root defaults', function (t) { + run(t, { Keyword: { 'var': '*:', _default: '+:-' }, _default: ':)' }, '*var- a = +new- Test();') + run(t, { Keyword: { 'var': ':-', _default: '*:+' }, _default: '(:' }, '*var- a = *new+ Test();') + t.end() + }) + + t.test('all exact tokens undefined, but type default', function (t) { + run(t, { 'Boolean': { 'true': undefined, 'false': undefined, _default: '+:-' } }, 'return +true- || +false-;', 'return true || false;') + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-types.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-types.js new file mode 100644 index 0000000..ca4837d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-types.js @@ -0,0 +1,71 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , redeyed = require('..') + +function inspect (obj) { + return util.inspect(obj, false, 5, true) +} + +test('adding custom asserts ... ', function (t) { + t.constructor.prototype.assertSurrounds = function (code, opts, expected) { + var optsi = inspect(opts); + var result = redeyed(code, opts).code + + this.equals( result + , expected + , util.format('%s: %s => %s', optsi, inspect(code), inspect(expected)) + ) + return this; + } + + t.end() +}) + +test('types', function (t) { + t.test('\n# Boolean', function (t) { + t.assertSurrounds('return true;', { 'Boolean': { _default: '$:%' } }, 'return $true%;') + t.assertSurrounds( 'return true; return false;' + , { 'Boolean': { 'false': '#:', _default: '$:%' } } + , 'return $true%; return #false%;') + t.end() + }) + + t.test('\n# Identifier', function (t) { + t.assertSurrounds('var a = 1;', { 'Identifier': { _default: '$:%' } }, 'var $a% = 1;') + t.assertSurrounds( 'var a = 1; const b = 2;' + , { 'Identifier': { 'b': '#:', _default: '$:%' } } + , 'var $a% = 1; const #b% = 2;') + t.end() + }) + + t.test('\n# Null', function (t) { + t.assertSurrounds('return null;', { 'Null': { _default: '$:%' } }, 'return $null%;').end() + }) + + t.test('\n# Numeric', function (t) { + t.assertSurrounds('return 1;', { 'Numeric': { _default: '$:%' } }, 'return $1%;') + t.assertSurrounds( 'return 1; return 2;' + , { 'Numeric': { '2': '#:', _default: '$:%' } } + , 'return $1%; return #2%;') + t.end() + }) + + t.test('\n# Punctuator', function (t) { + t.assertSurrounds('return 2 * 2;', { 'Punctuator': { _default: '$:%' } }, 'return 2 $*% 2$;%') + t.assertSurrounds( 'return 2 * 2;' + , { 'Punctuator': {'*': '#:', _default: '$:%' } } + , 'return 2 #*% 2$;%') + t.end() + }) + + t.test('\n# String', function (t) { + t.assertSurrounds('return "hello";', { 'String': { _default: '$:%' } }, 'return $"hello"%;') + t.assertSurrounds( 'return "hello"; return "world";' + , { 'String': { '"world"': '#:', _default: '$:%' } } + , 'return $"hello"%; return #"world"%;') + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/package.json new file mode 100644 index 0000000..b07c8d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/package.json @@ -0,0 +1,54 @@ +{ + "name": "cardinal", + "version": "0.4.4", + "description": "Syntax highlights JavaScript code with ANSI colors to be printed to the terminal.", + "main": "cardinal.js", + "scripts": { + "test": "tap ./test/*.js", + "demo": "node examples/highlight-string.js; node examples/highlight-self; node examples/highlight-self-hide-semicolons;" + }, + "bin": { + "cdl": "./bin/cdl.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/cardinal.git" + }, + "keywords": [ + "syntax", + "highlight", + "theme", + "javascript", + "json", + "terminal", + "console", + "print", + "output" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "license": "MIT", + "dependencies": { + "redeyed": "~0.4.0", + "ansicolors": "~0.2.1" + }, + "devDependencies": { + "tap": "~0.3.1", + "readdirp": "~0.2.1" + }, + "readme": "# cardinal [![Build Status](https://secure.travis-ci.org/thlorenz/cardinal.png)](http://travis-ci.org/thlorenz/cardinal)\n\n[![NPM](https://nodei.co/npm/cardinal.png?downloads=true&stars=true)](https://nodei.co/npm/cardinal/)\n\n**car·di·nal** *(kärdn-l, kärdnl)* - crested thick-billed North American finch having bright red plumage in the male.\n\n![screenshot](https://github.com/thlorenz/cardinal/raw/master/assets/screen-shot.png)\n\n## Features\n\n- highlights JavaScript code with ANSI colors to improve terminal output\n- theming support, see [custom color themes](https://github.com/thlorenz/cardinal/tree/master/themes)\n- optionally print line numbers\n- API and command line interface (`cdl`)\n- `.cardinalrc` config to customize settings\n- supports UNIX pipes\n\n***\n\n**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Installation](#installation)\n - [As library](#as-library)\n - [As Commandline Tool](#as-commandline-tool)\n- [Commandline](#commandline)\n - [Highlight a file](#highlight-a-file)\n - [As part of a UNIX pipe](#as-part-of-a-unix-pipe)\n - [Theme](#theme)\n- [API](#api)\n - [*highlight(code[, opts])*](#highlightcode-opts)\n - [*highlightFileSync(fullPath[, opts])*](#highlightfilesyncfullpath-opts)\n - [*highlightFile(fullPath[, opts], callback)*](#highlightfilefullpath-opts-callback)\n - [opts](#opts)\n- [Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples))](#examples-[browse]https://githubcom/thlorenz/cardinal/tree/master/examples)\n\n\n## Installation\n\n### As library\n\n npm install cardinal\n\n### As Commandline Tool\n\n [sudo] npm install -g cardinal\n\n**Note:** \n\nWhen installed globally, cardinal exposes itself as the `cdl` command.\n\n## Commandline\n\n### Highlight a file\n\n cdl [options]\n\n**options**:\n - `--nonum`: turns off line number printing (relevant if it is turned on inside `~/.cardinalrc`\n\n### As part of a UNIX pipe\n\n cat file.js | grep console | cdl\n\n**Note:**\n\nNot all code lines may be parsable JavaScript. In these cases the line is printed to the terminal without\nhighlighting it.\n\n### Theme\n\nThe default theme will be used for highlighting.\n\nTo use a different theme, include a `.cardinalrc` file in your `HOME` directory.\n\nThis is a JSON file of the following form:\n\n```json\n{\n \"theme\": \"hide-semicolons\",\n \"linenos\": true|false\n}\n```\n\n- `theme` can be the name of any of the [built-in themes](https://github.com/thlorenz/cardinal/tree/master/themes) or the\nfull path to a custom theme anywhere on your computer.\n- linenos toggles line number printing\n\n## API\n\n### *highlight(code[, opts])*\n\n- returns the highlighted version of the passed code ({String}) or throws an error if it was not able to parse it\n- opts (see below)\n\n### *highlightFileSync(fullPath[, opts])*\n\n- returns the highlighted version of the file whose fullPath ({String}) was passed or throws an error if it was not able\n to parse it\n- opts (see below)\n\n### *highlightFile(fullPath[, opts], callback)*\n\n- calls back with the highlighted version of the file whose fullPath ({String}) was passed or with an error if it was not able\n to parse it\n- opts (see below)\n- `callback` ({Function}) has the following signature: `function (err, highlighted) { .. }`\n\n### opts\n\nopts is an {Object} with the following properties:\n\n- `theme` {Object} is used to optionally override the theme used to highlight\n- `linenos` {Boolean} if `true` line numbers are included in the highlighted code\n- `firstline` {Integer} sets line number of the first line when line numbers are printed\n- `json` {Boolean} if `true` highlights JSON in addition to JavaScript (`true` by default if file extension is `.json`)\n\n## Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples))\n\n- [sample .cardinalrc](https://github.com/thlorenz/cardinal/blob/master/examples/.cardinalrc)\n- [highlighting a code snippet](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-string.js) via\n ***highlight()***\n- [file that highlights itself](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self.js) via\n ***highlightFile()*** including line numbers\n- [file that highlights itself hiding all\n semicolons](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self-hide-semicolons.js) via\n ***highlightFileSync()***\n\n\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/cardinal/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/thlorenz/cardinal/issues" + }, + "homepage": "https://github.com/thlorenz/cardinal", + "_id": "cardinal@0.4.4", + "dist": { + "shasum": "ca5bb68a5b511b90fe93b9acea49bdee5c32bfe2" + }, + "_from": "cardinal@~0.4.0", + "_resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.4.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/settings.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/settings.js new file mode 100644 index 0000000..f31817a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/settings.js @@ -0,0 +1,51 @@ +var path = require('path') + , util = require('util') + , fs = require('fs') + , utl = require('./utl') + , home = process.env.HOME + , settings; + +function getSettings (home_) { + if (settings) return settings; + try { + settingsJson = fs.readFileSync(path.join(home_ || home, '.cardinalrc'), 'utf-8'); + } catch (_) { + // no .cardinalrc found - not a problem + return undefined; + } + try { + return JSON.parse(settingsJson); + } catch (e) { + // Have a .cardinalrc, but something about it is wrong - warn the user + // Coudn't parse the contained JSON + console.error(e); + return undefined; + } +} + +// home_ mainly to be used during tests +// Resolves the preferred theme from the .cardinalrc found in the HOME directory +// If it couldn't be resolved, undefined is returned +function resolveTheme (home_) { + var themePath + , settings = getSettings(home_); + + if (!settings || !settings.theme) return undefined; + + try { + // allow specifying just the name of a built-in theme or a full path to a custom theme + themePath = utl.isPath(settings.theme) ? settings.theme : path.join(__dirname, 'themes', settings.theme); + + return require(themePath); + } catch (e) { + // Specified theme path is invalid + console.error(e); + return undefined; + } +} + +module.exports = { + resolveTheme: resolveTheme + , getSettings: getSettings +}; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-block-comment.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-block-comment.js new file mode 100644 index 0000000..6b99a1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-block-comment.js @@ -0,0 +1,25 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , fs = require('fs') + , customTheme = require('./fixtures/custom') + , cardinal = require('..') + +function inspect(obj, depth) { + console.log(require('util').inspect(obj, false, depth || 5, true)); +} + +test('\nhighlighting a block comment without line numbers', function (t) { + var code = fs.readFileSync(__dirname + '/fixtures/block-comment.js', 'utf8'); + var highlighted = cardinal.highlight(code, { theme: customTheme }); + t.equal(highlighted, '\n\u001b[90m/**\n * This is a meaningless block jsdoc for a meaningless function.\n * Joins two strings, separating them to appear on two lines.\n * \n * @name foo\n * @function\n * @param uno {String} first string\n * @param dos {String} second string\n * @return {String} result of the join\n */\u001b[39m\n\u001b[96mmodule\u001b[39m\u001b[32m.\u001b[39m\u001b[96mexports\u001b[39m \u001b[93m=\u001b[39m \u001b[94mfunction\u001b[39m \u001b[96mfoo\u001b[39m \u001b[90m(\u001b[39m\u001b[96muno\u001b[39m\u001b[32m,\u001b[39m \u001b[96mdos\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m\n \u001b[31mreturn\u001b[39m \u001b[96muno\u001b[39m \u001b[93m+\u001b[39m \u001b[92m\'\\n\'\u001b[39m \u001b[93m+\u001b[39m \u001b[96mdos\u001b[39m\u001b[90m;\u001b[39m\n\u001b[33m}\u001b[39m\n') + t.end() +}) + +test('\nhighlighting a block comment with line numbers', function (t) { + var code = fs.readFileSync(__dirname + '/fixtures/block-comment.js', 'utf8'); + var highlighted = cardinal.highlight(code, { theme: customTheme, linenos: true }); + t.equal(highlighted, '\u001b[90m 1: \n\u001b[90m 2: \u001b[90m/**\n\u001b[90m 3: * This is a meaningless block jsdoc for a meaningless function.\n\u001b[90m 4: * Joins two strings, separating them to appear on two lines.\n\u001b[90m 5: * \n\u001b[90m 6: * @name foo\n\u001b[90m 7: * @function\n\u001b[90m 8: * @param uno {String} first string\n\u001b[90m 9: * @param dos {String} second string\n\u001b[90m10: * @return {String} result of the join\n\u001b[90m11: */\u001b[39m\n\u001b[90m12: \u001b[96mmodule\u001b[39m\u001b[32m.\u001b[39m\u001b[96mexports\u001b[39m \u001b[93m=\u001b[39m \u001b[94mfunction\u001b[39m \u001b[96mfoo\u001b[39m \u001b[90m(\u001b[39m\u001b[96muno\u001b[39m\u001b[32m,\u001b[39m \u001b[96mdos\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m\n\u001b[90m13: \u001b[31mreturn\u001b[39m \u001b[96muno\u001b[39m \u001b[93m+\u001b[39m \u001b[92m\'\\n\'\u001b[39m \u001b[93m+\u001b[39m \u001b[96mdos\u001b[39m\u001b[90m;\u001b[39m\n\u001b[90m14: \u001b[33m}\u001b[39m') + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-diff-spike.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-diff-spike.js new file mode 100644 index 0000000..eec5317 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-diff-spike.js @@ -0,0 +1,95 @@ +/*jshint asi:true */ +'use strict'; + +var fs = require('fs') + , path = require('path') + , utl = require('../utl') + , highlighter = require('..') + , colors = require('ansicolors') + , diffFile = path.join(__dirname, 'fixtures', 'git-diff.txt') + , diff = fs.readFileSync(diffFile, 'utf-8') + + +// @@ is not a valid js token, so when we see it, we can be sure that we are dealing with a git or svn diff +var diffRegex = /^@@[^@]+@@$/m; +var diffIndRegex = /^(@@[^@]+@@)(.*)$/; +var addRemRegex = /^[+\-]/; +var lines = diff.split('\n'); + +function isDiff(lines) { + return !!lines + .filter(function (line) { + return diffRegex.test(line); + }) + .length; +} + +var diff = isDiff(lines); + +function tryHighlight(code) { + + // TODO: need to remove symbols added to get valid code + // this should be done by getting the splits instead of the actual code from the highlighter + // now we can remove first / last one after highlighting completed + function tryAppending(appended, tryNext) { + try { + return highlighter.highlight(code + appended); + } catch (e) { + return tryNext(code); + } + } + + function tryRemoveLeadingComma(tryNext) { + var success; + try { + success = highlighter.highlight(code.replace(/^( +),(.+)$/, '$1 $2')); + return success; + } catch (e) { + return tryNext(code); + } + } + + function tryPlain() { + try { + return highlighter.highlight(code); + } catch (e) { + return tryCloseMustache(); + } + } + + function tryCloseMustache() { return tryAppending('}', tryCloseParen); } + + function tryCloseParen() { return tryAppending('\\)', tryCloseMustacheParen); } + + function tryCloseMustacheParen() { return tryAppending('})', tryRemovingCommas);} + + function tryRemovingCommas() { return tryRemoveLeadingComma(giveUp); } + + function giveUp() { return code; } + + return tryPlain(); +} + +function highlightDiffInd(line, matches) { + var highlighted = colors.brightBlue(matches[1]) + , code = matches[2]; + return code ? highlighted + tryHighlight(code) : highlighted; +} + +function colorsAddRemove(c) { + return addRemRegex.test(c) ? colors.yellow(c) : c; +} + +function highlightDiff(line) { + var diffIndMatches = diffIndRegex.exec(line); + + return diffIndMatches + ? highlightDiffInd(line, diffIndMatches) + : colorsAddRemove(line[0]) + tryHighlight(line.slice(1)); +} + +var highlightFn = diff ? highlightDiff : tryHighlight; +var highlightedLines = lines.map(highlightFn); + +console.log(highlightedLines.join('\n')); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-async.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-async.js new file mode 100644 index 0000000..02b8d96 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-async.js @@ -0,0 +1,48 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , fs = require('fs') + , path = require('path') + , customTheme = require('./fixtures/custom') + , cardinal = require('..') + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var file = path.join(__dirname, 'fixtures/foo.js') + , fileWithErrors = path.join(__dirname, 'fixtures/foo-with-errors.js') + +test('supplying custom theme', function (t) { + cardinal.highlightFile(file, { theme: customTheme }, function (err, highlighted) { + + t.equals(null, err, 'no error') + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[96mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \n \u001b[32mvar\u001b[39m \u001b[96ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[96ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[31mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \n\u001b[33m}\u001b[39m\n') + t.end() + }) +}) + +test('not supplying custom theme', function (t) { + cardinal.highlightFile(file, function (err, highlighted) { + + t.equals(null, err, 'no error') + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \n \u001b[32mvar\u001b[39m \u001b[37ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[37ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[91mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \n\u001b[33m}\u001b[39m\n') + t.end() + }) +}) + +test('errornous code', function (t) { + cardinal.highlightFile(fileWithErrors, function (err, highlighted) { + t.similar(err.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token [(]/) + t.end() + }) +}) + +test('non existing file', function (t) { + cardinal.highlightFile('./not/existing', function (err, highlighted) { + t.similar(err.message, /ENOENT, .*not.existing/) + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-sync.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-sync.js new file mode 100644 index 0000000..7b16e4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-file-sync.js @@ -0,0 +1,48 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , fs = require('fs') + , path = require('path') + , customTheme = require('./fixtures/custom') + , cardinal = require('..') + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var file = path.join(__dirname, 'fixtures/foo.js') + , fileWithErrors = path.join(__dirname, 'fixtures/foo-with-errors.js') + +test('supplying custom theme', function (t) { + var highlighted = cardinal.highlightFileSync(file, { theme: customTheme }); + + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[96mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \n \u001b[32mvar\u001b[39m \u001b[96ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[96ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[31mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \n\u001b[33m}\u001b[39m\n') + t.end() +}) + +test('not supplying custom theme', function (t) { + var highlighted = cardinal.highlightFileSync(file); + + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \n \u001b[32mvar\u001b[39m \u001b[37ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[37ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[91mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \n\u001b[33m}\u001b[39m\n') + t.end() +}) + +test('errornous code', function (t) { + try { + cardinal.highlightFileSync(fileWithErrors); + } catch (e) { + t.similar(e.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token [(]/) + t.end() + } +}) + +test('non existing file', function (t) { + try { + cardinal.highlightFileSync('./not/existing'); + } catch (e) { + t.similar(e.message, /ENOENT, .*not.existing/) + t.end() + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-git-diff.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-git-diff.js new file mode 100644 index 0000000..9f7482d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-git-diff.js @@ -0,0 +1,3 @@ + +// Test Cases +// highlightDiff('@@ -25,22 +31,47 @@ function resolveTheme (config) { }') diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-async.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-async.js new file mode 100644 index 0000000..54fd169 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-async.js @@ -0,0 +1,31 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , path = require('path') + , cardinal = require('..') + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var file = path.join(__dirname, 'fixtures/json.json'); + +test('json option set from extension', function (t) { + cardinal.highlightFile(file, function (err, highlighted) { + + t.equals(null, err, 'no error'); + t.equals(highlighted, '\u001b[33m{\u001b[39m\u001b[32m"foo"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"bar"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"baz"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"quux"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"bam"\u001b[39m\u001b[93m:\u001b[39m\u001b[90mnull\u001b[39m\u001b[33m}\u001b[39m'); + t.end(); + }); +}); + +test('json option respected if false', function (t) { + cardinal.highlightFile(file, { json: false }, function (err, highlighted) { + + t.similar(err.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token /); + t.end(); + + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-sync.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-sync.js new file mode 100644 index 0000000..0f75077 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json-file-sync.js @@ -0,0 +1,29 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , path = require('path') + , cardinal = require('..') + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var file = path.join(__dirname, 'fixtures/json.json'); + +test('json option set from extension', function (t) { + var highlighted = cardinal.highlightFileSync(file); + + t.equals(highlighted, '\u001b[33m{\u001b[39m\u001b[32m"foo"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"bar"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"baz"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"quux"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"bam"\u001b[39m\u001b[93m:\u001b[39m\u001b[90mnull\u001b[39m\u001b[33m}\u001b[39m'); + t.end(); +}); + +test('json option respected if false', function (t) { + try { + var highlighted = cardinal.highlightFileSync(file, { json: false }); + } catch (e) { + t.similar(e.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token /); + t.end(); + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json.js new file mode 100644 index 0000000..bbbe27d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-json.js @@ -0,0 +1,41 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , customTheme = require('./fixtures/custom') + , cardinal = require('..') + + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var json = JSON.stringify({ + foo: 'bar', + baz: 'quux', + bam: null +}); + +test('supplying custom theme', function (t) { + var highlighted = cardinal.highlight(json, { json: true, theme: customTheme }); + + t.equals(highlighted, '\u001b[33m{\u001b[39m\u001b[92m"foo"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"bar"\u001b[39m\u001b[32m,\u001b[39m\u001b[92m"baz"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"quux"\u001b[39m\u001b[32m,\u001b[39m\u001b[92m"bam"\u001b[39m\u001b[93m:\u001b[39m\u001b[90mnull\u001b[39m\u001b[33m}\u001b[39m') + t.end(); +}); + +test('not supplying custom theme', function (t) { + var highlighted = cardinal.highlight(json, { json: true }); + + t.equals(highlighted, '\u001b[33m{\u001b[39m\u001b[32m"foo"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"bar"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"baz"\u001b[39m\u001b[93m:\u001b[39m\u001b[92m"quux"\u001b[39m\u001b[32m,\u001b[39m\u001b[32m"bam"\u001b[39m\u001b[93m:\u001b[39m\u001b[90mnull\u001b[39m\u001b[33m}\u001b[39m') + t.end(); +}); + +test('without json option', function (t) { + try { + cardinal.highlight(json); + } catch (e) { + t.similar(e.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token /) + t.end(); + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-string.js new file mode 100644 index 0000000..beefe0d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-highlight-string.js @@ -0,0 +1,70 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , util = require('util') + , fs = require('fs') + , customTheme = require('./fixtures/custom') + , cardinal = require('..') + +function inspect (obj) { + return console.log(util.inspect(obj, false, 5, false)) +} + +var code = 'function foo() { var a = 3; return a > 2 ? true : false; }' + , codeWithErrors = 'function () { var a = 3; return a > 2 ? true : false; }'; + +test('supplying custom theme', function (t) { + var highlighted = cardinal.highlight(code, { theme: customTheme }); + + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[96mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \u001b[32mvar\u001b[39m \u001b[96ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[96ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[31mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \u001b[33m}\u001b[39m') + t.end() +}) + +test('not supplying custom theme', function (t) { + var highlighted = cardinal.highlight(code); + + t.equals(highlighted, '\u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \u001b[32mvar\u001b[39m \u001b[37ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[37ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[91mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \u001b[33m}\u001b[39m') + t.end() +}) + +test('errornous code', function (t) { + try { + cardinal.highlight(codeWithErrors); + } catch (e) { + t.similar(e.message, /Unable to perform highlight. The code contained syntax errors.* Line 1: Unexpected token [(]/) + t.end() + } +}) + +test('line numbers no firstline given', function (t) { + var highlighted = cardinal.highlight(code, { linenos: true }); + t.equals(highlighted, '\u001b[90m1: \u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \u001b[32mvar\u001b[39m \u001b[37ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[37ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[91mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \u001b[33m}\u001b[39m') + t.end() +}) + +test('line numbers firstline 99', function (t) { + var highlighted = cardinal.highlight(code, { linenos: true, firstline: 99 }); + t.equals(highlighted, '\u001b[90m99: \u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m \u001b[32mvar\u001b[39m \u001b[37ma\u001b[39m \u001b[93m=\u001b[39m \u001b[34m3\u001b[39m\u001b[90m;\u001b[39m \u001b[31mreturn\u001b[39m \u001b[37ma\u001b[39m \u001b[93m>\u001b[39m \u001b[34m2\u001b[39m \u001b[93m?\u001b[39m \u001b[91mtrue\u001b[39m \u001b[93m:\u001b[39m \u001b[91mfalse\u001b[39m\u001b[90m;\u001b[39m \u001b[33m}\u001b[39m') + t.end() +}) + +test('line numbers multi line no first line given', function (t) { + var multilineCode = '' + + function foo () { + return 1; + }; + var highlighted = cardinal.highlight(multilineCode, { linenos: true }); + t.equals(highlighted,'\u001b[90m1: \u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m\n\u001b[90m2: \u001b[31mreturn\u001b[39m \u001b[34m1\u001b[39m\u001b[90m;\u001b[39m\n\u001b[90m3: \u001b[33m}\u001b[39m') + t.end() +}) + +test('line numbers multi line first line 99', function (t) { + var multilineCode = '' + + function foo () { + return 1; + }; + var highlighted = cardinal.highlight(multilineCode, { linenos: true, firstline: 99 }); + t.equals(highlighted,'\u001b[90m 99: \u001b[94mfunction\u001b[39m \u001b[37mfoo\u001b[39m\u001b[90m(\u001b[39m\u001b[90m)\u001b[39m \u001b[33m{\u001b[39m\n\u001b[90m100: \u001b[31mreturn\u001b[39m \u001b[34m1\u001b[39m\u001b[90m;\u001b[39m\n\u001b[90m101: \u001b[33m}\u001b[39m') + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-smoke.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-smoke.js new file mode 100644 index 0000000..f2d0e18 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/cardinal-smoke.js @@ -0,0 +1,44 @@ +'use strict'; +/*jshint asi: true*/ + +// applying esprima to a bunch of files of contained libraries as a smoke test +var test = require('tap').test + , path = require('path') + , fs = require('fs') + , readdirp = require('readdirp') + , cardinal = require('..') + , node_modules = path.join(__dirname, '..', 'node_modules') + , tapdir = path.join(node_modules, 'tap') + , redeyeddir = path.join(node_modules, 'redeyed') + + +test('tap', function (t) { + var invalidTapFiles = [ + 'async-map-ordered.js' + , 'prof.js' + ] + + readdirp({ root: tapdir, fileFilter: '*.js' }) + .on('data', function (entry) { + + if (~invalidTapFiles.indexOf(entry.name)) return + + var code = fs.readFileSync(entry.fullPath, 'utf-8') + , result = cardinal.highlight(code); + + t.assert(~result.indexOf('[32mvar\u001b[39m') || !(~result.indexOf('var ')), 'highlighted ' + entry.path) + }) + .on('end', t.end.bind(t)) +}) + +test('redeyed', function (t) { + readdirp({ root: redeyeddir, fileFilter: 'redeyed.js' }) + .on('data', function (entry) { + + var code = fs.readFileSync(entry.fullPath, 'utf-8') + , result = cardinal.highlight(code); + + t.assert(~result.indexOf('[32mvar\u001b[39m') || !(~result.indexOf('var ')), 'highlighted ' + entry.path) + }) + .on('end', t.end.bind(t)) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/block-comment.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/block-comment.js new file mode 100644 index 0000000..597bc69 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/block-comment.js @@ -0,0 +1,14 @@ + +/** + * This is a meaningless block jsdoc for a meaningless function. + * Joins two strings, separating them to appear on two lines. + * + * @name foo + * @function + * @param uno {String} first string + * @param dos {String} second string + * @return {String} result of the join + */ +module.exports = function foo (uno, dos) { + return uno + '\n' + dos; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/custom.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/custom.js new file mode 100644 index 0000000..fc369fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/custom.js @@ -0,0 +1,144 @@ +var colors = require('ansicolors'); + +// Change the below definitions in order to tweak the color theme. +module.exports = { + + 'Boolean': { + // changed from default + 'true' : colors.red + + , 'false' : undefined + , _default : colors.brightRed + } + + , 'Identifier': { + 'undefined' : colors.brightBlack + , 'self' : colors.brightRed + , 'console' : colors.blue + , 'log' : colors.blue + , 'warn' : colors.red + , 'error' : colors.brightRed + // + // changed from default + , _default : colors.brightCyan + } + + , 'Null': { + _default: colors.brightBlack + } + + , 'Numeric': { + _default: colors.blue + } + + , 'String': { + _default: colors.brightGreen + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : colors.cyan + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : colors.red + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : colors.cyan + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : colors.red + , 'return' : colors.red + , 'switch' : undefined + + , 'this' : colors.brightRed + , 'throw' : undefined + , 'try' : colors.cyan + , 'typeof' : undefined + + , 'var' : colors.green + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : colors.brightBlue + } + , 'Punctuator': { + ';': colors.brightBlack + , '.': colors.green + , ',': colors.green + + , '{': colors.yellow + , '}': colors.yellow + , '(': colors.brightBlack + , ')': colors.brightBlack + , '[': colors.yellow + , ']': colors.yellow + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: colors.brightYellow + } + + // line comment + , Line: { + _default: colors.brightBlack + } + + /* block comment */ + , Block: { + _default: colors.brightBlack + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo-with-errors.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo-with-errors.js new file mode 100644 index 0000000..fefebe2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo-with-errors.js @@ -0,0 +1,3 @@ +function () { + var a = 3; return a > 2 ? true : false; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo.js new file mode 100644 index 0000000..bd9a3e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/foo.js @@ -0,0 +1,3 @@ +function foo() { + var a = 3; return a > 2 ? true : false; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/git-diff.txt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/git-diff.txt new file mode 100644 index 0000000..e324b67 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/git-diff.txt @@ -0,0 +1,78 @@ +diff --git a/test/settings.js b/test/settings.js +index 7b28d66..642688f 100644 +--- a/test/settings.js ++++ b/test/settings.js +@@ -1,14 +1,20 @@ + 'use strict'; + /*jshint asi: true*/ + +-var test = require('tap').test +- , path = require('path') +- , fs = require('fs') +- , settings = require('../settings') +- , existsSync = fs.existsSync || path.existsSync ++var test = require('tap').test ++ , path = require('path') ++ , fs = require('fs') + , hideSemicolonsTheme = require('../themes/hide-semicolons') + , home = path.join(__dirname, 'fixtures', 'home') + , rcpath = path.join(home, '.cardinalrc') ++ , existsSync = fs.existsSync || path.existsSync ++ , settingsResolve = require.resolve('../settings') ++ , settings ++ ++function setup () { ++ delete require.cache[settingsResolve] ++ settings = require(settingsResolve) ++} + + function writerc(config) { + fs.writeFileSync(rcpath, JSON.stringify(config), 'utf-8') +@@ -25,22 +31,47 @@ function resolveTheme (config) { + return result; + } + ++function getSettings (config) { ++ writerc(config) ++ var result = settings.getSettings(home) ++ removerc() ++ return result; ++} ++ + if (!existsSync(home)) fs.mkdirSync(home); + + test('no .cardinalrc in home', function (t) { ++ setup() + var theme = settings.resolveTheme(home) + t.equals(theme, undefined, 'resolves no theme') + t.end() + }) + + test('.cardinalrc with theme "hide-semicolons" in home', function (t) { ++ setup() + var theme = resolveTheme({ theme: "hide-semicolons" }) + t.deepEquals(theme, hideSemicolonsTheme, 'resolves hide-semicolons theme') + t.end() + }) + + test('.cardinalrc with full path to "hide-semicolons.js" in home', function (t) { ++ setup() + var theme = resolveTheme({ theme: path.join(__dirname, '..', 'themes', 'hide-semicolons.js') }) + t.deepEquals(theme, hideSemicolonsTheme, 'resolves hide-semicolons theme') + t.end() + }) ++ ++test('.cardinalrc with linenos: true', function (t) { ++ setup() ++ var opts = { linenos: true } ++ t.deepEquals(getSettings(opts), opts) ++ t.end() ++}) ++ ++test('.cardinalrc with linenos: true and theme', function (t) { ++ setup() ++ var opts = { linenos: true, theme: 'some theme' } ++ t.deepEquals(getSettings(opts), opts) ++ t.end() ++}) ++ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/json.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/json.json new file mode 100644 index 0000000..0c39df4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/json.json @@ -0,0 +1 @@ +{"foo":"bar","baz":"quux","bam":null} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/svn-diff.txt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/svn-diff.txt new file mode 100644 index 0000000..635b056 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/fixtures/svn-diff.txt @@ -0,0 +1,23 @@ +Index: grunt.js +=================================================================== +--- grunt.js (revision 31200) ++++ grunt.js (working copy) +@@ -12,6 +12,7 @@ + + module.exports = function (grunt) { + ++ console.log('hello world'); + // Project configuration. + grunt.initConfig({ + lint: { +@@ -19,10 +20,6 @@ + 'packages/services.web/{!(test)/**/,}*.js', + 'packages/error/**/*.js' + ], +- scripts: [ +- 'grunt.js', +- 'db/**/*.js' +- ], + browser: [ + 'packages/web/server.js', + 'packages/web/server/**/*.js', diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/settings.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/settings.js new file mode 100644 index 0000000..642688f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/settings.js @@ -0,0 +1,77 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , path = require('path') + , fs = require('fs') + , hideSemicolonsTheme = require('../themes/hide-semicolons') + , home = path.join(__dirname, 'fixtures', 'home') + , rcpath = path.join(home, '.cardinalrc') + , existsSync = fs.existsSync || path.existsSync + , settingsResolve = require.resolve('../settings') + , settings + +function setup () { + delete require.cache[settingsResolve] + settings = require(settingsResolve) +} + +function writerc(config) { + fs.writeFileSync(rcpath, JSON.stringify(config), 'utf-8') +} + +function removerc () { + fs.unlinkSync(rcpath) +} + +function resolveTheme (config) { + writerc(config) + var result = settings.resolveTheme(home) + removerc() + return result; +} + +function getSettings (config) { + writerc(config) + var result = settings.getSettings(home) + removerc() + return result; +} + +if (!existsSync(home)) fs.mkdirSync(home); + +test('no .cardinalrc in home', function (t) { + setup() + var theme = settings.resolveTheme(home) + t.equals(theme, undefined, 'resolves no theme') + t.end() +}) + +test('.cardinalrc with theme "hide-semicolons" in home', function (t) { + setup() + var theme = resolveTheme({ theme: "hide-semicolons" }) + t.deepEquals(theme, hideSemicolonsTheme, 'resolves hide-semicolons theme') + t.end() +}) + +test('.cardinalrc with full path to "hide-semicolons.js" in home', function (t) { + setup() + var theme = resolveTheme({ theme: path.join(__dirname, '..', 'themes', 'hide-semicolons.js') }) + t.deepEquals(theme, hideSemicolonsTheme, 'resolves hide-semicolons theme') + t.end() +}) + +test('.cardinalrc with linenos: true', function (t) { + setup() + var opts = { linenos: true } + t.deepEquals(getSettings(opts), opts) + t.end() +}) + +test('.cardinalrc with linenos: true and theme', function (t) { + setup() + var opts = { linenos: true, theme: 'some theme' } + t.deepEquals(getSettings(opts), opts) + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/themes.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/themes.js new file mode 100644 index 0000000..590cdca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/test/themes.js @@ -0,0 +1,22 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test + , path = require('path') + , fs = require('fs') + , themesdir = path.join(__dirname, '..', 'themes') + , allFiles = fs.readdirSync(themesdir) + +test('validate themes by requiring all of them', function (t) { + allFiles + .filter(function (file) { return path.extname(file) === '.js'; }) + .forEach(function (theme) { + try { + t.ok(require(path.join(themesdir, theme)), theme + ' is valid') + } catch (e) { + t.fail('theme: ' + theme + ' is invalid! ' + e.message) + } + }) + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/README.md new file mode 100644 index 0000000..fe2a443 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/README.md @@ -0,0 +1,31 @@ +# cardinal themes + +These are the built in themes that come with cardinal. + +You can create more themes by copying and then editing the [empty +theme](https://github.com/thlorenz/cardinal/blob/master/themes/empty.js) which is provided for that purpose. + +The [hide semicolons theme](https://github.com/thlorenz/cardinal/blob/master/themes/hide-semicolons.js) has the added +benefit of making all semicolons invisible. This makes code more readable at times. + +Find out how to change the theme used by cardinal [here](https://github.com/thlorenz/cardinal#theme). + +# sharing themes + +To add your theme to the cardinal built-in themes, follow the below steps: + +1. fork the cardinal repository +2. add your theme to the themes folder and commit your changes +3. create a pull request + +If you believe that your theme is better than the current default theme, let me know by creating an issue. + +This will allow others to cast their vote. If enough people agree, your theme will be promoted to be the default. + +## Contributed Themes + +### tomorrow night + +[![tomorrow-night](https://github.com/thlorenz/cardinal/raw/master/assets/theme-tomorrow-night.png)](https://github.com/thlorenz/cardinal/blob/master/themes/tomorrow-night.js) + +*by [firede](https://github.com/firede)* diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/default.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/default.js new file mode 100644 index 0000000..86ee59a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/default.js @@ -0,0 +1,147 @@ +var colors = require('ansicolors'); + +// Change the below definitions in order to tweak the color theme. +module.exports = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : colors.brightRed + } + + , 'Identifier': { + 'undefined' : colors.brightBlack + , 'self' : colors.brightRed + , 'console' : colors.blue + , 'log' : colors.blue + , 'warn' : colors.red + , 'error' : colors.brightRed + , _default : colors.white + } + + , 'Null': { + _default: colors.brightBlack + } + + , 'Numeric': { + _default: colors.blue + } + + , 'String': { + _default: function (s, info) { + var nextToken = info.tokens[info.tokenIndex + 1]; + + // show keys of object literals and json in different color + return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':') + ? colors.green(s) + : colors.brightGreen(s); + } + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : colors.cyan + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : colors.red + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : colors.cyan + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : colors.red + , 'return' : colors.red + , 'switch' : undefined + + , 'this' : colors.brightRed + , 'throw' : undefined + , 'try' : colors.cyan + , 'typeof' : undefined + + , 'var' : colors.green + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : colors.brightBlue + } + , 'Punctuator': { + ';': colors.brightBlack + , '.': colors.green + , ',': colors.green + + , '{': colors.yellow + , '}': colors.yellow + , '(': colors.brightBlack + , ')': colors.brightBlack + , '[': colors.yellow + , ']': colors.yellow + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: colors.brightYellow + } + + // line comment + , Line: { + _default: colors.brightBlack + } + + /* block comment */ + , Block: { + _default: colors.brightBlack + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/empty.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/empty.js new file mode 100644 index 0000000..3203aac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/empty.js @@ -0,0 +1,140 @@ +/* + * Copy this file and use it as a starting point for your custom cardinal color theme. + * Just fill in or change the entries for the tokens you want to color + * Keep in mind that more specific configurations override less specific ones. + */ + +var colors = require('ansicolors'); + +// Change the below definitions in order to tweak the color theme. +module.exports = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : undefined + } + + , 'Identifier': { + _default: undefined + } + + , 'Null': { + _default: undefined + } + + , 'Numeric': { + _default: undefined + } + + , 'String': { + _default: undefined + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : undefined + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : undefined + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : undefined + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : undefined + , 'return' : undefined + , 'switch' : undefined + + , 'this' : undefined + , 'throw' : undefined + , 'try' : undefined + , 'typeof' : undefined + + , 'var' : undefined + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : undefined + } + , 'Punctuator': { + ';': undefined + , '.': undefined + , ',': undefined + + , '{': undefined + , '}': undefined + , '(': undefined + , ')': undefined + , '[': undefined + , ']': undefined + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: undefined + } + + // line comment + , Line: { + _default: undefined + } + + /* block comment */ + , Block: { + _default: undefined + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/hide-semicolons.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/hide-semicolons.js new file mode 100644 index 0000000..c1871ee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/hide-semicolons.js @@ -0,0 +1,149 @@ +var colors = require('ansicolors'); + +// Change the below definitions in order to tweak the color theme. +module.exports = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : colors.brightRed + } + + , 'Identifier': { + 'undefined' : colors.brightBlack + , 'self' : colors.brightRed + , 'console' : colors.blue + , 'log' : colors.blue + , 'warn' : colors.red + , 'error' : colors.brightRed + , _default : colors.white + } + + , 'Null': { + _default: colors.brightBlack + } + + , 'Numeric': { + _default: colors.blue + } + + , 'String': { + _default: function (s, info) { + var nextToken = info.tokens[info.tokenIndex + 1]; + + // show keys of object literals and json in different color + return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':') + ? colors.green(s) + : colors.brightGreen(s); + } + } + + , 'Keyword': { + 'break' : undefined + + , 'case' : undefined + , 'catch' : colors.cyan + , 'continue' : undefined + + , 'debugger' : undefined + , 'default' : undefined + , 'delete' : colors.red + , 'do' : undefined + + , 'else' : undefined + + , 'finally' : colors.cyan + , 'for' : undefined + , 'function' : undefined + + , 'if' : undefined + , 'in' : undefined + , 'instanceof' : undefined + + , 'new' : colors.red + , 'return' : colors.red + , 'switch' : undefined + + , 'this' : colors.brightRed + , 'throw' : undefined + , 'try' : colors.cyan + , 'typeof' : undefined + + , 'var' : colors.green + , 'void' : undefined + + , 'while' : undefined + , 'with' : undefined + , _default : colors.brightBlue + } + , 'Punctuator': { + // setting semicolon's color to the same as the terminal background makes it invisible + ';': colors.black + + , '.': colors.green + , ',': colors.green + + , '{': colors.yellow + , '}': colors.yellow + , '(': colors.brightBlack + , ')': colors.brightBlack + , '[': colors.yellow + , ']': colors.yellow + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': undefined + , '^': undefined + , '!': undefined + , '~': undefined + , '?': undefined + , ':': undefined + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: colors.brightYellow + } + + // line comment + , Line: { + _default: colors.brightBlack + } + + /* block comment */ + , Block: { + _default: colors.brightBlack + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/tomorrow-night.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/tomorrow-night.js new file mode 100644 index 0000000..9e0fc58 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/themes/tomorrow-night.js @@ -0,0 +1,161 @@ +var colors = require('ansicolors'); + +// Change the below definitions in order to tweak the color theme. +module.exports = { + + 'Boolean': { + 'true' : undefined + , 'false' : undefined + , _default : colors.yellow + } + + , 'Identifier': { + 'undefined' : colors.yellow + , 'self' : colors.yellow + , 'type' : colors.yellow + , 'value' : colors.yellow + , 'console' : undefined + , 'log' : colors.blue + , 'warn' : colors.blue + , 'error' : colors.blue + , 'join' : colors.blue + , _default : function (s, info) { + var prevToken = info.tokens[info.tokenIndex - 1]; + var nextToken = info.tokens[info.tokenIndex + 1]; + + return (nextToken + && nextToken.type === 'Punctuator' + && nextToken.value === '(' + && prevToken + && prevToken.type === 'Keyword' + && prevToken.value === 'function' + ) ? colors.blue(s) : colors.white(s); + } + } + + , 'Null': { + _default: colors.yellow + } + + , 'Numeric': { + _default: colors.yellow + } + + , 'String': { + _default: function (s, info) { + var nextToken = info.tokens[info.tokenIndex + 1]; + + // show keys of object literals and json in different color + return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':') + ? colors.green(s) + : colors.brightGreen(s); + } + } + + , 'Keyword': { + 'break' : colors.magenta + + , 'case' : colors.magenta + , 'catch' : colors.magenta + , 'continue' : colors.magenta + + , 'debugger' : colors.magenta + , 'default' : colors.magenta + , 'delete' : colors.red + , 'do' : colors.magenta + + , 'else' : colors.magenta + + , 'finally' : colors.magenta + , 'for' : colors.magenta + , 'function' : colors.magenta + + , 'if' : colors.magenta + , 'in' : colors.cyan + , 'instanceof' : colors.cyan + + , 'new' : colors.cyan + , 'return' : colors.magenta + , 'switch' : colors.magenta + + , 'this' : colors.red + , 'throw' : colors.magenta + , 'try' : colors.magenta + , 'typeof' : colors.cyan + + , 'var' : colors.magenta + , 'void' : colors.magenta + + , 'while' : colors.magenta + , 'with' : colors.cyan + , _default : colors.white + } + , 'Punctuator': { + ';': colors.white + , '.': colors.white + , ',': colors.white + + , '{': colors.white + , '}': colors.white + , '(': colors.white + , ')': colors.white + , '[': colors.white + , ']': colors.white + + , '<': undefined + , '>': undefined + , '+': undefined + , '-': undefined + , '*': undefined + , '%': undefined + , '&': undefined + , '|': colors.white + , '^': undefined + , '!': undefined + , '~': undefined + , '?': colors.white + , ':': colors.white + , '=': undefined + + , '<=': undefined + , '>=': undefined + , '==': undefined + , '!=': undefined + , '++': undefined + , '--': undefined + , '<<': undefined + , '>>': undefined + , '&&': undefined + , '||': undefined + , '+=': undefined + , '-=': undefined + , '*=': undefined + , '%=': undefined + , '&=': undefined + , '|=': undefined + , '^=': undefined + , '/=': undefined + + , '===': undefined + , '!==': undefined + , '>>>': undefined + , '<<=': undefined + , '>>=': undefined + + , '>>>=': undefined + + , _default: colors.cyan + } + + // line comment + , Line: { + _default: colors.brightBlack + } + + /* block comment */ + , Block: { + _default: colors.brightBlack + } + + , _default: undefined +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/utl.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/utl.js new file mode 100644 index 0000000..0f36e40 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/cardinal/utl.js @@ -0,0 +1,11 @@ +var util = require('util'); + +module.exports.isPath = function (s) { + return (/[\/\\]/).test(s); +}; + +module.exports.inspect = function(obj, depth) { + console.log(util.inspect(obj, false, depth || 5, true)); +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/chalk.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/chalk.js new file mode 100644 index 0000000..17c6dba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/chalk.js @@ -0,0 +1,62 @@ +'use strict'; +var ansi = require('ansi-styles'); +var defineProps = Object.defineProperties; + +ansi.grey = ansi.gray; + +var styles = (function () { + var ret = {}; + + Object.keys(ansi).forEach(function (key) { + ret[key] = { + get: function () { + this._styles.push(key); + return this; + } + }; + }); + + return ret; +})(); + +var chalk = module.exports = defineProps({}, init()); + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + var obj = defineProps(function self(str) { + if (!chalk.enabled) { + return str; + } + + return self._styles.reduce(function (str, name) { + var code = ansi[name]; + return code[0] + (str || '') + code[1]; + }, str); + }, styles); + + obj._styles = []; + + return obj[name]; + } + } + }); + + return ret; +} + +chalk.styles = ansi; + +chalk.stripColor = function (str) { + return str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, ''); +}; + +chalk.supportsColor = require('has-color'); + +// detect mode if not set manually +if (chalk.enabled === undefined) { + chalk.enabled = chalk.supportsColor; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js new file mode 100644 index 0000000..56a5d19 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js @@ -0,0 +1,29 @@ +'use strict'; +module.exports = { + reset: ['\x1b[0m', '\x1b[0m'], + + bold: ['\x1b[1m', '\x1b[22m'], + italic: ['\x1b[3m', '\x1b[23m'], + underline: ['\x1b[4m', '\x1b[24m'], + inverse: ['\x1b[7m', '\x1b[27m'], + strikethrough: ['\x1b[9m', '\x1b[29m'], + + black: ['\x1b[30m', '\x1b[39m'], + red: ['\x1b[31m', '\x1b[39m'], + green: ['\x1b[32m', '\x1b[39m'], + yellow: ['\x1b[33m', '\x1b[39m'], + blue: ['\x1b[34m', '\x1b[39m'], + magenta: ['\x1b[35m', '\x1b[39m'], + cyan: ['\x1b[36m', '\x1b[39m'], + white: ['\x1b[37m', '\x1b[39m'], + gray: ['\x1B[90m', '\x1b[39m'], + + bgBlack: ['\x1b[40m', '\x1b[49m'], + bgRed: ['\x1b[41m', '\x1b[49m'], + bgGreen: ['\x1b[42m', '\x1b[49m'], + bgYellow: ['\x1b[43m', '\x1b[49m'], + bgBlue: ['\x1b[44m', '\x1b[49m'], + bgMagenta: ['\x1b[45m', '\x1b[49m'], + bgCyan: ['\x1b[46m', '\x1b[49m'], + bgWhite: ['\x1b[47m', '\x1b[49m'] +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..c2f556a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,58 @@ +{ + "name": "ansi-styles", + "version": "0.2.0", + "description": "ANSI escape codes for colorizing strings in the terminal", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "homepage": "https://github.com/sindresorhus/ansi-styles", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-styles/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "ansi-styles.js" + ], + "main": "ansi-styles", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/ansi-styles.git" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles)\n\n> ANSI escape codes for colorizing strings in the terminal.\n\nYou probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings.\n\n![screenshot](screenshot.png)\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles`\n\n\n## Example\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green[0] + 'Hello world!' + ansi.green[1]);\n```\n\n## API\n\nEach style is an array of a start and end escape code.\n\n\n## Styles\n\n### General\n\n- reset\n- bold\n- italic\n- underline\n- inverse\n- strikethrough\n\n### Text colors\n\n- black\n- red\n- green\n- yellow\n- blue\n- magenta\n- cyan\n- white\n- gray\n\n### Background colors\n\n- bgBlack\n- bgRed\n- bgGreen\n- bgYellow\n- bgBlue\n- bgMagenta\n- bgCyan\n- bgWhite\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "ansi-styles@0.2.0", + "_from": "ansi-styles@~0.2.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..646837c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,65 @@ +# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles) + +> ANSI escape codes for colorizing strings in the terminal. + +You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. + +![screenshot](screenshot.png) + + +## Install + +Install with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles` + + +## Example + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green[0] + 'Hello world!' + ansi.green[1]); +``` + +## API + +Each style is an array of a start and end escape code. + + +## Styles + +### General + +- reset +- bold +- italic +- underline +- inverse +- strikethrough + +### Text colors + +- black +- red +- green +- yellow +- blue +- magenta +- cyan +- white +- gray + +### Background colors + +- bgBlack +- bgRed +- bgGreen +- bgYellow +- bgBlue +- bgMagenta +- bgCyan +- bgWhite + + +## License + +MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/has-color.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/has-color.js new file mode 100644 index 0000000..27316b1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/has-color.js @@ -0,0 +1,24 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (!process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + return /^screen|^xterm|color|ansi|cygwin|linux/i.test(process.env.TERM); +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/package.json new file mode 100644 index 0000000..d60b2d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/package.json @@ -0,0 +1,59 @@ +{ + "name": "has-color", + "version": "0.1.4", + "description": "Detect whether a terminal supports color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "has-color.js" + ], + "main": "has-color", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# has-color [![Build Status](https://secure.travis-ci.org/sindresorhus/has-color.png?branch=master)](http://travis-ci.org/sindresorhus/has-color)\n\n> Detect whether a terminal supports color.\n\nUsed in the terminal color module [chalk](https://github.com/sindresorhus/chalk).\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/has-color): `npm install --save has-color`\n\n\n## Example\n\n```js\nvar hasColor = require('has-color');\n\nif (hasColor) {\n\tconsole.log('Terminal supports color.');\n}\n```\n\nIt obeys the CLI flags `--color` and `--no-color`.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "has-color@0.1.4", + "dist": { + "shasum": "d1dadeea5b9e8b446bf08603532333710c95a290" + }, + "_from": "has-color@~0.1.0", + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.4.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/readme.md new file mode 100644 index 0000000..0918c85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/node_modules/has-color/readme.md @@ -0,0 +1,28 @@ +# has-color [![Build Status](https://secure.travis-ci.org/sindresorhus/has-color.png?branch=master)](http://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +Install with [npm](https://npmjs.org/package/has-color): `npm install --save has-color` + + +## Example + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the CLI flags `--color` and `--no-color`. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/package.json new file mode 100644 index 0000000..fa15ac2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk/package.json @@ -0,0 +1,61 @@ +{ + "name": "chalk", + "version": "0.2.1", + "description": "Terminal string styling done right", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "homepage": "https://github.com/sindresorhus/chalk", + "bugs": { + "url": "https://github.com/sindresorhus/chalk/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "chalk.js" + ], + "main": "chalk", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/chalk.git" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "has-color": "~0.1.0", + "ansi-styles": "~0.2.0" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# chalk [![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk)\n\n> Terminal string styling done right.\n\n[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of problems. Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![screenshot](screenshot.png)\n\n\n## Why\n\n- **Doesn't extend String.prototype**\n- Expressive API\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/chalk): `npm install --save chalk`\n\n\n## Example\n\nChalk comes with an easy to use composable API where you just chain the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nconsole.log(chalk.blue('Hello world!'));\n\n// combine styled and normal strings\nconsole.log(chalk.blue('Hello') + 'World' + chalk.red('!'));\n\n// compose multiple styles using the chainable API\nconsole.log(chalk.blue.bgRed.bold('Hello world!'));\n\n// nest styles\nchalk.red('Hello' + chalk.underline.bgBlue('world') + '!');\n```\n\nYou can easily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\n\n## API\n\n### chalk.\\ + + + + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/test/test.js new file mode 100644 index 0000000..2469225 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/test/test.js @@ -0,0 +1,228 @@ +if (!this.uuid) { + // node.js + uuid = require('../uuid'); +} + +// +// x-platform log/assert shims +// + +function _log(msg, type) { + type = type || 'log'; + + if (typeof(document) != 'undefined') { + document.write('
    ' + msg.replace(/\n/g, '
    ') + '
    '); + } + if (typeof(console) != 'undefined') { + var color = { + log: '\033[39m', + warn: '\033[33m', + error: '\033[31m' + }; + console[type](color[type] + msg + color.log); + } +} + +function log(msg) {_log(msg, 'log');} +function warn(msg) {_log(msg, 'warn');} +function error(msg) {_log(msg, 'error');} + +function assert(res, msg) { + if (!res) { + error('FAIL: ' + msg); + } else { + log('Pass: ' + msg); + } +} + +// +// Unit tests +// + +// Verify ordering of v1 ids created with explicit times +var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 + +function compare(name, ids) { + ids = ids.map(function(id) { + return id.split('-').reverse().join('-'); + }).sort(); + var sorted = ([].concat(ids)).sort(); + + assert(sorted.toString() == ids.toString(), name + ' have expected order'); +} + +// Verify ordering of v1 ids created using default behavior +compare('uuids with current time', [ + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1() +]); + +// Verify ordering of v1 ids created with explicit times +compare('uuids with time option', [ + uuid.v1({msecs: TIME - 10*3600*1000}), + uuid.v1({msecs: TIME - 1}), + uuid.v1({msecs: TIME}), + uuid.v1({msecs: TIME + 1}), + uuid.v1({msecs: TIME + 28*24*3600*1000}) +]); + +assert( + uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), + 'IDs created at same msec are different' +); + +// Verify throw if too many ids created +var thrown = false; +try { + uuid.v1({msecs: TIME, nsecs: 10000}); +} catch (e) { + thrown = true; +} +assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); + +// Verify clock regression bumps clockseq +var uidt = uuid.v1({msecs: TIME}); +var uidtb = uuid.v1({msecs: TIME - 1}); +assert( + parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, + 'Clock regression by msec increments the clockseq' +); + +// Verify clock regression bumps clockseq +var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); +var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); +assert( + parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, + 'Clock regression by nsec increments the clockseq' +); + +// Verify explicit options produce expected id +var id = uuid.v1({ + msecs: 1321651533573, + nsecs: 5432, + clockseq: 0x385c, + node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] +}); +assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); + +// Verify adjacent ids across a msec boundary are 1 time unit apart +var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); +var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); + +var before = u0.split('-')[0], after = u1.split('-')[0]; +var dt = parseInt(after, 16) - parseInt(before, 16); +assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); + +// +// Test parse/unparse +// + +id = '00112233445566778899aabbccddeeff'; +assert(uuid.unparse(uuid.parse(id.substr(0,10))) == + '00112233-4400-0000-0000-000000000000', 'Short parse'); +assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == + '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); + +// +// Perf tests +// + +var generators = { + v1: uuid.v1, + v4: uuid.v4 +}; + +var UUID_FORMAT = { + v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, + v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i +}; + +var N = 1e4; + +// Get %'age an actual value differs from the ideal value +function divergence(actual, ideal) { + return Math.round(100*100*(actual - ideal)/ideal)/100; +} + +function rate(msg, t) { + log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); +} + +for (var version in generators) { + var counts = {}, max = 0; + var generator = generators[version]; + var format = UUID_FORMAT[version]; + + log('\nSanity check ' + N + ' ' + version + ' uuids'); + for (var i = 0, ok = 0; i < N; i++) { + id = generator(); + if (!format.test(id)) { + throw Error(id + ' is not a valid UUID string'); + } + + if (id != uuid.unparse(uuid.parse(id))) { + assert(fail, id + ' is not a valid id'); + } + + // Count digits for our randomness check + if (version == 'v4') { + var digits = id.replace(/-/g, '').split(''); + for (var j = digits.length-1; j >= 0; j--) { + var c = digits[j]; + max = Math.max(max, counts[c] = (counts[c] || 0) + 1); + } + } + } + + // Check randomness for v4 UUIDs + if (version == 'v4') { + // Limit that we get worried about randomness. (Purely empirical choice, this!) + var limit = 2*100*Math.sqrt(1/N); + + log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); + + for (var i = 0; i < 16; i++) { + var c = i.toString(16); + var bar = '', n = counts[c], p = Math.round(n/max*100|0); + + // 1-3,5-8, and D-F: 1:16 odds over 30 digits + var ideal = N*30/16; + if (i == 4) { + // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1 + 30/16); + } else if (i >= 8 && i <= 11) { + // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1/4 + 30/16); + } else { + // Otherwise: 1:16 odds on 30 digits + ideal = N*30/16; + } + var d = divergence(n, ideal); + + // Draw bar using UTF squares (just for grins) + var s = n/max*50 | 0; + while (s--) bar += '='; + + assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); + } + } +} + +// Perf tests +for (var version in generators) { + log('\nPerformance testing ' + version + ' UUIDs'); + var generator = generators[version]; + var buf = new uuid.BufferClass(16); + + for (var i = 0, t = Date.now(); i < N; i++) generator(); + rate('uuid.' + version + '()', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); + rate('uuid.' + version + '(\'binary\')', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); + rate('uuid.' + version + '(\'binary\', buffer)', t); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/uuid.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/uuid.js new file mode 100644 index 0000000..2fac6dc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/node-uuid/uuid.js @@ -0,0 +1,245 @@ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +(function() { + var _global = this; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng; + + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if (typeof(require) == 'function') { + try { + var _rb = require('crypto').randomBytes; + _rng = _rb && function() {return _rb(16);}; + } catch(e) {} + } + + if (!_rng && _global.crypto && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + _rng = function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + } + + // Buffer class to use + var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = options.clockseq != null ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs != null ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + + if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + } else if (typeof(module) != 'undefined' && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else { + // Publish as global (in browsers) + var _previousRoot = _global.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _global.uuid = _previousRoot; + return uuid; + }; + + _global.uuid = uuid; + } +}).call(this); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/LICENSE new file mode 100644 index 0000000..a4a9aee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the 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. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/README.md new file mode 100644 index 0000000..34c4a85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/README.md @@ -0,0 +1,4 @@ +oauth-sign +========== + +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/index.js new file mode 100644 index 0000000..e35bfa6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/index.js @@ -0,0 +1,43 @@ +var crypto = require('crypto') + , qs = require('querystring') + ; + +function sha1 (key, body) { + return crypto.createHmac('sha1', key).update(body).digest('base64') +} + +function rfc3986 (str) { + return encodeURIComponent(str) + .replace(/!/g,'%21') + .replace(/\*/g,'%2A') + .replace(/\(/g,'%28') + .replace(/\)/g,'%29') + .replace(/'/g,'%27') + ; +} + +function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { + // adapted from https://dev.twitter.com/docs/auth/oauth and + // https://dev.twitter.com/docs/auth/creating-signature + + var querystring = Object.keys(params).sort().map(function(key){ + // big WTF here with the escape + encoding but it's what twitter wants + return escape(rfc3986(key)) + "%3D" + escape(rfc3986(params[key])) + }).join('%26') + + var base = [ + httpMethod ? httpMethod.toUpperCase() : 'GET', + rfc3986(base_uri), + querystring + ].join('&') + + var key = [ + consumer_secret, + token_secret || '' + ].map(rfc3986).join('&') + + return sha1(key, base) +} + +exports.hmacsign = hmacsign +exports.rfc3986 = rfc3986 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/package.json new file mode 100644 index 0000000..dc99a4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/package.json @@ -0,0 +1,31 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "oauth-sign", + "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", + "version": "0.3.0", + "repository": { + "url": "https://github.com/mikeal/oauth-sign" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "scripts": { + "test": "node test.js" + }, + "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/mikeal/oauth-sign/issues" + }, + "homepage": "https://github.com/mikeal/oauth-sign", + "_id": "oauth-sign@0.3.0", + "_from": "oauth-sign@~0.3.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/test.js new file mode 100644 index 0000000..46955ff --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/oauth-sign/test.js @@ -0,0 +1,49 @@ +var hmacsign = require('./index').hmacsign + , assert = require('assert') + , qs = require('querystring') + ; + +// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth + +var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', + { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' + , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_timestamp: '1272323042' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") + +console.log(reqsign) +console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') +assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') + +var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', + { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' + , oauth_timestamp: '1272323047' + , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") + +console.log(accsign) +console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') +assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') + +var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', + { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" + , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" + , oauth_signature_method: "HMAC-SHA1" + , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" + , oauth_timestamp: "1272325550" + , oauth_version: "1.0" + , status: 'setting up my twitter 私のさえずりを設定する' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") + +console.log(upsign) +console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') +assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.gitmodules b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.gitmodules new file mode 100644 index 0000000..49e31da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.gitmodules @@ -0,0 +1,6 @@ +[submodule "support/expresso"] + path = support/expresso + url = git://github.com/visionmedia/expresso.git +[submodule "support/should"] + path = support/should + url = git://github.com/visionmedia/should.js.git diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.npmignore new file mode 100644 index 0000000..e85ce2a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/.npmignore @@ -0,0 +1,7 @@ +test +.travis.yml +benchmark.js +component.json +examples.js +History.md +Makefile diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/Readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/Readme.md new file mode 100644 index 0000000..27e54a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/Readme.md @@ -0,0 +1,58 @@ +# node-querystring + + query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. + +## Installation + + $ npm install qs + +## Examples + +```js +var qs = require('qs'); + +qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); +// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } + +qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) +// => user[name]=Tobi&user[email]=tobi%40learnboost.com +``` + +## Testing + +Install dev dependencies: + + $ npm install -d + +and execute: + + $ make test + +browser: + + $ open test/browser/index.html + +## License + +(The MIT License) + +Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/index.js new file mode 100644 index 0000000..b05938a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/index.js @@ -0,0 +1,366 @@ +/** + * Object#toString() ref for stringify(). + */ + +var toString = Object.prototype.toString; + +/** + * Object#hasOwnProperty ref + */ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * Array#indexOf shim. + */ + +var indexOf = typeof Array.prototype.indexOf === 'function' + ? function(arr, el) { return arr.indexOf(el); } + : function(arr, el) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === el) return i; + } + return -1; + }; + +/** + * Array.isArray shim. + */ + +var isArray = Array.isArray || function(arr) { + return toString.call(arr) == '[object Array]'; +}; + +/** + * Object.keys shim. + */ + +var objectKeys = Object.keys || function(obj) { + var ret = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + ret.push(key); + } + } + return ret; +}; + +/** + * Array#forEach shim. + */ + +var forEach = typeof Array.prototype.forEach === 'function' + ? function(arr, fn) { return arr.forEach(fn); } + : function(arr, fn) { + for (var i = 0; i < arr.length; i++) fn(arr[i]); + }; + +/** + * Array#reduce shim. + */ + +var reduce = function(arr, fn, initial) { + if (typeof arr.reduce === 'function') return arr.reduce(fn, initial); + var res = initial; + for (var i = 0; i < arr.length; i++) res = fn(res, arr[i]); + return res; +}; + +/** + * Cache non-integer test regexp. + */ + +var isint = /^[0-9]+$/; + +function promote(parent, key) { + if (parent[key].length == 0) return parent[key] = {} + var t = {}; + for (var i in parent[key]) { + if (hasOwnProperty.call(parent[key], i)) { + t[i] = parent[key][i]; + } + } + parent[key] = t; + return t; +} + +function parse(parts, parent, key, val) { + var part = parts.shift(); + + // illegal + if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return; + + // end + if (!part) { + if (isArray(parent[key])) { + parent[key].push(val); + } else if ('object' == typeof parent[key]) { + parent[key] = val; + } else if ('undefined' == typeof parent[key]) { + parent[key] = val; + } else { + parent[key] = [parent[key], val]; + } + // array + } else { + var obj = parent[key] = parent[key] || []; + if (']' == part) { + if (isArray(obj)) { + if ('' != val) obj.push(val); + } else if ('object' == typeof obj) { + obj[objectKeys(obj).length] = val; + } else { + obj = parent[key] = [parent[key], val]; + } + // prop + } else if (~indexOf(part, ']')) { + part = part.substr(0, part.length - 1); + if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); + parse(parts, obj, part, val); + // key + } else { + if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); + parse(parts, obj, part, val); + } + } +} + +/** + * Merge parent key/val pair. + */ + +function merge(parent, key, val){ + if (~indexOf(key, ']')) { + var parts = key.split('[') + , len = parts.length + , last = len - 1; + parse(parts, parent, 'base', val); + // optimize + } else { + if (!isint.test(key) && isArray(parent.base)) { + var t = {}; + for (var k in parent.base) t[k] = parent.base[k]; + parent.base = t; + } + set(parent.base, key, val); + } + + return parent; +} + +/** + * Compact sparse arrays. + */ + +function compact(obj) { + if ('object' != typeof obj) return obj; + + if (isArray(obj)) { + var ret = []; + + for (var i in obj) { + if (hasOwnProperty.call(obj, i)) { + ret.push(obj[i]); + } + } + + return ret; + } + + for (var key in obj) { + obj[key] = compact(obj[key]); + } + + return obj; +} + +/** + * Parse the given obj. + */ + +function parseObject(obj){ + var ret = { base: {} }; + + forEach(objectKeys(obj), function(name){ + merge(ret, name, obj[name]); + }); + + return compact(ret.base); +} + +/** + * Parse the given str. + */ + +function parseString(str){ + var ret = reduce(String(str).split('&'), function(ret, pair){ + var eql = indexOf(pair, '=') + , brace = lastBraceInKey(pair) + , key = pair.substr(0, brace || eql) + , val = pair.substr(brace || eql, pair.length) + , val = val.substr(indexOf(val, '=') + 1, val.length); + + // ?foo + if ('' == key) key = pair, val = ''; + if ('' == key) return ret; + + return merge(ret, decode(key), decode(val)); + }, { base: {} }).base; + + return compact(ret); +} + +/** + * Parse the given query `str` or `obj`, returning an object. + * + * @param {String} str | {Object} obj + * @return {Object} + * @api public + */ + +exports.parse = function(str){ + if (null == str || '' == str) return {}; + return 'object' == typeof str + ? parseObject(str) + : parseString(str); +}; + +/** + * Turn the given `obj` into a query string + * + * @param {Object} obj + * @return {String} + * @api public + */ + +var stringify = exports.stringify = function(obj, prefix) { + if (isArray(obj)) { + return stringifyArray(obj, prefix); + } else if ('[object Object]' == toString.call(obj)) { + return stringifyObject(obj, prefix); + } else if ('string' == typeof obj) { + return stringifyString(obj, prefix); + } else { + return prefix + '=' + encodeURIComponent(String(obj)); + } +}; + +/** + * Stringify the given `str`. + * + * @param {String} str + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyString(str, prefix) { + if (!prefix) throw new TypeError('stringify expects an object'); + return prefix + '=' + encodeURIComponent(str); +} + +/** + * Stringify the given `arr`. + * + * @param {Array} arr + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyArray(arr, prefix) { + var ret = []; + if (!prefix) throw new TypeError('stringify expects an object'); + for (var i = 0; i < arr.length; i++) { + ret.push(stringify(arr[i], prefix + '[' + i + ']')); + } + return ret.join('&'); +} + +/** + * Stringify the given `obj`. + * + * @param {Object} obj + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyObject(obj, prefix) { + var ret = [] + , keys = objectKeys(obj) + , key; + + for (var i = 0, len = keys.length; i < len; ++i) { + key = keys[i]; + if ('' == key) continue; + if (null == obj[key]) { + ret.push(encodeURIComponent(key) + '='); + } else { + ret.push(stringify(obj[key], prefix + ? prefix + '[' + encodeURIComponent(key) + ']' + : encodeURIComponent(key))); + } + } + + return ret.join('&'); +} + +/** + * Set `obj`'s `key` to `val` respecting + * the weird and wonderful syntax of a qs, + * where "foo=bar&foo=baz" becomes an array. + * + * @param {Object} obj + * @param {String} key + * @param {String} val + * @api private + */ + +function set(obj, key, val) { + var v = obj[key]; + if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return; + if (undefined === v) { + obj[key] = val; + } else if (isArray(v)) { + v.push(val); + } else { + obj[key] = [v, val]; + } +} + +/** + * Locate last brace in `str` within the key. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function lastBraceInKey(str) { + var len = str.length + , brace + , c; + for (var i = 0; i < len; ++i) { + c = str[i]; + if (']' == c) brace = false; + if ('[' == c) brace = true; + if ('=' == c && !brace) return i; + } +} + +/** + * Decode `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +function decode(str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (err) { + return str; + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/package.json new file mode 100644 index 0000000..f429d7e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/qs/package.json @@ -0,0 +1,42 @@ +{ + "name": "qs", + "description": "querystring parser", + "version": "0.6.6", + "keywords": [ + "query string", + "parser", + "component" + ], + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/node-querystring.git" + }, + "devDependencies": { + "mocha": "*", + "expect.js": "*" + }, + "scripts": { + "test": "make test" + }, + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "main": "index", + "engines": { + "node": "*" + }, + "readme": "# node-querystring\n\n query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", + "readmeFilename": "Readme.md", + "bugs": { + "url": "https://github.com/visionmedia/node-querystring/issues" + }, + "homepage": "https://github.com/visionmedia/node-querystring", + "_id": "qs@0.6.6", + "dist": { + "shasum": "6e015098ff51968b8a3c819001d5f2c89bc4b107" + }, + "_from": "qs@~0.6.0", + "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/LICENSE new file mode 100644 index 0000000..a4a9aee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the 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. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/README.md new file mode 100644 index 0000000..bb533d5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/README.md @@ -0,0 +1,4 @@ +tunnel-agent +============ + +HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/index.js new file mode 100644 index 0000000..3f7bbb9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/index.js @@ -0,0 +1,227 @@ +'use strict' + +var net = require('net') + , tls = require('tls') + , http = require('http') + , https = require('https') + , events = require('events') + , assert = require('assert') + , util = require('util') + ; + +exports.httpOverHttp = httpOverHttp +exports.httpsOverHttp = httpsOverHttp +exports.httpOverHttps = httpOverHttps +exports.httpsOverHttps = httpsOverHttps + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + return agent +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + agent.createSocket = createSecureSocket + return agent +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + return agent +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + agent.createSocket = createSecureSocket + return agent +} + + +function TunnelingAgent(options) { + var self = this + self.options = options || {} + self.proxyOptions = self.options.proxy || {} + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets + self.requests = [] + self.sockets = [] + + self.on('free', function onFree(socket, host, port) { + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i] + if (pending.host === host && pending.port === port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1) + pending.request.onSocket(socket) + return + } + } + socket.destroy() + self.removeSocket(socket) + }) +} +util.inherits(TunnelingAgent, events.EventEmitter) + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { + var self = this + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push({host: host, port: port, request: req}) + return + } + + // If we are under maxSockets create a new one. + self.createSocket({host: host, port: port, request: req}, function(socket) { + socket.on('free', onFree) + socket.on('close', onCloseOrRemove) + socket.on('agentRemove', onCloseOrRemove) + req.onSocket(socket) + + function onFree() { + self.emit('free', socket, host, port) + } + + function onCloseOrRemove(err) { + self.removeSocket() + socket.removeListener('free', onFree) + socket.removeListener('close', onCloseOrRemove) + socket.removeListener('agentRemove', onCloseOrRemove) + } + }) +} + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this + var placeholder = {} + self.sockets.push(placeholder) + + var connectOptions = mergeOptions({}, self.proxyOptions, + { method: 'CONNECT' + , path: options.host + ':' + options.port + , agent: false + } + ) + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {} + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64') + } + + debug('making CONNECT request') + var connectReq = self.request(connectOptions) + connectReq.useChunkedEncodingByDefault = false // for v0.6 + connectReq.once('response', onResponse) // for v0.6 + connectReq.once('upgrade', onUpgrade) // for v0.6 + connectReq.once('connect', onConnect) // for v0.7 or later + connectReq.once('error', onError) + connectReq.end() + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head) + }) + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners() + socket.removeAllListeners() + + if (res.statusCode === 200) { + assert.equal(head.length, 0) + debug('tunneling connection has established') + self.sockets[self.sockets.indexOf(placeholder)] = socket + cb(socket) + } else { + debug('tunneling socket could not be established, statusCode=%d', res.statusCode) + var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } + } + + function onError(cause) { + connectReq.removeAllListeners() + + debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) + var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } +} + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) return + + this.sockets.splice(pos, 1) + + var pending = this.requests.shift() + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket) + }) + } +} + +function createSecureSocket(options, cb) { + var self = this + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, mergeOptions({}, self.options, + { servername: options.host + , socket: socket + } + )) + cb(secureSocket) + }) +} + + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i] + if (typeof overrides === 'object') { + var keys = Object.keys(overrides) + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j] + if (overrides[k] !== undefined) { + target[k] = overrides[k] + } + } + } + } + return target +} + + +var debug +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments) + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0] + } else { + args.unshift('TUNNEL:') + } + console.error.apply(console, args) + } +} else { + debug = function() {} +} +exports.debug = debug // for test diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/package.json new file mode 100644 index 0000000..3d7492a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/node_modules/tunnel-agent/package.json @@ -0,0 +1,28 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "tunnel-agent", + "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", + "version": "0.3.0", + "repository": { + "url": "https://github.com/mikeal/tunnel-agent" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/mikeal/tunnel-agent/issues" + }, + "homepage": "https://github.com/mikeal/tunnel-agent", + "_id": "tunnel-agent@0.3.0", + "_from": "tunnel-agent@~0.3.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/package.json new file mode 100755 index 0000000..f19e699 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/package.json @@ -0,0 +1,48 @@ +{ + "name": "request", + "description": "Simplified HTTP request client.", + "tags": [ + "http", + "simple", + "util", + "utility" + ], + "version": "2.27.0", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" + }, + "repository": { + "type": "git", + "url": "http://github.com/mikeal/request.git" + }, + "bugs": { + "url": "http://github.com/mikeal/request/issues" + }, + "engines": [ + "node >= 0.8.0" + ], + "main": "index.js", + "dependencies": { + "qs": "~0.6.0", + "json-stringify-safe": "~5.0.0", + "forever-agent": "~0.5.0", + "tunnel-agent": "~0.3.0", + "http-signature": "~0.10.0", + "hawk": "~1.0.0", + "aws-sign": "~0.3.0", + "oauth-sign": "~0.3.0", + "cookie-jar": "~0.3.0", + "node-uuid": "~1.4.0", + "mime": "~1.2.9", + "form-data": "~0.1.0" + }, + "scripts": { + "test": "node tests/run.js" + }, + "readme": "# Request -- Simplified HTTP client\n\n[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/)\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params =\n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as request() but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/mikeal/request", + "_id": "request@2.27.0", + "_from": "request@~2.27.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/request.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/request.js new file mode 100644 index 0000000..0311f74 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/request.js @@ -0,0 +1,1235 @@ +var http = require('http') + , https = false + , tls = false + , url = require('url') + , util = require('util') + , stream = require('stream') + , qs = require('qs') + , querystring = require('querystring') + , crypto = require('crypto') + + , oauth = require('oauth-sign') + , hawk = require('hawk') + , aws = require('aws-sign') + , httpSignature = require('http-signature') + , uuid = require('node-uuid') + , mime = require('mime') + , tunnel = require('tunnel-agent') + , _safeStringify = require('json-stringify-safe') + + , ForeverAgent = require('forever-agent') + , FormData = require('form-data') + + , Cookie = require('cookie-jar') + , CookieJar = Cookie.Jar + , cookieJar = new CookieJar + + , copy = require('./lib/copy') + , debug = require('./lib/debug') + , getSafe = require('./lib/getSafe') + ; + +function safeStringify (obj) { + var ret + try { ret = JSON.stringify(obj) } + catch (e) { ret = _safeStringify(obj) } + return ret +} + +var globalPool = {} +var isUrl = /^https?:/i + +try { + https = require('https') +} catch (e) {} + +try { + tls = require('tls') +} catch (e) {} + + + +// Hacky fix for pre-0.4.4 https +if (https && !https.Agent) { + https.Agent = function (options) { + http.Agent.call(this, options) + } + util.inherits(https.Agent, http.Agent) + https.Agent.prototype._getConnection = function (host, port, cb) { + var s = tls.connect(port, host, this.options, function () { + // do other checks here? + if (cb) cb() + }) + return s + } +} + +function isReadStream (rs) { + if (rs.readable && rs.path && rs.mode) { + return true + } +} + +function toBase64 (str) { + return (new Buffer(str || "", "ascii")).toString("base64") +} + +function md5 (str) { + return crypto.createHash('md5').update(str).digest('hex') +} + +function Request (options) { + stream.Stream.call(this) + this.readable = true + this.writable = true + + if (typeof options === 'string') { + options = {uri:options} + } + + var reserved = Object.keys(Request.prototype) + for (var i in options) { + if (reserved.indexOf(i) === -1) { + this[i] = options[i] + } else { + if (typeof options[i] === 'function') { + delete options[i] + } + } + } + + if (options.method) { + this.explicitMethod = true + } + + this.init(options) +} +util.inherits(Request, stream.Stream) +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) options = {} + + if (!self.method) self.method = options.method || 'GET' + self.localAddress = options.localAddress + + debug(options) + if (!self.pool && self.pool !== false) self.pool = globalPool + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) return // Print a warning maybe? + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + if (self.url && !self.uri) { + // People use this property instead all the time so why not just support it. + self.uri = self.url + delete self.url + } + + if (!self.uri) { + // this will throw if unhandled but is handleable when in a redirect + return self.emit('error', new Error("options.uri is a required argument")) + } else { + if (typeof self.uri == "string") self.uri = url.parse(self.uri) + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (self.proxy) { + if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy) + + // do the HTTP CONNECT dance using koichik/node-tunnel + if (http.globalAgent && self.uri.protocol === "https:") { + var tunnelFn = self.proxy.protocol === "http:" + ? tunnel.httpsOverHttp : tunnel.httpsOverHttps + + var tunnelOptions = { proxy: { host: self.proxy.hostname + , port: +self.proxy.port + , proxyAuth: self.proxy.auth + , headers: { Host: self.uri.hostname + ':' + + (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }} + , rejectUnauthorized: self.rejectUnauthorized + , ca: this.ca } + + self.agent = tunnelFn(tunnelOptions) + self.tunnel = true + } + } + + if (!self.uri.pathname) {self.uri.pathname = '/'} + + if (!self.uri.host) { + // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (he didn't call request directly with this URL) + // he should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + self.emit('error', new Error(message)) + return // This error was fatal + } + + self._redirectsFollowed = self._redirectsFollowed || 0 + self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10 + self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true + self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false + if (self.followRedirect || self.followAllRedirects) + self.redirects = self.redirects || [] + + self.headers = self.headers ? copy(self.headers) : {} + + self.setHost = false + if (!self.hasHeader('host')) { + self.setHeader('host', self.uri.hostname) + if (self.uri.port) { + if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && + !(self.uri.port === 443 && self.uri.protocol === 'https:') ) + self.setHeader('host', self.getHeader('host') + (':'+self.uri.port) ) + } + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol == 'http:') {self.uri.port = 80} + else if (self.uri.protocol == 'https:') {self.uri.port = 443} + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + self.clientErrorHandler = function (error) { + if (self._aborted) return + + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' + && self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) + } + + self._parserErrorHandler = function (error) { + if (this.res) { + if (this.res.request) { + this.res.request.emit('error', error) + } else { + this.res.emit('error', error) + } + } else { + this._httpMessage.emit('error', error) + } + } + + if (options.form) { + self.form(options.form) + } + + if (options.qs) self.qs(options.qs) + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || "") + } + + if (self.path.length === 0) self.path = '/' + + + // Auth must happen last in case signing is dependent on other headers + if (options.oauth) { + self.oauth(options.oauth) + } + + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + self.auth( + (options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ), + options.auth.pass || options.auth.password, + options.auth.sendImmediately) + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) + self.auth(authPieces[0], authPieces.slice(1).join(':'), true) + } + if (self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization') && !self.tunnel) { + self.setHeader('proxy-authorization', "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':'))) + } + + + if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + + if (options.json) { + self.json(options.json) + } else if (options.multipart) { + self.boundary = uuid() + self.multipart(options.multipart) + } + + if (self.body) { + var length = 0 + if (!Buffer.isBuffer(self.body)) { + if (Array.isArray(self.body)) { + for (var i = 0; i < self.body.length; i++) { + length += self.body[i].length + } + } else { + self.body = new Buffer(self.body) + length = self.body.length + } + } else { + length = self.body.length + } + if (length) { + if (!self.hasHeader('content-length')) self.setHeader('content-length', length) + } else { + throw new Error('Argument error, options.body.') + } + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + , defaultModules = {'http:':http, 'https:':https} + , httpModules = self.httpModules || {} + ; + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) return this.emit('error', new Error("Invalid protocol")) + + if (options.ca) self.ca = options.ca + + if (!self.agent) { + if (options.agentOptions) self.agentOptions = options.agentOptions + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getAgent() + if (self.maxSockets) { + // Don't use our pooling if node has the refactored client + self.agent.maxSockets = self.maxSockets + } + if (self.pool.maxSockets) { + // Don't use our pooling if node has the refactored client + self.agent.maxSockets = self.pool.maxSockets + } + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.") + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) self.setHeader('content-type', mime.lookup(src.path)) + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) + self.setHeader('content-type', 'application/json') + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error("You have already piped to this stream. Pipeing twice is likely to break the request.") + // }) + }) + + process.nextTick(function () { + if (self._aborted) return + + if (self._form) { + self.setHeaders(self._form.getHeaders()) + self._form.pipe(self) + } + if (self.body) { + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } else if (self.requestBodyStream) { + console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.") + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + self.ntick = true + }) +} + +// Must call this when following a redirect from https to http or vice versa +// Attempts to keep everything as identical as possible, but update the +// httpModule, Tunneling agent, and/or Forever Agent in use. +Request.prototype._updateProtocol = function () { + var self = this + var protocol = self.uri.protocol + + if (protocol === 'https:') { + // previously was doing http, now doing https + // if it's https, then we might need to tunnel now. + if (self.proxy) { + self.tunnel = true + var tunnelFn = self.proxy.protocol === 'http:' + ? tunnel.httpsOverHttp : tunnel.httpsOverHttps + var tunnelOptions = { proxy: { host: self.proxy.hostname + , port: +self.proxy.port + , proxyAuth: self.proxy.auth } + , rejectUnauthorized: self.rejectUnauthorized + , ca: self.ca } + self.agent = tunnelFn(tunnelOptions) + return + } + + self.httpModule = https + switch (self.agentClass) { + case ForeverAgent: + self.agentClass = ForeverAgent.SSL + break + case http.Agent: + self.agentClass = https.Agent + break + default: + // nothing we can do. Just hope for the best. + return + } + + // if there's an agent, we need to get a new one. + if (self.agent) self.agent = self.getAgent() + + } else { + // previously was doing https, now doing http + // stop any tunneling. + if (self.tunnel) self.tunnel = false + self.httpModule = http + switch (self.agentClass) { + case ForeverAgent.SSL: + self.agentClass = ForeverAgent + break + case https.Agent: + self.agentClass = http.Agent + break + default: + // nothing we can do. just hope for the best + return + } + + // if there's an agent, then get a new one. + if (self.agent) { + self.agent = null + self.agent = self.getAgent() + } + } +} + +Request.prototype.getAgent = function () { + var Agent = this.agentClass + var options = {} + if (this.agentOptions) { + for (var i in this.agentOptions) { + options[i] = this.agentOptions[i] + } + } + if (this.ca) options.ca = this.ca + if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized + + if (this.cert && this.key) { + options.key = this.key + options.cert = this.cert + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== this.httpModule.Agent) { + poolKey += Agent.name + } + + if (!this.httpModule.globalAgent) { + // node 0.4.x + options.host = this.host + options.port = this.port + if (poolKey) poolKey += ':' + poolKey += this.host + ':' + this.port + } + + // ca option is only relevant if proxy or destination are https + var proxy = this.proxy + if (typeof proxy === 'string') proxy = url.parse(proxy) + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + if (isHttps) { + if (options.ca) { + if (poolKey) poolKey += ':' + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) poolKey += ':' + poolKey += options.rejectUnauthorized + } + + if (options.cert) + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + + if (options.ciphers) { + if (poolKey) poolKey += ':' + poolKey += options.ciphers + } + + if (options.secureOptions) { + if (poolKey) poolKey += ':' + poolKey += options.secureOptions + } + } + + if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return this.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = this.uri.protocol + poolKey + + // already generated an agent for this setting + if (this.pool[poolKey]) return this.pool[poolKey] + + return this.pool[poolKey] = new Agent(options) +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self._aborted) return + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self)) + + if (self.timeout && !self.timeoutTimer) { + self.timeoutTimer = setTimeout(function () { + self.req.abort() + var e = new Error("ETIMEDOUT") + e.code = "ETIMEDOUT" + self.emit("error", e) + }, self.timeout) + + // Set additional timeout on socket - in case if remote + // server freeze after sending headers + if (self.req.setTimeout) { // only works on node 0.6+ + self.req.setTimeout(self.timeout, function () { + if (self.req) { + self.req.abort() + var e = new Error("ESOCKETTIMEDOUT") + e.code = "ESOCKETTIMEDOUT" + self.emit("error", e) + } + }) + } + } + + self.req.on('error', self.clientErrorHandler) + self.req.on('drain', function() { + self.emit('drain') + }) + self.on('end', function() { + if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler) + }) + self.emit('request', self.req) +} +Request.prototype.onResponse = function (response) { + var self = this + debug('onResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function() { + debug('response end', self.uri.href, response.statusCode, response.headers) + }); + + if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) { + response.connection.once('error', self._parserErrorHandler) + } + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + if (self._paused) response.pause() + else response.resume() + + self.response = response + response.request = self + response.toJSON = toJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && + !response.client.authorized) { + debug('strict ssl error', self.uri.href) + var sslErr = response.client.authorizationError + self.emit('error', new Error('SSL Error: '+ sslErr)) + return + } + + if (self.setHost && self.hasHeader('host')) delete self.headers[self.hasHeader('host')] + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + + var addCookie = function (cookie) { + if (self._jar){ + if(self._jar.add){ + self._jar.add(new Cookie(cookie)) + } + else cookieJar.add(new Cookie(cookie)) + } + + } + + if (hasHeader('set-cookie', response.headers) && (!self._disableCookies)) { + var headerName = hasHeader('set-cookie', response.headers) + if (Array.isArray(response.headers[headerName])) response.headers[headerName].forEach(addCookie) + else addCookie(response.headers[headerName]) + } + + var redirectTo = null + if (response.statusCode >= 300 && response.statusCode < 400 && hasHeader('location', response.headers)) { + var location = response.headers[hasHeader('location', response.headers)] + debug('redirect', location) + + if (self.followAllRedirects) { + redirectTo = location + } else if (self.followRedirect) { + switch (self.method) { + case 'PATCH': + case 'PUT': + case 'POST': + case 'DELETE': + // Do not follow redirects + break + default: + redirectTo = location + break + } + } + } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { + var authHeader = response.headers[hasHeader('www-authenticate', response.headers)] + var authVerb = authHeader && authHeader.split(' ')[0] + debug('reauth', authVerb) + + switch (authVerb) { + case 'Basic': + self.auth(self._user, self._pass, true) + redirectTo = self.uri + break + + case 'Digest': + // TODO: More complete implementation of RFC 2617. For reference: + // http://tools.ietf.org/html/rfc2617#section-3 + // https://github.com/bagder/curl/blob/master/lib/http_digest.c + + var matches = authHeader.match(/([a-z0-9_-]+)="([^"]+)"/gi) + var challenge = {} + + for (var i = 0; i < matches.length; i++) { + var eqPos = matches[i].indexOf('=') + var key = matches[i].substring(0, eqPos) + var quotedValue = matches[i].substring(eqPos + 1) + challenge[key] = quotedValue.substring(1, quotedValue.length - 1) + } + + var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass) + var ha2 = md5(self.method + ':' + self.uri.path) + var digestResponse = md5(ha1 + ':' + challenge.nonce + ':1::auth:' + ha2) + var authValues = { + username: self._user, + realm: challenge.realm, + nonce: challenge.nonce, + uri: self.uri.path, + qop: challenge.qop, + response: digestResponse, + nc: 1, + cnonce: '' + } + + authHeader = [] + for (var k in authValues) { + authHeader.push(k + '="' + authValues[k] + '"') + } + authHeader = 'Digest ' + authHeader.join(', ') + self.setHeader('authorization', authHeader) + self._sentAuth = true + + redirectTo = self.uri + break + } + } + + if (redirectTo) { + debug('redirect to', redirectTo) + + // ignore any potential response body. it cannot possibly be useful + // to us at this point. + if (self._paused) response.resume() + + if (self._redirectsFollowed >= self.maxRedirects) { + self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href)) + return + } + self._redirectsFollowed += 1 + + if (!isUrl.test(redirectTo)) { + redirectTo = url.resolve(self.uri.href, redirectTo) + } + + var uriPrev = self.uri + self.uri = url.parse(redirectTo) + + // handle the case where we change protocol from https to http or vice versa + if (self.uri.protocol !== uriPrev.protocol) { + self._updateProtocol() + } + + self.redirects.push( + { statusCode : response.statusCode + , redirectUri: redirectTo + } + ) + if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET' + // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215 + delete self.src + delete self.req + delete self.agent + delete self._started + if (response.statusCode != 401) { + // Remove parameters from the previous response, unless this is the second request + // for a server that requires digest authentication. + delete self.body + delete self._form + if (self.headers) { + if (self.hasHeader('host')) delete self.headers[self.hasHeader('host')] + if (self.hasHeader('content-type')) delete self.headers[self.hasHeader('content-type')] + if (self.hasHeader('content-length')) delete self.headers[self.hasHeader('content-length')] + } + } + + self.emit('redirect'); + + self.init() + return // Ignore the rest of the response + } else { + self._redirectsFollowed = self._redirectsFollowed || 0 + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) self.response.emit('end') + }) + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.") + } else { + response.setEncoding(self.encoding) + } + } + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + response.on("data", function (chunk) { + self._destdata = true + self.emit("data", chunk) + }) + response.on("end", function (chunk) { + self._ended = true + self.emit("end", chunk) + }) + response.on("close", function () {self.emit("close")}) + + if (self.callback) { + var buffer = [] + var bodyLen = 0 + self.on("data", function (chunk) { + buffer.push(chunk) + bodyLen += chunk.length + }) + self.on("end", function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + + if (buffer.length && Buffer.isBuffer(buffer[0])) { + debug('has body', self.uri.href, bodyLen) + var body = new Buffer(bodyLen) + var i = 0 + buffer.forEach(function (chunk) { + chunk.copy(body, i, 0, chunk.length) + i += chunk.length + }) + if (self.encoding === null) { + response.body = body + } else { + response.body = body.toString(self.encoding) + } + } else if (buffer.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") { + buffer[0] = buffer[0].substring(1) + } + response.body = buffer.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body) + } catch (e) {} + } + debug('emitting complete', self.uri.href) + if(response.body == undefined && !self._json) { + response.body = ""; + } + self.emit('complete', response, response.body) + }) + } + //if no callback + else{ + self.on("end", function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response); + }); + } + } + debug('finish init function', self.uri.href) +} + +Request.prototype.abort = function () { + this._aborted = true + + if (this.req) { + this.req.abort() + } + else if (this.response) { + this.response.abort() + } + + this.emit("abort") +} + +Request.prototype.pipeDest = function (dest) { + var response = this.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (hasHeader('content-type', response.headers)) { + var ctname = hasHeader('content-type', response.headers) + if (dest.setHeader) dest.setHeader(ctname, response.headers[ctname]) + else dest.headers[ctname] = response.headers[ctname] + } + + if (hasHeader('content-length', response.headers)) { + var clname = hasHeader('content-length', response.headers) + if (dest.setHeader) dest.setHeader(clname, response.headers[clname]) + else dest.headers[clname] = response.headers[clname] + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + dest.setHeader(i, response.headers[i]) + } + dest.statusCode = response.statusCode + } + if (this.pipefilter) this.pipefilter(response, dest) +} + +// Composable API +Request.prototype.setHeader = function (name, value, clobber) { + if (clobber === undefined) clobber = true + if (clobber || !this.hasHeader(name)) this.headers[name] = value + else this.headers[this.hasHeader(name)] += ',' + value + return this +} +Request.prototype.setHeaders = function (headers) { + for (var i in headers) {this.setHeader(i, headers[i])} + return this +} +Request.prototype.hasHeader = function (header, headers) { + var headers = Object.keys(headers || this.headers) + , lheaders = headers.map(function (h) {return h.toLowerCase()}) + ; + header = header.toLowerCase() + for (var i=0;iOh hi.' + + '\r\n--__BOUNDARY__\r\n\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__--' + ) + , method: "PUT" + , multipart: + [ {'content-type': 'text/html', 'body': 'Oh hi.'} + , {'body': 'Oh hi.'} + ] + } + , testPutMultipartPreambleCRLF : + { resp: server.createPostValidator( + '\r\n--__BOUNDARY__\r\n' + + 'content-type: text/html\r\n' + + '\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__\r\n\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__--' + ) + , method: "PUT" + , preambleCRLF: true + , multipart: + [ {'content-type': 'text/html', 'body': 'Oh hi.'} + , {'body': 'Oh hi.'} + ] + } + } + +s.listen(s.port, function () { + + var counter = 0 + + for (i in tests) { + (function () { + var test = tests[i] + s.on('/'+i, test.resp) + test.uri = s.url + '/' + i + request(test, function (err, resp, body) { + if (err) throw err + if (test.expectBody) { + assert.deepEqual(test.expectBody, body) + } + counter = counter - 1; + if (counter === 0) { + console.log(Object.keys(tests).length+" tests passed.") + s.close() + } + }) + counter++ + })() + } +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-defaults.js new file mode 100644 index 0000000..f6c4024 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-defaults.js @@ -0,0 +1,129 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + ; + +var s = server.createServer(); + +s.listen(s.port, function () { + var counter = 0; + s.on('/get', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.method, 'GET') + resp.writeHead(200, {'Content-Type': 'text/plain'}); + resp.end('TESTING!'); + }); + + // test get(string, function) + request.defaults({headers:{foo:"bar"}})(s.url + '/get', function (e, r, b){ + if (e) throw e; + assert.deepEqual("TESTING!", b); + counter += 1; + }); + + s.on('/post', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.headers['content-type'], null); + assert.equal(req.method, 'POST') + resp.writeHead(200, {'Content-Type': 'application/json'}); + resp.end(JSON.stringify({foo:'bar'})); + }); + + // test post(string, object, function) + request.defaults({headers:{foo:"bar"}}).post(s.url + '/post', {json: true}, function (e, r, b){ + if (e) throw e; + assert.deepEqual('bar', b.foo); + counter += 1; + }); + + s.on('/patch', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.headers['content-type'], null); + assert.equal(req.method, 'PATCH') + resp.writeHead(200, {'Content-Type': 'application/json'}); + resp.end(JSON.stringify({foo:'bar'})); + }); + + // test post(string, object, function) + request.defaults({headers:{foo:"bar"}}).patch(s.url + '/patch', {json: true}, function (e, r, b){ + if (e) throw e; + assert.deepEqual('bar', b.foo); + counter += 1; + }); + + s.on('/post-body', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.headers['content-type'], 'application/json'); + assert.equal(req.method, 'POST') + resp.writeHead(200, {'Content-Type': 'application/json'}); + resp.end(JSON.stringify({foo:'bar'})); + }); + + // test post(string, object, function) with body + request.defaults({headers:{foo:"bar"}}).post(s.url + '/post-body', {json: true, body:{bar:"baz"}}, function (e, r, b){ + if (e) throw e; + assert.deepEqual('bar', b.foo); + counter += 1; + }); + + s.on('/del', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.method, 'DELETE') + resp.writeHead(200, {'Content-Type': 'application/json'}); + resp.end(JSON.stringify({foo:'bar'})); + }); + + // test .del(string, function) + request.defaults({headers:{foo:"bar"}, json:true}).del(s.url + '/del', function (e, r, b){ + if (e) throw e; + assert.deepEqual('bar', b.foo); + counter += 1; + }); + + s.on('/head', function (req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.method, 'HEAD') + resp.writeHead(200, {'Content-Type': 'text/plain'}); + resp.end(); + }); + + // test head.(object, function) + request.defaults({headers:{foo:"bar"}}).head({uri: s.url + '/head'}, function (e, r, b){ + if (e) throw e; + counter += 1; + }); + + s.on('/get_custom', function(req, resp) { + assert.equal(req.headers.foo, 'bar'); + assert.equal(req.headers.x, 'y'); + resp.writeHead(200, {'Content-Type': 'text/plain'}); + resp.end(); + }); + + // test custom request handler function + var defaultRequest = request.defaults({ + headers:{foo:"bar"} + , body: 'TESTING!' + }, function(uri, options, callback) { + var params = request.initParams(uri, options, callback); + options = params.options; + options.headers.x = 'y'; + + return request(params.uri, params.options, params.callback); + }); + + var msg = 'defaults test failed. head request should throw earlier'; + assert.throws(function() { + defaultRequest.head(s.url + '/get_custom', function(e, r, b) { + throw new Error(msg); + }); + counter+=1; + }, msg); + + defaultRequest.get(s.url + '/get_custom', function(e, r, b) { + if(e) throw e; + counter += 1; + console.log(counter.toString() + " tests passed."); + s.close(); + }); +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-digest-auth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-digest-auth.js new file mode 100644 index 0000000..5f2d6eb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-digest-auth.js @@ -0,0 +1,69 @@ +var assert = require('assert') + , http = require('http') + , request = require('../index') + ; + +// Test digest auth +// Using header values captured from interaction with Apache + +var numDigestRequests = 0; + +var digestServer = http.createServer(function (req, res) { + console.error('Digest auth server: ', req.method, req.url); + numDigestRequests++; + + var ok; + + if (req.headers.authorization) { + if (req.headers.authorization == 'Digest username="test", realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", uri="/test/", qop="auth", response="54753ce37c10cb20b09b769f0bed730e", nc="1", cnonce=""') { + ok = true; + } else { + // Bad auth header, don't send back WWW-Authenticate header + ok = false; + } + } else { + // No auth header, send back WWW-Authenticate header + ok = false; + res.setHeader('www-authenticate', 'Digest realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", algorithm=MD5, qop="auth"'); + } + + if (ok) { + console.log('request ok'); + res.end('ok'); + } else { + console.log('status=401'); + res.statusCode = 401; + res.end('401'); + } +}); + +digestServer.listen(6767); + +request({ + 'method': 'GET', + 'uri': 'http://localhost:6767/test/', + 'auth': { + 'user': 'test', + 'pass': 'testing', + 'sendImmediately': false + } +}, function(error, response, body) { + assert.equal(response.statusCode, 200); + assert.equal(numDigestRequests, 2); + + // If we don't set sendImmediately = false, request will send basic auth + request({ + 'method': 'GET', + 'uri': 'http://localhost:6767/test/', + 'auth': { + 'user': 'test', + 'pass': 'testing' + } + }, function(error, response, body) { + assert.equal(response.statusCode, 401); + assert.equal(numDigestRequests, 3); + + console.log('All tests passed'); + digestServer.close(); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-emptyBody.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-emptyBody.js new file mode 100644 index 0000000..338c92e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-emptyBody.js @@ -0,0 +1,20 @@ +var request = require('../index') + , http = require('http') + , assert = require('assert') + ; + +var s = http.createServer(function (req, resp) { + resp.statusCode = 200 + resp.end('') +}).listen(8080, function () { + var r = request('http://localhost:8080', function (e, resp, body) { + assert.equal(resp.statusCode, 200) + assert.equal(body, "") + + var r2 = request({ url: 'http://localhost:8080', json: {} }, function (e, resp, body) { + assert.equal(resp.statusCode, 200) + assert.equal(body, undefined) + s.close() + }); + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-errors.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-errors.js new file mode 100644 index 0000000..4df1302 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-errors.js @@ -0,0 +1,37 @@ +var server = require('./server') + , events = require('events') + , assert = require('assert') + , request = require('../index') + ; + +var local = 'http://localhost:8888/asdf' + +try { + request({uri:local, body:{}}) + assert.fail("Should have throw") +} catch(e) { + assert.equal(e.message, 'Argument error, options.body.') +} + +try { + request({uri:local, multipart: 'foo'}) + assert.fail("Should have throw") +} catch(e) { + assert.equal(e.message, 'Argument error, options.multipart.') +} + +try { + request({uri:local, multipart: [{}]}) + assert.fail("Should have throw") +} catch(e) { + assert.equal(e.message, 'Body attribute missing in multipart.') +} + +try { + request(local, {multipart: [{}]}) + assert.fail("Should have throw") +} catch(e) { + assert.equal(e.message, 'Body attribute missing in multipart.') +} + +console.log("All tests passed.") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all-303.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all-303.js new file mode 100644 index 0000000..956e386 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all-303.js @@ -0,0 +1,30 @@ +var request = require('../index'); +var http = require('http'); +var requests = 0; +var assert = require('assert'); + +var server = http.createServer(function (req, res) { + console.error(req.method, req.url); + requests ++; + + if (req.method === 'POST') { + console.error('send 303'); + res.setHeader('location', req.url); + res.statusCode = 303; + res.end('try again, i guess\n'); + } else { + console.error('send 200') + res.end('ok: ' + requests); + } +}); +server.listen(6767); + +request.post({ url: 'http://localhost:6767/foo', + followAllRedirects: true, + form: { foo: 'bar' } }, function (er, req, body) { + if (er) throw er; + assert.equal(body, 'ok: 2'); + assert.equal(requests, 2); + console.error('ok - ' + process.version); + server.close(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all.js new file mode 100644 index 0000000..f2e51ff --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-follow-all.js @@ -0,0 +1,36 @@ +var request = require('../index'); +var http = require('http'); +var requests = 0; +var assert = require('assert'); + +var server = http.createServer(function (req, res) { + requests ++; + + // redirect everything 3 times, no matter what. + var c = req.headers.cookie; + + if (!c) c = 0; + else c = +c.split('=')[1] || 0; + + if (c > 3) { + res.end('ok: '+requests); + return; + } + + res.setHeader('set-cookie', 'c=' + (c + 1)); + res.setHeader('location', req.url); + res.statusCode = 302; + res.end('try again, i guess\n'); +}); +server.listen(6767); + +request.post({ url: 'http://localhost:6767/foo', + followAllRedirects: true, + jar: true, + form: { foo: 'bar' } }, function (er, req, body) { + if (er) throw er; + assert.equal(body, 'ok: 5'); + assert.equal(requests, 5); + console.error('ok - ' + process.version); + server.close(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-form.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-form.js new file mode 100644 index 0000000..91b9230 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-form.js @@ -0,0 +1,79 @@ +var assert = require('assert') +var http = require('http'); +var path = require('path'); +var mime = require('mime'); +var request = require('../index'); +var fs = require('fs'); + +var remoteFile = 'http://nodejs.org/images/logo.png'; + +var FIELDS = [ + {name: 'my_field', value: 'my_value'}, + {name: 'my_buffer', value: new Buffer([1, 2, 3])}, + {name: 'my_file', value: fs.createReadStream(__dirname + '/unicycle.jpg')}, + {name: 'remote_file', value: request(remoteFile) } +]; + +var server = http.createServer(function(req, res) { + + // temp workaround + var data = ''; + req.setEncoding('utf8'); + + req.on('data', function(d) { + data += d; + }); + + req.on('end', function() { + // check for the fields' traces + + // 1st field : my_field + var field = FIELDS.shift(); + assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); + assert.ok( data.indexOf(field.value) != -1 ); + + // 2nd field : my_buffer + var field = FIELDS.shift(); + assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); + assert.ok( data.indexOf(field.value) != -1 ); + + // 3rd field : my_file + var field = FIELDS.shift(); + assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); + assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 ); + // check for unicycle.jpg traces + assert.ok( data.indexOf('2005:06:21 01:44:12') != -1 ); + assert.ok( data.indexOf('Content-Type: '+mime.lookup(field.value.path) ) != -1 ); + + // 4th field : remote_file + var field = FIELDS.shift(); + assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); + assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 ); + // check for http://nodejs.org/images/logo.png traces + assert.ok( data.indexOf('ImageReady') != -1 ); + assert.ok( data.indexOf('Content-Type: '+mime.lookup(remoteFile) ) != -1 ); + + res.writeHead(200); + res.end('done'); + + }); + + +}); + +server.listen(8080, function() { + + var req = request.post('http://localhost:8080/upload', function () { + server.close(); + }) + var form = req.form() + + FIELDS.forEach(function(field) { + form.append(field.name, field.value); + }); + +}); + +process.on('exit', function() { + assert.strictEqual(FIELDS.length, 0); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-hawk.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-hawk.js new file mode 100755 index 0000000..8454625 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-hawk.js @@ -0,0 +1,33 @@ +var createServer = require('http').createServer + , request = require('../index') + , hawk = require('hawk') + , assert = require('assert') + ; + +var server = createServer(function (req, resp) { + + var getCred = function (id, callback) { + assert.equal(id, 'dh37fgj492je') + var credentials = + { key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn' + , algorithm: 'sha256' + , user: 'Steve' + } + return callback(null, credentials) + } + + hawk.server.authenticate(req, getCred, {}, function (err, credentials, attributes) { + resp.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' }) + resp.end(!err ? 'Hello ' + credentials.user : 'Shoosh!') + }) + +}) + +server.listen(8080, function () { + var creds = {key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', algorithm: 'sha256', id:'dh37fgj492je'} + request('http://localhost:8080', {hawk:{credentials:creds}}, function (e, r, b) { + assert.equal(200, r.statusCode) + assert.equal(b, 'Hello Steve') + server.close() + }) +}) \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-headers.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-headers.js new file mode 100644 index 0000000..3982b9b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-headers.js @@ -0,0 +1,52 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + , Cookie = require('cookie-jar') + , Jar = Cookie.Jar + , s = server.createServer() + +s.listen(s.port, function () { + var serverUri = 'http://localhost:' + s.port + , numTests = 0 + , numOutstandingTests = 0 + + function createTest(requestObj, serverAssertFn) { + var testNumber = numTests; + numTests += 1; + numOutstandingTests += 1; + s.on('/' + testNumber, function (req, res) { + serverAssertFn(req, res); + res.writeHead(200); + res.end(); + }); + requestObj.url = serverUri + '/' + testNumber + request(requestObj, function (err, res, body) { + assert.ok(!err) + assert.equal(res.statusCode, 200) + numOutstandingTests -= 1 + if (numOutstandingTests === 0) { + console.log(numTests + ' tests passed.') + s.close() + } + }) + } + + // Issue #125: headers.cookie shouldn't be replaced when a cookie jar isn't specified + createTest({headers: {cookie: 'foo=bar'}}, function (req, res) { + assert.ok(req.headers.cookie) + assert.equal(req.headers.cookie, 'foo=bar') + }) + + // Issue #125: headers.cookie + cookie jar + var jar = new Jar() + jar.add(new Cookie('quux=baz')); + createTest({jar: jar, headers: {cookie: 'foo=bar'}}, function (req, res) { + assert.ok(req.headers.cookie) + assert.equal(req.headers.cookie, 'foo=bar; quux=baz') + }) + + // There should be no cookie header when neither headers.cookie nor a cookie jar is specified + createTest({}, function (req, res) { + assert.ok(!req.headers.cookie) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-http-signature.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-http-signature.js new file mode 100755 index 0000000..9300473 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-http-signature.js @@ -0,0 +1,106 @@ +var createServer = require('http').createServer + , request = require('../index') + , httpSignature = require('http-signature') + , assert = require('assert') + ; + +var privateKeyPEMs = {} + +privateKeyPEMs['key-1'] = + '-----BEGIN RSA PRIVATE KEY-----\n' + + 'MIIEpAIBAAKCAQEAzWSJl+Z9Bqv00FVL5N3+JCUoqmQPjIlya1BbeqQroNQ5yG1i\n' + + 'VbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9diDMnrzijAnYlTLOl84CK2vOxkj5b6\n' + + '8zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcuVi2lT9VjygFs1ILG4RyeX1BXUumu\n' + + 'Y8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u114wS7OQPigu6G99dpn/iPHa3zBm8\n' + + '7baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADPTdnO/SO+kvXy7fqd8atSn+HlQcx6\n' + + 'tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft2QIDAQABAoIBAG1exe3/LEBrPLfb\n' + + 'U8iRdY0lxFvHYIhDgIwohC3wUdMYb5SMurpNdEZn+7Sh/fkUVgp/GKJViu1mvh52\n' + + 'bKd2r52DwG9NQBQjVgkqY/auRYSglIPpr8PpYNSZlcneunCDGeqEY9hMmXc5Ssqs\n' + + 'PQYoEKKPN+IlDTg6PguDgAfLR4IUvt9KXVvmB/SSgV9tSeTy35LECt1Lq3ozbUgu\n' + + '30HZI3U6/7H+X22Pxxf8vzBtzkg5rRCLgv+OeNPo16xMnqbutt4TeqEkxRv5rtOo\n' + + '/A1i9khBeki0OJAFJsE82qnaSZodaRsxic59VnN8sWBwEKAt87tEu5A3K3j4XSDU\n' + + '/avZxAECgYEA+pS3DvpiQLtHlaO3nAH6MxHRrREOARXWRDe5nUQuUNpS1xq9wte6\n' + + 'DkFtba0UCvDLic08xvReTCbo9kH0y6zEy3zMpZuJlKbcWCkZf4S5miYPI0RTZtF8\n' + + 'yps6hWqzYFSiO9hMYws9k4OJLxX0x3sLK7iNZ32ujcSrkPBSiBr0gxkCgYEA0dWl\n' + + '637K41AJ/zy0FP0syq+r4eIkfqv+/t6y2aQVUBvxJYrj9ci6XHBqoxpDV8lufVYj\n' + + 'fUAfeI9/MZaWvQJRbnYLre0I6PJfLuCBIL5eflO77BGso165AF7QJZ+fwtgKv3zv\n' + + 'ZX75eudCSS/cFo0po9hlbcLMT4B82zEkgT8E2MECgYEAnz+3/wrdOmpLGiyL2dff\n' + + '3GjsqmJ2VfY8z+niSrI0BSpbD11tT9Ct67VlCBjA7hsOH6uRfpd6/kaUMzzDiFVq\n' + + 'VDAiFvV8QD6zNkwYalQ9aFvbrvwTTPrBpjl0vamMCiJ/YC0cjq1sGr2zh3sar1Ph\n' + + 'S43kP+s97dcZeelhaiJHVrECgYEAsx61q/loJ/LDFeYzs1cLTVn4V7I7hQY9fkOM\n' + + 'WM0AhInVqD6PqdfXfeFYpjJdGisQ7l0BnoGGW9vir+nkcyPvb2PFRIr6+B8tsU5j\n' + + '7BeVgjDoUfQkcrEBK5fEBtnj/ud9BUkY8oMZZBjVNLRuI7IMwZiPvMp0rcj4zAN/\n' + + 'LfUlpgECgYArBvFcBxSkNAzR3Rtteud1YDboSKluRM37Ey5plrn4BS0DD0jm++aD\n' + + '0pG2Hsik000hibw92lCkzvvBVAqF8BuAcnPlAeYfsOaa97PGEjSKEN5bJVWZ9/om\n' + + '9FV1axotRN2XWlwrhixZLEaagkREXhgQc540FS5O8IaI2Vpa80Atzg==\n' + + '-----END RSA PRIVATE KEY-----' + +var publicKeyPEMs = {} + +publicKeyPEMs['key-1'] = + '-----BEGIN PUBLIC KEY-----\n' + + 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzWSJl+Z9Bqv00FVL5N3+\n' + + 'JCUoqmQPjIlya1BbeqQroNQ5yG1iVbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9di\n' + + 'DMnrzijAnYlTLOl84CK2vOxkj5b68zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcu\n' + + 'Vi2lT9VjygFs1ILG4RyeX1BXUumuY8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u1\n' + + '14wS7OQPigu6G99dpn/iPHa3zBm87baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADP\n' + + 'TdnO/SO+kvXy7fqd8atSn+HlQcx6tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft\n' + + '2QIDAQAB\n' + + '-----END PUBLIC KEY-----' + +publicKeyPEMs['key-2'] = + '-----BEGIN PUBLIC KEY-----\n' + + 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqp04VVr9OThli9b35Omz\n' + + 'VqSfWbsoQuRrgyWsrNRn3XkFmbWw4FzZwQ42OgGMzQ84Ta4d9zGKKQyFriTiPjPf\n' + + 'xhhrsaJnDuybcpVhcr7UNKjSZ0S59tU3hpRiEz6hO+Nc/OSSLkvalG0VKrxOln7J\n' + + 'LK/h3rNS/l6wDZ5S/KqsI6CYtV2ZLpn3ahLrizvEYNY038Qcm38qMWx+VJAvZ4di\n' + + 'qqmW7RLIsLT59SWmpXdhFKnkYYGhxrk1Mwl22dBTJNY5SbriU5G3gWgzYkm8pgHr\n' + + '6CtrXch9ciJAcDJehPrKXNvNDOdUh8EW3fekNJerF1lWcwQg44/12v8sDPyfbaKB\n' + + 'dQIDAQAB\n' + + '-----END PUBLIC KEY-----' + +var server = createServer(function (req, res) { + var parsed = httpSignature.parseRequest(req) + var publicKeyPEM = publicKeyPEMs[parsed.keyId] + var verified = httpSignature.verifySignature(parsed, publicKeyPEM) + res.writeHead(verified ? 200 : 400) + res.end() +}) + +server.listen(8080, function () { + function correctKeyTest(callback) { + var options = { + httpSignature: { + keyId: 'key-1', + key: privateKeyPEMs['key-1'] + } + } + request('http://localhost:8080', options, function (e, r, b) { + assert.equal(200, r.statusCode) + callback() + }) + } + + function incorrectKeyTest(callback) { + var options = { + httpSignature: { + keyId: 'key-2', + key: privateKeyPEMs['key-1'] + } + } + request('http://localhost:8080', options, function (e, r, b) { + assert.equal(400, r.statusCode) + callback() + }) + } + + var tests = [correctKeyTest, incorrectKeyTest] + var todo = tests.length; + for(var i = 0; i < tests.length; ++i) { + tests[i](function() { + if(!--todo) { + server.close() + } + }) + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-httpModule.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-httpModule.js new file mode 100644 index 0000000..2c19615 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-httpModule.js @@ -0,0 +1,94 @@ +var http = require('http') + , https = require('https') + , server = require('./server') + , assert = require('assert') + , request = require('../index') + + +var faux_requests_made = {'http':0, 'https':0} +function wrap_request(name, module) { + // Just like the http or https module, but note when a request is made. + var wrapped = {} + Object.keys(module).forEach(function(key) { + var value = module[key]; + + if(key != 'request') + wrapped[key] = value; + else + wrapped[key] = function(options, callback) { + faux_requests_made[name] += 1 + return value.apply(this, arguments) + } + }) + + return wrapped; +} + + +var faux_http = wrap_request('http', http) + , faux_https = wrap_request('https', https) + , plain_server = server.createServer() + , https_server = server.createSSLServer() + + +plain_server.listen(plain_server.port, function() { + plain_server.on('/plain', function (req, res) { + res.writeHead(200) + res.end('plain') + }) + plain_server.on('/to_https', function (req, res) { + res.writeHead(301, {'location':'https://localhost:'+https_server.port + '/https'}) + res.end() + }) + + https_server.listen(https_server.port, function() { + https_server.on('/https', function (req, res) { + res.writeHead(200) + res.end('https') + }) + https_server.on('/to_plain', function (req, res) { + res.writeHead(302, {'location':'http://localhost:'+plain_server.port + '/plain'}) + res.end() + }) + + run_tests() + run_tests({}) + run_tests({'http:':faux_http}) + run_tests({'https:':faux_https}) + run_tests({'http:':faux_http, 'https:':faux_https}) + }) +}) + +function run_tests(httpModules) { + var to_https = 'http://localhost:'+plain_server.port+'/to_https' + var to_plain = 'https://localhost:'+https_server.port+'/to_plain' + + request(to_https, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) { + if (er) throw er + assert.equal(body, 'https', 'Received HTTPS server body') + done() + }) + + request(to_plain, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) { + if (er) throw er + assert.equal(body, 'plain', 'Received HTTPS server body') + done() + }) +} + + +var passed = 0; +function done() { + passed += 1 + var expected = 10 + + if(passed == expected) { + plain_server.close() + https_server.close() + + assert.equal(faux_requests_made.http, 4, 'Wrapped http module called appropriately') + assert.equal(faux_requests_made.https, 4, 'Wrapped https module called appropriately') + + console.log((expected+2) + ' tests passed.') + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https-strict.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https-strict.js new file mode 100644 index 0000000..d49a9af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https-strict.js @@ -0,0 +1,97 @@ +// a test where we validate the siguature of the keys +// otherwise exactly the same as the ssl test + +var server = require('./server') + , assert = require('assert') + , request = require('../index') + , fs = require('fs') + , path = require('path') + , opts = { key: path.resolve(__dirname, 'ssl/ca/server.key') + , cert: path.resolve(__dirname, 'ssl/ca/server.crt') } + , s = server.createSSLServer(null, opts) + , caFile = path.resolve(__dirname, 'ssl/ca/ca.crt') + , ca = fs.readFileSync(caFile) + +var tests = + { testGet : + { resp : server.createGetResponse("TESTING!") + , expectBody: "TESTING!" + } + , testGetChunkBreak : + { resp : server.createChunkResponse( + [ new Buffer([239]) + , new Buffer([163]) + , new Buffer([191]) + , new Buffer([206]) + , new Buffer([169]) + , new Buffer([226]) + , new Buffer([152]) + , new Buffer([131]) + ]) + , expectBody: "Ω☃" + } + , testGetJSON : + { resp : server.createGetResponse('{"test":true}', 'application/json') + , json : true + , expectBody: {"test":true} + } + , testPutString : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : "PUTTINGDATA" + } + , testPutBuffer : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : new Buffer("PUTTINGDATA") + } + , testPutJSON : + { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) + , method: "PUT" + , json: {foo: 'bar'} + } + , testPutMultipart : + { resp: server.createPostValidator( + '--__BOUNDARY__\r\n' + + 'content-type: text/html\r\n' + + '\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__\r\n\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__--' + ) + , method: "PUT" + , multipart: + [ {'content-type': 'text/html', 'body': 'Oh hi.'} + , {'body': 'Oh hi.'} + ] + } + } + +s.listen(s.port, function () { + + var counter = 0 + + for (i in tests) { + (function () { + var test = tests[i] + s.on('/'+i, test.resp) + test.uri = s.url + '/' + i + test.strictSSL = true + test.ca = ca + test.headers = { host: 'testing.request.mikealrogers.com' } + request(test, function (err, resp, body) { + if (err) throw err + if (test.expectBody) { + assert.deepEqual(test.expectBody, body) + } + counter = counter - 1; + if (counter === 0) { + console.log(Object.keys(tests).length+" tests passed.") + s.close() + } + }) + counter++ + })() + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https.js new file mode 100644 index 0000000..b6858d4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-https.js @@ -0,0 +1,87 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + +var s = server.createSSLServer(); + +var tests = + { testGet : + { resp : server.createGetResponse("TESTING!") + , expectBody: "TESTING!" + } + , testGetChunkBreak : + { resp : server.createChunkResponse( + [ new Buffer([239]) + , new Buffer([163]) + , new Buffer([191]) + , new Buffer([206]) + , new Buffer([169]) + , new Buffer([226]) + , new Buffer([152]) + , new Buffer([131]) + ]) + , expectBody: "Ω☃" + } + , testGetJSON : + { resp : server.createGetResponse('{"test":true}', 'application/json') + , json : true + , expectBody: {"test":true} + } + , testPutString : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : "PUTTINGDATA" + } + , testPutBuffer : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : new Buffer("PUTTINGDATA") + } + , testPutJSON : + { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) + , method: "PUT" + , json: {foo: 'bar'} + } + , testPutMultipart : + { resp: server.createPostValidator( + '--__BOUNDARY__\r\n' + + 'content-type: text/html\r\n' + + '\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__\r\n\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__--' + ) + , method: "PUT" + , multipart: + [ {'content-type': 'text/html', 'body': 'Oh hi.'} + , {'body': 'Oh hi.'} + ] + } + } + +s.listen(s.port, function () { + + var counter = 0 + + for (i in tests) { + (function () { + var test = tests[i] + s.on('/'+i, test.resp) + test.uri = s.url + '/' + i + test.rejectUnauthorized = false + request(test, function (err, resp, body) { + if (err) throw err + if (test.expectBody) { + assert.deepEqual(test.expectBody, body) + } + counter = counter - 1; + if (counter === 0) { + console.log(Object.keys(tests).length+" tests passed.") + s.close() + } + }) + counter++ + })() + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-isUrl.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-isUrl.js new file mode 100644 index 0000000..4a51ad0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-isUrl.js @@ -0,0 +1,28 @@ +var assert = require('assert') + , request = require('../index') + , http = require('http') + ; + +var s = http.createServer(function(req, res) { + res.statusCode = 200; + res.end(''); +}).listen(6767, function () { + + // Test lowercase + request('http://localhost:6767', function (err, resp, body) { + // just need to get here without throwing an error + assert.equal(true, true); + }) + + // Test uppercase + request('HTTP://localhost:6767', function (err, resp, body) { + assert.equal(true, true); + }) + + // Test mixedcase + request('HtTp://localhost:6767', function (err, resp, body) { + assert.equal(true, true); + // clean up + s.close(); + }) +}) \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-localAddress.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-localAddress.js new file mode 100644 index 0000000..11a1bd1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-localAddress.js @@ -0,0 +1,15 @@ +var request = require('../index') + , assert = require('assert') + ; + +request.get({ + uri: 'http://www.google.com', localAddress: '1.2.3.4' // some invalid address +}, function(err, res) { + assert(!res) // asserting that no response received +}) + +request.get({ + uri: 'http://www.google.com', localAddress: '127.0.0.1' +}, function(err, res) { + assert(!res) // asserting that no response received +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-oauth.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-oauth.js new file mode 100644 index 0000000..3269483 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-oauth.js @@ -0,0 +1,117 @@ +var hmacsign = require('oauth-sign').hmacsign + , assert = require('assert') + , qs = require('querystring') + , request = require('../index') + ; + +function getsignature (r) { + var sign + r.headers.Authorization.slice('OAuth '.length).replace(/,\ /g, ',').split(',').forEach(function (v) { + if (v.slice(0, 'oauth_signature="'.length) === 'oauth_signature="') sign = v.slice('oauth_signature="'.length, -1) + }) + return decodeURIComponent(sign) +} + +// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth + +var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', + { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' + , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_timestamp: '1272323042' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") + +console.log(reqsign) +console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') +assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') + +var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', + { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' + , oauth_timestamp: '1272323047' + , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") + +console.log(accsign) +console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') +assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') + +var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', + { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" + , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" + , oauth_signature_method: "HMAC-SHA1" + , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" + , oauth_timestamp: "1272325550" + , oauth_version: "1.0" + , status: 'setting up my twitter 私のさえずりを設定する' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") + +console.log(upsign) +console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') +assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') + + +var rsign = request.post( + { url: 'https://api.twitter.com/oauth/request_token' + , oauth: + { callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' + , consumer_key: 'GDdmIQH6jhtmLUypg82g' + , nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' + , timestamp: '1272323042' + , version: '1.0' + , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" + } + }) + +setTimeout(function () { + console.log(getsignature(rsign)) + assert.equal(reqsign, getsignature(rsign)) +}) + +var raccsign = request.post( + { url: 'https://api.twitter.com/oauth/access_token' + , oauth: + { consumer_key: 'GDdmIQH6jhtmLUypg82g' + , nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' + , signature_method: 'HMAC-SHA1' + , token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' + , timestamp: '1272323047' + , verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' + , version: '1.0' + , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" + , token_secret: "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA" + } + }) + +setTimeout(function () { + console.log(getsignature(raccsign)) + assert.equal(accsign, getsignature(raccsign)) +}, 1) + +var rupsign = request.post( + { url: 'http://api.twitter.com/1/statuses/update.json' + , oauth: + { consumer_key: "GDdmIQH6jhtmLUypg82g" + , nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" + , signature_method: "HMAC-SHA1" + , token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" + , timestamp: "1272325550" + , version: "1.0" + , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" + , token_secret: "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA" + } + , form: {status: 'setting up my twitter 私のさえずりを設定する'} + }) +setTimeout(function () { + console.log(getsignature(rupsign)) + assert.equal(upsign, getsignature(rupsign)) +}, 1) + + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-onelineproxy.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-onelineproxy.js new file mode 100644 index 0000000..c239f89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-onelineproxy.js @@ -0,0 +1,46 @@ +var http = require('http') + , assert = require('assert') + , request = require('../index') + ; + +var server = http.createServer(function (req, resp) { + resp.statusCode = 200 + if (req.url === '/get') { + assert.equal(req.method, 'GET') + resp.write('content') + resp.end() + return + } + if (req.url === '/put') { + var x = '' + assert.equal(req.method, 'PUT') + req.on('data', function (chunk) { + x += chunk + }) + req.on('end', function () { + assert.equal(x, 'content') + resp.write('success') + resp.end() + }) + return + } + if (req.url === '/proxy') { + assert.equal(req.method, 'PUT') + return req.pipe(request('http://localhost:8080/put')).pipe(resp) + } + + if (req.url === '/test') { + return request('http://localhost:8080/get').pipe(request.put('http://localhost:8080/proxy')).pipe(resp) + } + throw new Error('Unknown url', req.url) +}).listen(8080, function () { + request('http://localhost:8080/test', function (e, resp, body) { + if (e) throw e + if (resp.statusCode !== 200) throw new Error('statusCode not 200 ' + resp.statusCode) + assert.equal(body, 'success') + server.close() + }) +}) + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-params.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-params.js new file mode 100644 index 0000000..a5831a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-params.js @@ -0,0 +1,93 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + ; + +var s = server.createServer(); + +var tests = + { testGet : + { resp : server.createGetResponse("TESTING!") + , expectBody: "TESTING!" + } + , testGetChunkBreak : + { resp : server.createChunkResponse( + [ new Buffer([239]) + , new Buffer([163]) + , new Buffer([191]) + , new Buffer([206]) + , new Buffer([169]) + , new Buffer([226]) + , new Buffer([152]) + , new Buffer([131]) + ]) + , expectBody: "Ω☃" + } + , testGetBuffer : + { resp : server.createGetResponse(new Buffer("TESTING!")) + , encoding: null + , expectBody: new Buffer("TESTING!") + } + , testGetJSON : + { resp : server.createGetResponse('{"test":true}', 'application/json') + , json : true + , expectBody: {"test":true} + } + , testPutString : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : "PUTTINGDATA" + } + , testPutBuffer : + { resp : server.createPostValidator("PUTTINGDATA") + , method : "PUT" + , body : new Buffer("PUTTINGDATA") + } + , testPutJSON : + { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) + , method: "PUT" + , json: {foo: 'bar'} + } + , testPutMultipart : + { resp: server.createPostValidator( + '--__BOUNDARY__\r\n' + + 'content-type: text/html\r\n' + + '\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__\r\n\r\n' + + 'Oh hi.' + + '\r\n--__BOUNDARY__--' + ) + , method: "PUT" + , multipart: + [ {'content-type': 'text/html', 'body': 'Oh hi.'} + , {'body': 'Oh hi.'} + ] + } + } + +s.listen(s.port, function () { + + var counter = 0 + + for (i in tests) { + (function () { + var test = tests[i] + s.on('/'+i, test.resp) + //test.uri = s.url + '/' + i + request(s.url + '/' + i, test, function (err, resp, body) { + if (err) throw err + if (test.expectBody) { + assert.deepEqual(test.expectBody, body) + } + counter = counter - 1; + if (counter === 0) { + assert.notEqual(typeof test.callback, 'function') + console.log(1 + Object.keys(tests).length+" tests passed.") + s.close() + } + }) + counter++ + })() + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-piped-redirect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-piped-redirect.js new file mode 100644 index 0000000..e295ec7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-piped-redirect.js @@ -0,0 +1,42 @@ +var http = require('http') + , assert = require('assert') + , request = require('../index') + ; + +var portOne = 8968 + , portTwo = 8969 + ; + + +// server one +var s1 = http.createServer(function (req, resp) { + if (req.url == '/original') { + resp.writeHeader(302, {'location': '/redirected'}) + resp.end() + } else if (req.url == '/redirected') { + resp.writeHeader(200, {'content-type': 'text/plain'}) + resp.write('OK') + resp.end() + } + +}).listen(portOne); + + +// server two +var s2 = http.createServer(function (req, resp) { + var x = request('http://localhost:'+portOne+'/original') + req.pipe(x) + x.pipe(resp) + +}).listen(portTwo, function () { + var r = request('http://localhost:'+portTwo+'/original', function (err, res, body) { + assert.equal(body, 'OK') + + s1.close() + s2.close() + }); + + // it hangs, so wait a second :) + r.timeout = 1000; + +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pipes.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pipes.js new file mode 100644 index 0000000..52a15cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pipes.js @@ -0,0 +1,216 @@ +var server = require('./server') + , events = require('events') + , stream = require('stream') + , assert = require('assert') + , fs = require('fs') + , request = require('../index') + , path = require('path') + , util = require('util') + ; + +var s = server.createServer(3453); + +function ValidationStream(str) { + this.str = str + this.buf = '' + this.on('data', function (data) { + this.buf += data + }) + this.on('end', function () { + assert.equal(this.str, this.buf) + }) + this.writable = true +} +util.inherits(ValidationStream, stream.Stream) +ValidationStream.prototype.write = function (chunk) { + this.emit('data', chunk) +} +ValidationStream.prototype.end = function (chunk) { + if (chunk) emit('data', chunk) + this.emit('end') +} + +s.listen(s.port, function () { + counter = 0; + + var check = function () { + counter = counter - 1 + if (counter === 0) { + console.log('All tests passed.') + setTimeout(function () { + process.exit(); + }, 500) + } + } + + // Test pipeing to a request object + s.once('/push', server.createPostValidator("mydata")); + + var mydata = new stream.Stream(); + mydata.readable = true + + counter++ + var r1 = request.put({url:'http://localhost:3453/push'}, function () { + check(); + }) + mydata.pipe(r1) + + mydata.emit('data', 'mydata'); + mydata.emit('end'); + + // Test pipeing to a request object with a json body + s.once('/push-json', server.createPostValidator("{\"foo\":\"bar\"}", "application/json")); + + var mybodydata = new stream.Stream(); + mybodydata.readable = true + + counter++ + var r2 = request.put({url:'http://localhost:3453/push-json',json:true}, function () { + check(); + }) + mybodydata.pipe(r2) + + mybodydata.emit('data', JSON.stringify({foo:"bar"})); + mybodydata.emit('end'); + + // Test pipeing from a request object. + s.once('/pull', server.createGetResponse("mypulldata")); + + var mypulldata = new stream.Stream(); + mypulldata.writable = true + + counter++ + request({url:'http://localhost:3453/pull'}).pipe(mypulldata) + + var d = ''; + + mypulldata.write = function (chunk) { + d += chunk; + } + mypulldata.end = function () { + assert.equal(d, 'mypulldata'); + check(); + }; + + + s.on('/cat', function (req, resp) { + if (req.method === "GET") { + resp.writeHead(200, {'content-type':'text/plain-test', 'content-length':4}); + resp.end('asdf') + } else if (req.method === "PUT") { + assert.equal(req.headers['content-type'], 'text/plain-test'); + assert.equal(req.headers['content-length'], 4) + var validate = ''; + + req.on('data', function (chunk) {validate += chunk}) + req.on('end', function () { + resp.writeHead(201); + resp.end(); + assert.equal(validate, 'asdf'); + check(); + }) + } + }) + s.on('/pushjs', function (req, resp) { + if (req.method === "PUT") { + assert.equal(req.headers['content-type'], 'application/javascript'); + check(); + } + }) + s.on('/catresp', function (req, resp) { + request.get('http://localhost:3453/cat').pipe(resp) + }) + s.on('/doodle', function (req, resp) { + if (req.headers['x-oneline-proxy']) { + resp.setHeader('x-oneline-proxy', 'yup') + } + resp.writeHead('200', {'content-type':'image/jpeg'}) + fs.createReadStream(path.join(__dirname, 'googledoodle.jpg')).pipe(resp) + }) + s.on('/onelineproxy', function (req, resp) { + var x = request('http://localhost:3453/doodle') + req.pipe(x) + x.pipe(resp) + }) + + counter++ + fs.createReadStream(__filename).pipe(request.put('http://localhost:3453/pushjs')) + + counter++ + request.get('http://localhost:3453/cat').pipe(request.put('http://localhost:3453/cat')) + + counter++ + request.get('http://localhost:3453/catresp', function (e, resp, body) { + assert.equal(resp.headers['content-type'], 'text/plain-test'); + assert.equal(resp.headers['content-length'], 4) + check(); + }) + + var doodleWrite = fs.createWriteStream(path.join(__dirname, 'test.jpg')) + + counter++ + request.get('http://localhost:3453/doodle').pipe(doodleWrite) + + doodleWrite.on('close', function () { + assert.deepEqual(fs.readFileSync(path.join(__dirname, 'googledoodle.jpg')), fs.readFileSync(path.join(__dirname, 'test.jpg'))) + check() + }) + + process.on('exit', function () { + fs.unlinkSync(path.join(__dirname, 'test.jpg')) + }) + + counter++ + request.get({uri:'http://localhost:3453/onelineproxy', headers:{'x-oneline-proxy':'nope'}}, function (err, resp, body) { + assert.equal(resp.headers['x-oneline-proxy'], 'yup') + check() + }) + + s.on('/afterresponse', function (req, resp) { + resp.write('d') + resp.end() + }) + + counter++ + var afterresp = request.post('http://localhost:3453/afterresponse').on('response', function () { + var v = new ValidationStream('d') + afterresp.pipe(v) + v.on('end', check) + }) + + s.on('/forward1', function (req, resp) { + resp.writeHead(302, {location:'/forward2'}) + resp.end() + }) + s.on('/forward2', function (req, resp) { + resp.writeHead('200', {'content-type':'image/png'}) + resp.write('d') + resp.end() + }) + + counter++ + var validateForward = new ValidationStream('d') + validateForward.on('end', check) + request.get('http://localhost:3453/forward1').pipe(validateForward) + + // Test pipe options + s.once('/opts', server.createGetResponse('opts response')); + + var optsStream = new stream.Stream(); + optsStream.writable = true + + var optsData = ''; + optsStream.write = function (buf) { + optsData += buf; + if (optsData === 'opts response') { + setTimeout(check, 10); + } + } + + optsStream.end = function () { + assert.fail('end called') + }; + + counter++ + request({url:'http://localhost:3453/opts'}).pipe(optsStream, { end : false }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pool.js new file mode 100644 index 0000000..791ee8b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-pool.js @@ -0,0 +1,16 @@ +var request = require('../index') + , http = require('http') + , assert = require('assert') + ; + +var s = http.createServer(function (req, resp) { + resp.statusCode = 200; + resp.end('asdf'); +}).listen(8080, function () { + request({'url': 'http://localhost:8080', 'pool': false}, function (e, resp) { + var agent = resp.request.agent; + assert.strictEqual(typeof agent, 'boolean'); + assert.strictEqual(agent, false); + s.close(); + }); +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-protocol-changing-redirect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-protocol-changing-redirect.js new file mode 100644 index 0000000..7e83a41 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-protocol-changing-redirect.js @@ -0,0 +1,61 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + + +var s = server.createServer() +var ss = server.createSSLServer() +var sUrl = 'http://localhost:' + s.port +var ssUrl = 'https://localhost:' + ss.port + +s.listen(s.port, bouncy(s, ssUrl)) +ss.listen(ss.port, bouncy(ss, sUrl)) + +var hits = {} +var expect = {} +var pending = 0 +function bouncy (s, server) { return function () { + + var redirs = { a: 'b' + , b: 'c' + , c: 'd' + , d: 'e' + , e: 'f' + , f: 'g' + , g: 'h' + , h: 'end' } + + var perm = true + Object.keys(redirs).forEach(function (p) { + var t = redirs[p] + + // switch type each time + var type = perm ? 301 : 302 + perm = !perm + s.on('/' + p, function (req, res) { + res.writeHead(type, { location: server + '/' + t }) + res.end() + }) + }) + + s.on('/end', function (req, res) { + var h = req.headers['x-test-key'] + hits[h] = true + pending -- + if (pending === 0) done() + }) +}} + +for (var i = 0; i < 5; i ++) { + pending ++ + var val = 'test_' + i + expect[val] = true + request({ url: (i % 2 ? sUrl : ssUrl) + '/a' + , headers: { 'x-test-key': val } + , rejectUnauthorized: false }) +} + +function done () { + assert.deepEqual(hits, expect) + process.exit(0) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-proxy.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-proxy.js new file mode 100644 index 0000000..e183d68 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-proxy.js @@ -0,0 +1,39 @@ +var server = require('./server') + , events = require('events') + , stream = require('stream') + , assert = require('assert') + , fs = require('fs') + , request = require('../index') + , path = require('path') + , util = require('util') + ; + +var port = 6768 + , called = false + , proxiedHost = 'google.com' + ; + +var s = server.createServer(port) +s.listen(port, function () { + s.on('http://google.com/', function (req, res) { + called = true + assert.equal(req.headers.host, proxiedHost) + res.writeHeader(200) + res.end() + }) + request ({ + url: 'http://'+proxiedHost, + proxy: 'http://localhost:'+port + /* + //should behave as if these arguments where passed: + url: 'http://localhost:'+port, + headers: {host: proxiedHost} + //*/ + }, function (err, res, body) { + s.close() + }) +}) + +process.on('exit', function () { + assert.ok(called, 'the request must be made to the proxy server') +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-qs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-qs.js new file mode 100644 index 0000000..65958e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-qs.js @@ -0,0 +1,42 @@ +var request = request = require('../index') + , assert = require('assert') + ; + + +// Test adding a querystring +var req1 = request.get({ uri: 'http://www.google.com', qs: { q : 'search' }}) +setTimeout(function() { + assert.equal('/?q=search', req1.path) +}, 1) + +// Test replacing a querystring value +var req2 = request.get({ uri: 'http://www.google.com?q=abc', qs: { q : 'search' }}) +setTimeout(function() { + assert.equal('/?q=search', req2.path) +}, 1) + +// Test appending a querystring value to the ones present in the uri +var req3 = request.get({ uri: 'http://www.google.com?x=y', qs: { q : 'search' }}) +setTimeout(function() { + assert.equal('/?x=y&q=search', req3.path) +}, 1) + +// Test leaving a querystring alone +var req4 = request.get({ uri: 'http://www.google.com?x=y'}) +setTimeout(function() { + assert.equal('/?x=y', req4.path) +}, 1) + +// Test giving empty qs property +var req5 = request.get({ uri: 'http://www.google.com', qs: {}}) +setTimeout(function(){ + assert.equal('/', req5.path) +}, 1) + + +// Test modifying the qs after creating the request +var req6 = request.get({ uri: 'http://www.google.com', qs: {}}); +req6.qs({ q: "test" }); +process.nextTick(function() { + assert.equal('/?q=test', req6.path); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-redirect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-redirect.js new file mode 100644 index 0000000..cdd4606 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-redirect.js @@ -0,0 +1,155 @@ +var server = require('./server') + , assert = require('assert') + , request = require('../index') + , Cookie = require('cookie-jar') + , Jar = Cookie.Jar + ; + +var s = server.createServer() + +s.listen(s.port, function () { + var server = 'http://localhost:' + s.port; + var hits = {} + var passed = 0; + + bouncer(301, 'temp') + bouncer(302, 'perm') + bouncer(302, 'nope') + + function bouncer(code, label) { + var landing = label+'_landing'; + + s.on('/'+label, function (req, res) { + hits[label] = true; + res.writeHead(code, { + 'location':server + '/'+landing, + 'set-cookie': 'ham=eggs' + }) + res.end() + }) + + s.on('/'+landing, function (req, res) { + if (req.method !== 'GET') { // We should only accept GET redirects + console.error("Got a non-GET request to the redirect destination URL"); + res.writeHead(400); + res.end(); + return; + } + // Make sure the cookie doesn't get included twice, see #139: + // Make sure cookies are set properly after redirect + assert.equal(req.headers.cookie, 'foo=bar; quux=baz; ham=eggs'); + hits[landing] = true; + res.writeHead(200) + res.end(landing) + }) + } + + // Permanent bounce + var jar = new Jar() + jar.add(new Cookie('quux=baz')) + request({uri: server+'/perm', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) + assert.ok(hits.perm, 'Original request is to /perm') + assert.ok(hits.perm_landing, 'Forward to permanent landing URL') + assert.equal(body, 'perm_landing', 'Got permanent landing content') + passed += 1 + done() + }) + + // Temporary bounce + request({uri: server+'/temp', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(hits.temp_landing, 'Forward to temporary landing URL') + assert.equal(body, 'temp_landing', 'Got temporary landing content') + passed += 1 + done() + }) + + // Prevent bouncing. + request({uri:server+'/nope', jar: jar, headers: {cookie: 'foo=bar'}, followRedirect:false}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 302) throw new Error('Status is not 302: '+res.statusCode) + assert.ok(hits.nope, 'Original request to /nope') + assert.ok(!hits.nope_landing, 'No chasing the redirect') + assert.equal(res.statusCode, 302, 'Response is the bounce itself') + passed += 1 + done() + }) + + // Should not follow post redirects by default + request.post(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(!hits.temp_landing, 'No chasing the redirect when post') + assert.equal(res.statusCode, 301, 'Response is the bounce itself') + passed += 1 + done() + }) + + // Should follow post redirects when followAllRedirects true + request.post({uri:server+'/temp', followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(hits.temp_landing, 'Forward to temporary landing URL') + assert.equal(body, 'temp_landing', 'Got temporary landing content') + passed += 1 + done() + }) + + request.post({uri:server+'/temp', followAllRedirects:false, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(!hits.temp_landing, 'No chasing the redirect') + assert.equal(res.statusCode, 301, 'Response is the bounce itself') + passed += 1 + done() + }) + + // Should not follow delete redirects by default + request.del(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode < 301) throw new Error('Status is not a redirect.') + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(!hits.temp_landing, 'No chasing the redirect when delete') + assert.equal(res.statusCode, 301, 'Response is the bounce itself') + passed += 1 + done() + }) + + // Should not follow delete redirects even if followRedirect is set to true + request.del(server+'/temp', { followRedirect: true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(!hits.temp_landing, 'No chasing the redirect when delete') + assert.equal(res.statusCode, 301, 'Response is the bounce itself') + passed += 1 + done() + }) + + // Should follow delete redirects when followAllRedirects true + request.del(server+'/temp', {followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { + if (er) throw er + if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) + assert.ok(hits.temp, 'Original request is to /temp') + assert.ok(hits.temp_landing, 'Forward to temporary landing URL') + assert.equal(body, 'temp_landing', 'Got temporary landing content') + passed += 1 + done() + }) + + var reqs_done = 0; + function done() { + reqs_done += 1; + if(reqs_done == 9) { + console.log(passed + ' tests passed.') + s.close() + } + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-s3.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-s3.js new file mode 100644 index 0000000..0f6a832 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-s3.js @@ -0,0 +1,13 @@ +var request = require('../index') + +var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/', + { aws: + { key: 'AKIAI6KIQRRVMGK3WK5Q' + , secret: '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' + , bucket: 'log.curlybracecast.com' + } + }, function (e, resp, body) { + console.log(r.headers) + console.log(body) + } +) \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-timeout.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-timeout.js new file mode 100644 index 0000000..7036367 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-timeout.js @@ -0,0 +1,87 @@ +var server = require('./server') + , events = require('events') + , stream = require('stream') + , assert = require('assert') + , request = require('../index') + ; + +var s = server.createServer(); +var expectedBody = "waited"; +var remainingTests = 5; + +s.listen(s.port, function () { + // Request that waits for 200ms + s.on('/timeout', function (req, resp) { + setTimeout(function(){ + resp.writeHead(200, {'content-type':'text/plain'}) + resp.write(expectedBody) + resp.end() + }, 200); + }); + + // Scenario that should timeout + var shouldTimeout = { + url: s.url + "/timeout", + timeout:100 + } + + + request(shouldTimeout, function (err, resp, body) { + assert.equal(err.code, "ETIMEDOUT"); + checkDone(); + }) + + + // Scenario that shouldn't timeout + var shouldntTimeout = { + url: s.url + "/timeout", + timeout:300 + } + + request(shouldntTimeout, function (err, resp, body) { + assert.equal(err, null); + assert.equal(expectedBody, body) + checkDone(); + }) + + // Scenario with no timeout set, so shouldn't timeout + var noTimeout = { + url: s.url + "/timeout" + } + + request(noTimeout, function (err, resp, body) { + assert.equal(err); + assert.equal(expectedBody, body) + checkDone(); + }) + + // Scenario with a negative timeout value, should be treated a zero or the minimum delay + var negativeTimeout = { + url: s.url + "/timeout", + timeout:-1000 + } + + request(negativeTimeout, function (err, resp, body) { + assert.equal(err.code, "ETIMEDOUT"); + checkDone(); + }) + + // Scenario with a float timeout value, should be rounded by setTimeout anyway + var floatTimeout = { + url: s.url + "/timeout", + timeout: 100.76 + } + + request(floatTimeout, function (err, resp, body) { + assert.equal(err.code, "ETIMEDOUT"); + checkDone(); + }) + + function checkDone() { + if(--remainingTests == 0) { + s.close(); + console.log("All tests passed."); + } + } +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-toJSON.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-toJSON.js new file mode 100644 index 0000000..6d5f92a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-toJSON.js @@ -0,0 +1,14 @@ +var request = require('../index') + , http = require('http') + , assert = require('assert') + ; + +var s = http.createServer(function (req, resp) { + resp.statusCode = 200 + resp.end('asdf') +}).listen(8080, function () { + var r = request('http://localhost:8080', function (e, resp) { + assert.equal(JSON.parse(JSON.stringify(r)).response.statusCode, 200) + s.close() + }) +}) \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-tunnel.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-tunnel.js new file mode 100644 index 0000000..2ee3f39 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/test-tunnel.js @@ -0,0 +1,75 @@ +// test that we can tunnel a https request over an http proxy +// keeping all the CA and whatnot intact. +// +// Note: this requires that squid is installed. +// If the proxy fails to start, we'll just log a warning and assume success. + +var server = require('./server') + , assert = require('assert') + , request = require('../index') + , fs = require('fs') + , path = require('path') + , caFile = path.resolve(__dirname, 'ssl/npm-ca.crt') + , ca = fs.readFileSync(caFile) + , child_process = require('child_process') + , sqConf = path.resolve(__dirname, 'squid.conf') + , sqArgs = ['-f', sqConf, '-N', '-d', '5'] + , proxy = 'http://localhost:3128' + , hadError = null + +var squid = child_process.spawn('squid', sqArgs); +var ready = false + +squid.stderr.on('data', function (c) { + console.error('SQUIDERR ' + c.toString().trim().split('\n') + .join('\nSQUIDERR ')) + ready = c.toString().match(/ready to serve requests|Accepting HTTP Socket connections/i) +}) + +squid.stdout.on('data', function (c) { + console.error('SQUIDOUT ' + c.toString().trim().split('\n') + .join('\nSQUIDOUT ')) +}) + +squid.on('error', function (c) { + console.error('squid: error '+c) + if (c && !ready) { + notInstalled() + return + } +}) + +squid.on('exit', function (c) { + console.error('squid: exit '+c) + if (c && !ready) { + notInstalled() + return + } + + if (c) { + hadError = hadError || new Error('Squid exited with '+c) + } + if (hadError) throw hadError +}) + +setTimeout(function F () { + if (!ready) return setTimeout(F, 100) + request({ uri: 'https://registry.npmjs.org/' + , proxy: 'http://localhost:3128' + , strictSSL: true + , ca: ca + , json: true }, function (er, body) { + hadError = er + console.log(er || typeof body) + if (!er) console.log("ok") + squid.kill('SIGKILL') + }) +}, 100) + +function notInstalled() { + console.error('squid must be installed to run this test.') + console.error('skipping this test. please install squid and run again if you need to test tunneling.') + c = null + hadError = null + process.exit(0) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/unicycle.jpg b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/unicycle.jpg new file mode 100644 index 0000000..7cea4dd Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request/tests/unicycle.jpg differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/.npmignore new file mode 100644 index 0000000..5a23aa6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/.npmignore @@ -0,0 +1 @@ +/node_modules/* diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/License b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/License new file mode 100644 index 0000000..0b58de3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Makefile b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Makefile new file mode 100644 index 0000000..a6e68c4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Makefile @@ -0,0 +1,7 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +.PHONY: test + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Readme.md new file mode 100644 index 0000000..2bb8650 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/Readme.md @@ -0,0 +1,167 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `34 minutes and 7 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. See the `retry.timeouts()` function +below for available `options`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The amount of time before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum amount of time between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + +[http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000]() + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### new RetryOperation(timeouts) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +#Changelog + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactorings. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/equation.gif b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/equation.gif new file mode 100644 index 0000000..9710723 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/equation.gif differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/example/dns.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/example/dns.js new file mode 100644 index 0000000..e4082af --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + times: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/index.js new file mode 100644 index 0000000..ee62f3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry.js new file mode 100644 index 0000000..3840686 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry.js @@ -0,0 +1,50 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this._createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports._createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry_operation.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry_operation.js new file mode 100644 index 0000000..f24d2d5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,109 @@ +function RetryOperation(timeouts) { + this._timeouts = timeouts; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; +} +module.exports = RetryOperation; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + return false; + } + + this._attempts++; + + var self = this; + setTimeout(function() { + self._fn(self._attempts); + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + } + }, timeout); + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + this._fn(this._attempts); + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/package.json new file mode 100644 index 0000000..62d48b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/package.json @@ -0,0 +1,34 @@ +{ + "author": { + "name": "Tim Koschützki", + "email": "tim@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "retry", + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "version": "0.6.0", + "homepage": "https://github.com/tim-kos/node-retry", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-retry.git" + }, + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "readme": "# retry\n\nAbstraction for exponential and custom retry strategies for failed operations.\n\n## Installation\n\n npm install retry\n\n## Current Status\n\nThis module has been tested and is ready to be used.\n\n## Tutorial\n\nThe example below will retry a potentially failing `dns.resolve` operation\n`10` times using an exponential backoff strategy. With the default settings, this\nmeans the last attempt is made after `34 minutes and 7 seconds`.\n\n``` javascript\nvar dns = require('dns');\nvar retry = require('retry');\n\nfunction faultTolerantResolve(address, cb) {\n var operation = retry.operation();\n\n operation.attempt(function(currentAttempt) {\n dns.resolve(address, function(err, addresses) {\n if (operation.retry(err)) {\n return;\n }\n\n cb(operation.mainError(), addresses);\n });\n });\n}\n\nfaultTolerantResolve('nodejs.org', function(err, addresses) {\n console.log(err, addresses);\n});\n```\n\nOf course you can also configure the factors that go into the exponential\nbackoff. See the API documentation below for all available settings.\ncurrentAttempt is an int representing the number of attempts so far.\n\n``` javascript\nvar operation = retry.operation({\n retries: 5,\n factor: 3,\n minTimeout: 1 * 1000,\n maxTimeout: 60 * 1000,\n randomize: true,\n});\n```\n\n## API\n\n### retry.operation([options])\n\nCreates a new `RetryOperation` object. See the `retry.timeouts()` function\nbelow for available `options`.\n\n### retry.timeouts([options])\n\nReturns an array of timeouts. All time `options` and return values are in\nmilliseconds. If `options` is an array, a copy of that array is returned.\n\n`options` is a JS object that can contain any of the following keys:\n\n* `retries`: The maximum amount of times to retry the operation. Default is `10`.\n* `factor`: The exponential factor to use. Default is `2`.\n* `minTimeout`: The amount of time before starting the first retry. Default is `1000`.\n* `maxTimeout`: The maximum amount of time between two retries. Default is `Infinity`.\n* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.\n\nThe formula used to calculate the individual timeouts is:\n\n```\nvar Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout);\n```\n\nHave a look at [this article][article] for a better explanation of approach.\n\nIf you want to tune your `factor` / `times` settings to attempt the last retry\nafter a certain amount of time, you can use wolfram alpha. For example in order\nto tune for `10` attempts in `5 minutes`, you can use this equation:\n\n![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif)\n\nExplaining the various values from left to right:\n\n* `k = 0 ... 9`: The `retries` value (10)\n* `1000`: The `minTimeout` value in ms (1000)\n* `x^k`: No need to change this, `x` will be your resulting factor\n* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes)\n\nTo make this a little easier for you, use wolfram alpha to do the calculations:\n\n[http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000]()\n\n[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html\n\n### new RetryOperation(timeouts)\n\nCreates a new `RetryOperation` where `timeouts` is an array where each value is\na timeout given in milliseconds.\n\n#### retryOperation.errors()\n\nReturns an array of all errors that have been passed to\n`retryOperation.retry()` so far.\n\n#### retryOperation.mainError()\n\nA reference to the error object that occured most frequently. Errors are\ncompared using the `error.message` property.\n\nIf multiple error messages occured the same amount of time, the last error\nobject with that message is returned.\n\nIf no errors occured so far, the value is `null`.\n\n#### retryOperation.attempt(fn, timeoutOps)\n\nDefines the function `fn` that is to be retried and executes it for the first\ntime right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far.\n\nOptionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function.\nWhenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called.\n\n\n#### retryOperation.try(fn)\n\nThis is an alias for `retryOperation.attempt(fn)`. This is deprecated.\n\n#### retryOperation.start(fn)\n\nThis is an alias for `retryOperation.attempt(fn)`. This is deprecated.\n\n#### retryOperation.retry(error)\n\nReturns `false` when no `error` value is given, or the maximum amount of retries\nhas been reached.\n\nOtherwise it returns `true`, and retries the operation after the timeout for\nthe current attempt number.\n\n#### retryOperation.attempts()\n\nReturns an int representing the number of attempts it took to call `fn` before it was successful.\n\n## License\n\nretry is licensed under the MIT license.\n\n\n#Changelog\n\n0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.\n\n0.5.0 Some minor refactorings.\n\n0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it.\n\n0.3.0 Added retryOperation.start() which is an alias for retryOperation.try().\n\n0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn().\n", + "readmeFilename": "Readme.md", + "bugs": { + "url": "https://github.com/felixge/node-retry/issues" + }, + "_id": "retry@0.6.0", + "_from": "retry@~0.6.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/common.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/common.js new file mode 100644 index 0000000..2247206 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake'); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 0000000..d873d1f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,80 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-timeouts.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 0000000..7206b0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/runner.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/runner.js new file mode 100644 index 0000000..e0ee2f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/AUTHORS b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/AUTHORS new file mode 100644 index 0000000..247b754 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/AUTHORS @@ -0,0 +1,6 @@ +# Authors sorted by whether or not they're me. +Isaac Z. Schlueter (http://blog.izs.me) +Wayne Larsen (http://github.com/wvl) +ritch +Marcel Laverdet +Yosef Dinerstein diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/README.md new file mode 100644 index 0000000..cd123b6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/README.md @@ -0,0 +1,30 @@ +`rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, callback)` + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf ` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/bin.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/bin.js new file mode 100755 index 0000000..29bfa8a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/bin.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf ') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else { + args.forEach(function(arg) { + rimraf.sync(arg) + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/package.json new file mode 100644 index 0000000..95ed17c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/package.json @@ -0,0 +1,60 @@ +{ + "name": "rimraf", + "version": "2.2.6", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "cd test && bash run.sh" + }, + "bin": { + "rimraf": "./bin.js" + }, + "contributors": [ + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + { + "name": "Wayne Larsen", + "email": "wayne@larsen.st", + "url": "http://github.com/wvl" + }, + { + "name": "ritch", + "email": "skawful@gmail.com" + }, + { + "name": "Marcel Laverdet" + }, + { + "name": "Yosef Dinerstein", + "email": "yosefd@microsoft.com" + } + ], + "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "homepage": "https://github.com/isaacs/rimraf", + "_id": "rimraf@2.2.6", + "dist": { + "shasum": "7ada6a6d39b2301af3c8fe7b936c2e46e7c4463d" + }, + "_from": "rimraf@~2.2.0", + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/rimraf.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000..ce62051 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/rimraf.js @@ -0,0 +1,178 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var path = require("path") +var fs = require("fs") + +// for EMFILE handling +var timeout = 0 +exports.EMFILE_MAX = 1000 +exports.BUSYTRIES_MAX = 3 + +var isWindows = (process.platform === "win32") + +function rimraf (p, cb) { + if (!cb) throw new Error("No callback passed to rimraf()") + + var busyTries = 0 + rimraf_(p, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + busyTries < exports.BUSYTRIES_MAX) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { + return setTimeout(function () { + rimraf_(p, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, cb) { + fs.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) + if (er.code === "EISDIR") + return rmdir(p, er, cb) + } + return cb(er) + }) +} + +function fixWinEPERM (p, er, cb) { + fs.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + fs.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, er, cb) + else + fs.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, er, cb) { + try { + fs.chmodSync(p, 666) + } catch (er2) { + if (er2.code !== "ENOENT") + throw er + } + + try { + var stats = fs.statSync(p) + } catch (er3) { + if (er3 !== "ENOENT") + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, er) + else + fs.unlinkSync(p) +} + +function rmdir (p, originalEr, cb) { + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + fs.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, cb) { + fs.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return fs.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + fs.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p) { + try { + fs.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, er) + } +} + +function rmdirSync (p, originalEr) { + try { + fs.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p) + } +} + +function rmkidsSync (p) { + fs.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f)) + }) + fs.rmdirSync(p) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/run.sh b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/run.sh new file mode 100644 index 0000000..598f016 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +for i in test-*.js; do + echo -n $i ... + bash setup.sh + node $i + ! [ -d target ] + echo "pass" +done +rm -rf target diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/setup.sh b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/setup.sh new file mode 100644 index 0000000..2602e63 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/setup.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -e + +files=10 +folders=2 +depth=4 +target="$PWD/target" + +rm -rf target + +fill () { + local depth=$1 + local files=$2 + local folders=$3 + local target=$4 + + if ! [ -d $target ]; then + mkdir -p $target + fi + + local f + + f=$files + while [ $f -gt 0 ]; do + touch "$target/f-$depth-$f" + let f-- + done + + let depth-- + + if [ $depth -le 0 ]; then + return 0 + fi + + f=$folders + while [ $f -gt 0 ]; do + mkdir "$target/folder-$depth-$f" + fill $depth $files $folders "$target/d-$depth-$f" + let f-- + done +} + +fill $depth $files $folders $target + +# sanity assert +[ -d $target ] diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-async.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-async.js new file mode 100644 index 0000000..9c2e0b7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-async.js @@ -0,0 +1,5 @@ +var rimraf = require("../rimraf") + , path = require("path") +rimraf(path.join(__dirname, "target"), function (er) { + if (er) throw er +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-sync.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-sync.js new file mode 100644 index 0000000..eb71f10 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/rimraf/test/test-sync.js @@ -0,0 +1,3 @@ +var rimraf = require("../rimraf") + , path = require("path") +rimraf.sync(path.join(__dirname, "target")) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/.npmignore new file mode 100644 index 0000000..7300fbc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/.npmignore @@ -0,0 +1 @@ +# nada diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/Makefile b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/Makefile new file mode 100644 index 0000000..e171f70 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/Makefile @@ -0,0 +1,24 @@ +files = semver.browser.js \ + semver.min.js \ + semver.browser.js.gz \ + semver.min.js.gz + +all: $(files) + +clean: + rm $(files) + +semver.browser.js: head.js semver.js foot.js + ( cat head.js; \ + cat semver.js | \ + egrep -v '^ *\/\* nomin \*\/' | \ + perl -pi -e 's/debug\([^\)]+\)//g'; \ + cat foot.js ) > semver.browser.js + +semver.min.js: semver.browser.js + uglifyjs -m semver.min.js + +%.gz: % + gzip --stdout -9 <$< >$@ + +.PHONY: all clean diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/README.md new file mode 100644 index 0000000..018eb57 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/README.md @@ -0,0 +1,123 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Usage + + $ npm install semver + + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null + semver.clean(' =v1.2.3 ') // '1.2.3' + semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true + semver.gt('1.2.3', '9.8.7') // false + semver.lt('1.2.3', '9.8.7') // true + +As a command-line utility: + + $ semver -h + + Usage: semver [ [...]] [-r | -i | -d ] + Test if version(s) satisfy the supplied range(s), and sort them. + + Multiple versions or ranges may be supplied, unless increment + or decrement options are specified. In that case, only a single + version may be used, and it is incremented by the specified level + + Program exits successfully if any valid version satisfies + all supplied ranges, and prints all satisfying versions. + + If no versions are valid, or ranges are not satisfied, + then exits failure. + + Versions are printed in ascending order, so supplying + multiple versions to the utility will just sort them. + +## Versions + +A "version" is described by the v2.0.0 specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +The following range styles are supported: + +* `1.2.3` A specific version. When nothing else will do. Note that + build metadata is still ignored, so `1.2.3+build2012` will satisfy + this range. +* `>1.2.3` Greater than a specific version. +* `<1.2.3` Less than a specific version. If there is no prerelease + tag on the version range, then no prerelease version will be allowed + either, even though these are technically "less than". +* `>=1.2.3` Greater than or equal to. Note that prerelease versions + are NOT equal to their "normal" equivalents, so `1.2.3-beta` will + not satisfy this range, but `2.3.0-beta` will. +* `<=1.2.3` Less than or equal to. In this case, prerelease versions + ARE allowed, so `1.2.3-beta` would satisfy. +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` +* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to 1.2.3". When + using tilde operators, prerelease versions are supported as well, + but a prerelease of the next significant digit will NOT be + satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. +* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with 1.2.3". When + using caret operators, anything from the specified version (including + prerelease) will be supported up to, but not including, the next + major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, + while `1.2.2` and `2.0.0-beta` will not. +* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with 0.1.3". 0.x.x versions are + special: the first non-zero component indicates potentially breaking changes, + meaning the caret operator matches any version with the same first non-zero + component starting at the specified version. +* `^0.0.2` := `=0.0.2` "Only the version 0.0.2 is considered compatible" +* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with 1.2" +* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" +* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with 1" +* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" + + +Ranges can be joined with either a space (which implies "and") or a +`||` (which implies "or"). + +## Functions + +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* valid(v): Return the parsed version, or null if it's not valid. +* inc(v, release): Return the version incremented by the release type + (major, minor, patch, or prerelease), or null if it's not valid. + +### Comparison + +* gt(v1, v2): `v1 > v2` +* gte(v1, v2): `v1 >= v2` +* lt(v1, v2): `v1 < v2` +* lte(v1, v2): `v1 <= v2` +* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* neq(v1, v2): `v1 != v2` The opposite of eq. +* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if + v2 is greater. Sorts in ascending order if passed to Array.sort(). +* rcompare(v1, v2): The reverse of compare. Sorts an array of versions + in descending order when passed to Array.sort(). + + +### Ranges + +* validRange(range): Return the valid range or null if it's not valid +* satisfies(version, range): Return true if the version satisfies the + range. +* maxSatisfying(versions, range): Return the highest version in the list + that satisfies the range, or null if none of them do. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/bin/semver b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/bin/semver new file mode 100755 index 0000000..a6390b8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/bin/semver @@ -0,0 +1,119 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , semver = require("../semver") + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-l": case "--loose": + loose = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + versions = versions.filter(function (v) { + return semver.valid(v, loose) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], loose) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + versions.sort(function (a, b) { + return semver.compare(a, b, loose) + }).map(function (v) { + return semver.clean(v, loose) + }).map(function (v) { + return inc ? semver.inc(v, inc, loose) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] [ [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range " + ," Print versions that match the specified range." + ,"" + ,"-i --increment []" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, or prerelease" + ," Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/foot.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/foot.js new file mode 100644 index 0000000..8f83c20 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/foot.js @@ -0,0 +1,6 @@ + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/head.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/head.js new file mode 100644 index 0000000..6536865 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/head.js @@ -0,0 +1,2 @@ +;(function(exports) { + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/package.json new file mode 100644 index 0000000..4e35e05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/package.json @@ -0,0 +1,32 @@ +{ + "name": "semver", + "version": "2.1.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "browser": "semver.browser.js", + "min": "semver.min.js", + "scripts": { + "test": "tap test/*.js", + "prepublish": "make" + }, + "devDependencies": { + "tap": "0.x >=0.0.4", + "uglify-js": "~2.3.6" + }, + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver [ [...]] [-r | -i | -d ]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the v2.0.0 specification found at\n.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Note that\n build metadata is still ignored, so `1.2.3+build2012` will satisfy\n this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to 1.2.3\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` \"Compatible with 1.2.3\". When\n using caret operators, anything from the specified version (including\n prerelease) will be supported up to, but not including, the next\n major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,\n while `1.2.2` and `2.0.0-beta` will not.\n* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` \"Compatible with 0.1.3\". 0.x.x versions are\n special: the first non-zero component indicates potentially breaking changes,\n meaning the caret operator matches any version with the same first non-zero\n component starting at the specified version.\n* `^0.0.2` := `=0.0.2` \"Only the version 0.0.2 is considered compatible\"\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `^1.2` := `>=1.2.0-0 <2.0.0-0` \"Any version compatible with 1.2\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n* `^1` := `>=1.0.0-0 <2.0.0-0` \"Any version compatible with 1\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or prerelease), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-semver/issues" + }, + "homepage": "https://github.com/isaacs/node-semver", + "_id": "semver@2.1.0", + "_from": "semver@~2.1.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js new file mode 100644 index 0000000..087133e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js @@ -0,0 +1,919 @@ +;(function(exports) { + +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + ; + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version, loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + ; + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + ; + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.lenth && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + ; + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +SemVer.prototype.inc = function(release) { + switch (release) { + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = -1; + case 'patch': + this.patch++; + this.prerelease = []; + break; + case 'prerelease': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + ; + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); + } + } +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + ; + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + ; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + ; + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + ; + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + ; + comp = replaceCarets(comp, loose); + ; + comp = replaceTildes(comp, loose); + ; + comp = replaceXRanges(comp, loose); + ; + comp = replaceStars(comp, loose); + ; + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + ; + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') + if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr; + else ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0-0'; + } else + if (M === '0') + if (m === '0') ret = '=' + M + '.' + m + '.' + p; + else ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + (+M + 1) + '.0.0-0'; + + ; + return ret; + }); +} + +function replaceXRanges(comp, loose) { + ; + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + ; + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + } + + ; + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + ; + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js.gz b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js.gz new file mode 100644 index 0000000..fe7ba00 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.browser.js.gz differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.js new file mode 100644 index 0000000..5445fc1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.js @@ -0,0 +1,923 @@ +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version, loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.lenth && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +SemVer.prototype.inc = function(release) { + switch (release) { + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = -1; + case 'patch': + this.patch++; + this.prerelease = []; + break; + case 'prerelease': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); + } + } +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') + if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr; + else ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0-0'; + } else + if (M === '0') + if (m === '0') ret = '=' + M + '.' + m + '.' + p; + else ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + else ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + (+M + 1) + '.0.0-0'; + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.min.js new file mode 100644 index 0000000..45e22e0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/semver.min.js @@ -0,0 +1 @@ +!function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[o]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[o]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var $=n++;t[$]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var b=n++;t[b]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:("+t[l]+")"+")?)?)?";var E=n++;t[E]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[p]+")"+")?)?)?";var x=n++;t[x]="^"+t[y]+"\\s*"+t[b]+"$";var R=n++;t[R]="^"+t[y]+"\\s*"+t[E]+"$";var S=n++;t[S]="(?:~>?)";var k=n++;t[k]="(\\s*)"+t[S]+"\\s+";r[k]=new RegExp(t[k],"g");var V="$1~";var I=n++;t[I]="^"+t[S]+t[b]+"$";var A=n++;t[A]="^"+t[S]+t[E]+"$";var C=n++;t[C]="(?:\\^)";var T=n++;t[T]="(\\s*)"+t[C]+"\\s+";r[T]=new RegExp(t[T],"g");var z="$1^";var M=n++;t[M]="^"+t[C]+t[b]+"$";var P=n++;t[P]="^"+t[C]+t[E]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[b]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[b]+")"+"\\s+-\\s+"+"("+t[b]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[E]+")"+"\\s+-\\s+"+"("+t[E]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=-1;case"patch":this.patch++;this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=or;function or(e,r,t){return W(e,r,t)!==0}e.gte=ar;function ar(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=ar(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return''};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return''};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,Er);e=e.replace(r[L],X);e=e.replace(r[k],V);e=e.replace(r[T],z);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=$r(e,r);e=br(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[A]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[M];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0")if(t==="0")s="="+r+"."+t+"."+n+i;else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0"}else if(r==="0")if(t==="0")s="="+r+"."+t+"."+n;else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0";return s})}function $r(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[R]:r[x];return e.replace(n,function(e,r,t,n,i,s){var o=mr(t);var a=o||mr(n);var f=a||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(o)t=0;if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(o){e="*"}else if(a){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function br(e,t){return e.trim().replace(r[O],"")}function Er(e,r,t,n,i,s,o,a,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))a="";else if(mr(u))a="<"+(+f+1)+".0.0-0";else if(mr(c))a="<"+f+"."+(+u+1)+".0-0";else if(l)a="<="+f+"."+u+"."+c+"-"+l;else a="<="+a;return(r+" "+a).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;r=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); + t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); + t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); + }); + t.end(); +}); + +test('\nequality tests', function(t) { + // [version1, version2] + // version1 should be equivalent to version2 + [['1.2.3', 'v1.2.3', true], + ['1.2.3', '=1.2.3', true], + ['1.2.3', 'v 1.2.3', true], + ['1.2.3', '= 1.2.3', true], + ['1.2.3', ' v1.2.3', true], + ['1.2.3', ' =1.2.3', true], + ['1.2.3', ' v 1.2.3', true], + ['1.2.3', ' = 1.2.3', true], + ['1.2.3-0', 'v1.2.3-0', true], + ['1.2.3-0', '=1.2.3-0', true], + ['1.2.3-0', 'v 1.2.3-0', true], + ['1.2.3-0', '= 1.2.3-0', true], + ['1.2.3-0', ' v1.2.3-0', true], + ['1.2.3-0', ' =1.2.3-0', true], + ['1.2.3-0', ' v 1.2.3-0', true], + ['1.2.3-0', ' = 1.2.3-0', true], + ['1.2.3-1', 'v1.2.3-1', true], + ['1.2.3-1', '=1.2.3-1', true], + ['1.2.3-1', 'v 1.2.3-1', true], + ['1.2.3-1', '= 1.2.3-1', true], + ['1.2.3-1', ' v1.2.3-1', true], + ['1.2.3-1', ' =1.2.3-1', true], + ['1.2.3-1', ' v 1.2.3-1', true], + ['1.2.3-1', ' = 1.2.3-1', true], + ['1.2.3-beta', 'v1.2.3-beta', true], + ['1.2.3-beta', '=1.2.3-beta', true], + ['1.2.3-beta', 'v 1.2.3-beta', true], + ['1.2.3-beta', '= 1.2.3-beta', true], + ['1.2.3-beta', ' v1.2.3-beta', true], + ['1.2.3-beta', ' =1.2.3-beta', true], + ['1.2.3-beta', ' v 1.2.3-beta', true], + ['1.2.3-beta', ' = 1.2.3-beta', true], + ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], + ['1.2.3+build', ' = 1.2.3+otherbuild', true], + ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], + ['1.2.3+build', '1.2.3+otherbuild'], + [' v1.2.3+build', '1.2.3+otherbuild'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); + t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); + t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); + t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); + t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); + t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); + t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); + }); + t.end(); +}); + + +test('\nrange tests', function(t) { + // [range, version] + // version should be included by range + [['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0'], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo', true], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97', true], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, + ['~ 1.0', '1.0.2'], + ['~ 1.0.3', '1.0.12'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['1', '1.0.0beta', true], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['<=0.7.x', '0.6.2'], + ['~1.2.1 >=1.2.3', '1.2.3'], + ['~1.2.1 =1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], + ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['>=1.2.1 1.2.3', '1.2.3'], + ['1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.1 >=1.2.3', '1.2.3'], + ['<=1.2.3', '1.2.3-beta'], + ['>1.2', '1.3.0-beta'], + ['>=1.2', '1.2.8'], + ['^1.2.3', '1.8.1'], + ['^1.2.3', '1.2.3-beta'], + ['^0.1.2', '0.1.2'], + ['^0.1', '0.1.2'], + ['^1.2', '1.4.2'], + ['^1.2 ^1', '1.4.2'], + ['^1.2', '1.2.0-pre'], + ['^1.2.3', '1.2.3-pre'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); + }); + t.end(); +}); + +test('\nnegative range tests', function(t) { + // [range, version] + // version should not be included by range + [['1.0.0 - 2.0.0', '2.2.3'], + ['1.0.0', '1.0.1'], + ['>=1.0.0', '0.0.0'], + ['>=1.0.0', '0.0.1'], + ['>=1.0.0', '0.1.0'], + ['>1.0.0', '0.0.1'], + ['>1.0.0', '0.1.0'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['>=0.1.97', 'v0.1.93', true], + ['>=0.1.97', '0.1.93'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['>=0.2.3 || <0.0.1', '0.0.3'], + ['>=0.2.3 || <0.0.1', '0.2.2'], + ['2.x.x', '1.1.3'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.9'], + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['>=1.2', '1.1.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-beta', '0.5.4-alpha'], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['=0.7.x', '0.8.2'], + ['>=0.7.x', '0.6.2'], + ['<=0.7.x', '0.7.2'], + ['<1.2.3', '1.2.3-beta'], + ['=1.2.3', '1.2.3-beta'], + ['>1.2', '1.2.8'], + ['^1.2.3', '2.0.0-alpha'], + ['^1.2.3', '1.2.2'], + ['^1.2', '1.1.9'], + // invalid ranges never satisfied! + ['blerg', '1.2.3'], + ['git+https://user:password0123@github.com/foo', '123.0.0', true], + ['^1.2.3', '2.0.0-pre'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + var found = satisfies(ver, range, loose); + t.ok(!found, ver + ' not satisfied by ' + range); + }); + t.end(); +}); + +test('\nincrement versions test', function(t) { + // [version, inc, result] + // inc(version, inc) -> result + [['1.2.3', 'major', '2.0.0'], + ['1.2.3', 'minor', '1.3.0'], + ['1.2.3', 'patch', '1.2.4'], + ['1.2.3tag', 'major', '2.0.0', true], + ['1.2.3-tag', 'major', '2.0.0'], + ['1.2.3', 'fake', null], + ['fake', 'major', null], + ['1.2.3', 'prerelease', '1.2.3-0'], + ['1.2.3-0', 'prerelease', '1.2.3-1'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], + ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], + ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], + ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], + ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'] + ].forEach(function(v) { + var pre = v[0]; + var what = v[1]; + var wanted = v[2]; + var loose = v[3]; + var found = inc(pre, what, loose); + t.equal(found, wanted, 'inc(' + pre + ', ' + what + ') === ' + wanted); + }); + + t.end(); +}); + +test('\nvalid range test', function(t) { + // [range, result] + // validRange(range) -> result + // translate ranges into their canonical form + [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], + ['1.0.0', '1.0.0'], + ['>=*', '>=0.0.0-0'], + ['', '*'], + ['*', '*'], + ['*', '*'], + ['>=1.0.0', '>=1.0.0'], + ['>1.0.0', '>1.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['1', '>=1.0.0-0 <2.0.0-0'], + ['<=2.0.0', '<=2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<2.0.0', '<2.0.0-0'], + ['<2.0.0', '<2.0.0-0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['< 2.0.0', '<2.0.0-0'], + ['< 2.0.0', '<2.0.0-0'], + ['>=0.1.97', '>=0.1.97'], + ['>=0.1.97', '>=0.1.97'], + ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['||', '||'], + ['2.x.x', '>=2.0.0-0 <3.0.0-0'], + ['1.2.x', '>=1.2.0-0 <1.3.0-0'], + ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['x', '*'], + ['2.*.*', '>=2.0.0-0 <3.0.0-0'], + ['1.2.*', '>=1.2.0-0 <1.3.0-0'], + ['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['*', '*'], + ['2', '>=2.0.0-0 <3.0.0-0'], + ['2.3', '>=2.3.0-0 <2.4.0-0'], + ['~2.4', '>=2.4.0-0 <2.5.0-0'], + ['~2.4', '>=2.4.0-0 <2.5.0-0'], + ['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], + ['~1', '>=1.0.0-0 <2.0.0-0'], + ['~>1', '>=1.0.0-0 <2.0.0-0'], + ['~> 1', '>=1.0.0-0 <2.0.0-0'], + ['~1.0', '>=1.0.0-0 <1.1.0-0'], + ['~ 1.0', '>=1.0.0-0 <1.1.0-0'], + ['^0', '>=0.0.0-0 <1.0.0-0'], + ['^ 1', '>=1.0.0-0 <2.0.0-0'], + ['^0.1', '>=0.1.0-0 <0.2.0-0'], + ['^1.0', '>=1.0.0-0 <2.0.0-0'], + ['^1.2', '>=1.2.0-0 <2.0.0-0'], + ['^0.0.1', '=0.0.1'], + ['^0.0.1-beta', '=0.0.1-beta'], + ['^0.1.2', '>=0.1.2-0 <0.2.0-0'], + ['^1.2.3', '>=1.2.3-0 <2.0.0-0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'], + ['<1', '<1.0.0-0'], + ['< 1', '<1.0.0-0'], + ['>=1', '>=1.0.0-0'], + ['>= 1', '>=1.0.0-0'], + ['<1.2', '<1.2.0-0'], + ['< 1.2', '<1.2.0-0'], + ['1', '>=1.0.0-0 <2.0.0-0'], + ['>01.02.03', '>1.2.3', true], + ['>01.02.03', null], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], + ['~1.2.3beta', null], + ['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0'] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var loose = v[2]; + var found = validRange(pre, loose); + + t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); + }); + + t.end(); +}); + +test('\ncomparators test', function(t) { + // [range, comparators] + // turn range into a set of individual comparators + [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], + ['1.0.0', [['1.0.0']]], + ['>=*', [['>=0.0.0-0']]], + ['', [['']]], + ['*', [['']]], + ['*', [['']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['1', [['>=1.0.0-0', '<2.0.0-0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<2.0.0', [['<2.0.0-0']]], + ['<2.0.0', [['<2.0.0-0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['< 2.0.0', [['<2.0.0-0']]], + ['<\t2.0.0', [['<2.0.0-0']]], + ['>=0.1.97', [['>=0.1.97']]], + ['>=0.1.97', [['>=0.1.97']]], + ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['||', [[''], ['']]], + ['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], + ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['x', [['']]], + ['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], + ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['*', [['']]], + ['2', [['>=2.0.0-0', '<3.0.0-0']]], + ['2.3', [['>=2.3.0-0', '<2.4.0-0']]], + ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], + ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], + ['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], + ['~1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~>1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], + ['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], + ['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], + ['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], + ['<1', [['<1.0.0-0']]], + ['< 1', [['<1.0.0-0']]], + ['>=1', [['>=1.0.0-0']]], + ['>= 1', [['>=1.0.0-0']]], + ['<1.2', [['<1.2.0-0']]], + ['< 1.2', [['<1.2.0-0']]], + ['1', [['>=1.0.0-0', '<2.0.0-0']]], + ['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], + ['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0-0']]] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var found = toComparators(v[0]); + var jw = JSON.stringify(wanted); + t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); + }); + + t.end(); +}); + +test('\nstrict vs loose version numbers', function(t) { + [['=1.2.3', '1.2.3'], + ['01.02.03', '1.2.3'], + ['1.2.3-beta.01', '1.2.3-beta.1'], + [' =1.2.3', '1.2.3'], + ['1.2.3foo', '1.2.3-foo'] + ].forEach(function(v) { + var loose = v[0]; + var strict = v[1]; + t.throws(function() { + new SemVer(loose); + }); + var lv = new SemVer(loose, true); + t.equal(lv.version, strict); + t.ok(eq(loose, strict, true)); + t.throws(function() { + eq(loose, strict); + }); + t.throws(function() { + new SemVer(strict).compare(loose); + }); + }); + t.end(); +}); + +test('\nstrict vs loose ranges', function(t) { + [['>=01.02.03', '>=1.2.3'], + ['~1.02.03beta', '>=1.2.3-beta <1.3.0-0'] + ].forEach(function(v) { + var loose = v[0]; + var comps = v[1]; + t.throws(function() { + new Range(loose); + }); + t.equal(new Range(loose, true).range, comps); + }); + t.end(); +}); + +test('\nmax satisfying', function(t) { + [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], + [['1.2.4', '1.2.3'], '1.2', '1.2.4'], + [['1.2.3','1.2.4','1.2.5','1.2.6'], '~1.2.3', '1.2.6'], + [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] + ].forEach(function(v) { + var versions = v[0]; + var range = v[1]; + var expect = v[2]; + var loose = v[3]; + var actual = semver.maxSatisfying(versions, range, loose); + t.equal(actual, expect); + }); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/test/no-module.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/test/no-module.js new file mode 100644 index 0000000..96d1cd1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/semver/test/no-module.js @@ -0,0 +1,19 @@ +var tap = require('tap'); +var test = tap.test; + +test('no module system', function(t) { + var fs = require('fs'); + var vm = require('vm'); + var head = fs.readFileSync(require.resolve('../head.js'), 'utf8'); + var src = fs.readFileSync(require.resolve('../'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js'), 'utf8'); + vm.runInThisContext(head + src + foot, 'semver.js'); + + // just some basic poking to see if it did some stuff + t.type(global.semver, 'object'); + t.type(global.semver.SemVer, 'function'); + t.type(global.semver.Range, 'function'); + t.ok(global.semver.satisfies('1.2.3', '1.2')); + t.end(); +}); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/package.json new file mode 100644 index 0000000..a68a88d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/package.json @@ -0,0 +1,55 @@ +{ + "name": "stringify-object", + "version": "0.1.8", + "description": "Stringify an object/array like JSON.stringify just without all the double-quotes", + "keywords": [ + "object", + "stringify", + "pretty", + "print", + "dump", + "format" + ], + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "main": "stringify-object.js", + "repository": { + "type": "git", + "url": "git://github.com/yeoman/stringify-object.git" + }, + "scripts": { + "test": "mocha && phantomjs node_modules/mocha-phantomjs/lib/mocha-phantomjs.coffee test/test.html" + }, + "devDependencies": { + "mocha": "*", + "chai": "*", + "phantomjs": "~1.9.0", + "mocha-phantomjs": "2.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "licenses": [ + { + "type": "BSD" + } + ], + "files": [ + "stringify-object.js" + ], + "readme": "# stringify-object [![Build Status](https://secure.travis-ci.org/yeoman/stringify-object.png?branch=master)](http://travis-ci.org/yeoman/stringify-object)\n\n> Stringify an object/array like JSON.stringify just without all the double-quotes.\n\nUseful for when you want to get the string representation of an object in a formatted way.\n\nIt also handles circular references and let's you specify quote type.\n\n\n## Install\n\nDownload [manually](https://github.com/yeoman/stringify-object/releases) or with a package-manager.\n\n#### [npm](https://npmjs.org/package/stringify-object)\n\n```\nnpm install --save stringify-object\n```\n\n#### [Bower](http://bower.io)\n\n```\nbower install --save stringify-object\n```\n\n#### [Component](https://github.com/component/component)\n\n```\ncomponent install yeoman/stringify-object\n```\n\n\n## Example\n\n### Node.js\n\n```js\nvar stringifyObject = require('stringify-object');\n```\n\n### Browser\n\n```html\n\n```\n\n### Usage\n\n```js\nvar obj = {\n foo: 'bar',\n 'arr': [1, 2, 3],\n nested: { hello: \"world\" }\n};\n\nvar pretty = stringifyObject(obj, {\n indent: ' ',\n singleQuotes: false\n});\n\nconsole.log(pretty);\n/*\n{\n foo: \"bar\",\n arr: [1, 2, 3],\n nested: {\n hello: \"world\"\n }\n}\n*/\n```\n\n\n## API\n\n### stringifyObject(object, [options])\n\nAccepts an object to stringify and optionally an option object. Circular references will be replaced with `null`.\n\n#### options\n\n##### indent\n\nType: `String` \nDefault: `'\\t'`\n\nChoose the indentation you prefer.\n\n##### singleQuotes\n\nType: `Boolean` \nDefault: `true`\n\nSet to false to get double-quoted strings.\n\n\n## License\n\n[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google\n", + "readmeFilename": "readme.md", + "bugs": { + "url": "https://github.com/yeoman/stringify-object/issues" + }, + "homepage": "https://github.com/yeoman/stringify-object", + "_id": "stringify-object@0.1.8", + "dist": { + "shasum": "463348f38fdcd4fec1c011084c24a59ac653c1ee" + }, + "_from": "stringify-object@~0.1.4", + "_resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/readme.md new file mode 100644 index 0000000..2e8547d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/readme.md @@ -0,0 +1,99 @@ +# stringify-object [![Build Status](https://secure.travis-ci.org/yeoman/stringify-object.png?branch=master)](http://travis-ci.org/yeoman/stringify-object) + +> Stringify an object/array like JSON.stringify just without all the double-quotes. + +Useful for when you want to get the string representation of an object in a formatted way. + +It also handles circular references and let's you specify quote type. + + +## Install + +Download [manually](https://github.com/yeoman/stringify-object/releases) or with a package-manager. + +#### [npm](https://npmjs.org/package/stringify-object) + +``` +npm install --save stringify-object +``` + +#### [Bower](http://bower.io) + +``` +bower install --save stringify-object +``` + +#### [Component](https://github.com/component/component) + +``` +component install yeoman/stringify-object +``` + + +## Example + +### Node.js + +```js +var stringifyObject = require('stringify-object'); +``` + +### Browser + +```html + +``` + +### Usage + +```js +var obj = { + foo: 'bar', + 'arr': [1, 2, 3], + nested: { hello: "world" } +}; + +var pretty = stringifyObject(obj, { + indent: ' ', + singleQuotes: false +}); + +console.log(pretty); +/* +{ + foo: "bar", + arr: [1, 2, 3], + nested: { + hello: "world" + } +} +*/ +``` + + +## API + +### stringifyObject(object, [options]) + +Accepts an object to stringify and optionally an option object. Circular references will be replaced with `null`. + +#### options + +##### indent + +Type: `String` +Default: `'\t'` + +Choose the indentation you prefer. + +##### singleQuotes + +Type: `Boolean` +Default: `true` + +Set to false to get double-quoted strings. + + +## License + +[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/stringify-object.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/stringify-object.js new file mode 100644 index 0000000..3172928 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/stringify-object/stringify-object.js @@ -0,0 +1,90 @@ +/*global window */ +(function () { + 'use strict'; + + function isObject(val) { + return val === Object(val); + } + + function isEmpty(val) { + if (val === undefined || val === null) { + return true; + } + + if (Array.isArray(val) || typeof val === 'string') { + return val.length === 0; + } + + for (var key in val) { + if (Object.prototype.hasOwnProperty.call(val, key)) { + return false; + } + } + + return true; + } + + function stringifyObject (val, opts, pad) { + var cache = []; + + return (function stringify(val, opts, pad) { + var objKeys; + opts = opts || {}; + opts.indent = opts.indent || '\t'; + pad = pad || ''; + + if (typeof val === 'number' || + typeof val === 'boolean' || + val === null || + val === undefined) { + return val; + } + + if (Array.isArray(val)) { + if (isEmpty(val)) { + return '[]'; + } + + return '[\n' + val.map(function (el, i) { + var eol = val.length - 1 === i ? '\n' : ',\n'; + return pad + opts.indent + stringify(el, opts, pad + opts.indent) + eol; + }).join('') + pad + ']'; + } + + if (isObject(val)) { + if (cache.indexOf(val) !== -1) { + return null; + } + + if (isEmpty(val)) { + return '{}'; + } + + cache.push(val); + + objKeys = Object.keys(val); + + return '{\n' + objKeys.map(function (el, i) { + var eol = objKeys.length - 1 === i ? '\n' : ',\n'; + // quote key if the first character is not `a-z` or + // the rest contains something other than `a-z0-9_` + // TODO: Find out why this don't work: `/^[^a-z_\$]|\W+/ig` + var key = /^[^a-z_]|\W+/ig.test(el) && el[0] !== '$' ? stringify(el, opts) : el; + return pad + opts.indent + key + ': ' + stringify(val[el], opts, pad + opts.indent) + eol; + }).join('') + pad + '}'; + } + + if (opts.singleQuotes === false) { + return '"' + val.replace(/"/g, '\\\"') + '"'; + } else { + return "'" + val.replace(/'/g, "\\\'") + "'"; + } + })(val, opts, pad); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = stringifyObject; + } else { + window.stringifyObject = stringifyObject; + } +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/chalk.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/chalk.js new file mode 100644 index 0000000..d4887e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/chalk.js @@ -0,0 +1,64 @@ +'use strict'; +var ansi = require('ansi-styles'); +var defineProps = Object.defineProperties; + +var styles = (function () { + var ret = {}; + + Object.keys(ansi).forEach(function (key) { + var code = ansi[key]; + ret[key] = { + enumerable: true, + get: function () { + this._styles.push(code); + return this; + } + }; + }); + + return ret; +})(); + +var chalk = module.exports = defineProps({}, init()); + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + var code = styles[name]; + + ret[name] = { + enumerable: true, + get: function () { + var obj = defineProps(function self(str) { + if (!chalk.enabled) { + return str; + } + + return self._styles.reduce(function (str, code) { + return code + (str || ''); + }, str) + ansi['reset']; + }, styles); + + obj._styles = []; + + return obj[name]; + } + } + }); + + return ret; +} + +chalk.styles = ansi; + +chalk.stripColor = function (str) { + return str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, ''); +}; + +chalk.supportsColor = require('has-color'); + +// detect mode if not set manually +if (chalk.enabled === undefined) { + chalk.enabled = chalk.supportsColor; +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js new file mode 100644 index 0000000..26dc10e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js @@ -0,0 +1,31 @@ +'use strict'; +module.exports = { + reset: '\x1b[0m', + bold: '\x1b[1m', + italic: '\x1b[3m', + underline: '\x1b[4m', + blink: '\x1b[5m', + inverse: '\x1b[7m', + strikethrough: '\x1b[9m', + + black: '\x1b[30m', + red: '\x1b[31m', + green: '\x1b[32m', + yellow: '\x1b[33m', + blue: '\x1b[34m', + magenta: '\x1b[35m', + cyan: '\x1b[36m', + white: '\x1b[37m', + default: '\x1b[39m', + gray: '\x1B[90m', + + bgBlack: '\x1b[40m', + bgRed: '\x1b[41m', + bgGreen: '\x1b[42m', + bgYellow: '\x1b[43m', + bgBlue: '\x1b[44m', + bgMagenta: '\x1b[45m', + bgCyan: '\x1b[46m', + bgWhite: '\x1b[47m', + bgDefault: '\x1b[49m' +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..8dfaf88 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,58 @@ +{ + "name": "ansi-styles", + "version": "0.1.2", + "description": "ANSI escape codes for colorizing strings in the terminal", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "homepage": "https://github.com/sindresorhus/ansi-styles", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-styles/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "ansi-styles.js" + ], + "main": "ansi-styles", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/ansi-styles.git" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles)\n\n> ANSI escape codes for colorizing strings in the terminal.\n\nYou probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings.\n\n![screenshot](screenshot.png)\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles`\n\n\n## Example\n\nGenerates the above screenshot.\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green + 'Styles:' + ansi.reset + '\\n');\n\nObject.keys(ansi).forEach(function (el) {\n\tvar style = ansi[el];\n\n\tif (/^bg[^B]/.test(el)) {\n\t\tstyle = ansi.black + style;\n\t}\n\n\tprocess.stdout.write(style + el + ansi.reset + ' ');\n});\n```\n\n\n## Styles\n\n### General\n\n- reset\n- bold\n- italic\n- underline\n- blink\n- inverse\n- strikethrough\n\n### Text colors\n\n- black\n- red\n- green\n- yellow\n- blue\n- magenta\n- cyan\n- white\n- default\n- gray\n\n### Background colors\n\n- bgBlack\n- bgRed\n- bgGreen\n- bgYellow\n- bgBlue\n- bgMagenta\n- bgCyan\n- bgWhite\n- bgDefault\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "ansi-styles@0.1.2", + "_from": "ansi-styles@~0.1.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..8be91a9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,76 @@ +# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles) + +> ANSI escape codes for colorizing strings in the terminal. + +You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. + +![screenshot](screenshot.png) + + +## Install + +Install with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles` + + +## Example + +Generates the above screenshot. + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green + 'Styles:' + ansi.reset + '\n'); + +Object.keys(ansi).forEach(function (el) { + var style = ansi[el]; + + if (/^bg[^B]/.test(el)) { + style = ansi.black + style; + } + + process.stdout.write(style + el + ansi.reset + ' '); +}); +``` + + +## Styles + +### General + +- reset +- bold +- italic +- underline +- blink +- inverse +- strikethrough + +### Text colors + +- black +- red +- green +- yellow +- blue +- magenta +- cyan +- white +- default +- gray + +### Background colors + +- bgBlack +- bgRed +- bgGreen +- bgYellow +- bgBlue +- bgMagenta +- bgCyan +- bgWhite +- bgDefault + + +## License + +MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/has-color.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/has-color.js new file mode 100644 index 0000000..27316b1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/has-color.js @@ -0,0 +1,24 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (!process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + return /^screen|^xterm|color|ansi|cygwin|linux/i.test(process.env.TERM); +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/package.json new file mode 100644 index 0000000..d60b2d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/package.json @@ -0,0 +1,59 @@ +{ + "name": "has-color", + "version": "0.1.4", + "description": "Detect whether a terminal supports color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "has-color.js" + ], + "main": "has-color", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# has-color [![Build Status](https://secure.travis-ci.org/sindresorhus/has-color.png?branch=master)](http://travis-ci.org/sindresorhus/has-color)\n\n> Detect whether a terminal supports color.\n\nUsed in the terminal color module [chalk](https://github.com/sindresorhus/chalk).\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/has-color): `npm install --save has-color`\n\n\n## Example\n\n```js\nvar hasColor = require('has-color');\n\nif (hasColor) {\n\tconsole.log('Terminal supports color.');\n}\n```\n\nIt obeys the CLI flags `--color` and `--no-color`.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "has-color@0.1.4", + "dist": { + "shasum": "d1dadeea5b9e8b446bf08603532333710c95a290" + }, + "_from": "has-color@~0.1.0", + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.4.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/readme.md new file mode 100644 index 0000000..0918c85 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/node_modules/has-color/readme.md @@ -0,0 +1,28 @@ +# has-color [![Build Status](https://secure.travis-ci.org/sindresorhus/has-color.png?branch=master)](http://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +Install with [npm](https://npmjs.org/package/has-color): `npm install --save has-color` + + +## Example + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the CLI flags `--color` and `--no-color`. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/package.json new file mode 100644 index 0000000..8bd5907 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/package.json @@ -0,0 +1,61 @@ +{ + "name": "chalk", + "version": "0.1.1", + "description": "Terminal string styling done right", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "homepage": "https://github.com/sindresorhus/chalk", + "bugs": { + "url": "https://github.com/sindresorhus/chalk/issues" + }, + "license": "MIT", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "files": [ + "chalk.js" + ], + "main": "chalk", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/chalk.git" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "has-color": "~0.1.0", + "ansi-styles": "~0.1.0" + }, + "devDependencies": { + "mocha": "~1.12.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "readme": "# chalk [![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk)\n\n> Terminal string styling done right.\n\n[colors.js](https://github.com/Marak/colors.js) is currently the most popular coloring module, but it has serious deficiencies like extending String.prototype which causes all kinds of problems. Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![screenshot](screenshot.png)\n\n\n## Why\n\n- **Doesn't extend String.prototype**\n- Expressive API\n- Auto-detects color support\n- Actively maintained\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/chalk): `npm install --save chalk`\n\n\n## Example\n\nChalk comes with an easy to use composable API where you just chain the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nconsole.log(chalk.blue('Hello world!'));\n\n// combine styled and normal strings\nconsole.log(chalk.blue('Hello') + 'World' + chalk.red('!'));\n\n// compose multiple styles using the chainable API\nconsole.log(chalk.blue.bgRed.bold('Hello world!'));\n```\n\nYou can easily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\n\n## API\n\n### chalk.\\\\[.\\...\\](*string*)\n\nChain [styles](#styles) and call the last one as a method with a string argument.\n\n\n### chalk.enabled\n\nColor support is automatically detected, but you can override it.\n\n### chalk.supportsColor\n\nDetect whether the terminal [supports color](https://github.com/sindresorhus/has-color).\n\nCan be overridden by the user with the flags `--color` and `--no-color`.\n\nUsed internally and handled for you, but exposed for convenience.\n\n### chalk.styles\n\nExposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles).\n\n```js\nvar chalk = require('chalk');\nconsole.log(chalk.styles.red);\n//=> \\x1b[31m\n```\n\n### chalk.stripColor(*string*)\n\nStrip color from a string.\n\n\n## Styles\n\n### General\n\n- reset\n- bold\n- italic\n- underline\n- blink\n- inverse\n- strikethrough\n\n### Text colors\n\n- black\n- red\n- green\n- yellow\n- blue\n- magenta\n- cyan\n- white\n- default\n- gray\n\n### Background colors\n\n- bgBlack\n- bgRed\n- bgGreen\n- bgYellow\n- bgBlue\n- bgMagenta\n- bgCyan\n- bgWhite\n- bgDefault\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "chalk@0.1.1", + "_from": "chalk@~0.1.1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/readme.md new file mode 100644 index 0000000..35c61d0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/node_modules/chalk/readme.md @@ -0,0 +1,125 @@ +# chalk [![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk) + +> Terminal string styling done right. + +[colors.js](https://github.com/Marak/colors.js) is currently the most popular coloring module, but it has serious deficiencies like extending String.prototype which causes all kinds of problems. Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![screenshot](screenshot.png) + + +## Why + +- **Doesn't extend String.prototype** +- Expressive API +- Auto-detects color support +- Actively maintained + + +## Install + +Install with [npm](https://npmjs.org/package/chalk): `npm install --save chalk` + + +## Example + +Chalk comes with an easy to use composable API where you just chain the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +console.log(chalk.blue('Hello world!')); + +// combine styled and normal strings +console.log(chalk.blue('Hello') + 'World' + chalk.red('!')); + +// compose multiple styles using the chainable API +console.log(chalk.blue.bgRed.bold('Hello world!')); +``` + +You can easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + + +## API + +### chalk.\\[.\...\](*string*) + +Chain [styles](#styles) and call the last one as a method with a string argument. + + +### chalk.enabled + +Color support is automatically detected, but you can override it. + +### chalk.supportsColor + +Detect whether the terminal [supports color](https://github.com/sindresorhus/has-color). + +Can be overridden by the user with the flags `--color` and `--no-color`. + +Used internally and handled for you, but exposed for convenience. + +### chalk.styles + +Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles). + +```js +var chalk = require('chalk'); +console.log(chalk.styles.red); +//=> \x1b[31m +``` + +### chalk.stripColor(*string*) + +Strip color from a string. + + +## Styles + +### General + +- reset +- bold +- italic +- underline +- blink +- inverse +- strikethrough + +### Text colors + +- black +- red +- green +- yellow +- blue +- magenta +- cyan +- white +- default +- gray + +### Background colors + +- bgBlack +- bgRed +- bgGreen +- bgYellow +- bgBlue +- bgMagenta +- bgCyan +- bgWhite +- bgDefault + + +## License + +MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/package.json new file mode 100644 index 0000000..43636f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/package.json @@ -0,0 +1,53 @@ +{ + "name": "sudo-block", + "version": "0.2.1", + "description": "Block users from running your tool with root permissions", + "keywords": [ + "sudo", + "root", + "permissions", + "uid", + "block", + "prevent", + "stop" + ], + "homepage": "https://github.com/sindresorhus/sudo-block", + "bugs": { + "url": "https://github.com/sindresorhus/sudo-block/issues" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "main": "sudo-block.js", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/sudo-block.git" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "chalk": "~0.1.1" + }, + "devDependencies": { + "mocha": "~1.12.0", + "sinon": "~1.7.3" + }, + "engines": { + "node": ">=0.8.0" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "files": [ + "sudo-block.js" + ], + "readme": "# sudo-block [![Build Status](https://secure.travis-ci.org/sindresorhus/sudo-block.png?branch=master)](http://travis-ci.org/sindresorhus/sudo-block)\n\nBlock users from running your tool with root permissions.\n\n\n## Install\n\nInstall with [npm](https://npmjs.org): `npm install --save sudo-block`\n\n\n## Example\n\n```js\nvar sudoBlock = require('sudo-block');\nsudoBlock('my-module');\n```\n\nWhen the above file is ran with root permissions it will exit and show an error message telling the user how to fix the problem so they don't have to run it with `sudo`.\n\n\n## API\n\n### sudoBlock(options)\n\nOptions is either a string specifying the *package name* or an object with these\nkeys:\n\n- `packageName`: name of the package the error message is printed for\n- `message`: a custom error message\n\n\n### sudoBlock.isRoot\n\nBoolean indicating whether the current user is `root`.\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "_id": "sudo-block@0.2.1", + "_from": "sudo-block@~0.2.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/readme.md new file mode 100644 index 0000000..f4eac6e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/readme.md @@ -0,0 +1,39 @@ +# sudo-block [![Build Status](https://secure.travis-ci.org/sindresorhus/sudo-block.png?branch=master)](http://travis-ci.org/sindresorhus/sudo-block) + +Block users from running your tool with root permissions. + + +## Install + +Install with [npm](https://npmjs.org): `npm install --save sudo-block` + + +## Example + +```js +var sudoBlock = require('sudo-block'); +sudoBlock('my-module'); +``` + +When the above file is ran with root permissions it will exit and show an error message telling the user how to fix the problem so they don't have to run it with `sudo`. + + +## API + +### sudoBlock(options) + +Options is either a string specifying the *package name* or an object with these +keys: + +- `packageName`: name of the package the error message is printed for +- `message`: a custom error message + + +### sudoBlock.isRoot + +Boolean indicating whether the current user is `root`. + + +## License + +MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/sudo-block.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/sudo-block.js new file mode 100644 index 0000000..85c66f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/sudo-block/sudo-block.js @@ -0,0 +1,27 @@ +'use strict'; +var chalk = require('chalk'); + +function defaultMessage(packageName) { + return chalk.red('You are running ') + chalk.red.bold(packageName) + chalk.red(' with root permissions.'); +} + +function block(options) { + var packageName = typeof options === 'string' ? options : options.packageName; + var message = options.message; + console.error(message || defaultMessage(packageName)); + process.exit(1); +} + +function sudoBlock(options) { + if (sudoBlock.isRoot) { + block(options); + } +} + +Object.defineProperty(sudoBlock, 'isRoot', { + get: function () { + return process.getuid && process.getuid() === 0; + } +}); + +module.exports = sudoBlock; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.npmignore new file mode 100644 index 0000000..c167ad5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.npmignore @@ -0,0 +1,5 @@ +.*.swp +node_modules +examples/extract/ +test/tmp/ +test/fixtures/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.travis.yml new file mode 100644 index 0000000..2d26206 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.6 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/LICENCE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/LICENCE new file mode 100644 index 0000000..74489e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/LICENCE @@ -0,0 +1,25 @@ +Copyright (c) Isaac Z. Schlueter +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/README.md new file mode 100644 index 0000000..5bcc82c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/README.md @@ -0,0 +1,46 @@ +# node-tar + +Tar for Node.js. + +[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/) + +## API + +See `examples/` for usage examples. + +### var tar = require('tar') + +Returns an object with `.Pack`, `.Extract` and `.Parse` methods. + +### tar.Pack([properties]) + +Returns a through stream. Use +[fstream](https://npmjs.org/package/fstream) to write files into the +pack stream and you will receive tar archive data from the pack +stream. + +The optional `properties` object are used to set properties in the tar +'Global Extended Header'. + +### tar.Extract([options]) + +Returns a through stream. Write tar data to the stream and the files +in the tarball will be extracted onto the filesystem. + +`options` can be: + +```js +{ + path: '/path/to/extract/tar/into', + strip: 0, // how many path segments to strip from the root when extracting +} +``` + +`options` also get passed to the `fstream.Writer` instance that `tar` +uses internally. + +### tar.Parse() + +Returns a writable stream. Write tar data to it and it will emit +`entry` events for each entry parsed from the tarball. This is used by +`tar.Extract`. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/extracter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/extracter.js new file mode 100644 index 0000000..e150abf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/extracter.js @@ -0,0 +1,11 @@ +var tar = require("../tar.js") + , fs = require("fs") + +fs.createReadStream(__dirname + "/../test/fixtures/c.tar") + .pipe(tar.Extract({ path: __dirname + "/extract" })) + .on("error", function (er) { + console.error("error here") + }) + .on("end", function () { + console.error("done") + }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/reader.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/reader.js new file mode 100644 index 0000000..39f3f08 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/examples/reader.js @@ -0,0 +1,36 @@ +var tar = require("../tar.js") + , fs = require("fs") + +fs.createReadStream(__dirname + "/../test/fixtures/c.tar") + .pipe(tar.Parse()) + .on("extendedHeader", function (e) { + console.error("extended pax header", e.props) + e.on("end", function () { + console.error("extended pax fields:", e.fields) + }) + }) + .on("ignoredEntry", function (e) { + console.error("ignoredEntry?!?", e.props) + }) + .on("longLinkpath", function (e) { + console.error("longLinkpath entry", e.props) + e.on("end", function () { + console.error("value=%j", e.body.toString()) + }) + }) + .on("longPath", function (e) { + console.error("longPath entry", e.props) + e.on("end", function () { + console.error("value=%j", e.body.toString()) + }) + }) + .on("entry", function (e) { + console.error("entry", e.props) + e.on("data", function (c) { + console.error(" >>>" + c.toString().replace(/\n/g, "\\n")) + }) + e.on("end", function () { + console.error(" << 0 + return !this._needDrain +} + +EntryWriter.prototype.end = function (c) { + // console.error(".. ew end") + if (c) this._buffer.push(c) + this._buffer.push(EOF) + this._ended = true + this._process() + this._needDrain = this._buffer.length > 0 +} + +EntryWriter.prototype.pause = function () { + // console.error(".. ew pause") + this._paused = true + this.emit("pause") +} + +EntryWriter.prototype.resume = function () { + // console.error(".. ew resume") + this._paused = false + this.emit("resume") + this._process() +} + +EntryWriter.prototype.add = function (entry) { + // console.error(".. ew add") + if (!this.parent) return this.emit("error", new Error("no parent")) + + // make sure that the _header and such is emitted, and clear out + // the _currentEntry link on the parent. + if (!this._ended) this.end() + + return this.parent.add(entry) +} + +EntryWriter.prototype._header = function () { + // console.error(".. ew header") + if (this._didHeader) return + this._didHeader = true + + var headerBlock = TarHeader.encode(this.props) + + if (this.props.needExtended && !this._meta) { + var me = this + + ExtendedHeaderWriter = ExtendedHeaderWriter || + require("./extended-header-writer.js") + + ExtendedHeaderWriter(this.props) + .on("data", function (c) { + me.emit("data", c) + }) + .on("error", function (er) { + me.emit("error", er) + }) + .end() + } + + // console.error(".. .. ew headerBlock emitting") + this.emit("data", headerBlock) + this.emit("header") +} + +EntryWriter.prototype._process = function () { + // console.error(".. .. ew process") + if (!this._didHeader && !this._meta) { + this._header() + } + + if (this._paused || this._processing) { + // console.error(".. .. .. paused=%j, processing=%j", this._paused, this._processing) + return + } + + this._processing = true + + var buf = this._buffer + for (var i = 0; i < buf.length; i ++) { + // console.error(".. .. .. i=%d", i) + + var c = buf[i] + + if (c === EOF) this._stream.end() + else this._stream.write(c) + + if (this._paused) { + // console.error(".. .. .. paused mid-emission") + this._processing = false + if (i < buf.length) { + this._needDrain = true + this._buffer = buf.slice(i + 1) + } + return + } + } + + // console.error(".. .. .. emitted") + this._buffer.length = 0 + this._processing = false + + // console.error(".. .. .. emitting drain") + this.emit("drain") +} + +EntryWriter.prototype.destroy = function () {} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/entry.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/entry.js new file mode 100644 index 0000000..4af5c41 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/entry.js @@ -0,0 +1,213 @@ +// A passthrough read/write stream that sets its properties +// based on a header, extendedHeader, and globalHeader +// +// Can be either a file system object of some sort, or +// a pax/ustar metadata entry. + +module.exports = Entry + +var TarHeader = require("./header.js") + , tar = require("../tar") + , assert = require("assert").ok + , Stream = require("stream").Stream + , inherits = require("inherits") + , fstream = require("fstream").Abstract + +function Entry (header, extended, global) { + Stream.call(this) + this.readable = true + this.writable = true + + this._needDrain = false + this._paused = false + this._reading = false + this._ending = false + this._ended = false + this._remaining = 0 + this._queue = [] + this._index = 0 + this._queueLen = 0 + + this._read = this._read.bind(this) + + this.props = {} + this._header = header + this._extended = extended || {} + + // globals can change throughout the course of + // a file parse operation. Freeze it at its current state. + this._global = {} + var me = this + Object.keys(global || {}).forEach(function (g) { + me._global[g] = global[g] + }) + + this._setProps() +} + +inherits(Entry, Stream) + +Entry.prototype.write = function (c) { + if (this._ending) this.error("write() after end()", null, true) + if (this._remaining === 0) { + this.error("invalid bytes past eof") + } + + // often we'll get a bunch of \0 at the end of the last write, + // since chunks will always be 512 bytes when reading a tarball. + if (c.length > this._remaining) { + c = c.slice(0, this._remaining) + } + this._remaining -= c.length + + // put it on the stack. + var ql = this._queueLen + this._queue.push(c) + this._queueLen ++ + + this._read() + + // either paused, or buffered + if (this._paused || ql > 0) { + this._needDrain = true + return false + } + + return true +} + +Entry.prototype.end = function (c) { + if (c) this.write(c) + this._ending = true + this._read() +} + +Entry.prototype.pause = function () { + this._paused = true + this.emit("pause") +} + +Entry.prototype.resume = function () { + // console.error(" Tar Entry resume", this.path) + this.emit("resume") + this._paused = false + this._read() + return this._queueLen - this._index > 1 +} + + // This is bound to the instance +Entry.prototype._read = function () { + // console.error(" Tar Entry _read", this.path) + + if (this._paused || this._reading || this._ended) return + + // set this flag so that event handlers don't inadvertently + // get multiple _read() calls running. + this._reading = true + + // have any data to emit? + while (this._index < this._queueLen && !this._paused) { + var chunk = this._queue[this._index ++] + this.emit("data", chunk) + } + + // check if we're drained + if (this._index >= this._queueLen) { + this._queue.length = this._queueLen = this._index = 0 + if (this._needDrain) { + this._needDrain = false + this.emit("drain") + } + if (this._ending) { + this._ended = true + this.emit("end") + } + } + + // if the queue gets too big, then pluck off whatever we can. + // this should be fairly rare. + var mql = this._maxQueueLen + if (this._queueLen > mql && this._index > 0) { + mql = Math.min(this._index, mql) + this._index -= mql + this._queueLen -= mql + this._queue = this._queue.slice(mql) + } + + this._reading = false +} + +Entry.prototype._setProps = function () { + // props = extended->global->header->{} + var header = this._header + , extended = this._extended + , global = this._global + , props = this.props + + // first get the values from the normal header. + var fields = tar.fields + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , val = header[field] + if (typeof val !== "undefined") props[field] = val + } + + // next, the global header for this file. + // numeric values, etc, will have already been parsed. + ;[global, extended].forEach(function (p) { + Object.keys(p).forEach(function (f) { + if (typeof p[f] !== "undefined") props[f] = p[f] + }) + }) + + // no nulls allowed in path or linkpath + ;["path", "linkpath"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = props[p].split("\0")[0] + } + }) + + + // set date fields to be a proper date + ;["mtime", "ctime", "atime"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = new Date(props[p] * 1000) + } + }) + + // set the type so that we know what kind of file to create + var type + switch (tar.types[props.type]) { + case "OldFile": + case "ContiguousFile": + type = "File" + break + + case "GNUDumpDir": + type = "Directory" + break + + case undefined: + type = "Unknown" + break + + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + default: + type = tar.types[props.type] + } + + this.type = type + this.path = props.path + this.size = props.size + + // size is special, since it signals when the file needs to end. + this._remaining = props.size +} + +Entry.prototype.warn = fstream.warn +Entry.prototype.error = fstream.error diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header-writer.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header-writer.js new file mode 100644 index 0000000..1728c45 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header-writer.js @@ -0,0 +1,191 @@ + +module.exports = ExtendedHeaderWriter + +var inherits = require("inherits") + , EntryWriter = require("./entry-writer.js") + +inherits(ExtendedHeaderWriter, EntryWriter) + +var tar = require("../tar.js") + , path = require("path") + , TarHeader = require("./header.js") + +// props is the props of the thing we need to write an +// extended header for. +// Don't be shy with it. Just encode everything. +function ExtendedHeaderWriter (props) { + // console.error(">> ehw ctor") + var me = this + + if (!(me instanceof ExtendedHeaderWriter)) { + return new ExtendedHeaderWriter(props) + } + + me.fields = props + + var p = + { path : ("PaxHeader" + path.join("/", props.path || "")) + .replace(/\\/g, "/").substr(0, 100) + , mode : props.mode || 0666 + , uid : props.uid || 0 + , gid : props.gid || 0 + , size : 0 // will be set later + , mtime : props.mtime || Date.now() / 1000 + , type : "x" + , linkpath : "" + , ustar : "ustar\0" + , ustarver : "00" + , uname : props.uname || "" + , gname : props.gname || "" + , devmaj : props.devmaj || 0 + , devmin : props.devmin || 0 + } + + + EntryWriter.call(me, p) + // console.error(">> ehw props", me.props) + me.props = p + + me._meta = true +} + +ExtendedHeaderWriter.prototype.end = function () { + // console.error(">> ehw end") + var me = this + + if (me._ended) return + me._ended = true + + me._encodeFields() + + if (me.props.size === 0) { + // nothing to write! + me._ready = true + me._stream.end() + return + } + + me._stream.write(TarHeader.encode(me.props)) + me.body.forEach(function (l) { + me._stream.write(l) + }) + me._ready = true + + // console.error(">> ehw _process calling end()", me.props) + this._stream.end() +} + +ExtendedHeaderWriter.prototype._encodeFields = function () { + // console.error(">> ehw _encodeFields") + this.body = [] + if (this.fields.prefix) { + this.fields.path = this.fields.prefix + "/" + this.fields.path + this.fields.prefix = "" + } + encodeFields(this.fields, "", this.body, this.fields.noProprietary) + var me = this + this.body.forEach(function (l) { + me.props.size += l.length + }) +} + +function encodeFields (fields, prefix, body, nop) { + // console.error(">> >> ehw encodeFields") + // "%d %s=%s\n", , , + // The length is a decimal number, and includes itself and the \n + // Numeric values are decimal strings. + + Object.keys(fields).forEach(function (k) { + var val = fields[k] + , numeric = tar.numeric[k] + + if (prefix) k = prefix + "." + k + + // already including NODETAR.type, don't need File=true also + if (k === fields.type && val === true) return + + switch (k) { + // don't include anything that's always handled just fine + // in the normal header, or only meaningful in the context + // of nodetar + case "mode": + case "cksum": + case "ustar": + case "ustarver": + case "prefix": + case "basename": + case "dirname": + case "needExtended": + case "block": + case "filter": + return + + case "rdev": + if (val === 0) return + break + + case "nlink": + case "dev": // Truly a hero among men, Creator of Star! + case "ino": // Speak his name with reverent awe! It is: + k = "SCHILY." + k + break + + default: break + } + + if (val && typeof val === "object" && + !Buffer.isBuffer(val)) encodeFields(val, k, body, nop) + else if (val === null || val === undefined) return + else body.push.apply(body, encodeField(k, val, nop)) + }) + + return body +} + +function encodeField (k, v, nop) { + // lowercase keys must be valid, otherwise prefix with + // "NODETAR." + if (k.charAt(0) === k.charAt(0).toLowerCase()) { + var m = k.split(".")[0] + if (!tar.knownExtended[m]) k = "NODETAR." + k + } + + // no proprietary + if (nop && k.charAt(0) !== k.charAt(0).toLowerCase()) { + return [] + } + + if (typeof val === "number") val = val.toString(10) + + var s = new Buffer(" " + k + "=" + v + "\n") + , digits = Math.floor(Math.log(s.length) / Math.log(10)) + 1 + + // console.error("1 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) + + // if adding that many digits will make it go over that length, + // then add one to it. For example, if the string is: + // " foo=bar\n" + // then that's 9 characters. With the "9", that bumps the length + // up to 10. However, this is invalid: + // "10 foo=bar\n" + // but, since that's actually 11 characters, since 10 adds another + // character to the length, and the length includes the number + // itself. In that case, just bump it up again. + if (s.length + digits >= Math.pow(10, digits)) digits += 1 + // console.error("2 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) + + var len = digits + s.length + // console.error("3 s=%j digits=%j s.length=%d len=%d", s.toString(), digits, s.length, len) + var lenBuf = new Buffer("" + len) + if (lenBuf.length + s.length !== len) { + throw new Error("Bad length calculation\n"+ + "len="+len+"\n"+ + "lenBuf="+JSON.stringify(lenBuf.toString())+"\n"+ + "lenBuf.length="+lenBuf.length+"\n"+ + "digits="+digits+"\n"+ + "s="+JSON.stringify(s.toString())+"\n"+ + "s.length="+s.length) + } + + return [lenBuf, s] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header.js new file mode 100644 index 0000000..74f432c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extended-header.js @@ -0,0 +1,140 @@ +// An Entry consisting of: +// +// "%d %s=%s\n", , , +// +// The length is a decimal number, and includes itself and the \n +// \0 does not terminate anything. Only the length terminates the string. +// Numeric values are decimal strings. + +module.exports = ExtendedHeader + +var Entry = require("./entry.js") + , inherits = require("inherits") + , tar = require("../tar.js") + , numeric = tar.numeric + , keyTrans = { "SCHILY.dev": "dev" + , "SCHILY.ino": "ino" + , "SCHILY.nlink": "nlink" } + +function ExtendedHeader () { + Entry.apply(this, arguments) + this.on("data", this._parse) + this.fields = {} + this._position = 0 + this._fieldPos = 0 + this._state = SIZE + this._sizeBuf = [] + this._keyBuf = [] + this._valBuf = [] + this._size = -1 + this._key = "" +} + +inherits(ExtendedHeader, Entry) +ExtendedHeader.prototype._parse = parse + +var s = 0 + , states = ExtendedHeader.states = {} + , SIZE = states.SIZE = s++ + , KEY = states.KEY = s++ + , VAL = states.VAL = s++ + , ERR = states.ERR = s++ + +Object.keys(states).forEach(function (s) { + states[states[s]] = states[s] +}) + +states[s] = null + +// char code values for comparison +var _0 = "0".charCodeAt(0) + , _9 = "9".charCodeAt(0) + , point = ".".charCodeAt(0) + , a = "a".charCodeAt(0) + , Z = "Z".charCodeAt(0) + , a = "a".charCodeAt(0) + , z = "z".charCodeAt(0) + , space = " ".charCodeAt(0) + , eq = "=".charCodeAt(0) + , cr = "\n".charCodeAt(0) + +function parse (c) { + if (this._state === ERR) return + + for ( var i = 0, l = c.length + ; i < l + ; this._position++, this._fieldPos++, i++) { + // console.error("top of loop, size="+this._size) + + var b = c[i] + + if (this._size >= 0 && this._fieldPos > this._size) { + error(this, "field exceeds length="+this._size) + return + } + + switch (this._state) { + case ERR: return + + case SIZE: + // console.error("parsing size, b=%d, rest=%j", b, c.slice(i).toString()) + if (b === space) { + this._state = KEY + // this._fieldPos = this._sizeBuf.length + this._size = parseInt(new Buffer(this._sizeBuf).toString(), 10) + this._sizeBuf.length = 0 + continue + } + if (b < _0 || b > _9) { + error(this, "expected [" + _0 + ".." + _9 + "], got " + b) + return + } + this._sizeBuf.push(b) + continue + + case KEY: + // can be any char except =, not > size. + if (b === eq) { + this._state = VAL + this._key = new Buffer(this._keyBuf).toString() + if (keyTrans[this._key]) this._key = keyTrans[this._key] + this._keyBuf.length = 0 + continue + } + this._keyBuf.push(b) + continue + + case VAL: + // field must end with cr + if (this._fieldPos === this._size - 1) { + // console.error("finished with "+this._key) + if (b !== cr) { + error(this, "expected \\n at end of field") + return + } + var val = new Buffer(this._valBuf).toString() + if (numeric[this._key]) { + val = parseFloat(val) + } + this.fields[this._key] = val + + this._valBuf.length = 0 + this._state = SIZE + this._size = -1 + this._fieldPos = -1 + continue + } + this._valBuf.push(b) + continue + } + } +} + +function error (me, msg) { + msg = "invalid header: " + msg + + "\nposition=" + me._position + + "\nfield position=" + me._fieldPos + + me.error(msg) + me.state = ERR +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extract.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extract.js new file mode 100644 index 0000000..c34a81e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/extract.js @@ -0,0 +1,78 @@ +// give it a tarball and a path, and it'll dump the contents + +module.exports = Extract + +var tar = require("../tar.js") + , fstream = require("fstream") + , inherits = require("inherits") + , path = require("path") + +function Extract (opts) { + if (!(this instanceof Extract)) return new Extract(opts) + tar.Parse.apply(this) + + // have to dump into a directory + opts.type = "Directory" + opts.Directory = true + + if (typeof opts !== "object") { + opts = { path: opts } + } + + // better to drop in cwd? seems more standard. + opts.path = opts.path || path.resolve("node-tar-extract") + opts.type = "Directory" + opts.Directory = true + + // similar to --strip or --strip-components + opts.strip = +opts.strip + if (!opts.strip || opts.strip <= 0) opts.strip = 0 + + this._fst = fstream.Writer(opts) + + this.pause() + var me = this + + // Hardlinks in tarballs are relative to the root + // of the tarball. So, they need to be resolved against + // the target directory in order to be created properly. + me.on("entry", function (entry) { + // if there's a "strip" argument, then strip off that many + // path components. + if (opts.strip) { + var p = entry.path.split("/").slice(opts.strip).join("/") + entry.path = entry.props.path = p + if (entry.linkpath) { + var lp = entry.linkpath.split("/").slice(opts.strip).join("/") + entry.linkpath = entry.props.linkpath = lp + } + } + if (entry.type !== "Link") return + entry.linkpath = entry.props.linkpath = + path.join(opts.path, path.join("/", entry.props.linkpath)) + }) + + this._fst.on("ready", function () { + me.pipe(me._fst, { end: false }) + me.resume() + }) + + // this._fst.on("end", function () { + // console.error("\nEEEE Extract End", me._fst.path) + // }) + + this._fst.on("close", function () { + // console.error("\nEEEE Extract End", me._fst.path) + me.emit("end") + me.emit("close") + }) +} + +inherits(Extract, tar.Parse) + +Extract.prototype._streamEnd = function () { + var me = this + if (!me._ended) me.error("unexpected eof") + me._fst.end() + // my .end() is coming later. +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/global-header-writer.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/global-header-writer.js new file mode 100644 index 0000000..0bfc7b8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/global-header-writer.js @@ -0,0 +1,14 @@ +module.exports = GlobalHeaderWriter + +var ExtendedHeaderWriter = require("./extended-header-writer.js") + , inherits = require("inherits") + +inherits(GlobalHeaderWriter, ExtendedHeaderWriter) + +function GlobalHeaderWriter (props) { + if (!(this instanceof GlobalHeaderWriter)) { + return new GlobalHeaderWriter(props) + } + ExtendedHeaderWriter.call(this, props) + this.props.type = "g" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/header.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/header.js new file mode 100644 index 0000000..05b237c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/header.js @@ -0,0 +1,385 @@ +// parse a 512-byte header block to a data object, or vice-versa +// If the data won't fit nicely in a simple header, then generate +// the appropriate extended header file, and return that. + +module.exports = TarHeader + +var tar = require("../tar.js") + , fields = tar.fields + , fieldOffs = tar.fieldOffs + , fieldEnds = tar.fieldEnds + , fieldSize = tar.fieldSize + , numeric = tar.numeric + , assert = require("assert").ok + , space = " ".charCodeAt(0) + , slash = "/".charCodeAt(0) + , bslash = process.platform === "win32" ? "\\".charCodeAt(0) : null + +function TarHeader (block) { + if (!(this instanceof TarHeader)) return new TarHeader(block) + if (block) this.decode(block) +} + +TarHeader.prototype = + { decode : decode + , encode: encode + , calcSum: calcSum + , checkSum: checkSum + } + +TarHeader.parseNumeric = parseNumeric +TarHeader.encode = encode +TarHeader.decode = decode + +// note that this will only do the normal ustar header, not any kind +// of extended posix header file. If something doesn't fit comfortably, +// then it will set obj.needExtended = true, and set the block to +// the closest approximation. +function encode (obj) { + if (!obj && !(this instanceof TarHeader)) throw new Error( + "encode must be called on a TarHeader, or supplied an object") + + obj = obj || this + var block = obj.block = new Buffer(512) + + // if the object has a "prefix", then that's actually an extension of + // the path field. + if (obj.prefix) { + // console.error("%% header encoding, got a prefix", obj.prefix) + obj.path = obj.prefix + "/" + obj.path + // console.error("%% header encoding, prefixed path", obj.path) + obj.prefix = "" + } + + obj.needExtended = false + + if (obj.mode) { + if (typeof obj.mode === "string") obj.mode = parseInt(obj.mode, 8) + obj.mode = obj.mode & 0777 + } + + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , off = fieldOffs[f] + , end = fieldEnds[f] + , ret + + switch (field) { + case "cksum": + // special, done below, after all the others + break + + case "prefix": + // special, this is an extension of the "path" field. + // console.error("%% header encoding, skip prefix later") + break + + case "type": + // convert from long name to a single char. + var type = obj.type || "0" + if (type.length > 1) { + type = tar.types[obj.type] + if (!type) type = "0" + } + writeText(block, off, end, type) + break + + case "path": + // uses the "prefix" field if > 100 bytes, but <= 255 + var pathLen = Buffer.byteLength(obj.path) + , pathFSize = fieldSize[fields.path] + , prefFSize = fieldSize[fields.prefix] + + // paths between 100 and 255 should use the prefix field. + // longer than 255 + if (pathLen > pathFSize && + pathLen <= pathFSize + prefFSize) { + // need to find a slash somewhere in the middle so that + // path and prefix both fit in their respective fields + var searchStart = pathLen - 1 - pathFSize + , searchEnd = prefFSize + , found = false + , pathBuf = new Buffer(obj.path) + + for ( var s = searchStart + ; (s <= searchEnd) + ; s ++ ) { + if (pathBuf[s] === slash || pathBuf[s] === bslash) { + found = s + break + } + } + + if (found !== false) { + prefix = pathBuf.slice(0, found).toString("utf8") + path = pathBuf.slice(found + 1).toString("utf8") + + ret = writeText(block, off, end, path) + off = fieldOffs[fields.prefix] + end = fieldEnds[fields.prefix] + // console.error("%% header writing prefix", off, end, prefix) + ret = writeText(block, off, end, prefix) || ret + break + } + } + + // paths less than 100 chars don't need a prefix + // and paths longer than 255 need an extended header and will fail + // on old implementations no matter what we do here. + // Null out the prefix, and fallthrough to default. + // console.error("%% header writing no prefix") + var poff = fieldOffs[fields.prefix] + , pend = fieldEnds[fields.prefix] + writeText(block, poff, pend, "") + // fallthrough + + // all other fields are numeric or text + default: + ret = numeric[field] + ? writeNumeric(block, off, end, obj[field]) + : writeText(block, off, end, obj[field] || "") + break + } + obj.needExtended = obj.needExtended || ret + } + + var off = fieldOffs[fields.cksum] + , end = fieldEnds[fields.cksum] + + writeNumeric(block, off, end, calcSum.call(this, block)) + + return block +} + +// if it's a negative number, or greater than will fit, +// then use write256. +var MAXNUM = { 12: 077777777777 + , 11: 07777777777 + , 8 : 07777777 + , 7 : 0777777 } +function writeNumeric (block, off, end, num) { + var writeLen = end - off + , maxNum = MAXNUM[writeLen] || 0 + + num = num || 0 + // console.error(" numeric", num) + + if (num instanceof Date || + Object.prototype.toString.call(num) === "[object Date]") { + num = num.getTime() / 1000 + } + + if (num > maxNum || num < 0) { + write256(block, off, end, num) + // need an extended header if negative or too big. + return true + } + + // god, tar is so annoying + // if the string is small enough, you should put a space + // between the octal string and the \0, but if it doesn't + // fit, then don't. + var numStr = Math.floor(num).toString(8) + if (num < MAXNUM[writeLen - 1]) numStr += " " + + // pad with "0" chars + if (numStr.length < writeLen) { + numStr = (new Array(writeLen - numStr.length).join("0")) + numStr + } + + if (numStr.length !== writeLen - 1) { + throw new Error("invalid length: " + JSON.stringify(numStr) + "\n" + + "expected: "+writeLen) + } + block.write(numStr, off, writeLen, "utf8") + block[end - 1] = 0 +} + +function write256 (block, off, end, num) { + var buf = block.slice(off, end) + var positive = num >= 0 + buf[0] = positive ? 0x80 : 0xFF + + // get the number as a base-256 tuple + if (!positive) num *= -1 + var tuple = [] + do { + var n = num % 256 + tuple.push(n) + num = (num - n) / 256 + } while (num) + + var bytes = tuple.length + + var fill = buf.length - bytes + for (var i = 1; i < fill; i ++) { + buf[i] = positive ? 0 : 0xFF + } + + // tuple is a base256 number, with [0] as the *least* significant byte + // if it's negative, then we need to flip all the bits once we hit the + // first non-zero bit. The 2's-complement is (0x100 - n), and the 1's- + // complement is (0xFF - n). + var zero = true + for (i = bytes; i > 0; i --) { + var byte = tuple[bytes - i] + if (positive) buf[fill + i] = byte + else if (zero && byte === 0) buf[fill + i] = 0 + else if (zero) { + zero = false + buf[fill + i] = 0x100 - byte + } else buf[fill + i] = 0xFF - byte + } +} + +function writeText (block, off, end, str) { + // strings are written as utf8, then padded with \0 + var strLen = Buffer.byteLength(str) + , writeLen = Math.min(strLen, end - off) + // non-ascii fields need extended headers + // long fields get truncated + , needExtended = strLen !== str.length || strLen > writeLen + + // write the string, and null-pad + if (writeLen > 0) block.write(str, off, writeLen, "utf8") + for (var i = off + writeLen; i < end; i ++) block[i] = 0 + + return needExtended +} + +function calcSum (block) { + block = block || this.block + assert(Buffer.isBuffer(block) && block.length === 512) + + if (!block) throw new Error("Need block to checksum") + + // now figure out what it would be if the cksum was " " + var sum = 0 + , start = fieldOffs[fields.cksum] + , end = fieldEnds[fields.cksum] + + for (var i = 0; i < fieldOffs[fields.cksum]; i ++) { + sum += block[i] + } + + for (var i = start; i < end; i ++) { + sum += space + } + + for (var i = end; i < 512; i ++) { + sum += block[i] + } + + return sum +} + + +function checkSum (block) { + var sum = calcSum.call(this, block) + block = block || this.block + + var cksum = block.slice(fieldOffs[fields.cksum], fieldEnds[fields.cksum]) + cksum = parseNumeric(cksum) + + return cksum === sum +} + +function decode (block) { + block = block || this.block + assert(Buffer.isBuffer(block) && block.length === 512) + + this.block = block + this.cksumValid = this.checkSum() + + var prefix = null + + // slice off each field. + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , val = block.slice(fieldOffs[f], fieldEnds[f]) + + switch (field) { + case "ustar": + // if not ustar, then everything after that is just padding. + if (val.toString() !== "ustar\0") { + this.ustar = false + return + } else { + // console.error("ustar:", val, val.toString()) + this.ustar = val.toString() + } + break + + // prefix is special, since it might signal the xstar header + case "prefix": + var atime = parseNumeric(val.slice(131, 131 + 12)) + , ctime = parseNumeric(val.slice(131 + 12, 131 + 12 + 12)) + if ((val[130] === 0 || val[130] === space) && + typeof atime === "number" && + typeof ctime === "number" && + val[131 + 12] === space && + val[131 + 12 + 12] === space) { + this.atime = atime + this.ctime = ctime + val = val.slice(0, 130) + } + prefix = val.toString("utf8").replace(/\0+$/, "") + // console.error("%% header reading prefix", prefix) + break + + // all other fields are null-padding text + // or a number. + default: + if (numeric[field]) { + this[field] = parseNumeric(val) + } else { + this[field] = val.toString("utf8").replace(/\0+$/, "") + } + break + } + } + + // if we got a prefix, then prepend it to the path. + if (prefix) { + this.path = prefix + "/" + this.path + // console.error("%% header got a prefix", this.path) + } +} + +function parse256 (buf) { + // first byte MUST be either 80 or FF + // 80 for positive, FF for 2's comp + var positive + if (buf[0] === 0x80) positive = true + else if (buf[0] === 0xFF) positive = false + else return null + + // build up a base-256 tuple from the least sig to the highest + var zero = false + , tuple = [] + for (var i = buf.length - 1; i > 0; i --) { + var byte = buf[i] + if (positive) tuple.push(byte) + else if (zero && byte === 0) tuple.push(0) + else if (zero) { + zero = false + tuple.push(0x100 - byte) + } else tuple.push(0xFF - byte) + } + + for (var sum = 0, i = 0, l = tuple.length; i < l; i ++) { + sum += tuple[i] * Math.pow(256, i) + } + + return positive ? sum : -1 * sum +} + +function parseNumeric (f) { + if (f[0] & 0x80) return parse256(f) + + var str = f.toString("utf8").split("\0")[0].trim() + , res = parseInt(str, 8) + + return isNaN(res) ? null : res +} + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/pack.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/pack.js new file mode 100644 index 0000000..3ff14dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/pack.js @@ -0,0 +1,231 @@ +// pipe in an fstream, and it'll make a tarball. +// key-value pair argument is global extended header props. + +module.exports = Pack + +var EntryWriter = require("./entry-writer.js") + , Stream = require("stream").Stream + , path = require("path") + , inherits = require("inherits") + , GlobalHeaderWriter = require("./global-header-writer.js") + , collect = require("fstream").collect + , eof = new Buffer(512) + +for (var i = 0; i < 512; i ++) eof[i] = 0 + +inherits(Pack, Stream) + +function Pack (props) { + // console.error("-- p ctor") + var me = this + if (!(me instanceof Pack)) return new Pack(props) + + if (props) me._noProprietary = props.noProprietary + else me._noProprietary = false + + me._global = props + + me.readable = true + me.writable = true + me._buffer = [] + // console.error("-- -- set current to null in ctor") + me._currentEntry = null + me._processing = false + + me._pipeRoot = null + me.on("pipe", function (src) { + if (src.root === me._pipeRoot) return + me._pipeRoot = src + src.on("end", function () { + me._pipeRoot = null + }) + me.add(src) + }) +} + +Pack.prototype.addGlobal = function (props) { + // console.error("-- p addGlobal") + if (this._didGlobal) return + this._didGlobal = true + + var me = this + GlobalHeaderWriter(props) + .on("data", function (c) { + me.emit("data", c) + }) + .end() +} + +Pack.prototype.add = function (stream) { + if (this._global && !this._didGlobal) this.addGlobal(this._global) + + if (this._ended) return this.emit("error", new Error("add after end")) + + collect(stream) + this._buffer.push(stream) + this._process() + this._needDrain = this._buffer.length > 0 + return !this._needDrain +} + +Pack.prototype.pause = function () { + this._paused = true + if (this._currentEntry) this._currentEntry.pause() + this.emit("pause") +} + +Pack.prototype.resume = function () { + this._paused = false + if (this._currentEntry) this._currentEntry.resume() + this.emit("resume") + this._process() +} + +Pack.prototype.end = function () { + this._ended = true + this._buffer.push(eof) + this._process() +} + +Pack.prototype._process = function () { + var me = this + if (me._paused || me._processing) { + return + } + + var entry = me._buffer.shift() + + if (!entry) { + if (me._needDrain) { + me.emit("drain") + } + return + } + + if (entry.ready === false) { + // console.error("-- entry is not ready", entry) + me._buffer.unshift(entry) + entry.on("ready", function () { + // console.error("-- -- ready!", entry) + me._process() + }) + return + } + + me._processing = true + + if (entry === eof) { + // need 2 ending null blocks. + me.emit("data", eof) + me.emit("data", eof) + me.emit("end") + me.emit("close") + return + } + + // Change the path to be relative to the root dir that was + // added to the tarball. + // + // XXX This should be more like how -C works, so you can + // explicitly set a root dir, and also explicitly set a pathname + // in the tarball to use. That way we can skip a lot of extra + // work when resolving symlinks for bundled dependencies in npm. + + var root = path.dirname((entry.root || entry).path) + var wprops = {} + + Object.keys(entry.props || {}).forEach(function (k) { + wprops[k] = entry.props[k] + }) + + if (me._noProprietary) wprops.noProprietary = true + + wprops.path = path.relative(root, entry.path || '') + + // actually not a matter of opinion or taste. + if (process.platform === "win32") { + wprops.path = wprops.path.replace(/\\/g, "/") + } + + if (!wprops.type) + wprops.type = 'Directory' + + switch (wprops.type) { + // sockets not supported + case "Socket": + return + + case "Directory": + wprops.path += "/" + wprops.size = 0 + break + + case "Link": + var lp = path.resolve(path.dirname(entry.path), entry.linkpath) + wprops.linkpath = path.relative(root, lp) || "." + wprops.size = 0 + break + + case "SymbolicLink": + var lp = path.resolve(path.dirname(entry.path), entry.linkpath) + wprops.linkpath = path.relative(path.dirname(entry.path), lp) || "." + wprops.size = 0 + break + } + + // console.error("-- new writer", wprops) + // if (!wprops.type) { + // // console.error("-- no type?", entry.constructor.name, entry) + // } + + // console.error("-- -- set current to new writer", wprops.path) + var writer = me._currentEntry = EntryWriter(wprops) + + writer.parent = me + + // writer.on("end", function () { + // // console.error("-- -- writer end", writer.path) + // }) + + writer.on("data", function (c) { + me.emit("data", c) + }) + + writer.on("header", function () { + Buffer.prototype.toJSON = function () { + return this.toString().split(/\0/).join(".") + } + // console.error("-- -- writer header %j", writer.props) + if (writer.props.size === 0) nextEntry() + }) + writer.on("close", nextEntry) + + var ended = false + function nextEntry () { + if (ended) return + ended = true + + // console.error("-- -- writer close", writer.path) + // console.error("-- -- set current to null", wprops.path) + me._currentEntry = null + me._processing = false + me._process() + } + + writer.on("error", function (er) { + // console.error("-- -- writer error", writer.path) + me.emit("error", er) + }) + + // if it's the root, then there's no need to add its entries, + // or data, since they'll be added directly. + if (entry === me._pipeRoot) { + // console.error("-- is the root, don't auto-add") + writer.add = null + } + + entry.pipe(writer) +} + +Pack.prototype.destroy = function () {} +Pack.prototype.write = function () {} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/parse.js new file mode 100644 index 0000000..884e73d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/lib/parse.js @@ -0,0 +1,270 @@ + +// A writable stream. +// It emits "entry" events, which provide a readable stream that has +// header info attached. + +module.exports = Parse.create = Parse + +var stream = require("stream") + , Stream = stream.Stream + , BlockStream = require("block-stream") + , tar = require("../tar.js") + , TarHeader = require("./header.js") + , Entry = require("./entry.js") + , BufferEntry = require("./buffer-entry.js") + , ExtendedHeader = require("./extended-header.js") + , assert = require("assert").ok + , inherits = require("inherits") + , fstream = require("fstream") + +// reading a tar is a lot like reading a directory +// However, we're actually not going to run the ctor, +// since it does a stat and various other stuff. +// This inheritance gives us the pause/resume/pipe +// behavior that is desired. +inherits(Parse, fstream.Reader) + +function Parse () { + var me = this + if (!(me instanceof Parse)) return new Parse() + + // doesn't apply fstream.Reader ctor? + // no, becasue we don't want to stat/etc, we just + // want to get the entry/add logic from .pipe() + Stream.apply(me) + + me.writable = true + me.readable = true + me._stream = new BlockStream(512) + me.position = 0 + + me._stream.on("error", function (e) { + me.emit("error", e) + }) + + me._stream.on("data", function (c) { + me._process(c) + }) + + me._stream.on("end", function () { + me._streamEnd() + }) + + me._stream.on("drain", function () { + me.emit("drain") + }) +} + +// overridden in Extract class, since it needs to +// wait for its DirWriter part to finish before +// emitting "end" +Parse.prototype._streamEnd = function () { + var me = this + if (!me._ended) me.error("unexpected eof") + me.emit("end") +} + +// a tar reader is actually a filter, not just a readable stream. +// So, you should pipe a tarball stream into it, and it needs these +// write/end methods to do that. +Parse.prototype.write = function (c) { + if (this._ended) { + // gnutar puts a LOT of nulls at the end. + // you can keep writing these things forever. + // Just ignore them. + for (var i = 0, l = c.length; i > l; i ++) { + if (c[i] !== 0) return this.error("write() after end()") + } + return + } + return this._stream.write(c) +} + +Parse.prototype.end = function (c) { + this._ended = true + return this._stream.end(c) +} + +// don't need to do anything, since we're just +// proxying the data up from the _stream. +// Just need to override the parent's "Not Implemented" +// error-thrower. +Parse.prototype._read = function () {} + +Parse.prototype._process = function (c) { + assert(c && c.length === 512, "block size should be 512") + + // one of three cases. + // 1. A new header + // 2. A part of a file/extended header + // 3. One of two or more EOF null blocks + + if (this._entry) { + var entry = this._entry + entry.write(c) + if (entry._remaining === 0) { + entry.end() + this._entry = null + } + } else { + // either zeroes or a header + var zero = true + for (var i = 0; i < 512 && zero; i ++) { + zero = c[i] === 0 + } + + // eof is *at least* 2 blocks of nulls, and then the end of the + // file. you can put blocks of nulls between entries anywhere, + // so appending one tarball to another is technically valid. + // ending without the eof null blocks is not allowed, however. + if (zero) { + this._ended = this._eofStarted + this._eofStarted = true + } else { + this._ended = this._eofStarted = false + this._startEntry(c) + } + + } + + this.position += 512 +} + +// take a header chunk, start the right kind of entry. +Parse.prototype._startEntry = function (c) { + var header = new TarHeader(c) + , self = this + , entry + , ev + , EntryType + , onend + , meta = false + + if (null === header.size || !header.cksumValid) { + var e = new Error("invalid tar file") + e.header = header + e.tar_file_offset = this.position + e.tar_block = this.position / 512 + this.emit("error", e) + } + + switch (tar.types[header.type]) { + case "File": + case "OldFile": + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + case "ContiguousFile": + case "GNUDumpDir": + // start a file. + // pass in any extended headers + // These ones consumers are typically most interested in. + EntryType = Entry + ev = "entry" + break + + case "GlobalExtendedHeader": + // extended headers that apply to the rest of the tarball + EntryType = ExtendedHeader + onend = function () { + self._global = self._global || {} + Object.keys(entry.fields).forEach(function (k) { + self._global[k] = entry.fields[k] + }) + } + ev = "globalExtendedHeader" + meta = true + break + + case "ExtendedHeader": + case "OldExtendedHeader": + // extended headers that apply to the next entry + EntryType = ExtendedHeader + onend = function () { + self._extended = entry.fields + } + ev = "extendedHeader" + meta = true + break + + case "NextFileHasLongLinkpath": + // set linkpath= in extended header + EntryType = BufferEntry + onend = function () { + self._extended = self._extended || {} + self._extended.linkpath = entry.body + } + ev = "longLinkpath" + meta = true + break + + case "NextFileHasLongPath": + case "OldGnuLongPath": + // set path= in file-extended header + EntryType = BufferEntry + onend = function () { + self._extended = self._extended || {} + self._extended.path = entry.body + } + ev = "longPath" + meta = true + break + + default: + // all the rest we skip, but still set the _entry + // member, so that we can skip over their data appropriately. + // emit an event to say that this is an ignored entry type? + EntryType = Entry + ev = "ignoredEntry" + break + } + + var global, extended + if (meta) { + global = extended = null + } else { + var global = this._global + var extended = this._extended + + // extendedHeader only applies to one entry, so once we start + // an entry, it's over. + this._extended = null + } + entry = new EntryType(header, extended, global) + entry.meta = meta + + // only proxy data events of normal files. + if (!meta) { + entry.on("data", function (c) { + me.emit("data", c) + }) + } + + if (onend) entry.on("end", onend) + + this._entry = entry + var me = this + + entry.on("pause", function () { + me.pause() + }) + + entry.on("resume", function () { + me.resume() + }) + + if (this.listeners("*").length) { + this.emit("*", ev, entry) + } + + this.emit(ev, entry) + + // Zero-byte entry. End immediately. + if (entry.props.size === 0) { + entry.end() + this._entry = null + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/LICENCE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/LICENCE new file mode 100644 index 0000000..74489e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/LICENCE @@ -0,0 +1,25 @@ +Copyright (c) Isaac Z. Schlueter +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/README.md new file mode 100644 index 0000000..c16e9c4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/README.md @@ -0,0 +1,14 @@ +# block-stream + +A stream of blocks. + +Write data into it, and it'll output data in buffer blocks the size you +specify, padding with zeroes if necessary. + +```javascript +var block = new BlockStream(512) +fs.createReadStream("some-file").pipe(block) +block.pipe(fs.createWriteStream("block-file")) +``` + +When `.end()` or `.flush()` is called, it'll pad the block with zeroes. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js new file mode 100644 index 0000000..9328844 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js @@ -0,0 +1,70 @@ +var BlockStream = require("../block-stream.js") + +var blockSizes = [16, 25, 1024] + , writeSizes = [4, 8, 15, 16, 17, 64, 100] + , writeCounts = [1, 10, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize, {nopad: true }) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + f.pause() + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + f.resume() + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = writeSize * writeCount * 2 + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream.js new file mode 100644 index 0000000..1141f3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/block-stream.js @@ -0,0 +1,68 @@ +var BlockStream = require("../block-stream.js") + +var blockSizes = [16, 25, 1024] + , writeSizes = [4, 8, 15, 16, 17, 64, 100] + , writeCounts = [1, 10, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize, {nopad: true }) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = writeSize * writeCount * 2 + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js new file mode 100644 index 0000000..93e4068 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js @@ -0,0 +1,70 @@ +var BlockStream = require("dropper") + +var blockSizes = [16, 25, 1024] + , writeSizes = [4, 8, 15, 16, 17, 64, 100] + , writeCounts = [1, 10, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize, {nopad: true }) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + f.pause() + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + f.resume() + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = writeSize * writeCount * 2 + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper.js new file mode 100644 index 0000000..55fa133 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/bench/dropper.js @@ -0,0 +1,68 @@ +var BlockStream = require("dropper") + +var blockSizes = [16, 25, 1024] + , writeSizes = [4, 8, 15, 16, 17, 64, 100] + , writeCounts = [1, 10, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize, {nopad: true }) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = writeSize * writeCount * 2 + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js new file mode 100644 index 0000000..008de03 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js @@ -0,0 +1,209 @@ +// write data to it, and it'll emit data in 512 byte blocks. +// if you .end() or .flush(), it'll emit whatever it's got, +// padded with nulls to 512 bytes. + +module.exports = BlockStream + +var Stream = require("stream").Stream + , inherits = require("inherits") + , assert = require("assert").ok + , debug = process.env.DEBUG ? console.error : function () {} + +function BlockStream (size, opt) { + this.writable = this.readable = true + this._opt = opt || {} + this._chunkSize = size || 512 + this._offset = 0 + this._buffer = [] + this._bufferLength = 0 + if (this._opt.nopad) this._zeroes = false + else { + this._zeroes = new Buffer(this._chunkSize) + for (var i = 0; i < this._chunkSize; i ++) { + this._zeroes[i] = 0 + } + } +} + +inherits(BlockStream, Stream) + +BlockStream.prototype.write = function (c) { + // debug(" BS write", c) + if (this._ended) throw new Error("BlockStream: write after end") + if (c && !Buffer.isBuffer(c)) c = new Buffer(c + "") + if (c.length) { + this._buffer.push(c) + this._bufferLength += c.length + } + // debug("pushed onto buffer", this._bufferLength) + if (this._bufferLength >= this._chunkSize) { + if (this._paused) { + // debug(" BS paused, return false, need drain") + this._needDrain = true + return false + } + this._emitChunk() + } + return true +} + +BlockStream.prototype.pause = function () { + // debug(" BS pausing") + this._paused = true +} + +BlockStream.prototype.resume = function () { + // debug(" BS resume") + this._paused = false + return this._emitChunk() +} + +BlockStream.prototype.end = function (chunk) { + // debug("end", chunk) + if (typeof chunk === "function") cb = chunk, chunk = null + if (chunk) this.write(chunk) + this._ended = true + this.flush() +} + +BlockStream.prototype.flush = function () { + this._emitChunk(true) +} + +BlockStream.prototype._emitChunk = function (flush) { + // debug("emitChunk flush=%j emitting=%j paused=%j", flush, this._emitting, this._paused) + + // emit a chunk + if (flush && this._zeroes) { + // debug(" BS push zeroes", this._bufferLength) + // push a chunk of zeroes + var padBytes = (this._bufferLength % this._chunkSize) + if (padBytes !== 0) padBytes = this._chunkSize - padBytes + if (padBytes > 0) { + // debug("padBytes", padBytes, this._zeroes.slice(0, padBytes)) + this._buffer.push(this._zeroes.slice(0, padBytes)) + this._bufferLength += padBytes + // debug(this._buffer[this._buffer.length - 1].length, this._bufferLength) + } + } + + if (this._emitting || this._paused) return + this._emitting = true + + // debug(" BS entering loops") + var bufferIndex = 0 + while (this._bufferLength >= this._chunkSize && + (flush || !this._paused)) { + // debug(" BS data emission loop", this._bufferLength) + + var out + , outOffset = 0 + , outHas = this._chunkSize + + while (outHas > 0 && (flush || !this._paused) ) { + // debug(" BS data inner emit loop", this._bufferLength) + var cur = this._buffer[bufferIndex] + , curHas = cur.length - this._offset + // debug("cur=", cur) + // debug("curHas=%j", curHas) + // If it's not big enough to fill the whole thing, then we'll need + // to copy multiple buffers into one. However, if it is big enough, + // then just slice out the part we want, to save unnecessary copying. + // Also, need to copy if we've already done some copying, since buffers + // can't be joined like cons strings. + if (out || curHas < outHas) { + out = out || new Buffer(this._chunkSize) + cur.copy(out, outOffset, + this._offset, this._offset + Math.min(curHas, outHas)) + } else if (cur.length === outHas && this._offset === 0) { + // shortcut -- cur is exactly long enough, and no offset. + out = cur + } else { + // slice out the piece of cur that we need. + out = cur.slice(this._offset, this._offset + outHas) + } + + if (curHas > outHas) { + // means that the current buffer couldn't be completely output + // update this._offset to reflect how much WAS written + this._offset += outHas + outHas = 0 + } else { + // output the entire current chunk. + // toss it away + outHas -= curHas + outOffset += curHas + bufferIndex ++ + this._offset = 0 + } + } + + this._bufferLength -= this._chunkSize + assert(out.length === this._chunkSize) + // debug("emitting data", out) + // debug(" BS emitting, paused=%j", this._paused, this._bufferLength) + this.emit("data", out) + out = null + } + // debug(" BS out of loops", this._bufferLength) + + // whatever is left, it's not enough to fill up a block, or we're paused + this._buffer = this._buffer.slice(bufferIndex) + if (this._paused) { + // debug(" BS paused, leaving", this._bufferLength) + this._needsDrain = true + this._emitting = false + return + } + + // if flushing, and not using null-padding, then need to emit the last + // chunk(s) sitting in the queue. We know that it's not enough to + // fill up a whole block, because otherwise it would have been emitted + // above, but there may be some offset. + var l = this._buffer.length + if (flush && !this._zeroes && l) { + if (l === 1) { + if (this._offset) { + this.emit("data", this._buffer[0].slice(this._offset)) + } else { + this.emit("data", this._buffer[0]) + } + } else { + var outHas = this._bufferLength + , out = new Buffer(outHas) + , outOffset = 0 + for (var i = 0; i < l; i ++) { + var cur = this._buffer[i] + , curHas = cur.length - this._offset + cur.copy(out, outOffset, this._offset) + this._offset = 0 + outOffset += curHas + this._bufferLength -= curHas + } + this.emit("data", out) + } + // truncate + this._buffer.length = 0 + this._bufferLength = 0 + this._offset = 0 + } + + // now either drained or ended + // debug("either draining, or ended", this._bufferLength, this._ended) + // means that we've flushed out all that we can so far. + if (this._needDrain) { + // debug("emitting drain", this._bufferLength) + this._needDrain = false + this.emit("drain") + } + + if ((this._bufferLength === 0) && this._ended && !this._endEmitted) { + // debug("emitting end", this._bufferLength) + this._endEmitted = true + this.emit("end") + } + + this._emitting = false + + // debug(" BS no longer emitting", flush, this._paused, this._emitting, this._bufferLength, this._chunkSize) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/package.json new file mode 100644 index 0000000..48840aa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/package.json @@ -0,0 +1,36 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "block-stream", + "description": "a stream of blocks", + "version": "0.0.7", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/block-stream.git" + }, + "engines": { + "node": "0.4 || >=0.5.8" + }, + "main": "block-stream.js", + "dependencies": { + "inherits": "~2.0.0" + }, + "devDependencies": { + "tap": "0.x" + }, + "scripts": { + "test": "tap test/" + }, + "license": "BSD", + "readme": "# block-stream\n\nA stream of blocks.\n\nWrite data into it, and it'll output data in buffer blocks the size you\nspecify, padding with zeroes if necessary.\n\n```javascript\nvar block = new BlockStream(512)\nfs.createReadStream(\"some-file\").pipe(block)\nblock.pipe(fs.createWriteStream(\"block-file\"))\n```\n\nWhen `.end()` or `.flush()` is called, it'll pad the block with zeroes.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/block-stream/issues" + }, + "homepage": "https://github.com/isaacs/block-stream", + "_id": "block-stream@0.0.7", + "_from": "block-stream@*" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/basic.js new file mode 100644 index 0000000..b4b9305 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/basic.js @@ -0,0 +1,27 @@ +var tap = require("tap") + , BlockStream = require("../block-stream.js") + +tap.test("basic test", function (t) { + var b = new BlockStream(16) + var fs = require("fs") + var fstr = fs.createReadStream(__filename, {encoding: "utf8"}) + fstr.pipe(b) + + var stat + t.doesNotThrow(function () { + stat = fs.statSync(__filename) + }, "stat should not throw") + + var totalBytes = 0 + b.on("data", function (c) { + t.equal(c.length, 16, "chunks should be 16 bytes long") + t.type(c, Buffer, "chunks should be buffer objects") + totalBytes += c.length + }) + b.on("end", function () { + var expectedBytes = stat.size + (16 - stat.size % 16) + t.equal(totalBytes, expectedBytes, "Should be multiple of 16") + t.end() + }) + +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js new file mode 100644 index 0000000..7a8de88 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js @@ -0,0 +1,68 @@ +var BlockStream = require("../block-stream.js") + +var blockSizes = [16]//, 25]//, 1024] + , writeSizes = [4, 15, 16, 17, 64 ]//, 64, 100] + , writeCounts = [1, 10]//, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize, {nopad: true }) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = writeSize * writeCount * 2 + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad.js new file mode 100644 index 0000000..6d38429 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/nopad.js @@ -0,0 +1,57 @@ +var BlockStream = require("../") +var tap = require("tap") + + +tap.test("don't pad, small writes", function (t) { + var f = new BlockStream(16, { nopad: true }) + t.plan(1) + + f.on("data", function (c) { + t.equal(c.toString(), "abc", "should get 'abc'") + }) + + f.on("end", function () { t.end() }) + + f.write(new Buffer("a")) + f.write(new Buffer("b")) + f.write(new Buffer("c")) + f.end() +}) + +tap.test("don't pad, exact write", function (t) { + var f = new BlockStream(16, { nopad: true }) + t.plan(1) + + var first = true + f.on("data", function (c) { + if (first) { + first = false + t.equal(c.toString(), "abcdefghijklmnop", "first chunk") + } else { + t.fail("should only get one") + } + }) + + f.on("end", function () { t.end() }) + + f.end(new Buffer("abcdefghijklmnop")) +}) + +tap.test("don't pad, big write", function (t) { + var f = new BlockStream(16, { nopad: true }) + t.plan(2) + + var first = true + f.on("data", function (c) { + if (first) { + first = false + t.equal(c.toString(), "abcdefghijklmnop", "first chunk") + } else { + t.equal(c.toString(), "q") + } + }) + + f.on("end", function () { t.end() }) + + f.end(new Buffer("abcdefghijklmnopq")) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/pause-resume.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/pause-resume.js new file mode 100644 index 0000000..64d0d09 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/pause-resume.js @@ -0,0 +1,73 @@ +var BlockStream = require("../block-stream.js") + +var blockSizes = [16] + , writeSizes = [15, 16, 17] + , writeCounts = [1, 10]//, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + var paused = false + + f.on("data", function (c) { + timeouts ++ + t.notOk(paused, "should not be paused when emitting data") + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + paused = true + f.pause() + process.nextTick(function () { + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + paused = false + f.resume() + timeouts -- + }) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = expectChunks * blockSize + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 200) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/thorough.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/thorough.js new file mode 100644 index 0000000..1cc9ea0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/thorough.js @@ -0,0 +1,68 @@ +var BlockStream = require("../block-stream.js") + +var blockSizes = [16]//, 25]//, 1024] + , writeSizes = [4, 15, 16, 17, 64 ]//, 64, 100] + , writeCounts = [1, 10]//, 100] + , tap = require("tap") + +writeCounts.forEach(function (writeCount) { +blockSizes.forEach(function (blockSize) { +writeSizes.forEach(function (writeSize) { + tap.test("writeSize=" + writeSize + + " blockSize="+blockSize + + " writeCount="+writeCount, function (t) { + var f = new BlockStream(blockSize) + + var actualChunks = 0 + var actualBytes = 0 + var timeouts = 0 + + f.on("data", function (c) { + timeouts ++ + + actualChunks ++ + actualBytes += c.length + + // make sure that no data gets corrupted, and basic sanity + var before = c.toString() + // simulate a slow write operation + setTimeout(function () { + timeouts -- + + var after = c.toString() + t.equal(after, before, "should not change data") + + // now corrupt it, to find leaks. + for (var i = 0; i < c.length; i ++) { + c[i] = "x".charCodeAt(0) + } + }, 100) + }) + + f.on("end", function () { + // round up to the nearest block size + var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) + var expectBytes = expectChunks * blockSize + t.equal(actualBytes, expectBytes, + "bytes=" + expectBytes + " writeSize=" + writeSize) + t.equal(actualChunks, expectChunks, + "chunks=" + expectChunks + " writeSize=" + writeSize) + + // wait for all the timeout checks to finish, then end the test + setTimeout(function WAIT () { + if (timeouts > 0) return setTimeout(WAIT) + t.end() + }, 100) + }) + + for (var i = 0; i < writeCount; i ++) { + var a = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) + var b = new Buffer(writeSize); + for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) + f.write(a) + f.write(b) + } + f.end() + }) +}) }) }) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/two-stream.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/two-stream.js new file mode 100644 index 0000000..c6db79a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/block-stream/test/two-stream.js @@ -0,0 +1,59 @@ +var log = console.log, + assert = require( 'assert' ), + BlockStream = require("../block-stream.js"), + isize = 0, tsize = 0, fsize = 0, psize = 0, i = 0, + filter = null, paper = null, stack = null, + +// a source data buffer +tsize = 1 * 1024; // <- 1K +stack = new Buffer( tsize ); +for ( ; i < tsize; i++) stack[i] = "x".charCodeAt(0); + +isize = 1 * 1024; // <- initial packet size with 4K no bug! +fsize = 2 * 1024 ; // <- first block-stream size +psize = Math.ceil( isize / 6 ); // <- second block-stream size + +fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first +pexpected = Math.ceil( tsize / psize ); // <- packets expected for second + + +filter = new BlockStream( fsize, { nopad : true } ); +paper = new BlockStream( psize, { nopad : true } ); + + +var fcounter = 0; +filter.on( 'data', function (c) { + // verify that they're not null-padded + for (var i = 0; i < c.length; i ++) { + assert.strictEqual(c[i], "x".charCodeAt(0)) + } + ++fcounter; +} ); + +var pcounter = 0; +paper.on( 'data', function (c) { + // verify that they're not null-padded + for (var i = 0; i < c.length; i ++) { + assert.strictEqual(c[i], "x".charCodeAt(0)) + } + ++pcounter; +} ); + +filter.pipe( paper ); + +filter.on( 'end', function () { + log("fcounter: %s === %s", fcounter, fexpected) + assert.strictEqual( fcounter, fexpected ); +} ); + +paper.on( 'end', function () { + log("pcounter: %s === %s", pcounter, pexpected); + assert.strictEqual( pcounter, pexpected ); +} ); + + +for ( i = 0, j = isize; j <= tsize; j += isize ) { + filter.write( stack.slice( j - isize, j ) ); +} + +filter.end(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits_browser.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/package.json new file mode 100644 index 0000000..5bf0db5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/package.json @@ -0,0 +1,33 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits", + "_id": "inherits@2.0.1", + "_from": "inherits@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/package.json new file mode 100644 index 0000000..3d99f70 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "tar", + "description": "tar for node", + "version": "0.1.19", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-tar.git" + }, + "main": "tar.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "inherits": "2", + "block-stream": "*", + "fstream": "~0.1.8" + }, + "devDependencies": { + "tap": "0.x", + "rimraf": "1.x" + }, + "license": "BSD", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-tar/issues" + }, + "homepage": "https://github.com/isaacs/node-tar", + "_id": "tar@0.1.19", + "dist": { + "shasum": "bd31a1030d51bfbbbf4b3e174603500389a1250d" + }, + "_from": "tar@~0.1.17", + "_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.19.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/tar.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/tar.js new file mode 100644 index 0000000..a81298b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/tar.js @@ -0,0 +1,173 @@ +// field paths that every tar file must have. +// header is padded to 512 bytes. +var f = 0 + , fields = {} + , path = fields.path = f++ + , mode = fields.mode = f++ + , uid = fields.uid = f++ + , gid = fields.gid = f++ + , size = fields.size = f++ + , mtime = fields.mtime = f++ + , cksum = fields.cksum = f++ + , type = fields.type = f++ + , linkpath = fields.linkpath = f++ + , headerSize = 512 + , blockSize = 512 + , fieldSize = [] + +fieldSize[path] = 100 +fieldSize[mode] = 8 +fieldSize[uid] = 8 +fieldSize[gid] = 8 +fieldSize[size] = 12 +fieldSize[mtime] = 12 +fieldSize[cksum] = 8 +fieldSize[type] = 1 +fieldSize[linkpath] = 100 + +// "ustar\0" may introduce another bunch of headers. +// these are optional, and will be nulled out if not present. + +var ustar = fields.ustar = f++ + , ustarver = fields.ustarver = f++ + , uname = fields.uname = f++ + , gname = fields.gname = f++ + , devmaj = fields.devmaj = f++ + , devmin = fields.devmin = f++ + , prefix = fields.prefix = f++ + , fill = fields.fill = f++ + +// terminate fields. +fields[f] = null + +fieldSize[ustar] = 6 +fieldSize[ustarver] = 2 +fieldSize[uname] = 32 +fieldSize[gname] = 32 +fieldSize[devmaj] = 8 +fieldSize[devmin] = 8 +fieldSize[prefix] = 155 +fieldSize[fill] = 12 + +// nb: prefix field may in fact be 130 bytes of prefix, +// a null char, 12 bytes for atime, 12 bytes for ctime. +// +// To recognize this format: +// 1. prefix[130] === ' ' or '\0' +// 2. atime and ctime are octal numeric values +// 3. atime and ctime have ' ' in their last byte + +var fieldEnds = {} + , fieldOffs = {} + , fe = 0 +for (var i = 0; i < f; i ++) { + fieldOffs[i] = fe + fieldEnds[i] = (fe += fieldSize[i]) +} + +// build a translation table of field paths. +Object.keys(fields).forEach(function (f) { + if (fields[f] !== null) fields[fields[f]] = f +}) + +// different values of the 'type' field +// paths match the values of Stats.isX() functions, where appropriate +var types = + { 0: "File" + , "\0": "OldFile" // like 0 + , "": "OldFile" + , 1: "Link" + , 2: "SymbolicLink" + , 3: "CharacterDevice" + , 4: "BlockDevice" + , 5: "Directory" + , 6: "FIFO" + , 7: "ContiguousFile" // like 0 + // posix headers + , g: "GlobalExtendedHeader" // k=v for the rest of the archive + , x: "ExtendedHeader" // k=v for the next file + // vendor-specific stuff + , A: "SolarisACL" // skip + , D: "GNUDumpDir" // like 5, but with data, which should be skipped + , I: "Inode" // metadata only, skip + , K: "NextFileHasLongLinkpath" // data = link path of next file + , L: "NextFileHasLongPath" // data = path of next file + , M: "ContinuationFile" // skip + , N: "OldGnuLongPath" // like L + , S: "SparseFile" // skip + , V: "TapeVolumeHeader" // skip + , X: "OldExtendedHeader" // like x + } + +Object.keys(types).forEach(function (t) { + types[types[t]] = types[types[t]] || t +}) + +// values for the mode field +var modes = + { suid: 04000 // set uid on extraction + , sgid: 02000 // set gid on extraction + , svtx: 01000 // set restricted deletion flag on dirs on extraction + , uread: 0400 + , uwrite: 0200 + , uexec: 0100 + , gread: 040 + , gwrite: 020 + , gexec: 010 + , oread: 4 + , owrite: 2 + , oexec: 1 + , all: 07777 + } + +var numeric = + { mode: true + , uid: true + , gid: true + , size: true + , mtime: true + , devmaj: true + , devmin: true + , cksum: true + , atime: true + , ctime: true + , dev: true + , ino: true + , nlink: true + } + +Object.keys(modes).forEach(function (t) { + modes[modes[t]] = modes[modes[t]] || t +}) + +var knownExtended = + { atime: true + , charset: true + , comment: true + , ctime: true + , gid: true + , gname: true + , linkpath: true + , mtime: true + , path: true + , realtime: true + , security: true + , size: true + , uid: true + , uname: true } + + +exports.fields = fields +exports.fieldSize = fieldSize +exports.fieldOffs = fieldOffs +exports.fieldEnds = fieldEnds +exports.types = types +exports.modes = modes +exports.numeric = numeric +exports.headerSize = headerSize +exports.blockSize = blockSize +exports.knownExtended = knownExtended + +exports.Pack = require("./lib/pack.js") +exports.Parse = require("./lib/parse.js") +exports.Extract = require("./lib/extract.js") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/00-setup-fixtures.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/00-setup-fixtures.js new file mode 100644 index 0000000..1524ff7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/00-setup-fixtures.js @@ -0,0 +1,53 @@ +// the fixtures have some weird stuff that is painful +// to include directly in the repo for various reasons. +// +// So, unpack the fixtures with the system tar first. +// +// This means, of course, that it'll only work if you +// already have a tar implementation, and some of them +// will not properly unpack the fixtures anyway. +// +// But, since usually those tests will fail on Windows +// and other systems with less capable filesystems anyway, +// at least this way we don't cause inconveniences by +// merely cloning the repo or installing the package. + +var tap = require("tap") +, child_process = require("child_process") +, rimraf = require("rimraf") +, test = tap.test +, path = require("path") + +test("clean fixtures", function (t) { + rimraf(path.resolve(__dirname, "fixtures"), function (er) { + t.ifError(er, "rimraf ./fixtures/") + t.end() + }) +}) + +test("clean tmp", function (t) { + rimraf(path.resolve(__dirname, "tmp"), function (er) { + t.ifError(er, "rimraf ./tmp/") + t.end() + }) +}) + +test("extract fixtures", function (t) { + var c = child_process.spawn("tar" + ,["xzvf", "fixtures.tgz"] + ,{ cwd: __dirname }) + + c.stdout.on("data", errwrite) + c.stderr.on("data", errwrite) + function errwrite (chunk) { + process.stderr.write(chunk) + } + + c.on("exit", function (code) { + t.equal(code, 0, "extract fixtures should exit with 0") + if (code) { + t.comment("Note, all tests from here on out will fail because of this.") + } + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/extract.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/extract.js new file mode 100644 index 0000000..fff4818 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/extract.js @@ -0,0 +1,358 @@ +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + , target = path.resolve(__dirname, "tmp/extract-test") + , index = 0 + , fstream = require("fstream") + + , ee = 0 + , expectEntries = +[ { path: 'c.txt', + mode: '644', + type: '0', + depth: undefined, + size: 513, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'cc.txt', + mode: '644', + type: '0', + depth: undefined, + size: 513, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 100, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'Ω.txt', + mode: '644', + type: '0', + depth: undefined, + size: 2, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'Ω.txt', + mode: '644', + type: '0', + depth: undefined, + size: 2, + linkpath: '', + nlink: 1, + dev: 234881026, + ino: 51693379 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 200, + linkpath: '', + nlink: 1, + dev: 234881026, + ino: 51681874 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 201, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '777', + type: '2', + depth: undefined, + size: 0, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: '200-hard', + mode: '644', + type: '0', + depth: undefined, + size: 200, + linkpath: '', + nlink: 2, + dev: 234881026, + ino: 51681874 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '1', + depth: undefined, + size: 0, + linkpath: path.resolve(target, '200-hard'), + nlink: 2, + dev: 234881026, + ino: 51681874 } ] + + , ef = 0 + , expectFiles = +[ { path: '', + mode: '40755', + type: 'Directory', + depth: 0, + linkpath: undefined }, + { path: '/200-hard', + mode: '100644', + type: 'File', + depth: 1, + size: 200, + linkpath: undefined, + nlink: 2 }, + { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '100644', + type: 'Link', + depth: 1, + size: 200, + linkpath: path.join(target, '200-hard'), + nlink: 2 }, + { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '120777', + type: 'SymbolicLink', + depth: 1, + size: 200, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: 1 }, + { path: '/c.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 513, + linkpath: undefined, + nlink: 1 }, + { path: '/cc.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 513, + linkpath: undefined, + nlink: 1 }, + { path: '/r', + mode: '40755', + type: 'Directory', + depth: 1, + linkpath: undefined }, + { path: '/r/e', + mode: '40755', + type: 'Directory', + depth: 2, + linkpath: undefined }, + { path: '/r/e/a', + mode: '40755', + type: 'Directory', + depth: 3, + linkpath: undefined }, + { path: '/r/e/a/l', + mode: '40755', + type: 'Directory', + depth: 4, + linkpath: undefined }, + { path: '/r/e/a/l/l', + mode: '40755', + type: 'Directory', + depth: 5, + linkpath: undefined }, + { path: '/r/e/a/l/l/y', + mode: '40755', + type: 'Directory', + depth: 6, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-', + mode: '40755', + type: 'Directory', + depth: 7, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d', + mode: '40755', + type: 'Directory', + depth: 8, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e', + mode: '40755', + type: 'Directory', + depth: 9, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e', + mode: '40755', + type: 'Directory', + depth: 10, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p', + mode: '40755', + type: 'Directory', + depth: 11, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-', + mode: '40755', + type: 'Directory', + depth: 12, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f', + mode: '40755', + type: 'Directory', + depth: 13, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o', + mode: '40755', + type: 'Directory', + depth: 14, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l', + mode: '40755', + type: 'Directory', + depth: 15, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d', + mode: '40755', + type: 'Directory', + depth: 16, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e', + mode: '40755', + type: 'Directory', + depth: 17, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r', + mode: '40755', + type: 'Directory', + depth: 18, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-', + mode: '40755', + type: 'Directory', + depth: 19, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p', + mode: '40755', + type: 'Directory', + depth: 20, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a', + mode: '40755', + type: 'Directory', + depth: 21, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t', + mode: '40755', + type: 'Directory', + depth: 22, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h', + mode: '40755', + type: 'Directory', + depth: 23, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '100644', + type: 'File', + depth: 24, + size: 100, + linkpath: undefined, + nlink: 1 }, + { path: '/Ω.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 2, + linkpath: undefined, + nlink: 1 } ] + + + +// The extract class basically just pipes the input +// to a Reader, and then to a fstream.DirWriter + +// So, this is as much a test of fstream.Reader and fstream.Writer +// as it is of tar.Extract, but it sort of makes sense. + +tap.test("extract test", function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) + + // give it a weird buffer size to try to break in odd places + inp.bufferSize = 1234 + + inp.pipe(extract) + + extract.on("end", function () { + t.equal(ee, expectEntries.length, "should see "+ee+" entries") + + // should get no more entries after end + extract.removeAllListeners("entry") + extract.on("entry", function (e) { + t.fail("Should not get entries after end!") + }) + + next() + }) + + extract.on("entry", function (entry) { + var found = + { path: entry.path + , mode: entry.props.mode.toString(8) + , type: entry.props.type + , depth: entry.props.depth + , size: entry.props.size + , linkpath: entry.props.linkpath + , nlink: entry.props.nlink + , dev: entry.props.dev + , ino: entry.props.ino + } + + var wanted = expectEntries[ee ++] + + t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path) + }) + + function next () { + var r = fstream.Reader({ path: target + , type: "Directory" + // this is just to encourage consistency + , sort: "alpha" }) + + r.on("ready", function () { + foundEntry(r) + }) + + r.on("end", finish) + + function foundEntry (entry) { + var p = entry.path.substr(target.length) + var found = + { path: p + , mode: entry.props.mode.toString(8) + , type: entry.props.type + , depth: entry.props.depth + , size: entry.props.size + , linkpath: entry.props.linkpath + , nlink: entry.props.nlink + } + + var wanted = expectFiles[ef ++] + + t.has(found, wanted, "unpacked file " + ef + " " + wanted.path) + + entry.on("entry", foundEntry) + } + + function finish () { + t.equal(ef, expectFiles.length, "should have "+ef+" items") + t.end() + } + } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/fixtures.tgz b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/fixtures.tgz new file mode 100644 index 0000000..4501bcf Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/fixtures.tgz differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/header.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/header.js new file mode 100644 index 0000000..8ea6f79 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/header.js @@ -0,0 +1,183 @@ +var tap = require("tap") +var TarHeader = require("../lib/header.js") +var tar = require("../tar.js") +var fs = require("fs") + + +var headers = + { "a.txt file header": + [ "612e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303430312031313635313336303333332030313234353100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'a.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 257 + , mtime: 1319493851 + , cksum: 5417 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "omega pax": // the extended header from omega tar. + [ "5061784865616465722fcea92e74787400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303137302031313534333731303631312030313530353100207800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'PaxHeader/Ω.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 120 + , mtime: 1301254537 + , cksum: 6697 + , type: 'x' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } ] + + , "omega file header": + [ "cea92e7478740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030322031313534333731303631312030313330373200203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'Ω.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 2 + , mtime: 1301254537 + , cksum: 5690 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } ] + + , "foo.js file header": + [ "666f6f2e6a730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030342031313534333637303734312030313236313700203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'foo.js' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 4 + , mtime: 1301246433 + , cksum: 5519 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "b.txt file header": + [ "622e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030313030302031313635313336303637372030313234363100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'b.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 512 + , mtime: 1319494079 + , cksum: 5425 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "deep nested file": + [ "636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363633030303634342000303537373631200030303030323420003030303030303030313434203131363532313531353333203034333331340020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075737461720030306973616163730000000000000000000000000000000000000000000000000000737461666600000000000000000000000000000000000000000000000000000030303030303020003030303030302000722f652f612f6c2f6c2f792f2d2f642f652f652f702f2d2f662f6f2f6c2f642f652f722f2d2f702f612f742f680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true, + path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 100 + , mtime: 1319687003 + , cksum: 18124 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + } + +tap.test("parsing", function (t) { + Object.keys(headers).forEach(function (name) { + var h = headers[name] + , header = new Buffer(h[0], "hex") + , expect = h[1] + , parsed = new TarHeader(header) + + // console.error(parsed) + t.has(parsed, expect, "parse " + name) + }) + t.end() +}) + +tap.test("encoding", function (t) { + Object.keys(headers).forEach(function (name) { + var h = headers[name] + , expect = new Buffer(h[0], "hex") + , encoded = TarHeader.encode(h[1]) + + // might have slightly different bytes, since the standard + // isn't very strict, but should have the same semantics + // checkSum will be different, but cksumValid will be true + + var th = new TarHeader(encoded) + delete h[1].block + delete h[1].needExtended + delete h[1].cksum + t.has(th, h[1], "fields "+name) + }) + t.end() +}) + +// test these manually. they're a bit rare to find in the wild +tap.test("parseNumeric tests", function (t) { + var parseNumeric = TarHeader.parseNumeric + , numbers = + { "303737373737373700": 2097151 + , "30373737373737373737373700": 8589934591 + , "303030303036343400": 420 + , "800000ffffffffffff": 281474976710655 + , "ffffff000000000001": -281474976710654 + , "ffffff000000000000": -281474976710655 + , "800000000000200000": 2097152 + , "8000000000001544c5": 1393861 + , "ffffffffffff1544c5": -15383354 } + Object.keys(numbers).forEach(function (n) { + var b = new Buffer(n, "hex") + t.equal(parseNumeric(b), numbers[n], n + " === " + numbers[n]) + }) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack-no-proprietary.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack-no-proprietary.js new file mode 100644 index 0000000..5bf0e54 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack-no-proprietary.js @@ -0,0 +1,854 @@ +// This is exactly like test/pack.js, except that it's excluding +// any proprietary headers. +// +// This loses some information about the filesystem, but creates +// tarballs that are supported by more versions of tar, especially +// old non-spec-compliant copies of gnutar. + +// the symlink file is excluded from git, because it makes +// windows freak the hell out. +var fs = require("fs") + , path = require("path") + , symlink = path.resolve(__dirname, "fixtures/symlink") +try { fs.unlinkSync(symlink) } catch (e) {} +fs.symlinkSync("./hardlink-1", symlink) +process.on("exit", function () { + fs.unlinkSync(symlink) +}) + +var tap = require("tap") + , tar = require("../tar.js") + , pkg = require("../package.json") + , Pack = tar.Pack + , fstream = require("fstream") + , Reader = fstream.Reader + , Writer = fstream.Writer + , input = path.resolve(__dirname, "fixtures/") + , target = path.resolve(__dirname, "tmp/pack.tar") + , uid = process.getuid ? process.getuid() : 0 + , gid = process.getgid ? process.getgid() : 0 + + , entries = + + // the global header and root fixtures/ dir are going to get + // a different date each time, so omit that bit. + // Also, dev/ino values differ across machines, so that's not + // included. + [ [ 'entry', + { path: 'fixtures/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + uid: uid, + gid: gid, + size: 200 } ] + + , [ 'entry', + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/a.txt', + mode: 420, + uid: uid, + gid: gid, + size: 257, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/b.txt', + mode: 420, + uid: uid, + gid: gid, + size: 512, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/c.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/cc.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/foo.js', + mode: 420, + uid: uid, + gid: gid, + size: 4, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-1', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-2', + mode: 420, + uid: uid, + gid: gid, + size: 0, + type: '1', + linkpath: 'fixtures/hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/star.4.html', + mode: 420, + uid: uid, + gid: gid, + size: 54081, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/packtest/Ω.txt', + uid: uid, + gid: gid, + size: 2 } ] + + , [ 'entry', + { path: 'fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 100, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/symlink', + uid: uid, + gid: gid, + size: 0, + type: '2', + linkpath: 'hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: "fixtures/Ω.txt" + , uid: uid + , gid: gid + , size: 2 } ] + + , [ 'entry', + { path: 'fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + ] + + +// first, make sure that the hardlinks are actually hardlinks, or this +// won't work. Git has a way of replacing them with a copy. +var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") + , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") + , fs = require("fs") + +try { fs.unlinkSync(hard2) } catch (e) {} +fs.linkSync(hard1, hard2) + +tap.test("with global header", { timeout: 10000 }, function (t) { + runTest(t, true) +}) + +tap.test("without global header", { timeout: 10000 }, function (t) { + runTest(t, false) +}) + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} + + +function runTest (t, doGH) { + var reader = Reader({ path: input + , filter: function () { + return !this.path.match(/\.(tar|hex)$/) + } + , sort: alphasort + }) + + var props = doGH ? pkg : {} + props.noProprietary = true + var pack = Pack(props) + var writer = Writer(target) + + // global header should be skipped regardless, since it has no content. + var entry = 0 + + t.ok(reader, "reader ok") + t.ok(pack, "pack ok") + t.ok(writer, "writer ok") + + pack.pipe(writer) + + var parse = tar.Parse() + t.ok(parse, "parser should be ok") + + pack.on("data", function (c) { + // console.error("PACK DATA") + if (c.length !== 512) { + // this one is too noisy, only assert if it'll be relevant + t.equal(c.length, 512, "parser should emit data in 512byte blocks") + } + parse.write(c) + }) + + pack.on("end", function () { + // console.error("PACK END") + t.pass("parser ends") + parse.end() + }) + + pack.on("error", function (er) { + t.fail("pack error", er) + }) + + parse.on("error", function (er) { + t.fail("parse error", er) + }) + + writer.on("error", function (er) { + t.fail("writer error", er) + }) + + reader.on("error", function (er) { + t.fail("reader error", er) + }) + + parse.on("*", function (ev, e) { + var wanted = entries[entry++] + if (!wanted) { + t.fail("unexpected event: "+ev) + return + } + t.equal(ev, wanted[0], "event type should be "+wanted[0]) + + if (ev !== wanted[0] || e.path !== wanted[1].path) { + console.error(wanted) + console.error([ev, e.props]) + e.on("end", function () { + console.error(e.fields) + throw "break" + }) + } + + t.has(e.props, wanted[1], "properties "+wanted[1].path) + if (wanted[2]) { + e.on("end", function () { + if (!e.fields) { + t.ok(e.fields, "should get fields") + } else { + t.has(e.fields, wanted[2], "should get expected fields") + } + }) + } + }) + + reader.pipe(pack) + + writer.on("close", function () { + t.equal(entry, entries.length, "should get all expected entries") + t.pass("it finished") + t.end() + }) + +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack.js new file mode 100644 index 0000000..0f50994 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/pack.js @@ -0,0 +1,897 @@ + +// the symlink file is excluded from git, because it makes +// windows freak the hell out. +var fs = require("fs") + , path = require("path") + , symlink = path.resolve(__dirname, "fixtures/symlink") +try { fs.unlinkSync(symlink) } catch (e) {} +fs.symlinkSync("./hardlink-1", symlink) +process.on("exit", function () { + fs.unlinkSync(symlink) +}) + + +var tap = require("tap") + , tar = require("../tar.js") + , pkg = require("../package.json") + , Pack = tar.Pack + , fstream = require("fstream") + , Reader = fstream.Reader + , Writer = fstream.Writer + , input = path.resolve(__dirname, "fixtures/") + , target = path.resolve(__dirname, "tmp/pack.tar") + , uid = process.getuid ? process.getuid() : 0 + , gid = process.getgid ? process.getgid() : 0 + + , entries = + + // the global header and root fixtures/ dir are going to get + // a different date each time, so omit that bit. + // Also, dev/ino values differ across machines, so that's not + // included. + [ [ 'globalExtendedHeader', + { path: 'PaxHeader/', + mode: 438, + uid: 0, + gid: 0, + type: 'g', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { "NODETAR.author": pkg.author, + "NODETAR.name": pkg.name, + "NODETAR.description": pkg.description, + "NODETAR.version": pkg.version, + "NODETAR.repository.type": pkg.repository.type, + "NODETAR.repository.url": pkg.repository.url, + "NODETAR.main": pkg.main, + "NODETAR.scripts.test": pkg.scripts.test } ] + + , [ 'entry', + { path: 'fixtures/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + uid: uid, + gid: gid, + size: 200, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/a.txt', + mode: 420, + uid: uid, + gid: gid, + size: 257, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/b.txt', + mode: 420, + uid: uid, + gid: gid, + size: 512, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/c.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/cc.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/foo.js', + mode: 420, + uid: uid, + gid: gid, + size: 4, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-1', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-2', + mode: 420, + uid: uid, + gid: gid, + size: 0, + type: '1', + linkpath: 'fixtures/hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/star.4.html', + mode: 420, + uid: uid, + gid: gid, + size: 54081, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/packtest/Ω.txt', + 'NODETAR.depth': '2', + 'NODETAR.type': 'File', + nlink: 1, + uid: uid, + gid: gid, + size: 2, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '2', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 100, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/symlink', + uid: uid, + gid: gid, + size: 0, + type: '2', + linkpath: 'hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: "fixtures/Ω.txt" + , "NODETAR.depth": "1" + , "NODETAR.type": "File" + , nlink: 1 + , uid: uid + , gid: gid + , size: 2 + , "NODETAR.blksize": "4096" + , "NODETAR.blocks": "8" } ] + + , [ 'entry', + { path: 'fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + ] + + +// first, make sure that the hardlinks are actually hardlinks, or this +// won't work. Git has a way of replacing them with a copy. +var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") + , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") + , fs = require("fs") + +try { fs.unlinkSync(hard2) } catch (e) {} +fs.linkSync(hard1, hard2) + +tap.test("with global header", { timeout: 10000 }, function (t) { + runTest(t, true) +}) + +tap.test("without global header", { timeout: 10000 }, function (t) { + runTest(t, false) +}) + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} + + +function runTest (t, doGH) { + var reader = Reader({ path: input + , filter: function () { + return !this.path.match(/\.(tar|hex)$/) + } + , sort: alphasort + }) + + var pack = Pack(doGH ? pkg : null) + var writer = Writer(target) + + // skip the global header if we're not doing that. + var entry = doGH ? 0 : 1 + + t.ok(reader, "reader ok") + t.ok(pack, "pack ok") + t.ok(writer, "writer ok") + + pack.pipe(writer) + + var parse = tar.Parse() + t.ok(parse, "parser should be ok") + + pack.on("data", function (c) { + // console.error("PACK DATA") + if (c.length !== 512) { + // this one is too noisy, only assert if it'll be relevant + t.equal(c.length, 512, "parser should emit data in 512byte blocks") + } + parse.write(c) + }) + + pack.on("end", function () { + // console.error("PACK END") + t.pass("parser ends") + parse.end() + }) + + pack.on("error", function (er) { + t.fail("pack error", er) + }) + + parse.on("error", function (er) { + t.fail("parse error", er) + }) + + writer.on("error", function (er) { + t.fail("writer error", er) + }) + + reader.on("error", function (er) { + t.fail("reader error", er) + }) + + parse.on("*", function (ev, e) { + var wanted = entries[entry++] + if (!wanted) { + t.fail("unexpected event: "+ev) + return + } + t.equal(ev, wanted[0], "event type should be "+wanted[0]) + + // if (ev !== wanted[0] || e.path !== wanted[1].path) { + // console.error(wanted) + // console.error([ev, e.props]) + // throw "break" + // } + + t.has(e.props, wanted[1], "properties "+wanted[1].path) + if (wanted[2]) { + e.on("end", function () { + if (!e.fields) { + t.ok(e.fields, "should get fields") + } else { + t.has(e.fields, wanted[2], "should get expected fields") + } + }) + } + }) + + reader.pipe(pack) + + writer.on("close", function () { + t.equal(entry, entries.length, "should get all expected entries") + t.pass("it finished") + t.end() + }) + +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/parse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/parse.js new file mode 100644 index 0000000..f765a50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/parse.js @@ -0,0 +1,359 @@ +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + , index = 0 + + , expect = +[ [ 'entry', + { path: 'c.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 513, + mtime: new Date('Wed, 26 Oct 2011 01:10:58 GMT'), + cksum: 5422, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'cc.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 513, + mtime: new Date('Wed, 26 Oct 2011 01:11:02 GMT'), + cksum: 5525, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 100, + mtime: new Date('Thu, 27 Oct 2011 03:43:23 GMT'), + cksum: 18124, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 2, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 5695, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 120, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 6702, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'Ω.txt', + ctime: 1319737909, + atime: 1319739061, + dev: 234881026, + ino: 51693379, + nlink: 1 } ], + [ 'entry', + { path: 'Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 2, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 5695, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + atime: new Date('Thu, 27 Oct 2011 18:11:01 GMT'), + dev: 234881026, + ino: 51693379, + nlink: 1 }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 353, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14488, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ctime: 1319686868, + atime: 1319741254, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 1 } ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 200, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14570, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + atime: new Date('Thu, 27 Oct 2011 18:47:34 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 1 }, + undefined ], + [ 'longPath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4976, + type: 'L', + linkpath: '', + ustar: false }, + '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 1000, + gid: 1000, + size: 201, + mtime: new Date('Thu, 27 Oct 2011 22:21:50 GMT'), + cksum: 14086, + type: '0', + linkpath: '', + ustar: false }, + undefined ], + [ 'longLinkpath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4975, + type: 'K', + linkpath: '', + ustar: false }, + '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], + [ 'longPath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4976, + type: 'L', + linkpath: '', + ustar: false }, + '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL' ], + [ 'entry', + { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: 511, + uid: 1000, + gid: 1000, + size: 0, + mtime: new Date('Fri, 28 Oct 2011 23:05:17 GMT'), + cksum: 21603, + type: '2', + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ustar: false }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200-hard', + mode: 420, + uid: 24561, + gid: 20, + size: 143, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 6533, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { ctime: 1320617144, + atime: 1320617232, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 } ], + [ 'entry', + { path: '200-hard', + mode: 420, + uid: 24561, + gid: 20, + size: 200, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 5526, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), + atime: new Date('Sun, 06 Nov 2011 22:07:12 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 353, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14488, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ctime: 1320617144, + atime: 1320617406, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 } ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 0, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 15173, + type: '1', + linkpath: '200-hard', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), + atime: new Date('Sun, 06 Nov 2011 22:10:06 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 }, + undefined ] ] + + +tap.test("parser test", function (t) { + var parser = tar.Parse() + + parser.on("end", function () { + t.equal(index, expect.length, "saw all expected events") + t.end() + }) + + fs.createReadStream(file) + .pipe(parser) + .on("*", function (ev, entry) { + var wanted = expect[index] + if (!wanted) { + return t.fail("Unexpected event: " + ev) + } + var result = [ev, entry.props] + entry.on("end", function () { + result.push(entry.fields || entry.body) + + t.equal(ev, wanted[0], index + " event type") + t.equivalent(entry.props, wanted[1], wanted[1].path + " entry properties") + if (wanted[2]) { + t.equivalent(result[2], wanted[2], "metadata values") + } + index ++ + }) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/zz-cleanup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/zz-cleanup.js new file mode 100644 index 0000000..a00ff7f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tar/test/zz-cleanup.js @@ -0,0 +1,20 @@ +// clean up the fixtures + +var tap = require("tap") +, rimraf = require("rimraf") +, test = tap.test +, path = require("path") + +test("clean fixtures", function (t) { + rimraf(path.resolve(__dirname, "fixtures"), function (er) { + t.ifError(er, "rimraf ./fixtures/") + t.end() + }) +}) + +test("clean tmp", function (t) { + rimraf(path.resolve(__dirname, "tmp"), function (er) { + t.ifError(er, "rimraf ./tmp/") + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.npmignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.travis.yml new file mode 100644 index 0000000..0175d82 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.6" + - "0.8" + - "0.10" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/README.md new file mode 100644 index 0000000..3a1a509 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/README.md @@ -0,0 +1,162 @@ +# Tmp + +A simple temporary file and directory creator for [node.js.][1] + +[![Build Status](https://secure.travis-ci.org/raszi/node-tmp.png?branch=master)](http://travis-ci.org/raszi/node-tmp) + +## About + +The main difference between bruce's [node-temp][2] is that mine more +aggressively checks for the existence of the newly created temporary file and +creates the new file with `O_EXCL` instead of simple `O_CREAT | O_RDRW`, so it +is safer. + +The API is slightly different as well, Tmp does not yet provide synchronous +calls and all the parameters are optional. + +You can set whether you want to remove the temporary file on process exit or +not, and the destination directory can also be set. + +## How to install + +```bash +npm install tmp +``` + +## Usage + +### File creation + +Simple temporary file creation, the file will be unlinked on process exit. + +```javascript +var tmp = require('tmp'); + +tmp.file(function _tempFileCreated(err, path, fd) { + if (err) throw err; + + console.log("File: ", path); + console.log("Filedescriptor: ", fd); +}); +``` + +### Directory creation + +Simple temporary directory creation, it will be removed on process exit. + +If the directory still contains items on process exit, then it won't be removed. + +```javascript +var tmp = require('tmp'); + +tmp.dir(function _tempDirCreated(err, path) { + if (err) throw err; + + console.log("Dir: ", path); +}); +``` + +If you want to cleanup the directory even when there are entries in it, then +you can pass the `unsafeCleanup` option when creating it. + +### Filename generation + +It is possible with this library to generate a unique filename in the specified +directory. + +```javascript +var tmp = require('tmp'); + +tmp.tmpName(function _tempNameGenerated(err, path) { + if (err) throw err; + + console.log("Created temporary filename: ", path); +}); +``` + +## Advanced usage + +### File creation + +Creates a file with mode `0644`, prefix will be `prefix-` and postfix will be `.txt`. + +```javascript +var tmp = require('tmp'); + +tmp.file({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) { + if (err) throw err; + + console.log("File: ", path); + console.log("Filedescriptor: ", fd); +}); +``` + +### Directory creation + +Creates a directory with mode `0755`, prefix will be `myTmpDir_`. + +```javascript +var tmp = require('tmp'); + +tmp.dir({ mode: 0750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) { + if (err) throw err; + + console.log("Dir: ", path); +}); +``` + +### mkstemps like + +Creates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`. + +```javascript +var tmp = require('tmp'); + +tmp.dir({ template: '/tmp/tmp-XXXXXX' }, function _tempDirCreated(err, path) { + if (err) throw err; + + console.log("Dir: ", path); +}); +``` + +### Filename generation + +The `tmpName()` function accepts the `prefix`, `postfix`, `dir`, etc. parameters also: + +```javascript +var tmp = require('tmp'); + +tmp.tmpName({ template: '/tmp/tmp-XXXXXX' }, function _tempNameGenerated(err, path) { + if (err) throw err; + + console.log("Created temporary filename: ", path); +}); +``` + +## Graceful cleanup + +One may want to cleanup the temporary files even when an uncaught exception +occurs. To enforce this, you can call the `setGracefulCleanup()` method: + +```javascript +var tmp = require('tmp'); + +tmp.setGracefulCleanup(); +``` + +## Options + +All options are optional :) + + * `mode`: the file mode to create with, it fallbacks to `0600` on file creation and `0700` on directory creation + * `prefix`: the optional prefix, fallbacks to `tmp-` if not provided + * `postfix`: the optional postfix, fallbacks to `.tmp` on file creation + * `template`: [`mkstemps`][3] like filename template, no default + * `dir`: the optional temporary directory, fallbacks to system default (guesses from environment) + * `tries`: how many times should the function try to get a unique filename before giving up, default `3` + * `keep`: signals that the temporary file or directory should not be deleted on exit, default is `false`, means delete + * `unsafeCleanup`: recursively removes the created temporary directory, even when it's not empty. default is `false` + +[1]: http://nodejs.org/ +[2]: https://github.com/bruce/node-temp +[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/domain-test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/domain-test.js new file mode 100644 index 0000000..47221bc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/domain-test.js @@ -0,0 +1,13 @@ +var domain = require('domain'); + +//throw new Error('bazz'); + +var d = domain.create(); +d.on('error', function ( e ) { + console.log('error!!!', e); +}); + +d.run(function () { + console.log('hey'); + throw new Error('bazz'); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/lib/tmp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/lib/tmp.js new file mode 100644 index 0000000..dcb5bbb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/lib/tmp.js @@ -0,0 +1,280 @@ +/*! + * Tmp + * + * Copyright (c) 2011-2013 KARASZI Istvan + * + * MIT Licensed + */ + +/** + * Module dependencies. + */ +var + fs = require('fs'), + path = require('path'), + os = require('os'), + exists = fs.exists || path.exists, + tmpDir = os.tmpDir || _getTMPDir, + _c = require('constants'); + +/** + * The working inner variables. + */ +var + // store the actual TMP directory + _TMP = tmpDir(), + + // the random characters to choose from + randomChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", + randomCharsLength = randomChars.length, + + // this will hold the objects need to be removed on exit + _removeObjects = [], + + _gracefulCleanup = false, + _uncaughtException = false; + +/** + * Gets the temp directory. + * + * @return {String} + * @api private + */ +function _getTMPDir() { + var tmpNames = [ 'TMPDIR', 'TMP', 'TEMP' ]; + + for (var i = 0, length = tmpNames.length; i < length; i++) { + if (_isUndefined(process.env[tmpNames[i]])) continue; + + return process.env[tmpNames[i]]; + } + + // fallback to the default + return '/tmp'; +} + +/** + * Checks whether the `obj` parameter is defined or not. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ +function _isUndefined(obj) { + return typeof obj === 'undefined'; +} + +/** + * Parses the function arguments. + * + * This function helps to have optional arguments. + * + * @param {Object} options + * @param {Function} callback + * @api private + */ +function _parseArguments(options, callback) { + if (!callback || typeof callback != "function") { + callback = options; + options = {}; + } + + return [ options, callback ]; +} + +/** + * Gets a temporary file name. + * + * @param {Object} opts + * @param {Function} cb + * @api private + */ +function _getTmpName(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1], + template = opts.template, + templateDefined = !_isUndefined(template), + tries = opts.tries || 3; + + if (isNaN(tries) || tries < 0) + return cb(new Error('Invalid tries')); + + if (templateDefined && !template.match(/XXXXXX/)) + return cb(new Error('Invalid template provided')); + + function _getName() { + + // prefix and postfix + if (!templateDefined) { + var name = [ + (_isUndefined(opts.prefix)) ? 'tmp-' : opts.prefix, + process.pid, + (Math.random() * 0x1000000000).toString(36), + opts.postfix + ].join(''); + + return path.join(opts.dir || _TMP, name); + } + + // mkstemps like template + var chars = []; + + for (var i = 0; i < 6; i++) { + chars.push(randomChars.substr(Math.floor(Math.random() * randomCharsLength), 1)); + } + + return template.replace(/XXXXXX/, chars.join('')); + } + + (function _getUniqueName() { + var name = _getName(); + + // check whether the path exists then retry if needed + exists(name, function _pathExists(pathExists) { + if (pathExists) { + if (tries-- > 0) return _getUniqueName(); + + return cb(new Error('Could not get a unique tmp filename, max tries reached')); + } + + cb(null, name); + }); + }()); +} + +/** + * Creates and opens a temporary file. + * + * @param {Object} options + * @param {Function} callback + * @api public + */ +function _createTmpFile(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix; + + // gets a temporary filename + _getTmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create and open the file + fs.open(name, _c.O_CREAT | _c.O_EXCL | _c.O_RDWR, opts.mode || 0600, function _fileCreated(err, fd) { + if (err) return cb(err); + + if (!opts.keep) _removeObjects.unshift([ fs.unlinkSync, name ]); + + cb(null, name, fd); + }); + }); +} + +/** + * Removes files and folders in a directory recursively. + * + * @param {String} path + */ +function _rmdirRecursiveSync(dir) { + var files = fs.readdirSync(dir); + + for (var i = 0, length = files.length; i < length; i++) { + var file = path.join(dir, files[i]); + // lstat so we don't recurse into symlinked directories. + var stat = fs.lstatSync(file); + + if (stat.isDirectory()) { + _rmdirRecursiveSync(file); + } else { + fs.unlinkSync(file); + } + } + + fs.rmdirSync(dir); +} + +/** + * Creates a temporary directory. + * + * @param {Object} options + * @param {Function} callback + * @api public + */ +function _createTmpDir(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + // gets a temporary filename + _getTmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create the directory + fs.mkdir(name, opts.mode || 0700, function _dirCreated(err) { + if (err) return cb(err); + + if (!opts.keep) { + if (opts.unsafeCleanup) { + _removeObjects.unshift([ _rmdirRecursiveSync, name ]); + } else { + _removeObjects.unshift([ fs.rmdirSync, name ]); + } + } + + cb(null, name); + }); + }); +} + +/** + * The garbage collector. + * + * @api private + */ +function _garbageCollector() { + if (_uncaughtException && !_gracefulCleanup) { + return; + } + + for (var i = 0, length = _removeObjects.length; i < length; i++) { + try { + _removeObjects[i][0].call(null, _removeObjects[i][1]); + } catch (e) { + // already removed? + } + } +} + +function _setGracefulCleanup() { + _gracefulCleanup = true; +} + +var version = process.versions.node.split('.').map(function (value) { + return parseInt(value, 10); +}); + +if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) { + process.addListener('uncaughtException', function _uncaughtExceptionThrown( err ) { + _uncaughtException = true; + _garbageCollector(); + + throw err; + }); +} + +process.addListener('exit', function _exit(code) { + if (code) _uncaughtException = true; + _garbageCollector(); +}); + +// exporting all the needed methods +module.exports.tmpdir = _TMP; +module.exports.dir = _createTmpDir; +module.exports.file = _createTmpFile; +module.exports.tmpName = _getTmpName; +module.exports.setGracefulCleanup = _setGracefulCleanup; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/package.json new file mode 100644 index 0000000..5004bf2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/package.json @@ -0,0 +1,52 @@ +{ + "name": "tmp", + "version": "0.0.23", + "description": "Temporary file and directory creator", + "author": { + "name": "KARASZI István", + "email": "github@spam.raszi.hu", + "url": "http://raszi.hu/" + }, + "homepage": "http://github.com/raszi/node-tmp", + "keywords": [ + "temporary", + "tmp", + "temp", + "tempdir", + "tempfile", + "tmpdir", + "tmpfile" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://opensource.org/licenses/MIT" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/raszi/node-tmp.git" + }, + "bugs": { + "url": "http://github.com/raszi/node-tmp/issues" + }, + "main": "lib/tmp.js", + "scripts": { + "test": "vows test/*-test.js" + }, + "engines": { + "node": ">=0.4.0" + }, + "dependencies": {}, + "devDependencies": { + "vows": "~0.7.0" + }, + "readme": "# Tmp\n\nA simple temporary file and directory creator for [node.js.][1]\n\n[![Build Status](https://secure.travis-ci.org/raszi/node-tmp.png?branch=master)](http://travis-ci.org/raszi/node-tmp)\n\n## About\n\nThe main difference between bruce's [node-temp][2] is that mine more\naggressively checks for the existence of the newly created temporary file and\ncreates the new file with `O_EXCL` instead of simple `O_CREAT | O_RDRW`, so it\nis safer.\n\nThe API is slightly different as well, Tmp does not yet provide synchronous\ncalls and all the parameters are optional.\n\nYou can set whether you want to remove the temporary file on process exit or\nnot, and the destination directory can also be set.\n\n## How to install\n\n```bash\nnpm install tmp\n```\n\n## Usage\n\n### File creation\n\nSimple temporary file creation, the file will be unlinked on process exit.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.file(function _tempFileCreated(err, path, fd) {\n if (err) throw err;\n\n console.log(\"File: \", path);\n console.log(\"Filedescriptor: \", fd);\n});\n```\n\n### Directory creation\n\nSimple temporary directory creation, it will be removed on process exit.\n\nIf the directory still contains items on process exit, then it won't be removed.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir(function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\nIf you want to cleanup the directory even when there are entries in it, then\nyou can pass the `unsafeCleanup` option when creating it.\n\n### Filename generation\n\nIt is possible with this library to generate a unique filename in the specified\ndirectory.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.tmpName(function _tempNameGenerated(err, path) {\n if (err) throw err;\n\n console.log(\"Created temporary filename: \", path);\n});\n```\n\n## Advanced usage\n\n### File creation\n\nCreates a file with mode `0644`, prefix will be `prefix-` and postfix will be `.txt`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.file({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) {\n if (err) throw err;\n\n console.log(\"File: \", path);\n console.log(\"Filedescriptor: \", fd);\n});\n```\n\n### Directory creation\n\nCreates a directory with mode `0755`, prefix will be `myTmpDir_`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir({ mode: 0750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\n### mkstemps like\n\nCreates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir({ template: '/tmp/tmp-XXXXXX' }, function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\n### Filename generation\n\nThe `tmpName()` function accepts the `prefix`, `postfix`, `dir`, etc. parameters also:\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.tmpName({ template: '/tmp/tmp-XXXXXX' }, function _tempNameGenerated(err, path) {\n if (err) throw err;\n\n console.log(\"Created temporary filename: \", path);\n});\n```\n\n## Graceful cleanup\n\nOne may want to cleanup the temporary files even when an uncaught exception\noccurs. To enforce this, you can call the `setGracefulCleanup()` method:\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.setGracefulCleanup();\n```\n\n## Options\n\nAll options are optional :)\n\n * `mode`: the file mode to create with, it fallbacks to `0600` on file creation and `0700` on directory creation\n * `prefix`: the optional prefix, fallbacks to `tmp-` if not provided\n * `postfix`: the optional postfix, fallbacks to `.tmp` on file creation\n * `template`: [`mkstemps`][3] like filename template, no default\n * `dir`: the optional temporary directory, fallbacks to system default (guesses from environment)\n * `tries`: how many times should the function try to get a unique filename before giving up, default `3`\n * `keep`: signals that the temporary file or directory should not be deleted on exit, default is `false`, means delete\n * `unsafeCleanup`: recursively removes the created temporary directory, even when it's not empty. default is `false`\n\n[1]: http://nodejs.org/\n[2]: https://github.com/bruce/node-temp\n[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html\n", + "readmeFilename": "README.md", + "_id": "tmp@0.0.23", + "dist": { + "shasum": "cb718a94caf5fb1d9ce70d6c54d594e25c262c04" + }, + "_from": "tmp@~0.0.20", + "_resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.23.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test-all.sh b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test-all.sh new file mode 100755 index 0000000..4734d60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test-all.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#node06 +for node in node08 node; do + command -v ${node} > /dev/null 2>&1 || continue + + echo "Testing with $(${node} --version)..." + ${node} node_modules/vows/bin/vows test/*test.js +done diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test.js new file mode 100644 index 0000000..8058221 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test.js @@ -0,0 +1,6 @@ +process.on('uncaughtException', function ( err ) { + console.log('blah'); + throw err; +}); + +throw "on purpose" diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/base.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/base.js new file mode 100644 index 0000000..498d8fb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/base.js @@ -0,0 +1,74 @@ +var + assert = require('assert'), + path = require('path'), + exec = require('child_process').exec; + +function _spawnTestWithError(testFile, params, cb) { + _spawnTest(true, testFile, params, cb); +} + +function _spawnTestWithoutError(testFile, params, cb) { + _spawnTest(false, testFile, params, cb); +} + +function _spawnTest(passError, testFile, params, cb) { + var + filename, + node_path = process.argv[0], + command = [ node_path, path.join(__dirname, testFile) ].concat(params).join(' '); + + exec(command, function _execDone(err, stdout, stderr) { + if (passError) { + if (err) { + return cb(err); + } else if (stderr.length > 0) { + return cb(stderr.toString()); + } + } + + return cb(null, stdout.toString()); + }); +} + +function _testStat(stat, mode) { + assert.equal(stat.uid, process.getuid(), 'should have the same UID'); + assert.equal(stat.gid, process.getgid(), 'should have the same GUID'); + assert.equal(stat.mode, mode); +} + +function _testPrefix(prefix) { + return function _testPrefixGenerated(err, name, fd) { + assert.equal(path.basename(name).slice(0, prefix.length), prefix, 'should have the provided prefix'); + }; +} + +function _testPostfix(postfix) { + return function _testPostfixGenerated(err, name, fd) { + assert.equal(name.slice(name.length - postfix.length, name.length), postfix, 'should have the provided postfix'); + }; +} + +function _testKeep(type, keep, cb) { + _spawnTestWithError('keep.js', [ type, keep ], cb); +} + +function _testGraceful(type, graceful, cb) { + _spawnTestWithoutError('graceful.js', [ type, graceful ], cb); +} + +function _assertName(err, name) { + assert.isString(name); + assert.isNotZero(name.length); +} + +function _testUnsafeCleanup(unsafe, cb) { + _spawnTestWithoutError('unsafe.js', [ 'dir', unsafe ], cb); +} + +module.exports.testStat = _testStat; +module.exports.testPrefix = _testPrefix; +module.exports.testPostfix = _testPostfix; +module.exports.testKeep = _testKeep; +module.exports.testGraceful = _testGraceful; +module.exports.assertName = _assertName; +module.exports.testUnsafeCleanup = _testUnsafeCleanup; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/dir-test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/dir-test.js new file mode 100644 index 0000000..9b89009 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/dir-test.js @@ -0,0 +1,183 @@ +var + vows = require('vows'), + assert = require('assert'), + + path = require('path'), + fs = require('fs'), + existsSync = fs.existsSync || path.existsSync, + + tmp = require('../lib/tmp.js'), + Test = require('./base.js'); + + +function _testDir(mode) { + return function _testDirGenerated(err, name) { + assert.ok(existsSync(name), 'should exist'); + + var stat = fs.statSync(name); + assert.ok(stat.isDirectory(), 'should be a directory'); + + Test.testStat(stat, mode); + }; +} + +vows.describe('Directory creation').addBatch({ + 'when using without parameters': { + topic: function () { + tmp.dir(this.callback); + }, + + 'should be a directory': _testDir(040700), + 'should have the default prefix': Test.testPrefix('tmp-') + }, + + 'when using with prefix': { + topic: function () { + tmp.dir({ prefix: 'something' }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040700), + 'should have the provided prefix': Test.testPrefix('something') + }, + + 'when using with postfix': { + topic: function () { + tmp.dir({ postfix: '.txt' }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040700), + 'should have the provided postfix': Test.testPostfix('.txt') + }, + + 'when using template': { + topic: function () { + tmp.dir({ template: path.join(tmp.tmpdir, 'clike-XXXXXX-postfix') }, this.callback); + }, + + 'should not return with error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testDir(040700), + 'should have the provided prefix': Test.testPrefix('clike-'), + 'should have the provided postfix': Test.testPostfix('-postfix') + }, + + 'when using multiple options': { + topic: function () { + tmp.dir({ prefix: 'foo', postfix: 'bar', mode: 0750 }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040750), + 'should have the provided prefix': Test.testPrefix('foo'), + 'should have the provided postfix': Test.testPostfix('bar') + }, + + 'when using multiple options and mode': { + topic: function () { + tmp.dir({ prefix: 'complicated', postfix: 'options', mode: 0755 }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040755), + 'should have the provided prefix': Test.testPrefix('complicated'), + 'should have the provided postfix': Test.testPostfix('options') + }, + + 'no tries': { + topic: function () { + tmp.dir({ tries: -1 }, this.callback); + }, + + 'should return with an error': assert.isObject + }, + + 'keep testing': { + topic: function () { + Test.testKeep('dir', '1', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a dir': function (err, name) { + _testDir(040700)(err, name); + fs.rmdirSync(name); + } + }, + + 'unlink testing': { + topic: function () { + Test.testKeep('dir', '0', this.callback); + }, + + 'should not return with error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), "Directory should be removed"); + } + }, + + 'non graceful testing': { + topic: function () { + Test.testGraceful('dir', '0', this.callback); + }, + + 'should not return with error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a dir': function (err, name) { + _testDir(040700)(err, name); + fs.rmdirSync(name); + } + }, + + 'graceful testing': { + topic: function () { + Test.testGraceful('dir', '1', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), "Directory should be removed"); + } + }, + + 'unsafeCleanup === true': { + topic: function () { + Test.testUnsafeCleanup('1', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), "Directory should be removed"); + }, + 'should remove symlinked dir': function(err, name) { + assert.ok( + !existsSync(name + '/symlinkme-target'), + 'should remove target' + ); + }, + 'should not remove contents of symlink dir': function(err, name) { + assert.ok( + existsSync(__dirname + '/symlinkme/file.js'), + 'should not remove symlinked directory\'s content' + ); + } + }, + + 'unsafeCleanup === false': { + topic: function () { + Test.testUnsafeCleanup('0', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040700) + } +}).exportTo(module); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/file-test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/file-test.js new file mode 100644 index 0000000..150ca11 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/file-test.js @@ -0,0 +1,165 @@ +var + vows = require('vows'), + assert = require('assert'), + + path = require('path'), + fs = require('fs'), + existsSync = fs.existsSync || path.existsSync, + + tmp = require('../lib/tmp.js'), + Test = require('./base.js'); + + +function _testFile(mode, fdTest) { + return function _testFileGenerated(err, name, fd) { + assert.ok(existsSync(name), 'should exist'); + + var stat = fs.statSync(name); + assert.equal(stat.size, 0, 'should have zero size'); + assert.ok(stat.isFile(), 'should be a file'); + + Test.testStat(stat, mode); + + // check with fstat as well (fd checking) + if (fdTest) { + var fstat = fs.fstatSync(fd); + assert.deepEqual(fstat, stat, 'fstat results should be the same'); + + var data = new Buffer('something'); + assert.equal(fs.writeSync(fd, data, 0, data.length, 0), data.length, 'should be writable'); + assert.ok(!fs.closeSync(fd), 'should not return with error'); + } + }; +} + +vows.describe('File creation').addBatch({ + 'when using without parameters': { + topic: function () { + tmp.file(this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100600, true), + 'should have the default prefix': Test.testPrefix('tmp-'), + 'should have the default postfix': Test.testPostfix('.tmp') + }, + + 'when using with prefix': { + topic: function () { + tmp.file({ prefix: 'something' }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100600, true), + 'should have the provided prefix': Test.testPrefix('something') + }, + + 'when using with postfix': { + topic: function () { + tmp.file({ postfix: '.txt' }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100600, true), + 'should have the provided postfix': Test.testPostfix('.txt') + + }, + + 'when using template': { + topic: function () { + tmp.file({ template: path.join(tmp.tmpdir, 'clike-XXXXXX-postfix') }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100600, true), + 'should have the provided prefix': Test.testPrefix('clike-'), + 'should have the provided postfix': Test.testPostfix('-postfix') + }, + + 'when using multiple options': { + topic: function () { + tmp.file({ prefix: 'foo', postfix: 'bar', mode: 0640 }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100640, true), + 'should have the provided prefix': Test.testPrefix('foo'), + 'should have the provided postfix': Test.testPostfix('bar') + }, + + 'when using multiple options and mode': { + topic: function () { + tmp.file({ prefix: 'complicated', postfix: 'options', mode: 0644 }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': _testFile(0100644, true), + 'should have the provided prefix': Test.testPrefix('complicated'), + 'should have the provided postfix': Test.testPostfix('options') + }, + + 'no tries': { + topic: function () { + tmp.file({ tries: -1 }, this.callback); + }, + + 'should not be created': assert.isObject + }, + + 'keep testing': { + topic: function () { + Test.testKeep('file', '1', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': function (err, name) { + _testFile(0100600, false)(err, name, null); + fs.unlinkSync(name); + } + }, + + 'unlink testing': { + topic: function () { + Test.testKeep('file', '0', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), "File should be removed"); + } + }, + + 'non graceful testing': { + topic: function () { + Test.testGraceful('file', '0', this.callback); + }, + + 'should not return with error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a file': function (err, name) { + _testFile(0100600, false)(err, name, null); + fs.unlinkSync(name); + } + }, + + 'graceful testing': { + topic: function () { + Test.testGraceful('file', '1', this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), "File should be removed"); + } + } + +}).exportTo(module); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/graceful.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/graceful.js new file mode 100644 index 0000000..c898656 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/graceful.js @@ -0,0 +1,15 @@ +var + tmp = require('../lib/tmp'), + spawn = require('./spawn'); + +var graceful = spawn.arg; + +if (graceful) { + tmp.setGracefulCleanup(); +} + +spawn.tmpFunction(function (err, name) { + spawn.out(name, function () { + throw new Error("Thrown on purpose"); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/keep.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/keep.js new file mode 100644 index 0000000..9538605 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/keep.js @@ -0,0 +1,11 @@ +var spawn = require('./spawn'); + +var keep = spawn.arg; + +spawn.tmpFunction({ keep: keep }, function (err, name) { + if (err) { + spawn.err(err, spawn.exit); + } else { + spawn.out(name, spawn.exit); + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/name-test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/name-test.js new file mode 100644 index 0000000..a242c21 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/name-test.js @@ -0,0 +1,82 @@ +var + vows = require('vows'), + assert = require('assert'), + + path = require('path'), + + tmp = require('../lib/tmp.js'), + Test = require('./base.js'); + +vows.describe('Name creation').addBatch({ + 'when using without parameters': { + topic: function () { + tmp.tmpName(this.callback); + }, + + 'should not return with error': assert.isNull, + 'should have the default prefix': Test.testPrefix('tmp-') + }, + + 'when using with prefix': { + topic: function () { + tmp.tmpName({ prefix: 'something' }, this.callback); + }, + + 'should not return with error': assert.isNull, + 'should have the provided prefix': Test.testPrefix('something') + }, + + 'when using with postfix': { + topic: function () { + tmp.tmpName({ postfix: '.txt' }, this.callback); + }, + + 'should not return with error': assert.isNull, + 'should have the provided postfix': Test.testPostfix('.txt') + + }, + + 'when using template': { + topic: function () { + tmp.tmpName({ template: path.join(tmp.tmpdir, 'clike-XXXXXX-postfix') }, this.callback); + }, + + 'should not return with error': assert.isNull, + 'should have the provided prefix': Test.testPrefix('clike-'), + 'should have the provided postfix': Test.testPostfix('-postfix'), + 'should have template filled': function (err, name) { + assert.isTrue(/[a-zA-Z0-9]{6}/.test(name)); + } + }, + + 'when using multiple options': { + topic: function () { + tmp.tmpName({ prefix: 'foo', postfix: 'bar', tries: 5 }, this.callback); + }, + + 'should not return with error': assert.isNull, + 'should have the provided prefix': Test.testPrefix('foo'), + 'should have the provided postfix': Test.testPostfix('bar') + }, + + 'no tries': { + topic: function () { + tmp.tmpName({ tries: -1 }, this.callback); + }, + + 'should fail': function (err, name) { + assert.isObject(err); + } + }, + + 'tries not numeric': { + topic: function () { + tmp.tmpName({ tries: 'hello'}, this.callback); + }, + + 'should fail': function (err, name) { + assert.isObject(err); + } + } + +}).exportTo(module); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/spawn.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/spawn.js new file mode 100644 index 0000000..6468eb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/spawn.js @@ -0,0 +1,32 @@ +var + fs = require('fs'), + tmp = require('../lib/tmp'); + +function _writeSync(stream, str, cb) { + var flushed = stream.write(str); + if (flushed) { + return cb(null); + } + + stream.once('drain', function _flushed() { + cb(null); + }); +} + +module.exports.out = function (str, cb) { + _writeSync(process.stdout, str, cb); +}; + +module.exports.err = function (str, cb) { + _writeSync(process.stderr, str, cb); +}; + +module.exports.exit = function () { + process.exit(0); +}; + +var type = process.argv[2]; +module.exports.tmpFunction = (type == 'file') ? tmp.file : tmp.dir; + +var arg = (process.argv[3] && parseInt(process.argv[3], 10) === 1) ? true : false; +module.exports.arg = arg; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/symlinkme/file.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/symlinkme/file.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/unsafe.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/unsafe.js new file mode 100644 index 0000000..73e4fb3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/tmp/test/unsafe.js @@ -0,0 +1,30 @@ +var + fs = require('fs'), + join = require('path').join, + spawn = require('./spawn'); + +var unsafe = spawn.arg; +spawn.tmpFunction({ unsafeCleanup: unsafe }, function (err, name) { + if (err) { + spawn.err(err, spawn.exit); + return; + } + + try { + // file that should be removed + var fd = fs.openSync(join(name, 'should-be-removed.file'), 'w'); + fs.closeSync(fd); + + // in tree source + var symlinkSource = join(__dirname, 'symlinkme'); + // testing target + var symlinkTarget = join(name, 'symlinkme-target'); + + // symlink that should be removed but the contents should be preserved. + fs.symlinkSync(symlinkSource, symlinkTarget, 'dir'); + + spawn.out(name, spawn.exit); + } catch (e) { + spawn.err(e.toString(), spawn.exit); + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/contributing.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/contributing.md new file mode 100644 index 0000000..0be6f2f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/contributing.md @@ -0,0 +1 @@ +See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contributing.md) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/check.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/check.js new file mode 100644 index 0000000..e432b03 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/check.js @@ -0,0 +1,18 @@ +'use strict'; +var updateNotifier = require('./update-notifier'); +var options = JSON.parse(process.argv[2]); +var updateNotifier = new updateNotifier.UpdateNotifier(options); + +updateNotifier.checkNpm(function (err, update) { + if (err) { + process.exit(1); + } + + if (update.type && update.type !== 'latest') { + updateNotifier.config.set('update', update); + } + + // Call process exit explicitly to terminate the child process + // Otherwise the child process will run forever (according to nodejs docs) + process.exit(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/update-notifier.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/update-notifier.js new file mode 100644 index 0000000..7fdd494 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/lib/update-notifier.js @@ -0,0 +1,147 @@ +'use strict'; +var util = require('util'); +var path = require('path'); +var fork = require('child_process').fork; +var Configstore = require('configstore'); +var request = require('request'); +var chalk = require('chalk'); +var semver = require('semver'); + +var proxyServer = process.env.HTTPS_PROXY + || process.env.https_proxy + || process.env.HTTP_PROXY + || process.env.http_proxy; + +function UpdateNotifier(options) { + this.options = options = options || {}; + + if (!options.packageName || !options.packageVersion) { + this.packageFile = require(path.resolve(path.dirname(module.parent.filename), options.packagePath || 'package')); + } + + if (options.callback) { + this.hasCallback = true; + } + + this.packageName = options.packageName || this.packageFile.name; + this.packageVersion = options.packageVersion || this.packageFile.version; + this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : 1000 * 60 * 60 * 24; // 1 day + this.updateCheckTimeout = typeof options.updateCheckTimeout === 'number' ? options.updateCheckTimeout : 20000; // 20 secs + this.registryUrl = options.registryUrl || 'http://registry.npmjs.org/%s'; + this.callback = options.callback || function () {}; + + if (!this.hasCallback) { + this.config = new Configstore('update-notifier-' + this.packageName, { + optOut: false + }); + } +} + +UpdateNotifier.prototype.check = function () { + if (this.hasCallback) { + return this.checkNpm(this.callback); + } + + var cp; + + if (this.config.get('optOut')) { + return; + } + + this.update = this.config.get('update'); + if (this.update) { + this.config.del('update'); + } + + // Only check for updates on a set interval + if (new Date() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) { + return; + } + + this.config.set('lastUpdateCheck', +new Date()); + this.config.del('update'); + + // Set some needed options before forking + // This is needed because we can't infer the packagePath in the fork + this.options.packageName = this.packageName; + this.options.packageVersion = this.packageVersion; + + // Fork, passing the options as an environment property + cp = fork(__dirname + '/check.js', [JSON.stringify(this.options)]); + cp.unref(); + cp.disconnect(); +}; + +UpdateNotifier.prototype.checkNpm = function (cb) { + var url = util.format(this.registryUrl, this.packageName); + + request({url: url, json: true, timeout: this.updateCheckTimeout, proxy: proxyServer}, function (error, response, body) { + var currentVersion, latestVersion; + + if (error) { + return cb(error); + } + + if (body.error) { + return cb(new Error('Package not found')); + } + + currentVersion = this.packageVersion; + latestVersion = body['dist-tags'].latest + + cb(null, { + latest: latestVersion, + current: currentVersion, + type: this.updateType(currentVersion, latestVersion), + date: body.time[latestVersion], + name: this.packageName + }); + }.bind(this)); +}; + +UpdateNotifier.prototype.notify = function(customMessage) { + var message = + chalk.blue('-----------------------------------------') + + '\nUpdate available: ' + chalk.green.bold(this.update.latest) + + chalk.gray(' (current: ' + this.update.current + ')') + + '\nRun ' + chalk.magenta('npm update -g ' + this.packageName) + + ' to update\n' + + chalk.blue('-----------------------------------------'); + if (customMessage) { + process.on('exit', function () { + console.log(typeof customMessage === 'string' ? customMessage : message); + }); + } else { + console.log(message); + } +}; + +UpdateNotifier.prototype.updateType = function(currentVersion, latestVersion) { + // Check if the current version is greater or equal than the latest npm version + // Invalid versions should be ignored + if (!semver.valid(currentVersion) || semver.gte(currentVersion, latestVersion)) { + return 'latest'; + } + + // Otherwise there's an update + currentVersion = currentVersion.split('.'); + latestVersion = latestVersion.split('.'); + + if (latestVersion[0] > currentVersion[0]) { + return 'major'; + } else if (latestVersion[1] > currentVersion[1]) { + return 'minor'; + } else if (latestVersion[2] > currentVersion[2]) { + return 'patch'; + } +}; + +module.exports = function(options) { + var updateNotifier = new UpdateNotifier(options); + + updateNotifier.check(); + + return updateNotifier; +}; + +module.exports.UpdateNotifier = UpdateNotifier; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/configstore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/configstore.js new file mode 100644 index 0000000..6a2cba7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/configstore.js @@ -0,0 +1,98 @@ +'use strict'; +var path = require('path'); +var fs = require('graceful-fs'); +var crypto = require('crypto'); +var os = require('os'); +var osenv = require('osenv'); +var EOL = os.EOL; +var _ = require('lodash'); +var mkdirp = require('mkdirp'); +var yaml = require('js-yaml'); + +var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-'); +var tmpDir = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user); +var configDir = process.env.XDG_CONFIG_HOME || path.join(osenv.home() || tmpDir, '.config'); +var permissionError = 'You don\'t have access to this file.'; + +function generateFakeUser() { + var uid = [process.pid, Date.now(), Math.floor(Math.random() * 1000000)].join('-'); + return crypto.createHash('md5').update(uid).digest('hex'); +} + +function Configstore(id, defaults) { + this.path = path.join(configDir, 'configstore', id + '.yml'); + this.all = _.extend({}, defaults, this.all); +} + +Configstore.prototype = Object.create(Object.prototype, { + all: { + get: function () { + try { + return yaml.safeLoad(fs.readFileSync(this.path, 'utf8'), { + filename: this.path, + schema: yaml.JSON_SCHEMA + }); + } catch (err) { + // create dir if it doesn't exist + if (err.code === 'ENOENT') { + mkdirp.sync(path.dirname(this.path)); + return {}; + } + + // improve the message of permission errors + if (err.code === 'EACCES') { + err.message = err.message + EOL + permissionError + EOL; + } + + // empty the file if it encounters invalid YAML + if (err.name === 'YAMLException') { + fs.writeFileSync(this.path, ''); + return {}; + } + + throw err; + } + }, + set: function (val) { + try { + // make sure the folder exists, it could have been + // deleted meanwhile + mkdirp.sync(path.dirname(this.path)); + fs.writeFileSync(this.path, yaml.safeDump(val, { + skipInvalid: true, + schema: yaml.JSON_SCHEMA + })); + } catch (err) { + // improve the message of permission errors + if (err.code === 'EACCES') { + err.message = err.message + EOL + permissionError + EOL; + } + + throw err; + } + } + }, + size: { + get: function () { + return _.size(this.all); + } + } +}); + +Configstore.prototype.get = function (key) { + return this.all[key]; +}; + +Configstore.prototype.set = function (key, val) { + var config = this.all; + config[key] = val; + this.all = config; +}; + +Configstore.prototype.del = function (key) { + var config = this.all; + delete config[key]; + this.all = config; +}; + +module.exports = Configstore; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/.bin/js-yaml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/.bin/js-yaml new file mode 120000 index 0000000..9dbd010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/HISTORY.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/HISTORY.md new file mode 100644 index 0000000..960a537 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/HISTORY.md @@ -0,0 +1,186 @@ +2.1.3 / 2013-10-16 +------------------ + +- Fix wrong loading of empty block scalars. + + +2.1.2 / 2013-10-07 +------------------ + +- Fix unwanted line breaks in folded scalars. + + +2.1.1 / 2013-10-02 +------------------ + +- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 +- Fixed reader bug in JSON-like sequences/mappings. + + +2.1.0 / 2013-06-05 +------------------ + +- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), + JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). +- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` + and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. +- Bug fix: export `NIL` constant from the public interface. +- Add `skipInvalid` dumper option. +- Use `safeLoad` for `require` extension. + + +2.0.5 / 2013-04-26 +------------------ + +- Close security issue in !!js/function constructor. + Big thanks to @nealpoole for security audit. + + +2.0.4 / 2013-04-08 +------------------ + +- Updated .npmignore to reduce package size + + +2.0.3 / 2013-02-26 +------------------ + +- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) + + +2.0.2 / 2013-02-15 +------------------ + +- Fixed input validation: tabs are printable characters. + + +2.0.1 / 2013-02-09 +------------------ + +- Fixed error, when options not passed to function cass + + +2.0.0 / 2013-02-09 +------------------ + +- Full rewrite. New architecture. Fast one-stage parsing. +- Changed custom types API. +- Added YAML dumper. + + +1.0.3 / 2012-11-05 +------------------ + +- Fixed utf-8 files loading. + + +1.0.2 / 2012-08-02 +------------------ + +- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. +- Fix timstamps incorectly parsed in local time when no time part specified. + + +1.0.1 / 2012-07-07 +------------------ + +- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. +- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. + + +1.0.0 / 2012-07-01 +------------------ + +- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. + Fixes #42. +- `require(filename)` now returns a single document and throws an Error if + file contains more than one document. +- CLI was merged back from js-yaml.bin + + +0.3.7 / 2012-02-28 +------------------ + +- Fix export of `addConstructor()`. Closes #39. + + +0.3.6 / 2012-02-22 +------------------ + +- Removed AMD parts - too buggy to use. Need help to rewrite from scratch +- Removed YUI compressor warning (renamed `double` variable). Closes #40. + + +0.3.5 / 2012-01-10 +------------------ + +- Workagound for .npmignore fuckup under windows. Thanks to airportyh. + + +0.3.4 / 2011-12-24 +------------------ + +- Fixes str[] for oldIEs support. +- Adds better has change support for browserified demo. +- improves compact output of Error. Closes #33. + + +0.3.3 / 2011-12-20 +------------------ + +- jsyaml executable moved to separate module. +- adds `compact` stringification of Errors. + + +0.3.2 / 2011-12-16 +------------------ + +- Fixes ug with block style scalars. Closes #26. +- All sources are passing JSLint now. +- Fixes bug in Safari. Closes #28. +- Fixes bug in Opers. Closes #29. +- Improves browser support. Closes #20. +- Added jsyaml executable. +- Added !!js/function support. Closes #12. + + +0.3.1 / 2011-11-18 +------------------ + +- Added AMD support for browserified version. +- Wrapped browserified js-yaml into closure. +- Fixed the resolvement of non-specific tags. Closes #17. +- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. +- Added !!js/regexp and !!js/undefined types. Partially solves #12. +- Fixed !!set mapping. +- Fixed month parse in dates. Closes #19. + + +0.3.0 / 2011-11-09 +------------------ + +- Removed JS.Class dependency. Closes #3. +- Added browserified version. Closes #13. +- Added live demo of browserified version. +- Ported some of the PyYAML tests. See #14. +- Fixed timestamp bug when fraction was given. + + +0.2.2 / 2011-11-06 +------------------ + +- Fixed crash on docs without ---. Closes #8. +- Fixed miltiline string parse +- Fixed tests/comments for using array as key + + +0.2.1 / 2011-11-02 +------------------ + +- Fixed short file read (<4k). Closes #9. + + +0.2.0 / 2011-11-02 +------------------ + +- First public release diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/LICENSE new file mode 100644 index 0000000..0f16ee9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2011, 2013 by Vitaly Puzrin + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/README.md new file mode 100644 index 0000000..7446d2a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/README.md @@ -0,0 +1,277 @@ +JS-YAML - YAML 1.2 parser and serializer for JavaScript +======================================================= + +[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml) + +[Online Demo](http://nodeca.github.com/js-yaml/) + + +This is an implementation of [YAML](http://yaml.org/), a human friendly data +serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was +completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. + + +Installation +------------ + +### YAML module for node.js + +``` +npm install js-yaml +``` + + +### CLI executable + +If you want to inspect your YAML files from CLI, install js-yaml globally: + +``` +npm install js-yaml -g +``` + +#### Usage + +``` +usage: js-yaml [-h] [-v] [-c] [-j] [-t] file + +Positional arguments: + file File with YAML document(s) + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -c, --compact Display errors in compact mode + -j, --to-json Output a non-funky boring JSON + -t, --trace Show stack trace on error +``` + + +### Bundled YAML library for browsers + +``` html + + +``` + +Browser support was done mostly for online demo. If you find any errors - feel +free to send pull requests with fixes. Also note, that IE and other old browsers +needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more +info. + +In node.js JS-YAML automatically registers handlers for `.yml` and `.yaml` +files. You can load them just with `require`. That's mostly equivalent to +calling `safeLoad()` on fetched content of a file. Just with one string! + +``` javascript +require('js-yaml'); + +// Get document, or throw exception on error +try { + var doc = require('/home/ixti/example.yml'); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### safeLoad (string [ , options ]) + +**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript +object or throws `YAMLException` on error. By default, does not support regexps, +functions and undefined. This method is safe for untrusted data. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `strict` _(default - false)_ makes the loader to throw errors instead of + warnings. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones + (`!!js/undefined`, `!!js/regexp` and `!!js/function`): + http://yaml.org/type/ + - `DEFAULT_FULL_SCHEMA` - all supported YAML types. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, JSON schema is not such strict as defined in the YAML specification. +It allows numbers in any notaion, use `Null` and `NULL` as `null`, etc. +Core schema also has no such restrictions. It allows binary notation for integers. + + +### load (string [ , options ]) + +**Use with care with untrusted sources**. The same as `safeLoad()` but uses +`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: +`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you +must additionally validate object structure, to avoid injections: + +``` javascript +var untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; + +// I'm just converting that string, what could possibly go wrong? +require('js-yaml').load(untrusted_code) + '' +``` + + +### safeLoadAll (string, iterator [ , options ]) + +Same as `safeLoad()`, but understands multi-document sources and apply +`iterator` to each document. + +``` javascript +var yaml = require('js-yaml'); + +yaml.safeLoadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### loadAll (string, iterator [ , options ]) + +Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. + + +### safeDump (object [ , options ]) + +Serializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +throw exception if you try to dump regexps or functions. However, you can +disable exceptions by `skipInvalid` option. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` (default: -1) - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. + +styles: + +``` none +!!null + "canonical" => "~" + +!!int + "binary" => "0b1", "0b101010", "0b1110001111010" + "octal" => "01", "052", "016172" + "decimal" => "1", "42", "7290" + "hexadecimal" => "0x1", "0x2A", "0x1C7A" + +!!null, !!bool, !!float + "lowercase" => "null", "true", "false", ".nan", '.inf' + "uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF' + "camelcase" => "Null", "True", "False", ".NaN", '.Inf' +``` + +By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`. + + + +### dump (object [ , options ]) + +Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). + + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScipt types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +``` +!!js/regexp /pattern/gim # RegExp +!!js/undefined '' # Undefined +!!js/function 'function () {...}' # Function +``` + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS do not allows objects +or array as keys, and stringifies (by calling .toString method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +Breaking changes in 1.x.x -> 2.0.x +---------------------------------- + +If your have not used __custom__ tags or loader classes - no changes needed. Just +upgrade library and enjoy high parse speed. + +In other case, you should rewrite your tag constructors and custom loader +classes, to conform new schema-based API. See +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and +[wiki](https://github.com/nodeca/js-yaml/wiki) for details. +Note, that parser internals were completely rewritten. + + +License +------- + +View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file +(MIT). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/bin/js-yaml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/bin/js-yaml.js new file mode 100755 index 0000000..5110a4c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,125 @@ +#!/usr/bin/env node + + +'use strict'; + + +// stdlib +var fs = require('fs'); +var util = require('util'); + + +// 3rd-party +var ArgumentParser = require('argparse').ArgumentParser; + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument(['-c', '--compact'], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +cli.addArgument(['-j', '--to-json'], { + help: 'Output a non-funky boring JSON', + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument(['-t', '--trace'], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + + +cli.addArgument(['file'], { + help: 'File to read' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + + +fs.readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if ('ENOENT' === error.code) { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (error) { + if (error instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (0 === output.length) { + output = null; + } else if (1 === output.length) { + output = output[0]; + } + } catch (error) { + if (options.trace && error.stack) { + console.error(error.stack); + } else { + console.error(error.toString(options.compact)); + } + + process.exit(1); + } + } else { + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + } + + if (isYaml) { + if (options.json) { + console.log(JSON.stringify(output, null, ' ')); + } else { + console.log("\n" + util.inspect(output, false, 10, true) + "\n"); + } + } else { + console.log(yaml.dump(output)); + } + + process.exit(0); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.js new file mode 100644 index 0000000..1cb987c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.js @@ -0,0 +1,104 @@ +'use strict'; + + +var fs = require('fs'); +var path = require('path'); +var util = require('util'); +var yaml = require('../lib/js-yaml'); + + +// Let define a couple of classes... + +function Point(x, y, z) { + this.klass = 'Point'; + this.x = x; + this.y = y; + this.z = z; +} + + +function Space(height, width, points) { + if (points) { + if (!points.every(function (point) { return point instanceof Point; })) { + throw new Error('A non-Point inside a points array!'); + } + } + + this.klass = 'Space'; + this.height = height; + this.width = width; + this.points = points; +} + + +// Let define YAML types to load and dump our Point/Space objects. + +var pointYamlType = new yaml.Type('!point', { + // The information used to load a Point. + loader: { + kind: 'array', // It must be an array. (sequence in YAML) + resolver: function (object) { + // It must contain exactly tree elements. + if (3 === object.length) { + return new Point(object[0], object[1], object[2]); + + // Otherwise, it is NOT a Point. + } else { + return yaml.NIL; + } + } + }, + // The information used to dump a Point. + dumper: { + kind: 'object', // It must be an object but not an array. + instanceOf: Point, // Also, it must be an instance of Point class. + representer: function (point) { + // And it should be represented in YAML as three-element sequence. + return [ point.x, point.y, point.z ]; + } + } +}); + + +var spaceYamlType = new yaml.Type('!space', { + loader: { + kind: 'object', // 'object' here means 'mapping' in YAML. + resolver: function (object) { + return new Space(object.height, object.width, object.points); + } + }, + dumper: { + kind: 'object', + instanceOf: Space + // The representer is omitted here. So, Space objects will be dumped as is. + // That is regular mapping with three key-value pairs but with !space tag. + } +}); + + +// After our types are defined, it's time to join them into a schema. + +var SPACE_SCHEMA = yaml.Schema.create([ spaceYamlType, pointYamlType ]); + + +// And read a document using that schema. + +fs.readFile(path.join(__dirname, 'custom_types.yaml'), 'utf8', function (error, data) { + var loaded; + + if (!error) { + loaded = yaml.load(data, { schema: SPACE_SCHEMA }); + console.log(util.inspect(loaded, false, 20, true)); + } else { + console.error(error.stack || error.message || String(error)); + } +}); + + +// There are some exports to play with this example interactively. + +module.exports.Point = Point; +module.exports.Space = Space; +module.exports.pointYamlType = pointYamlType; +module.exports.spaceYamlType = spaceYamlType; +module.exports.SPACE_SCHEMA = SPACE_SCHEMA; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yaml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yaml new file mode 100644 index 0000000..033134f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yaml @@ -0,0 +1,18 @@ +subject: Custom types in JS-YAML +spaces: +- !space + height: 1000 + width: 1000 + points: + - !point [ 10, 43, 23 ] + - !point [ 165, 0, 50 ] + - !point [ 100, 100, 100 ] + +- !space + height: 64 + width: 128 + points: + - !point [ 12, 43, 0 ] + - !point [ 1, 4, 90 ] + +- !space {} # An empty space diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.js new file mode 100644 index 0000000..7952b18 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.js @@ -0,0 +1,31 @@ +'use strict'; + + +var yaml = require('../lib/js-yaml'); +var object = require('./dumper.json'); + + +console.log(yaml.dump(object, { + flowLevel: 3, + styles: { + '!!int' : 'hexadecimal', + '!!null' : 'camelcase' + } +})); + + +// Output: +//============================================================================== +// name: Wizzard +// level: 0x11 +// sanity: Null +// inventory: +// - name: Hat +// features: [magic, pointed] +// traits: {} +// - name: Staff +// features: [] +// traits: {damage: 0xA} +// - name: Cloak +// features: [old] +// traits: {defence: 0x0, comfort: 0x3} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.json new file mode 100644 index 0000000..9f54c05 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/dumper.json @@ -0,0 +1,22 @@ +{ + "name" : "Wizzard", + "level" : 17, + "sanity" : null, + "inventory" : [ + { + "name" : "Hat", + "features" : [ "magic", "pointed" ], + "traits" : {} + }, + { + "name" : "Staff", + "features" : [], + "traits" : { "damage" : 10 } + }, + { + "name" : "Cloak", + "features" : [ "old" ], + "traits" : { "defence" : 0, "comfort" : 3 } + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.js new file mode 100644 index 0000000..2378aba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.js @@ -0,0 +1,18 @@ +'use strict'; + + +var fs = require('fs'); +var path = require('path'); +var util = require('util'); +var yaml = require('../lib/js-yaml'); + + +try { + var filename = path.join(__dirname, 'sample_document.yaml'), + contents = fs.readFileSync(filename, 'utf8'), + data = yaml.load(contents); + + console.log(util.inspect(data, false, 10, true)); +} catch (err) { + console.log(err.stack || String(err)); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.yaml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.yaml new file mode 100644 index 0000000..4479ee9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/sample_document.yaml @@ -0,0 +1,197 @@ +--- +# Collection Types ############################################################# +################################################################################ + +# http://yaml.org/type/map.html -----------------------------------------------# + +map: + # Unordered set of key: value pairs. + Block style: !!map + Clark : Evans + Ingy : döt Net + Oren : Ben-Kiki + Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } + +# http://yaml.org/type/omap.html ----------------------------------------------# + +omap: + # Explicitly typed ordered map (dictionary). + Bestiary: !!omap + - aardvark: African pig-like ant eater. Ugly. + - anteater: South-American ant eater. Two species. + - anaconda: South-American constrictor snake. Scaly. + # Etc. + # Flow style + Numbers: !!omap [ one: 1, two: 2, three : 3 ] + +# http://yaml.org/type/pairs.html ---------------------------------------------# + +pairs: + # Explicitly typed pairs. + Block tasks: !!pairs + - meeting: with team. + - meeting: with boss. + - break: lunch. + - meeting: with client. + Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] + +# http://yaml.org/type/set.html -----------------------------------------------# + +set: + # Explicitly typed set. + baseball players: !!set + ? Mark McGwire + ? Sammy Sosa + ? Ken Griffey + # Flow style + baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } + +# http://yaml.org/type/seq.html -----------------------------------------------# + +seq: + # Ordered sequence of nodes + Block style: !!seq + - Mercury # Rotates - no light/dark sides. + - Venus # Deadliest. Aptly named. + - Earth # Mostly dirt. + - Mars # Seems empty. + - Jupiter # The king. + - Saturn # Pretty. + - Uranus # Where the sun hardly shines. + - Neptune # Boring. No rings. + - Pluto # You call this a planet? + Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks + Jupiter, Saturn, Uranus, Neptune, # Gas + Pluto ] # Overrated + + +# Scalar Types ################################################################# +################################################################################ + +# http://yaml.org/type/binary.html --------------------------------------------# + +binary: + canonical: !!binary "\ + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" + generic: !!binary | + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= + description: + The binary value above is a tiny arrow encoded as a gif image. + +# http://yaml.org/type/bool.html ----------------------------------------------# + +bool: + - true + - True + - TRUE + - false + - False + - FALSE + +# http://yaml.org/type/float.html ---------------------------------------------# + +float: + canonical: 6.8523015e+5 + exponentioal: 685.230_15e+03 + fixed: 685_230.15 + sexagesimal: 190:20:30.15 + negative infinity: -.inf + not a number: .NaN + +# http://yaml.org/type/int.html -----------------------------------------------# + +int: + canonical: 685230 + decimal: +685_230 + octal: 02472256 + hexadecimal: 0x_0A_74_AE + binary: 0b1010_0111_0100_1010_1110 + sexagesimal: 190:20:30 + +# http://yaml.org/type/merge.html ---------------------------------------------# + +merge: + - &CENTER { x: 1, y: 2 } + - &LEFT { x: 0, y: 2 } + - &BIG { r: 10 } + - &SMALL { r: 1 } + + # All the following maps are equal: + + - # Explicit keys + x: 1 + y: 2 + r: 10 + label: nothing + + - # Merge one map + << : *CENTER + r: 10 + label: center + + - # Merge multiple maps + << : [ *CENTER, *BIG ] + label: center/big + + - # Override + << : [ *BIG, *LEFT, *SMALL ] + x: 1 + label: big/left/small + +# http://yaml.org/type/null.html ----------------------------------------------# + +null: + # This mapping has four keys, + # one has a value. + empty: + canonical: ~ + english: null + ~: null key + # This sequence has five + # entries, two have values. + sparse: + - ~ + - 2nd entry + - + - 4th entry + - Null + +# http://yaml.org/type/str.html -----------------------------------------------# + +string: abcd + +# http://yaml.org/type/timestamp.html -----------------------------------------# + +timestamp: + canonical: 2001-12-15T02:59:43.1Z + valid iso8601: 2001-12-14t21:59:43.10-05:00 + space separated: 2001-12-14 21:59:43.10 -5 + no time zone (Z): 2001-12-15 2:59:43.10 + date (00:00:00Z): 2002-12-14 + + +# JavaScript Specific Types #################################################### +################################################################################ + +# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp + +regexp: + simple: !!js/regexp foobar + modifiers: !!js/regexp /foobar/mi + +# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined + +undefined: !!js/undefined ~ + +# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function + +function: !!js/function > + function foobar() { + return 'Wow! JS-YAML Rocks!'; + } diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/index.js new file mode 100644 index 0000000..40606dd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/js-yaml.js'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml.js new file mode 100644 index 0000000..1409828 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml.js @@ -0,0 +1,43 @@ +'use strict'; + + +var loader = require('./js-yaml/loader'); +var dumper = require('./js-yaml/dumper'); + + +function deprecated(name) { + return function () { + throw new Error('Function ' + name + ' is deprecated and cannot be used.'); + }; +} + + +module.exports.NIL = require('./js-yaml/common').NIL; +module.exports.Type = require('./js-yaml/type'); +module.exports.Schema = require('./js-yaml/schema'); +module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe'); +module.exports.JSON_SCHEMA = require('./js-yaml/schema/json'); +module.exports.CORE_SCHEMA = require('./js-yaml/schema/core'); +module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); +module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full'); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.safeLoad = loader.safeLoad; +module.exports.safeLoadAll = loader.safeLoadAll; +module.exports.dump = dumper.dump; +module.exports.safeDump = dumper.safeDump; +module.exports.YAMLException = require('./js-yaml/exception'); + +// Deprecared schema names from JS-YAML 2.0.x +module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); +module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); +module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); + +// Deprecated functions from JS-YAML 1.x.x +module.exports.scan = deprecated('scan'); +module.exports.parse = deprecated('parse'); +module.exports.compose = deprecated('compose'); +module.exports.addConstructor = deprecated('addConstructor'); + + +require('./js-yaml/require'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/common.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/common.js new file mode 100644 index 0000000..cc7f824 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/common.js @@ -0,0 +1,60 @@ +'use strict'; + + +var NIL = {}; + + +function isNothing(subject) { + return (undefined === subject) || (null === subject); +} + + +function isObject(subject) { + return ('object' === typeof subject) && (null !== subject); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) { + return sequence; + } else if (isNothing(sequence)) { + return []; + } else { + return [ sequence ]; + } +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +module.exports.NIL = NIL; +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.extend = extend; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/dumper.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/dumper.js new file mode 100644 index 0000000..25a38bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/dumper.js @@ -0,0 +1,485 @@ +'use strict'; + + +var common = require('./common'); +var NIL = common.NIL; +var YAMLException = require('./exception'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + + +function kindOf(object) { + var kind = typeof object; + + if (null === object) { + return 'null'; + } else if ('number' === kind) { + return 0 === object % 1 ? 'integer' : 'float'; + } else if ('object' === kind && Array.isArray(object)) { + return 'array'; + } else { + return kind; + } +} + + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (null === map) { + return {}; + } + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if ('!!' === tag.slice(0, 2)) { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + + type = schema.compiledTypeMap[tag]; + + if (type && type.dumper) { + if (_hasOwnProperty.call(type.dumper.styleAliases, style)) { + style = type.dumper.styleAliases[style]; + } + } + + result[tag] = style; + } + + return result; +} + + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +function dump(input, options) { + options = options || {}; + + var schema = options['schema'] || DEFAULT_FULL_SCHEMA, + indent = Math.max(1, (options['indent'] || 2)), + skipInvalid = options['skipInvalid'] || false, + flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']), + styleMap = compileStyleMap(schema, options['styles'] || null), + + implicitTypes = schema.compiledImplicit, + explicitTypes = schema.compiledExplicit, + + kind, + tag, + result; + + function generateNextLine(level) { + return '\n' + common.repeat(' ', indent * level); + } + + function testImplicitResolving(object) { + var index, length, type; + + for (index = 0, length = implicitTypes.length; index < length; index += 1) { + type = implicitTypes[index]; + + if (null !== type.loader && + NIL !== type.loader.resolver(object, false)) { + return true; + } + } + + return false; + } + + function writeScalar(object) { + var isQuoted, checkpoint, position, length, character; + + result = ''; + isQuoted = false; + checkpoint = 0; + + // Ensure compatibility with YAML 1.0/1.1 loaders. + // TODO: This check should be moved into boolean type definition. + if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) { + isQuoted = true; + } + + if (0 === object.length || + CHAR_SPACE === object.charCodeAt(0) || + CHAR_SPACE === object.charCodeAt(object.length - 1)) { + isQuoted = true; + } + + for (position = 0, length = object.length; position < length; position += 1) { + character = object.charCodeAt(position); + + if (!isQuoted) { + if (CHAR_TAB === character || + CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character || + CHAR_COMMA === character || + CHAR_LEFT_SQUARE_BRACKET === character || + CHAR_RIGHT_SQUARE_BRACKET === character || + CHAR_LEFT_CURLY_BRACKET === character || + CHAR_RIGHT_CURLY_BRACKET === character || + CHAR_SHARP === character || + CHAR_AMPERSAND === character || + CHAR_ASTERISK === character || + CHAR_EXCLAMATION === character || + CHAR_VERTICAL_LINE === character || + CHAR_GREATER_THAN === character || + CHAR_SINGLE_QUOTE === character || + CHAR_DOUBLE_QUOTE === character || + CHAR_PERCENT === character || + CHAR_COMMERCIAL_AT === character || + CHAR_GRAVE_ACCENT === character || + CHAR_QUESTION === character || + CHAR_COLON === character || + CHAR_MINUS === character) { + isQuoted = true; + } + } + + if (ESCAPE_SEQUENCES[character] || + !((0x00020 <= character && character <= 0x00007E) || + (0x00085 === character) || + (0x000A0 <= character && character <= 0x00D7FF) || + (0x0E000 <= character && character <= 0x00FFFD) || + (0x10000 <= character && character <= 0x10FFFF))) { + result += object.slice(checkpoint, position); + result += ESCAPE_SEQUENCES[character] || encodeHex(character); + checkpoint = position + 1; + isQuoted = true; + } + } + + if (checkpoint < position) { + result += object.slice(checkpoint, position); + } + + if (!isQuoted && testImplicitResolving(result)) { + isQuoted = true; + } + + if (isQuoted) { + result = '"' + result + '"'; + } + } + + function writeFlowSequence(level, object) { + var _result = '', + _tag = tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(level, object[index], false, false)) { + if (0 !== index) { + _result += ', '; + } + _result += result; + } + } + + tag = _tag; + result = '[' + _result + ']'; + } + + function writeBlockSequence(level, object, compact) { + var _result = '', + _tag = tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(level + 1, object[index], true, true)) { + if (!compact || 0 !== index) { + _result += generateNextLine(level); + } + _result += '- ' + result; + } + } + + tag = _tag; + result = _result || '[]'; // Empty sequence if no valid values. + } + + function writeFlowMapping(level, object) { + var _result = '', + _tag = tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (0 !== index) { + pairBuffer += ', '; + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (result.length > 1024) { + pairBuffer += '? '; + } + + pairBuffer += result + ': '; + + if (!writeNode(level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += result; + + // Both key and value are valid. + _result += pairBuffer; + } + + tag = _tag; + result = '{' + _result + '}'; + } + + function writeBlockMapping(level, object, compact) { + var _result = '', + _tag = tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || 0 !== index) { + pairBuffer += generateNextLine(level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(level + 1, objectKey, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (null !== tag && '?' !== tag && result.length <= 1024); + + if (explicitPair) { + pairBuffer += '? '; + } + + pairBuffer += result; + + if (explicitPair) { + pairBuffer += generateNextLine(level); + } + + if (!writeNode(level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += ': ' + result; + + // Both key and value are valid. + _result += pairBuffer; + } + + tag = _tag; + result = _result || '{}'; // Empty mapping if no valid pairs. + } + + function detectType(object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? explicitTypes : implicitTypes; + kind = kindOf(object); + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((null !== type.dumper) && + (null === type.dumper.kind || kind === type.dumper.kind) && + (null === type.dumper.instanceOf || object instanceof type.dumper.instanceOf) && + (null === type.dumper.predicate || type.dumper.predicate(object))) { + tag = explicit ? type.tag : '?'; + + if (null !== type.dumper.representer) { + style = styleMap[type.tag] || type.dumper.defaultStyle; + + if ('function' === typeof type.dumper.representer) { + _result = type.dumper.representer(object, style); + } else if (_hasOwnProperty.call(type.dumper.representer, style)) { + _result = type.dumper.representer[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + if (NIL !== _result) { + kind = kindOf(_result); + result = _result; + } else { + if (explicit) { + throw new YAMLException('cannot represent an object of !<' + type.tag + '> type'); + } else { + continue; + } + } + } + + return true; + } + } + + return false; + } + + // Serializes `object` and writes it to global `result`. + // Returns true on success, or false on invalid object. + // + function writeNode(level, object, block, compact) { + tag = null; + result = object; + + if (!detectType(object, false)) { + detectType(object, true); + } + + if (block) { + block = (0 > flowLevel || flowLevel > level); + } + + if ((null !== tag && '?' !== tag) || (2 !== indent && level > 0)) { + compact = false; + } + + if ('object' === kind) { + if (block && (0 !== Object.keys(result).length)) { + writeBlockMapping(level, result, compact); + } else { + writeFlowMapping(level, result); + } + } else if ('array' === kind) { + if (block && (0 !== result.length)) { + writeBlockSequence(level, result, compact); + } else { + writeFlowSequence(level, result); + } + } else if ('string' === kind) { + if ('?' !== tag) { + writeScalar(result); + } + } else if (skipInvalid) { + return false; + } else { + throw new YAMLException('unacceptabe kind of an object to dump (' + kind + ')'); + } + + if (null !== tag && '?' !== tag) { + result = '!<' + tag + '> ' + result; + } + return true; + } + + if (writeNode(0, input, true, true)) { + return result + '\n'; + } else { + return ''; + } +} + + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.dump = dump; +module.exports.safeDump = safeDump; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/exception.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/exception.js new file mode 100644 index 0000000..479ba88 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/exception.js @@ -0,0 +1,25 @@ +'use strict'; + + +function YAMLException(reason, mark) { + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = this.toString(false); +} + + +YAMLException.prototype.toString = function toString(compact) { + var result; + + result = 'JS-YAML: ' + (this.reason || '(unknown reason)'); + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/loader.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/loader.js new file mode 100644 index 0000000..2230318 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/loader.js @@ -0,0 +1,1585 @@ +'use strict'; + + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var NIL = common.NIL; +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var KIND_STRING = 'string'; +var KIND_ARRAY = 'array'; +var KIND_OBJECT = 'object'; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_PLUS = 0x2B; /* + */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_DOT = 0x2E; /* . */ +var CHAR_SLASH = 0x2F; /* / */ +var CHAR_DIGIT_ZERO = 0x30; /* 0 */ +var CHAR_DIGIT_ONE = 0x31; /* 1 */ +var CHAR_DIGIT_NINE = 0x39; /* 9 */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_LESS_THAN = 0x3C; /* < */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_CAPITAL_A = 0x41; /* A */ +var CHAR_CAPITAL_F = 0x46; /* F */ +var CHAR_CAPITAL_L = 0x4C; /* L */ +var CHAR_CAPITAL_N = 0x4E; /* N */ +var CHAR_CAPITAL_P = 0x50; /* P */ +var CHAR_CAPITAL_U = 0x55; /* U */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_BACKSLASH = 0x5C; /* \ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_UNDERSCORE = 0x5F; /* _ */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_SMALL_A = 0x61; /* a */ +var CHAR_SMALL_B = 0x62; /* b */ +var CHAR_SMALL_E = 0x65; /* e */ +var CHAR_SMALL_F = 0x66; /* f */ +var CHAR_SMALL_N = 0x6E; /* n */ +var CHAR_SMALL_R = 0x72; /* r */ +var CHAR_SMALL_T = 0x74; /* t */ +var CHAR_SMALL_U = 0x75; /* u */ +var CHAR_SMALL_V = 0x76; /* v */ +var CHAR_SMALL_X = 0x78; /* x */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + + +var SIMPLE_ESCAPE_SEQUENCES = {}; + +SIMPLE_ESCAPE_SEQUENCES[CHAR_DIGIT_ZERO] = '\x00'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_A] = '\x07'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_B] = '\x08'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_T] = '\x09'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_TAB] = '\x09'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_N] = '\x0A'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_V] = '\x0B'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_F] = '\x0C'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_R] = '\x0D'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_E] = '\x1B'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SPACE] = ' '; +SIMPLE_ESCAPE_SEQUENCES[CHAR_DOUBLE_QUOTE] = '\x22'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_SLASH] = '/'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_BACKSLASH] = '\x5C'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_N] = '\x85'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_UNDERSCORE] = '\xA0'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_L] = '\u2028'; +SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_P] = '\u2029'; + + +var HEXADECIMAL_ESCAPE_SEQUENCES = {}; + +HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_SMALL_X] = 2; +HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_SMALL_U] = 4; +HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_CAPITAL_U] = 8; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function loadAll(input, output, options) { + options = options || {}; + + var filename = options['filename'] || null, + schema = options['schema'] || DEFAULT_FULL_SCHEMA, + resolve = options['resolve'] || true, + validate = options['validate'] || true, + strict = options['strict'] || false, + legacy = options['legacy'] || false, + + directiveHandlers = {}, + implicitTypes = schema.compiledImplicit, + typeMap = schema.compiledTypeMap, + + length = input.length, + position = 0, + line = 0, + lineStart = 0, + lineIndent = 0, + character = input.charCodeAt(position), + + version, + checkLineBreaks, + tagMap, + anchorMap, + tag, + anchor, + kind, + result; + + function generateError(message) { + return new YAMLException( + message, + new Mark(filename, input, position, line, (position - lineStart))); + } + + function throwError(message) { + throw generateError(message); + } + + function throwWarning(message) { + var error = generateError(message); + + if (strict) { + throw error; + } else { + console.warn(error.toString()); + } + } + + directiveHandlers['YAML'] = function handleYamlDirective(name, args) { + var match, major, minor; + + if (null !== version) { + throwError('duplication of %YAML directive'); + } + + if (1 !== args.length) { + throwError('YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (null === match) { + throwError('ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (1 !== major) { + throwError('unacceptable YAML version of the document'); + } + + version = args[0]; + checkLineBreaks = (minor < 2); + + if (1 !== minor && 2 !== minor) { + throwWarning('unsupported YAML version of the document'); + } + }; + + directiveHandlers['TAG'] = function handleTagDirective(name, args) { + var handle, prefix; + + if (2 !== args.length) { + throwError('TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError('ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(tagMap, handle)) { + throwError('there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError('ill-formed tag prefix (second argument) of the TAG directive'); + } + + tagMap[handle] = prefix; + }; + + function captureSegment(start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = input.slice(start, end); + + if (checkJson && validate) { + for (_position = 0, _length = _result.length; + _position < _length; + _position += 1) { + _character = _result.charCodeAt(_position); + if (!(0x09 === _character || + 0x20 <= _character && _character <= 0x10FFFF)) { + throwError('expected valid JSON character'); + } + } + } + + result += _result; + } + } + + function mergeMappings(destination, source) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError('cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + } + } + } + + function storeMappingPair(_result, keyTag, keyNode, valueNode) { + var index, quantity; + + keyNode = String(keyNode); + + if (null === _result) { + _result = {}; + } + + if ('tag:yaml.org,2002:merge' === keyTag) { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(_result, valueNode[index]); + } + } else { + mergeMappings(_result, valueNode); + } + } else { + _result[keyNode] = valueNode; + } + + return _result; + } + + function readLineBreak() { + if (CHAR_LINE_FEED === character) { + position += 1; + } else if (CHAR_CARRIAGE_RETURN === character) { + if (CHAR_LINE_FEED === input.charCodeAt(position + 1)) { + position += 2; + } else { + position += 1; + } + } else { + throwError('a line break is expected'); + } + + line += 1; + lineStart = position; + character = input.charCodeAt(position); + } + + function skipSeparationSpace(allowComments, checkIndent) { + var lineBreaks = 0; + + while (position < length) { + while (CHAR_SPACE === character || CHAR_TAB === character) { + character = input.charCodeAt(++position); + } + + if (allowComments && CHAR_SHARP === character) { + do { character = input.charCodeAt(++position); } + while (position < length && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character); + } + + if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { + readLineBreak(); + lineBreaks += 1; + lineIndent = 0; + + while (CHAR_SPACE === character) { + lineIndent += 1; + character = input.charCodeAt(++position); + } + + if (lineIndent < checkIndent) { + throwWarning('deficient indentation'); + } + } else { + break; + } + } + + return lineBreaks; + } + + function testDocumentSeparator() { + var _position, _character; + + if (position === lineStart && + (CHAR_MINUS === character || CHAR_DOT === character) && + input.charCodeAt(position + 1) === character && + input.charCodeAt(position + 2) === character) { + + _position = position + 3; + _character = input.charCodeAt(_position); + + if (_position >= length || + CHAR_SPACE === _character || + CHAR_TAB === _character || + CHAR_LINE_FEED === _character || + CHAR_CARRIAGE_RETURN === _character) { + return true; + } + } + + return false; + } + + function writeFoldedLines(count) { + if (1 === count) { + result += ' '; + } else if (count > 1) { + result += common.repeat('\n', count - 1); + } + } + + function readPlainScalar(nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = kind, + _result = result; + + if (CHAR_SPACE === character || + CHAR_TAB === character || + CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character || + CHAR_COMMA === character || + CHAR_LEFT_SQUARE_BRACKET === character || + CHAR_RIGHT_SQUARE_BRACKET === character || + CHAR_LEFT_CURLY_BRACKET === character || + CHAR_RIGHT_CURLY_BRACKET === character || + CHAR_SHARP === character || + CHAR_AMPERSAND === character || + CHAR_ASTERISK === character || + CHAR_EXCLAMATION === character || + CHAR_VERTICAL_LINE === character || + CHAR_GREATER_THAN === character || + CHAR_SINGLE_QUOTE === character || + CHAR_DOUBLE_QUOTE === character || + CHAR_PERCENT === character || + CHAR_COMMERCIAL_AT === character || + CHAR_GRAVE_ACCENT === character) { + return false; + } + + if (CHAR_QUESTION === character || + CHAR_MINUS === character) { + following = input.charCodeAt(position + 1); + + if (CHAR_SPACE === following || + CHAR_TAB === following || + CHAR_LINE_FEED === following || + CHAR_CARRIAGE_RETURN === following || + withinFlowCollection && + (CHAR_COMMA === following || + CHAR_LEFT_SQUARE_BRACKET === following || + CHAR_RIGHT_SQUARE_BRACKET === following || + CHAR_LEFT_CURLY_BRACKET === following || + CHAR_RIGHT_CURLY_BRACKET === following)) { + return false; + } + } + + kind = KIND_STRING; + result = ''; + captureStart = captureEnd = position; + hasPendingContent = false; + + while (position < length) { + if (CHAR_COLON === character) { + following = input.charCodeAt(position + 1); + + if (CHAR_SPACE === following || + CHAR_TAB === following || + CHAR_LINE_FEED === following || + CHAR_CARRIAGE_RETURN === following || + withinFlowCollection && + (CHAR_COMMA === following || + CHAR_LEFT_SQUARE_BRACKET === following || + CHAR_RIGHT_SQUARE_BRACKET === following || + CHAR_LEFT_CURLY_BRACKET === following || + CHAR_RIGHT_CURLY_BRACKET === following)) { + break; + } + + } else if (CHAR_SHARP === character) { + preceding = input.charCodeAt(position - 1); + + if (CHAR_SPACE === preceding || + CHAR_TAB === preceding || + CHAR_LINE_FEED === preceding || + CHAR_CARRIAGE_RETURN === preceding) { + break; + } + + } else if ((position === lineStart && testDocumentSeparator()) || + withinFlowCollection && + (CHAR_COMMA === character || + CHAR_LEFT_SQUARE_BRACKET === character || + CHAR_RIGHT_SQUARE_BRACKET === character || + CHAR_LEFT_CURLY_BRACKET === character || + CHAR_RIGHT_CURLY_BRACKET === character)) { + break; + + } else if (CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character) { + _line = line; + _lineStart = lineStart; + _lineIndent = lineIndent; + skipSeparationSpace(false, -1); + + if (lineIndent >= nodeIndent) { + hasPendingContent = true; + continue; + } else { + position = captureEnd; + line = _line; + lineStart = _lineStart; + lineIndent = _lineIndent; + character = input.charCodeAt(position); + break; + } + } + + if (hasPendingContent) { + captureSegment(captureStart, captureEnd, false); + writeFoldedLines(line - _line); + captureStart = captureEnd = position; + hasPendingContent = false; + } + + if (CHAR_SPACE !== character && CHAR_TAB !== character) { + captureEnd = position + 1; + } + + character = input.charCodeAt(++position); + } + + captureSegment(captureStart, captureEnd, false); + + if (result) { + return true; + } else { + kind = _kind; + result = _result; + return false; + } + } + + function readSingleQuotedScalar(nodeIndent) { + var captureStart, captureEnd; + + if (CHAR_SINGLE_QUOTE !== character) { + return false; + } + + kind = KIND_STRING; + result = ''; + character = input.charCodeAt(++position); + captureStart = captureEnd = position; + + while (position < length) { + if (CHAR_SINGLE_QUOTE === character) { + captureSegment(captureStart, position, true); + character = input.charCodeAt(++position); + + if (CHAR_SINGLE_QUOTE === character) { + captureStart = captureEnd = position; + character = input.charCodeAt(++position); + } else { + return true; + } + + } else if (CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character) { + captureSegment(captureStart, captureEnd, true); + writeFoldedLines(skipSeparationSpace(false, nodeIndent)); + captureStart = captureEnd = position; + character = input.charCodeAt(position); + + } else if (position === lineStart && testDocumentSeparator()) { + throwError('unexpected end of the document within a single quoted scalar'); + + } else { + character = input.charCodeAt(++position); + captureEnd = position; + } + } + + throwError('unexpected end of the stream within a single quoted scalar'); + } + + function readDoubleQuotedScalar(nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexIndex, + hexOffset, + hexResult; + + if (CHAR_DOUBLE_QUOTE !== character) { + return false; + } + + kind = KIND_STRING; + result = ''; + character = input.charCodeAt(++position); + captureStart = captureEnd = position; + + while (position < length) { + if (CHAR_DOUBLE_QUOTE === character) { + captureSegment(captureStart, position, true); + character = input.charCodeAt(++position); + return true; + + } else if (CHAR_BACKSLASH === character) { + captureSegment(captureStart, position, true); + character = input.charCodeAt(++position); + + if (CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character) { + skipSeparationSpace(false, nodeIndent); + + } else if (SIMPLE_ESCAPE_SEQUENCES[character]) { + result += SIMPLE_ESCAPE_SEQUENCES[character]; + character = input.charCodeAt(++position); + + } else if (HEXADECIMAL_ESCAPE_SEQUENCES[character]) { + hexLength = HEXADECIMAL_ESCAPE_SEQUENCES[character]; + hexResult = 0; + + for (hexIndex = 1; hexIndex <= hexLength; hexIndex += 1) { + hexOffset = (hexLength - hexIndex) * 4; + character = input.charCodeAt(++position); + + if (CHAR_DIGIT_ZERO <= character && character <= CHAR_DIGIT_NINE) { + hexResult |= (character - CHAR_DIGIT_ZERO) << hexOffset; + + } else if (CHAR_CAPITAL_A <= character && character <= CHAR_CAPITAL_F) { + hexResult |= (character - CHAR_CAPITAL_A + 10) << hexOffset; + + } else if (CHAR_SMALL_A <= character && character <= CHAR_SMALL_F) { + hexResult |= (character - CHAR_SMALL_A + 10) << hexOffset; + + } else { + throwError('expected hexadecimal character'); + } + } + + result += String.fromCharCode(hexResult); + character = input.charCodeAt(++position); + + } else { + throwError('unknown escape sequence'); + } + + captureStart = captureEnd = position; + + } else if (CHAR_LINE_FEED === character || + CHAR_CARRIAGE_RETURN === character) { + captureSegment(captureStart, captureEnd, true); + writeFoldedLines(skipSeparationSpace(false, nodeIndent)); + captureStart = captureEnd = position; + character = input.charCodeAt(position); + + } else if (position === lineStart && testDocumentSeparator()) { + throwError('unexpected end of the document within a double quoted scalar'); + + } else { + character = input.charCodeAt(++position); + captureEnd = position; + } + } + + throwError('unexpected end of the stream within a double quoted scalar'); + } + + function readFlowCollection(nodeIndent) { + var readNext = true, + _line, + _tag = tag, + _result, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + keyNode, + keyTag, + valueNode; + + switch (character) { + case CHAR_LEFT_SQUARE_BRACKET: + terminator = CHAR_RIGHT_SQUARE_BRACKET; + isMapping = false; + _result = []; + break; + + case CHAR_LEFT_CURLY_BRACKET: + terminator = CHAR_RIGHT_CURLY_BRACKET; + isMapping = true; + _result = {}; + break; + + default: + return false; + } + + if (null !== anchor) { + anchorMap[anchor] = _result; + } + + character = input.charCodeAt(++position); + + while (position < length) { + skipSeparationSpace(true, nodeIndent); + + if (character === terminator) { + character = input.charCodeAt(++position); + tag = _tag; + kind = isMapping ? KIND_OBJECT : KIND_ARRAY; + result = _result; + return true; + } else if (!readNext) { + throwError('missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (CHAR_QUESTION === character) { + following = input.charCodeAt(position + 1); + + if (CHAR_SPACE === following || + CHAR_TAB === following || + CHAR_LINE_FEED === following || + CHAR_CARRIAGE_RETURN === following) { + isPair = isExplicitPair = true; + position += 1; + character = following; + skipSeparationSpace(true, nodeIndent); + } + } + + _line = line; + composeNode(nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = tag; + keyNode = result; + skipSeparationSpace(true, nodeIndent); + + if ((isExplicitPair || line === _line) && CHAR_COLON === character) { + isPair = true; + character = input.charCodeAt(++position); + skipSeparationSpace(true, nodeIndent); + composeNode(nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = result; + } + + if (isMapping) { + storeMappingPair(_result, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(null, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(true, nodeIndent); + + if (CHAR_COMMA === character) { + readNext = true; + character = input.charCodeAt(++position); + } else { + readNext = false; + } + } + + throwError('unexpected end of the stream within a flow collection'); + } + + function readBlockScalar(nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false; + + switch (character) { + case CHAR_VERTICAL_LINE: + folding = false; + break; + + case CHAR_GREATER_THAN: + folding = true; + break; + + default: + return false; + } + + kind = KIND_STRING; + result = ''; + + while (position < length) { + character = input.charCodeAt(++position); + + if (CHAR_PLUS === character || CHAR_MINUS === character) { + if (CHOMPING_CLIP === chomping) { + chomping = (CHAR_PLUS === character) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError('repeat of a chomping mode identifier'); + } + + } else if (CHAR_DIGIT_ZERO <= character && character <= CHAR_DIGIT_NINE) { + if (CHAR_DIGIT_ZERO === character) { + throwError('bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + (character - CHAR_DIGIT_ONE); + detectedIndent = true; + } else { + throwError('repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (CHAR_SPACE === character || CHAR_TAB === character) { + do { character = input.charCodeAt(++position); } + while (CHAR_SPACE === character || CHAR_TAB === character); + + if (CHAR_SHARP === character) { + do { character = input.charCodeAt(++position); } + while (position < length && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character); + } + } + + while (position < length) { + readLineBreak(); + lineIndent = 0; + + while ((!detectedIndent || lineIndent < textIndent) && + (CHAR_SPACE === character)) { + lineIndent += 1; + character = input.charCodeAt(++position); + } + + if (!detectedIndent && lineIndent > textIndent) { + textIndent = lineIndent; + } + + if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { + emptyLines += 1; + continue; + } + + // End of the scalar. + if (lineIndent < textIndent) { + + // Perform the chomping. + switch (chomping) { + case CHOMPING_KEEP: + result += common.repeat('\n', emptyLines); + break; + + case CHOMPING_CLIP: + if (detectedIndent) { // i.e. only if the scalar is not empty. + result += '\n'; + } + break; + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (CHAR_SPACE === character || CHAR_TAB === character) { + atMoreIndented = true; + result += common.repeat('\n', emptyLines + 1); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (0 === emptyLines) { + if (detectedIndent) { // i.e. only if we have already read some scalar content. + result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + result += common.repeat('\n', emptyLines + 1); + } + + detectedIndent = true; + emptyLines = 0; + captureStart = position; + + do { character = input.charCodeAt(++position); } + while (position < length && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character); + + captureSegment(captureStart, position, false); + } + + return true; + } + + function readBlockSequence(nodeIndent) { + var _line, + _tag = tag, + _result = [], + following, + detected = false; + + if (null !== anchor) { + anchorMap[anchor] = _result; + } + + while (position < length) { + if (CHAR_MINUS !== character) { + break; + } + + following = input.charCodeAt(position + 1); + + if (CHAR_SPACE !== following && + CHAR_TAB !== following && + CHAR_LINE_FEED !== following && + CHAR_CARRIAGE_RETURN !== following) { + break; + } + + detected = true; + position += 1; + character = following; + + if (skipSeparationSpace(true, -1)) { + if (lineIndent <= nodeIndent) { + _result.push(null); + continue; + } + } + + _line = line; + composeNode(nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(result); + skipSeparationSpace(true, -1); + + if ((line === _line || lineIndent > nodeIndent) && position < length) { + throwError('bad indentation of a sequence entry'); + } else if (lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + tag = _tag; + kind = KIND_ARRAY; + result = _result; + return true; + } else { + return false; + } + } + + function readBlockMapping(nodeIndent) { + var following, + allowCompact, + _line, + _tag = tag, + _result = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false; + + if (null !== anchor) { + anchorMap[anchor] = _result; + } + + while (position < length) { + following = input.charCodeAt(position + 1); + _line = line; // Save the current line. + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((CHAR_QUESTION === character || + CHAR_COLON === character) && + (CHAR_SPACE === following || + CHAR_TAB === following || + CHAR_LINE_FEED === following || + CHAR_CARRIAGE_RETURN === following)) { + + if (CHAR_QUESTION === character) { + if (atExplicitKey) { + storeMappingPair(_result, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. CHAR_COLON === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError('incomplete explicit mapping pair; a key node is missed'); + } + + position += 1; + character = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(nodeIndent, CONTEXT_FLOW_OUT, false, true)) { + if (line === _line) { + while (CHAR_SPACE === character || + CHAR_TAB === character) { + character = input.charCodeAt(++position); + } + + if (CHAR_COLON === character) { + character = input.charCodeAt(++position); + + if (CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character) { + throwError('a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(_result, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = tag; + keyNode = result; + + } else if (detected) { + throwError('can not read an implicit mapping pair; a colon is missed'); + + } else { + tag = _tag; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError('can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + tag = _tag; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (line === _line || lineIndent > nodeIndent) { + if (composeNode(nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = result; + } else { + valueNode = result; + } + } + + if (!atExplicitKey) { + storeMappingPair(_result, keyTag, keyNode, valueNode); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(true, -1); + } + + if (lineIndent > nodeIndent && position < length) { + throwError('bad indentation of a mapping entry'); + } else if (lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(_result, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + tag = _tag; + kind = KIND_OBJECT; + result = _result; + } + + return detected; + } + + function readTagProperty() { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName; + + if (CHAR_EXCLAMATION !== character) { + return false; + } + + if (null !== tag) { + throwError('duplication of a tag property'); + } + + character = input.charCodeAt(++position); + + if (CHAR_LESS_THAN === character) { + isVerbatim = true; + character = input.charCodeAt(++position); + + } else if (CHAR_EXCLAMATION === character) { + isNamed = true; + tagHandle = '!!'; + character = input.charCodeAt(++position); + + } else { + tagHandle = '!'; + } + + _position = position; + + if (isVerbatim) { + do { character = input.charCodeAt(++position); } + while (position < length && CHAR_GREATER_THAN !== character); + + if (position < length) { + tagName = input.slice(_position, position); + character = input.charCodeAt(++position); + } else { + throwError('unexpected end of the stream within a verbatim tag'); + } + } else { + while (position < length && + CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character) { + + if (CHAR_EXCLAMATION === character) { + if (!isNamed) { + tagHandle = input.slice(_position - 1, position + 1); + + if (validate && !PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError('named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = position + 1; + } else { + throwError('tag suffix cannot contain exclamation marks'); + } + } + + character = input.charCodeAt(++position); + } + + tagName = input.slice(_position, position); + + if (validate && PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError('tag suffix cannot contain flow indicator characters'); + } + } + + if (validate && tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError('tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + tag = tagName; + + } else if (_hasOwnProperty.call(tagMap, tagHandle)) { + tag = tagMap[tagHandle] + tagName; + + } else if ('!' === tagHandle) { + tag = '!' + tagName; + + } else if ('!!' === tagHandle) { + tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError('undeclared tag handle "' + tagHandle + '"'); + } + + return true; + } + + function readAnchorProperty() { + var _position; + + if (CHAR_AMPERSAND !== character) { + return false; + } + + if (null !== anchor) { + throwError('duplication of an anchor property'); + } + + character = input.charCodeAt(++position); + _position = position; + + while (position < length && + CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character && + CHAR_COMMA !== character && + CHAR_LEFT_SQUARE_BRACKET !== character && + CHAR_RIGHT_SQUARE_BRACKET !== character && + CHAR_LEFT_CURLY_BRACKET !== character && + CHAR_RIGHT_CURLY_BRACKET !== character) { + character = input.charCodeAt(++position); + } + + if (position === _position) { + throwError('name of an anchor node must contain at least one character'); + } + + anchor = input.slice(_position, position); + return true; + } + + function readAlias() { + var _position, alias; + + if (CHAR_ASTERISK !== character) { + return false; + } + + character = input.charCodeAt(++position); + _position = position; + + while (position < length && + CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character && + CHAR_COMMA !== character && + CHAR_LEFT_SQUARE_BRACKET !== character && + CHAR_RIGHT_SQUARE_BRACKET !== character && + CHAR_LEFT_CURLY_BRACKET !== character && + CHAR_RIGHT_CURLY_BRACKET !== character) { + character = input.charCodeAt(++position); + } + + if (position === _position) { + throwError('name of an alias node must contain at least one character'); + } + + alias = input.slice(_position, position); + + if (!anchorMap.hasOwnProperty(alias)) { + throwError('unidentified alias "' + alias + '"'); + } + + result = anchorMap[alias]; + skipSeparationSpace(true, -1); + return true; + } + + function composeNode(parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + atNewLine = false, + isIndented = true, + hasContent = false, + typeIndex, + typeQuantity, + type, + typeLoader, + flowIndent, + blockIndent, + _result; + + tag = null; + anchor = null; + kind = null; + result = null; + + allowBlockStyles = allowBlockScalars = allowBlockCollections = + CONTEXT_BLOCK_OUT === nodeContext || + CONTEXT_BLOCK_IN === nodeContext; + + if (allowToSeek) { + if (skipSeparationSpace(true, -1)) { + atNewLine = true; + + if (lineIndent === parentIndent) { + isIndented = false; + + } else if (lineIndent > parentIndent) { + isIndented = true; + + } else { + return false; + } + } + } + + if (isIndented) { + while (readTagProperty() || readAnchorProperty()) { + if (skipSeparationSpace(true, -1)) { + atNewLine = true; + + if (lineIndent > parentIndent) { + isIndented = true; + allowBlockCollections = allowBlockStyles; + + } else if (lineIndent === parentIndent) { + isIndented = false; + allowBlockCollections = allowBlockStyles; + + } else { + return true; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = position - lineStart; + + if (isIndented) { + if (allowBlockCollections && + (readBlockSequence(blockIndent) || + readBlockMapping(blockIndent)) || + readFlowCollection(flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(flowIndent)) || + readSingleQuotedScalar(flowIndent) || + readDoubleQuotedScalar(flowIndent)) { + hasContent = true; + + } else if (readAlias()) { + hasContent = true; + + if (null !== tag || null !== anchor) { + throwError('alias node should not have any properties'); + } + + } else if (readPlainScalar(flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (null === tag) { + tag = '?'; + } + } + + if (null !== anchor) { + anchorMap[anchor] = result; + } + } + } else { + hasContent = allowBlockCollections && readBlockSequence(blockIndent); + } + } + + if (null !== tag && '!' !== tag) { + if ('?' === tag) { + if (resolve) { + for (typeIndex = 0, typeQuantity = implicitTypes.length; + typeIndex < typeQuantity; + typeIndex += 1) { + type = implicitTypes[typeIndex]; + + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only assigned to plain scalars. So, it isn't + // needed to check for 'kind' conformity. + _result = type.loader.resolver(result, false); + + if (NIL !== _result) { + tag = type.tag; + result = _result; + break; + } + } + } + } else if (_hasOwnProperty.call(typeMap, tag)) { + typeLoader = typeMap[tag].loader; + + if (null !== result && typeLoader.kind !== kind) { + throwError('unacceptable node kind for !<' + tag + '> tag; it should be "' + typeLoader.kind + '", not "' + kind + '"'); + } + + if (typeLoader.resolver) { + _result = typeLoader.resolver(result, true); + + if (NIL !== _result) { + result = _result; + } else { + throwError('cannot resolve a node with !<' + tag + '> explicit tag'); + } + } + } else { + throwWarning('unknown tag !<' + tag + '>'); + } + } + + return null !== tag || null !== anchor || hasContent; + } + + function readDocument() { + var documentStart = position, + _position, + directiveName, + directiveArgs, + hasDirectives = false; + + version = null; + checkLineBreaks = legacy; + tagMap = {}; + anchorMap = {}; + + while (position < length) { + skipSeparationSpace(true, -1); + + if (lineIndent > 0 || CHAR_PERCENT !== character) { + break; + } + + hasDirectives = true; + character = input.charCodeAt(++position); + _position = position; + + while (position < length && + CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character) { + character = input.charCodeAt(++position); + } + + directiveName = input.slice(_position, position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError('directive name must not be less than one character in length'); + } + + while (position < length) { + while (CHAR_SPACE === character || CHAR_TAB === character) { + character = input.charCodeAt(++position); + } + + if (CHAR_SHARP === character) { + do { character = input.charCodeAt(++position); } + while (position < length && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character); + break; + } + + if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { + break; + } + + _position = position; + + while (position < length && + CHAR_SPACE !== character && + CHAR_TAB !== character && + CHAR_LINE_FEED !== character && + CHAR_CARRIAGE_RETURN !== character) { + character = input.charCodeAt(++position); + } + + directiveArgs.push(input.slice(_position, position)); + } + + if (position < length) { + readLineBreak(); + } + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](directiveName, directiveArgs); + } else { + throwWarning('unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(true, -1); + + if (0 === lineIndent && + CHAR_MINUS === character && + CHAR_MINUS === input.charCodeAt(position + 1) && + CHAR_MINUS === input.charCodeAt(position + 2)) { + position += 3; + character = input.charCodeAt(position); + skipSeparationSpace(true, -1); + + } else if (hasDirectives) { + throwError('directives end mark is expected'); + } + + composeNode(lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(true, -1); + + if (validate && checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(input.slice(documentStart, position))) { + throwWarning('non-ASCII line breaks are interpreted as content'); + } + + output(result); + + if (position === lineStart && testDocumentSeparator()) { + if (CHAR_DOT === character) { + position += 3; + character = input.charCodeAt(position); + skipSeparationSpace(true, -1); + } + return; + } + + if (position < length) { + throwError('end of the stream or a document separator is expected'); + } else { + return; + } + } + + if (validate && PATTERN_NON_PRINTABLE.test(input)) { + throwError('the stream contains non-printable characters'); + } + + while (CHAR_SPACE === character) { + lineIndent += 1; + character = input.charCodeAt(++position); + } + + while (position < length) { + readDocument(); + } +} + + +function load(input, options) { + var result = null, received = false; + + function callback(data) { + if (!received) { + result = data; + received = true; + } else { + throw new YAMLException('expected a single document in the stream, but found more'); + } + } + + loadAll(input, callback, options); + + return result; +} + + +function safeLoadAll(input, output, options) { + loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/mark.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/mark.js new file mode 100644 index 0000000..bfe279b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/mark.js @@ -0,0 +1,78 @@ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) { + return null; + } + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/require.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/require.js new file mode 100644 index 0000000..c237ff8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/require.js @@ -0,0 +1,23 @@ +'use strict'; + + +var fs = require('fs'); +var loader = require('./loader'); + + +function yamlRequireHandler(module, filename) { + var content = fs.readFileSync(filename, 'utf8'); + + // fill in documents + module.exports = loader.safeLoad(content, { filename: filename }); +} + +// register require extensions only if we're on node.js +// hack for browserify +if (undefined !== require.extensions) { + require.extensions['.yml'] = yamlRequireHandler; + require.extensions['.yaml'] = yamlRequireHandler; +} + + +module.exports = require; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema.js new file mode 100644 index 0000000..ce21391 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema.js @@ -0,0 +1,103 @@ +'use strict'; + + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return -1 === exclude.indexOf(index); + }); +} + + +function compileMap(/* lists... */) { + var result = {}, index, length; + + function collectType(type) { + result[type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (null !== type.loader && 'string' !== type.loader.kind) { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/core.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/core.js new file mode 100644 index 0000000..206daab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/core.js @@ -0,0 +1,18 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_full.js new file mode 100644 index 0000000..a55ef42 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_full.js @@ -0,0 +1,25 @@ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js new file mode 100644 index 0000000..11d89bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js @@ -0,0 +1,28 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js new file mode 100644 index 0000000..b7a33eb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/json.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/json.js new file mode 100644 index 0000000..5be3dbf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/schema/json.js @@ -0,0 +1,25 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js new file mode 100644 index 0000000..e0124f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js @@ -0,0 +1,82 @@ +'use strict'; + + +var YAMLException = require('./exception'); + + +// TODO: Add tag format check. +function Type(tag, options) { + options = options || {}; + + this.tag = tag; + this.loader = options['loader'] || null; + this.dumper = options['dumper'] || null; + + if (null === this.loader && null === this.dumper) { + throw new YAMLException('Incomplete YAML type definition. "loader" or "dumper" setting must be specified.'); + } + + if (null !== this.loader) { + this.loader = new Type.Loader(this.loader); + } + + if (null !== this.dumper) { + this.dumper = new Type.Dumper(this.dumper); + } +} + + +Type.Loader = function TypeLoader(options) { + options = options || {}; + + this.kind = options['kind'] || null; + this.resolver = options['resolver'] || null; + + if ('string' !== this.kind && + 'array' !== this.kind && + 'object' !== this.kind) { + throw new YAMLException('Unacceptable "kind" setting of a type loader.'); + } +}; + + +function compileAliases(map) { + var result = {}; + + if (null !== map) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + + +Type.Dumper = function TypeDumper(options) { + options = options || {}; + + this.kind = options['kind'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.representer = options['representer'] || null; + this.styleAliases = compileAliases(options['styleAliases'] || null); + + if ('undefined' !== this.kind && + 'null' !== this.kind && + 'boolean' !== this.kind && + 'integer' !== this.kind && + 'float' !== this.kind && + 'string' !== this.kind && + 'array' !== this.kind && + 'object' !== this.kind && + 'function' !== this.kind) { + throw new YAMLException('Unacceptable "kind" setting of a type dumper.'); + } +}; + + +module.exports = Type; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/binary.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/binary.js new file mode 100644 index 0000000..37b4bc7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -0,0 +1,118 @@ +// Modified from: +// https://raw.github.com/kanaka/noVNC/d890e8640f20fba3215ba7be8e0ff145aeb8c17c/include/base64.js + +'use strict'; + + +var NodeBuffer = require('buffer').Buffer; // A trick for browserified version. +var common = require('../common'); +var NIL = common.NIL; +var Type = require('../type'); + + + +var BASE64_PADDING = '='; + +var BASE64_BINTABLE = [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 +]; + +var BASE64_CHARTABLE = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + +function resolveYamlBinary(object /*, explicit*/) { + var value, code, idx = 0, result = [], leftbits, leftdata; + + leftbits = 0; // number of bits decoded, but yet to be appended + leftdata = 0; // bits decoded, but yet to be appended + + // Convert one by one. + for (idx = 0; idx < object.length; idx += 1) { + code = object.charCodeAt(idx); + value = BASE64_BINTABLE[code & 0x7F]; + + // Skip LF(NL) || CR + if (0x0A !== code && 0x0D !== code) { + // Fail on illegal characters + if (-1 === value) { + return NIL; + } + + // Collect data into leftdata, update bitcount + leftdata = (leftdata << 6) | value; + leftbits += 6; + + // If we have 8 or more bits, append 8 bits to the result + if (leftbits >= 8) { + leftbits -= 8; + + // Append if not padding. + if (BASE64_PADDING !== object.charAt(idx)) { + result.push((leftdata >> leftbits) & 0xFF); + } + + leftdata &= (1 << leftbits) - 1; + } + } + } + + // If there are any bits left, the base64 string was corrupted + if (leftbits) { + return NIL; + } else { + return new NodeBuffer(result); + } +} + + +function representYamlBinary(object /*, style*/) { + var result = '', index, length, rest; + + // Convert every three bytes to 4 ASCII characters. + for (index = 0, length = object.length - 2; index < length; index += 3) { + result += BASE64_CHARTABLE[object[index + 0] >> 2]; + result += BASE64_CHARTABLE[((object[index + 0] & 0x03) << 4) + (object[index + 1] >> 4)]; + result += BASE64_CHARTABLE[((object[index + 1] & 0x0F) << 2) + (object[index + 2] >> 6)]; + result += BASE64_CHARTABLE[object[index + 2] & 0x3F]; + } + + rest = object.length % 3; + + // Convert the remaining 1 or 2 bytes, padding out to 4 characters. + if (0 !== rest) { + index = object.length - rest; + result += BASE64_CHARTABLE[object[index + 0] >> 2]; + + if (2 === rest) { + result += BASE64_CHARTABLE[((object[index + 0] & 0x03) << 4) + (object[index + 1] >> 4)]; + result += BASE64_CHARTABLE[(object[index + 1] & 0x0F) << 2]; + result += BASE64_PADDING; + } else { + result += BASE64_CHARTABLE[(object[index + 0] & 0x03) << 4]; + result += BASE64_PADDING + BASE64_PADDING; + } + } + + return result; +} + + +module.exports = new Type('tag:yaml.org,2002:binary', { + loader: { + kind: 'string', + resolver: resolveYamlBinary + }, + dumper: { + kind: 'object', + instanceOf: NodeBuffer, + representer: representYamlBinary + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/bool.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/bool.js new file mode 100644 index 0000000..987a9e6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -0,0 +1,74 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var YAML_IMPLICIT_BOOLEAN_MAP = { + 'true' : true, + 'True' : true, + 'TRUE' : true, + 'false' : false, + 'False' : false, + 'FALSE' : false +}; + +var YAML_EXPLICIT_BOOLEAN_MAP = { + 'true' : true, + 'True' : true, + 'TRUE' : true, + 'false' : false, + 'False' : false, + 'FALSE' : false, + 'y' : true, + 'Y' : true, + 'yes' : true, + 'Yes' : true, + 'YES' : true, + 'n' : false, + 'N' : false, + 'no' : false, + 'No' : false, + 'NO' : false, + 'on' : true, + 'On' : true, + 'ON' : true, + 'off' : false, + 'Off' : false, + 'OFF' : false +}; + + +function resolveYamlBoolean(object, explicit) { + if (explicit) { + if (YAML_EXPLICIT_BOOLEAN_MAP.hasOwnProperty(object)) { + return YAML_EXPLICIT_BOOLEAN_MAP[object]; + } else { + return NIL; + } + } else { + if (YAML_IMPLICIT_BOOLEAN_MAP.hasOwnProperty(object)) { + return YAML_IMPLICIT_BOOLEAN_MAP[object]; + } else { + return NIL; + } + } +} + + +module.exports = new Type('tag:yaml.org,2002:bool', { + loader: { + kind: 'string', + resolver: resolveYamlBoolean + }, + dumper: { + kind: 'boolean', + defaultStyle: 'lowercase', + representer: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + } + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/float.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/float.js new file mode 100644 index 0000000..edb5fcb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -0,0 +1,102 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var YAML_FLOAT_PATTERN = new RegExp( + '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' + + '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' + + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + '|[-+]?\\.(?:inf|Inf|INF)' + + '|\\.(?:nan|NaN|NAN))$'); + + +function resolveYamlFloat(object /*, explicit*/) { + var value, sign, base, digits; + + if (!YAML_FLOAT_PATTERN.test(object)) { + return NIL; + } + + value = object.replace(/_/g, '').toLowerCase(); + sign = '-' === value[0] ? -1 : 1; + digits = []; + + if (0 <= '+-'.indexOf(value[0])) { + value = value.slice(1); + } + + if ('.inf' === value) { + return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if ('.nan' === value) { + return NaN; + + } else if (0 <= value.indexOf(':')) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } else { + return sign * parseFloat(value, 10); + } +} + + +function representYamlFloat(object, style) { + if (isNaN(object)) { + switch (style) { + case 'lowercase': + return '.nan'; + case 'uppercase': + return '.NAN'; + case 'camelcase': + return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': + return '.inf'; + case 'uppercase': + return '.INF'; + case 'camelcase': + return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': + return '-.inf'; + case 'uppercase': + return '-.INF'; + case 'camelcase': + return '-.Inf'; + } + } else { + return object.toString(10); + } +} + + +module.exports = new Type('tag:yaml.org,2002:float', { + loader: { + kind: 'string', + resolver: resolveYamlFloat + }, + dumper: { + kind: 'float', + defaultStyle: 'lowercase', + representer: representYamlFloat + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/int.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/int.js new file mode 100644 index 0000000..f5e1e7e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -0,0 +1,85 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var YAML_INTEGER_PATTERN = new RegExp( + '^(?:[-+]?0b[0-1_]+' + + '|[-+]?0[0-7_]+' + + '|[-+]?(?:0|[1-9][0-9_]*)' + + '|[-+]?0x[0-9a-fA-F_]+' + + '|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$'); + + +function resolveYamlInteger(object /*, explicit*/) { + var value, sign, base, digits; + + if (!YAML_INTEGER_PATTERN.test(object)) { + return NIL; + } + + value = object.replace(/_/g, ''); + sign = '-' === value[0] ? -1 : 1; + digits = []; + + if (0 <= '+-'.indexOf(value[0])) { + value = value.slice(1); + } + + if ('0' === value) { + return 0; + + } else if (/^0b/.test(value)) { + return sign * parseInt(value.slice(2), 2); + + } else if (/^0x/.test(value)) { + return sign * parseInt(value, 16); + + } else if ('0' === value[0]) { + return sign * parseInt(value, 8); + + } else if (0 <= value.indexOf(':')) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } else { + return sign * parseInt(value, 10); + } +} + + +module.exports = new Type('tag:yaml.org,2002:int', { + loader: { + kind: 'string', + resolver: resolveYamlInteger + }, + dumper: { + kind: 'integer', + defaultStyle: 'decimal', + representer: { + binary: function (object) { return '0b' + object.toString(2); }, + octal: function (object) { return '0' + object.toString(8); }, + decimal: function (object) { return object.toString(10); }, + hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); } + }, + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/function.js new file mode 100644 index 0000000..7ef21ac --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -0,0 +1,56 @@ +'use strict'; + + +var esprima = require('esprima'); + + +var NIL = require('../../common').NIL; +var Type = require('../../type'); + + +function resolveJavascriptFunction(object /*, explicit*/) { + /*jslint evil:true*/ + + try { + var source = '(' + object + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if ('Program' !== ast.type || + 1 !== ast.body.length || + 'ExpressionStatement' !== ast.body[0].type || + 'FunctionExpression' !== ast.body[0].expression.type) { + return NIL; + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + return new Function(params, source.slice(body[0]+1, body[1]-1)); + } catch (err) { + return NIL; + } +} + + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + + +module.exports = new Type('tag:yaml.org,2002:js/function', { + loader: { + kind: 'string', + resolver: resolveJavascriptFunction + }, + dumper: { + kind: 'function', + representer: representJavascriptFunction + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js new file mode 100644 index 0000000..9f4f89e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -0,0 +1,56 @@ +'use strict'; + + +var NIL = require('../../common').NIL; +var Type = require('../../type'); + + +function resolveJavascriptRegExp(object /*, explicit*/) { + var regexp = object, + tail = /\/([gim]*)$/.exec(object), + modifiers; + + // `/foo/gim` - tail can be maximum 4 chars + if ('/' === regexp[0] && tail && 4 >= tail[0].length) { + regexp = regexp.slice(1, regexp.length - tail[0].length); + modifiers = tail[1]; + } + + try { + return new RegExp(regexp, modifiers); + } catch (error) { + return NIL; + } +} + + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) { + result += 'g'; + } + + if (object.multiline) { + result += 'm'; + } + + if (object.ignoreCase) { + result += 'i'; + } + + return result; +} + + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + loader: { + kind: 'string', + resolver: resolveJavascriptRegExp + }, + dumper: { + kind: 'object', + instanceOf: RegExp, + representer: representJavascriptRegExp + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js new file mode 100644 index 0000000..8d2835e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -0,0 +1,28 @@ +'use strict'; + + +var Type = require('../../type'); + + +function resolveJavascriptUndefined(/*object, explicit*/) { + var undef; + + return undef; +} + + +function representJavascriptUndefined(/*object, explicit*/) { + return ''; +} + + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + loader: { + kind: 'string', + resolver: resolveJavascriptUndefined + }, + dumper: { + kind: 'undefined', + representer: representJavascriptUndefined + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/map.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/map.js new file mode 100644 index 0000000..5cda6de --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -0,0 +1,11 @@ +'use strict'; + + +var Type = require('../type'); + + +module.exports = new Type('tag:yaml.org,2002:map', { + loader: { + kind: 'object' + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/merge.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/merge.js new file mode 100644 index 0000000..8facc70 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -0,0 +1,18 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +function resolveYamlMerge(object /*, explicit*/) { + return '<<' === object ? object : NIL; +} + + +module.exports = new Type('tag:yaml.org,2002:merge', { + loader: { + kind: 'string', + resolver: resolveYamlMerge + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/null.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/null.js new file mode 100644 index 0000000..936c488 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -0,0 +1,36 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var YAML_NULL_MAP = { + '~' : true, + 'null' : true, + 'Null' : true, + 'NULL' : true +}; + + +function resolveYamlNull(object /*, explicit*/) { + return YAML_NULL_MAP[object] ? null : NIL; +} + + +module.exports = new Type('tag:yaml.org,2002:null', { + loader: { + kind: 'string', + resolver: resolveYamlNull + }, + dumper: { + kind: 'null', + defaultStyle: 'lowercase', + representer: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + } + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/omap.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/omap.js new file mode 100644 index 0000000..f7c248d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -0,0 +1,53 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + + +function resolveYamlOmap(object /*, explicit*/) { + var objectKeys = [], index, length, pair, pairKey, pairHasKey; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if ('[object Object]' !== _toString.call(pair)) { + return NIL; + } + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) { + pairHasKey = true; + } else { + return NIL; + } + } + } + + if (!pairHasKey) { + return NIL; + } + + if (-1 === objectKeys.indexOf(pairKey)) { + objectKeys.push(pairKey); + } else { + return NIL; + } + } + + return object; +} + + +module.exports = new Type('tag:yaml.org,2002:omap', { + loader: { + kind: 'array', + resolver: resolveYamlOmap + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/pairs.js new file mode 100644 index 0000000..828ff1b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -0,0 +1,41 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var _toString = Object.prototype.toString; + + +function resolveYamlPairs(object /*, explicit*/) { + var index, length, pair, keys, result; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if ('[object Object]' !== _toString.call(pair)) { + return NIL; + } + + keys = Object.keys(pair); + + if (1 !== keys.length) { + return NIL; + } + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + + +module.exports = new Type('tag:yaml.org,2002:pairs', { + loader: { + kind: 'array', + resolver: resolveYamlPairs + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/seq.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/seq.js new file mode 100644 index 0000000..80a7cf0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -0,0 +1,11 @@ +'use strict'; + + +var Type = require('../type'); + + +module.exports = new Type('tag:yaml.org,2002:seq', { + loader: { + kind: 'array' + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/set.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/set.js new file mode 100644 index 0000000..64bdc66 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -0,0 +1,31 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +function resolveYamlSet(object /*, explicit*/) { + var key; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (null !== object[key]) { + return NIL; + } + } + } + + return object; +} + + +module.exports = new Type('tag:yaml.org,2002:set', { + loader: { + kind: 'object', + resolver: resolveYamlSet + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/str.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/str.js new file mode 100644 index 0000000..384f14e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -0,0 +1,11 @@ +'use strict'; + + +var Type = require('../type'); + + +module.exports = new Type('tag:yaml.org,2002:str', { + loader: { + kind: 'string' + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/timestamp.js new file mode 100644 index 0000000..24da9e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -0,0 +1,91 @@ +'use strict'; + + +var NIL = require('../common').NIL; +var Type = require('../type'); + + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute + + +function resolveYamlTimestamp(object /*, explicit*/) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, data; + + match = YAML_TIMESTAMP_REGEXP.exec(object); + + if (null === match) { + return NIL; + } + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if ('-' === match[9]) { + delta = -delta; + } + } + + data = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) { + data.setTime(data.getTime() - delta); + } + + return data; +} + + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + loader: { + kind: 'string', + resolver: resolveYamlTimestamp + }, + dumper: { + kind: 'object', + instanceOf: Date, + representer: representYamlTimestamp + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esparse b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esparse new file mode 120000 index 0000000..7423b18 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esvalidate b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esvalidate new file mode 120000 index 0000000..16069ef --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/HISTORY.md new file mode 100644 index 0000000..102f82b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/HISTORY.md @@ -0,0 +1,109 @@ +0.1.15 / 2013-05-13 +------------------- + +* Fixed #55, @trebor89 + + +0.1.14 / 2013-05-12 +------------------- + +* Fixed #62, @maxtaco + + +0.1.13 / 2013-04-08 +------------------- + +* Added `.npmignore` to reduce package size + + +0.1.12 / 2013-02-10 +------------------- + +* Fixed conflictHandler (#46), @hpaulj + + +0.1.11 / 2013-02-07 +------------------- + +* Multiple bugfixes, @hpaulj +* Added 70+ tests (ported from python), @hpaulj +* Added conflictHandler, @applepicke +* Added fromfilePrefixChar, @hpaulj + + +0.1.10 / 2012-12-30 +------------------- + +* Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj +* Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +0.1.9 / 2012-12-27 +------------------ + +* Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +* Fixed default value behavior with `*` positionals, thanks to @hpaulj +* Improve `getDefault()` behavior, thanks to @hpaulj +* Imrove negative argument parsing, thanks to @hpaulj + + +0.1.8 / 2012-12-01 +------------------ + +* Fixed parser parents (issue #19), thanks to @hpaulj +* Fixed negative argument parse (issue #20), thanks to @hpaulj + + +0.1.7 / 2012-10-14 +------------------ + +* Fixed 'choices' argument parse (issue #16) +* Fixed stderr output (issue #15) + + +0.1.6 / 2012-09-09 +------------------ + +* Fixed check for conflict of options (thanks to @tomxtobin) + + +0.1.5 / 2012-09-03 +------------------ + +* Fix parser #setDefaults method (thanks to @tomxtobin) + + +0.1.4 / 2012-07-30 +------------------ + +* Fixed pseudo-argument support (thanks to @CGamesPlay) +* Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +0.1.3 / 2012-06-27 +------------------ + +* Fixed formatter api name: Formatter -> HelpFormatter + + +0.1.2 / 2012-05-29 +------------------ + +* Added basic tests +* Removed excess whitespace in help +* Fixed error reporting, when parcer with subcommands + called with empty arguments + + +0.1.1 / 2012-05-23 +------------------ + +* Fixed line wrapping in help formatter +* Added better error reporting on invalid arguments + + +0.1.0 / 2012-05-16 +------------------ + +* First release. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/LICENSE new file mode 100644 index 0000000..1afdae5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2012 by Vitaly Puzrin + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/README.md new file mode 100644 index 0000000..f20e0c1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/README.md @@ -0,0 +1,239 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse) + +CLI arguments parser for node.js. Javascript port of python's +[argparse](http://docs.python.org/dev/library/argparse.html) module +(original version 3.2). That's a full port, except some very rare options, +recorded in issue tracker. + +**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). + + +Example +======= + +test.js file: + +```javascript +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp:true, + description: 'Argparse example' +}); +parser.addArgument( + [ '-f', '--foo' ], + { + help: 'foo bar' + } +); +parser.addArgument( + [ '-b', '--bar' ], + { + help: 'bar foo' + } +); +var args = parser.parseArgs(); +console.dir(args); +``` + +Display help: + +``` +$ ./test.js -h +usage: example.js [-h] [-v] [-f FOO] [-b BAR] + +Argparse example + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 +{ foo: '3', bar: '4' } +``` + +More [examples](https://github.com/nodeca/argparse/tree/master/examples). + + +ArgumentParser objects +====================== + +``` +new ArgumentParser({paramters hash}); +``` + +Creates a new ArgumentParser object. + +**Supported params:** + +- ```description``` - Text to display before the argument help. +- ```epilog``` - Text to display after the argument help. +- ```addHelp``` - Add a -h/–help option to the parser. (default: True) +- ```argumentDefault``` - Set the global default value for arguments. (default: None) +- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. +- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) +- ```formatterClass``` - A class for customizing the help output. +- ```prog``` - The name of the program (default: sys.argv[0]) +- ```usage``` - The string describing the program usage (default: generated) +- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. + +**Not supportied yet** + +- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. + + +Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) + + +addArgument() method +==================== + +``` +ArgumentParser.addArgument([names or flags], {options}) +``` + +Defines how a single command-line argument should be parsed. + +- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo. + +Options: + +- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. +- ```nargs```- The number of command-line arguments that should be consumed. +- ```constant``` - A constant value required by some action and nargs selections. +- ```defaultValue``` - The value produced if the argument is absent from the command line. +- ```type``` - The type to which the command-line argument should be converted. +- ```choices``` - A container of the allowable values for the argument. +- ```required``` - Whether or not the command-line option may be omitted (optionals only). +- ```help``` - A brief description of what the argument does. +- ```metavar``` - A name for the argument in usage messages. +- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). + +Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) + + +Action (some details) +================ + +ArgumentParser objects associate command-line arguments with actions. +These actions can do just about anything with the command-line arguments associated +with them, though most actions simply add an attribute to the object returned by +parseArgs(). The action keyword argument specifies how the command-line arguments +should be handled. The supported actions are: + +- ```store``` - Just stores the argument’s value. This is the default action. +- ```storeConst``` - Stores value, specified by the const keyword argument. + (Note that the const keyword argument defaults to the rather unhelpful None.) + The 'storeConst' action is most commonly used with optional arguments, that + specify some sort of flag. +- ```storeTrue``` and ```storeFalse``` - Stores values True and False + respectively. These are special cases of 'storeConst'. +- ```append``` - Stores a list, and appends each argument value to the list. + This is useful to allow an option to be specified multiple times. +- ```appendConst``` - Stores a list, and appends value, specified by the + const keyword argument to the list. (Note, that the const keyword argument defaults + is None.) The 'appendConst' action is typically used when multiple arguments need + to store constants to the same list. +- ```count``` - Counts the number of times a keyword argument occurs. For example, + used for increasing verbosity levels. +- ```help``` - Prints a complete help message for all the options in the current + parser and then exits. By default a help action is automatically added to the parser. + See ArgumentParser for details of how the output is created. +- ```version``` - Prints version information and exit. Expects a `version=` + keyword argument in the addArgument() call. + +Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) + + +Sub-commands +============ + +ArgumentParser.addSubparsers() + +Many programs split their functionality into a number of sub-commands, for +example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, +and `svn commit`. Splitting up functionality this way can be a particularly good +idea when a program performs several different functions which require different +kinds of command-line arguments. `ArgumentParser` supports creation of such +sub-commands with `addSubparsers()` method. The `addSubparsers()` method is +normally called with no arguments and returns an special action object. +This object has a single method `addParser()`, which takes a command name and +any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object +that can be modified as usual. + +Example: + +sub_commands.js +```javascript +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp:true, + description: 'Argparse examples: sub-commands', +}); + +var subparsers = parser.addSubparsers({ + title:'subcommands', + dest:"subcommand_name" +}); + +var bar = subparsers.addParser('c1', {addHelp:true}); +bar.addArgument( + [ '-f', '--foo' ], + { + action: 'store', + help: 'foo3 bar3' + } +); +var bar = subparsers.addParser( + 'c2', + {aliases:['co'], addHelp:true} +); +bar.addArgument( + [ '-b', '--bar' ], + { + action: 'store', + type: 'int', + help: 'foo3 bar3' + } +); + +var args = parser.parseArgs(); +console.dir(args); + +``` + +Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) + + +Contributors +============ + +- [Eugene Shkuropat](https://github.com/shkuropat) +- [Paul Jacobson](https://github.com/hpaulj) + +[others](https://github.com/nodeca/argparse/graphs/contributors) + +License +======= + +Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). +Released under the MIT license. See +[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/arguments.js new file mode 100755 index 0000000..5b090fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/arguments.js @@ -0,0 +1,36 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: arguments' +}); +parser.addArgument( + [ '-f', '--foo' ], + { + help: 'foo bar' + } +); +parser.addArgument( + [ '-b', '--bar' ], + { + help: 'bar foo' + } +); + + +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs('-f 1 -b2'.split(' ')); +console.dir(args); +console.log('-----------'); +args = parser.parseArgs('-f=3 --bar=4'.split(' ')); +console.dir(args); +console.log('-----------'); +args = parser.parseArgs('--foo 5 --bar 6'.split(' ')); +console.dir(args); +console.log('-----------'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/choice.js new file mode 100755 index 0000000..2616fa4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/choice.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: choice' +}); + +parser.addArgument(['foo'], {choices: 'abc'}); + +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs(['c']); +console.dir(args); +console.log('-----------'); +parser.parseArgs(['X']); +console.dir(args); + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/constants.js new file mode 100755 index 0000000..172a4f3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/constants.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: constant' +}); + +parser.addArgument( + [ '-a'], + { + action: 'storeConst', + dest: 'answer', + help: 'store constant', + constant: 42 + } +); +parser.addArgument( + [ '--str' ], + { + action: 'appendConst', + dest: 'types', + help: 'append constant "str" to types', + constant: 'str' + } +); +parser.addArgument( + [ '--int' ], + { + action: 'appendConst', + dest: 'types', + help: 'append constant "int" to types', + constant: 'int' + } +); + +parser.addArgument( + [ '--true' ], + { + action: 'storeTrue', + help: 'store true constant' + } +); +parser.addArgument( + [ '--false' ], + { + action: 'storeFalse', + help: 'store false constant' + } +); + +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs('-a --str --int --true'.split(' ')); +console.dir(args); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/help.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/help.js new file mode 100755 index 0000000..7eb9555 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/help.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: help', + epilog: 'help epilog', + prog: 'help_example_prog', + usage: 'Usage %(prog)s ' +}); +parser.printHelp(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/nargs.js new file mode 100755 index 0000000..74f376b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/nargs.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: nargs' +}); +parser.addArgument( + [ '-f', '--foo' ], + { + help: 'foo bar', + nargs: 1 + } +); +parser.addArgument( + [ '-b', '--bar' ], + { + help: 'bar foo', + nargs: '*' + } +); + +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs('--foo a --bar c d'.split(' ')); +console.dir(args); +console.log('-----------'); +args = parser.parseArgs('--bar b c f --foo a'.split(' ')); +console.dir(args); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/parents.js new file mode 100755 index 0000000..dfe8968 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/parents.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; + +var args; +var parent_parser = new ArgumentParser({ addHelp: false }); +// note addHelp:false to prevent duplication of the -h option +parent_parser.addArgument( + ['--parent'], + { type: 'int', description: 'parent' } +); + +var foo_parser = new ArgumentParser({ + parents: [ parent_parser ], + description: 'child1' +}); +foo_parser.addArgument(['foo']); +args = foo_parser.parseArgs(['--parent', '2', 'XXX']); +console.log(args); + +var bar_parser = new ArgumentParser({ + parents: [ parent_parser ], + description: 'child2' +}); +bar_parser.addArgument(['--bar']); +args = bar_parser.parseArgs(['--bar', 'YYY']); +console.log(args); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js new file mode 100755 index 0000000..430d5e1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: prefix_chars', + prefixChars: '-+' +}); +parser.addArgument(['+f', '++foo']); +parser.addArgument(['++bar'], {action: 'storeTrue'}); + +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs(['+f', '1']); +console.dir(args); +args = parser.parseArgs(['++bar']); +console.dir(args); +args = parser.parseArgs(['++foo', '2', '++bar']); +console.dir(args); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js new file mode 100755 index 0000000..df9c494 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js @@ -0,0 +1,49 @@ +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: sub-commands' +}); + +var subparsers = parser.addSubparsers({ + title: 'subcommands', + dest: "subcommand_name" +}); + +var bar = subparsers.addParser('c1', {addHelp: true, help: 'c1 help'}); +bar.addArgument( + [ '-f', '--foo' ], + { + action: 'store', + help: 'foo3 bar3' + } +); +var bar = subparsers.addParser( + 'c2', + {aliases: ['co'], addHelp: true, help: 'c2 help'} +); +bar.addArgument( + [ '-b', '--bar' ], + { + action: 'store', + type: 'int', + help: 'foo3 bar3' + } +); +parser.printHelp(); +console.log('-----------'); + +var args; +args = parser.parseArgs('c1 -f 2'.split(' ')); +console.dir(args); +console.log('-----------'); +args = parser.parseArgs('c2 -b 1'.split(' ')); +console.dir(args); +console.log('-----------'); +args = parser.parseArgs('co -b 1'.split(' ')); +console.dir(args); +console.log('-----------'); +parser.parseArgs(['c1', '-h']); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sum.js new file mode 100755 index 0000000..4532800 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/sum.js @@ -0,0 +1,35 @@ +#!/usr/bin/env node + +'use strict'; + + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ description: 'Process some integers.' }); + + +function sum(arr) { + return arr.reduce(function (a, b) { + return a + b; + }, 0); +} +function max(arr) { + return Math.max.apply(Math, arr); +} + + +parser.addArgument(['integers'], { + metavar: 'N', + type: 'int', + nargs: '+', + help: 'an integer for the accumulator' +}); +parser.addArgument(['--sum'], { + dest: 'accumulate', + action: 'storeConst', + constant: sum, + defaultValue: max, + help: 'sum the integers (default: find the max)' +}); + +var args = parser.parseArgs('--sum 1 2 -1'.split(' ')); +console.log(args.accumulate(args.integers)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js new file mode 100644 index 0000000..afb4a2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js @@ -0,0 +1,270 @@ +'use strict'; + +var a, group, parser, helptext; + +var assert = require('assert'); +var _ = require('underscore'); +_.str = require('underscore.string'); +var print = function () { + return console.log.apply(console, arguments); + }; +// print = function () {}; + +var argparse = require('argparse'); + +print("TEST argparse.ArgumentDefaultsHelpFormatter"); + +parser = new argparse.ArgumentParser({ + debug: true, + formatterClass: argparse.ArgumentDefaultsHelpFormatter, + description: 'description' +}); + +parser.addArgument(['--foo'], { + help: 'foo help - oh and by the way, %(defaultValue)s' +}); + +parser.addArgument(['--bar'], { + action: 'storeTrue', + help: 'bar help' +}); + +parser.addArgument(['spam'], { + help: 'spam help' +}); + +parser.addArgument(['badger'], { + nargs: '?', + defaultValue: 'wooden', + help: 'badger help' +}); + +group = parser.addArgumentGroup({ + title: 'title', + description: 'group description' +}); + +group.addArgument(['--baz'], { + type: 'int', + defaultValue: 42, + help: 'baz help' +}); + +helptext = parser.formatHelp(); +print(helptext); +// test selected clips +assert(helptext.match(/badger help \(default: wooden\)/)); +assert(helptext.match(/foo help - oh and by the way, null/)); +assert(helptext.match(/bar help \(default: false\)/)); +assert(helptext.match(/title:\n {2}group description/)); // test indent +assert(helptext.match(/baz help \(default: 42\)/im)); + +/* +usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger] + +description + +positional arguments: + spam spam help + badger badger help (default: wooden) + +optional arguments: + -h, --help show this help message and exit + --foo FOO foo help - oh and by the way, null + --bar bar help (default: false) + +title: + group description + + --baz BAZ baz help (default: 42) +*/ + +print("TEST argparse.RawDescriptionHelpFormatter"); + +parser = new argparse.ArgumentParser({ + debug: true, + prog: 'PROG', + formatterClass: argparse.RawDescriptionHelpFormatter, + description: 'Keep the formatting\n' + + ' exactly as it is written\n' + + '\n' + + 'here\n' +}); + +a = parser.addArgument(['--foo'], { + help: ' foo help should not\n' + + ' retain this odd formatting' +}); + +parser.addArgument(['spam'], { + 'help': 'spam help' +}); + +group = parser.addArgumentGroup({ + title: 'title', + description: ' This text\n' + + ' should be indented\n' + + ' exactly like it is here\n' +}); + +group.addArgument(['--bar'], { + help: 'bar help' +}); + +helptext = parser.formatHelp(); +print(helptext); +// test selected clips +assert(helptext.match(parser.description)); +assert.equal(helptext.match(a.help), null); +assert(helptext.match(/foo help should not retain this odd formatting/)); + +/* +class TestHelpRawDescription(HelpTestCase): + """Test the RawTextHelpFormatter""" +.... + +usage: PROG [-h] [--foo FOO] [--bar BAR] spam + +Keep the formatting + exactly as it is written + +here + +positional arguments: + spam spam help + +optional arguments: + -h, --help show this help message and exit + --foo FOO foo help should not retain this odd formatting + +title: + This text + should be indented + exactly like it is here + + --bar BAR bar help +*/ + + +print("TEST argparse.RawTextHelpFormatter"); + +parser = new argparse.ArgumentParser({ + debug: true, + prog: 'PROG', + formatterClass: argparse.RawTextHelpFormatter, + description: 'Keep the formatting\n' + + ' exactly as it is written\n' + + '\n' + + 'here\n' +}); + +parser.addArgument(['--baz'], { + help: ' baz help should also\n' + + 'appear as given here' +}); + +a = parser.addArgument(['--foo'], { + help: ' foo help should also\n' + + 'appear as given here' +}); + +parser.addArgument(['spam'], { + 'help': 'spam help' +}); + +group = parser.addArgumentGroup({ + title: 'title', + description: ' This text\n' + + ' should be indented\n' + + ' exactly like it is here\n' +}); + +group.addArgument(['--bar'], { + help: 'bar help' +}); + +helptext = parser.formatHelp(); +print(helptext); +// test selected clips +assert(helptext.match(parser.description)); +assert(helptext.match(/( {14})appear as given here/gm)); + +/* +class TestHelpRawText(HelpTestCase): + """Test the RawTextHelpFormatter""" + +usage: PROG [-h] [--foo FOO] [--bar BAR] spam + +Keep the formatting + exactly as it is written + +here + +positional arguments: + spam spam help + +optional arguments: + -h, --help show this help message and exit + --foo FOO foo help should also + appear as given here + +title: + This text + should be indented + exactly like it is here + + --bar BAR bar help +*/ + + +print("TEST metavar as a tuple"); + +parser = new argparse.ArgumentParser({ + prog: 'PROG' +}); + +parser.addArgument(['-w'], { + help: 'w', + nargs: '+', + metavar: ['W1', 'W2'] +}); + +parser.addArgument(['-x'], { + help: 'x', + nargs: '*', + metavar: ['X1', 'X2'] +}); + +parser.addArgument(['-y'], { + help: 'y', + nargs: 3, + metavar: ['Y1', 'Y2', 'Y3'] +}); + +parser.addArgument(['-z'], { + help: 'z', + nargs: '?', + metavar: ['Z1'] +}); + +helptext = parser.formatHelp(); +print(helptext); +var ustring = 'PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]'; +ustring = ustring.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); +// print(ustring) +assert(helptext.match(new RegExp(ustring))); + +/* +class TestHelpTupleMetavar(HelpTestCase): + """Test specifying metavar as a tuple""" + +usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]] + +optional arguments: + -h, --help show this help message and exit + -w W1 [W2 ...] w + -x [X1 [X2 ...]] x + -y Y1 Y2 Y3 y + -z [Z1] z +*/ + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/index.js new file mode 100644 index 0000000..3b6eea0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/argparse'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action.js new file mode 100644 index 0000000..6f7e9a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action.js @@ -0,0 +1,146 @@ +/** + * class Action + * + * Base class for all actions + * Do not call in your code, use this class only for inherits your own action + * + * Information about how to convert command line strings to Javascript objects. + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the command + * line. The keyword arguments to the Action constructor are also all attributes + * of Action instances. + * + * #####Alowed keywords: + * + * - `store` + * - `storeConstant` + * - `storeTrue` + * - `storeFalse` + * - `append` + * - `appendConstant` + * - `count` + * - `help` + * - `version` + * + * Information about action options see [[Action.new]] + * + * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) + * + **/ + +'use strict'; + + +// Constants +var $$ = require('./const'); + + +/** + * new Action(options) + * + * Base class for all actions. Used only for inherits + * + * + * ##### Options: + * + * - `optionStrings` A list of command-line option strings for the action. + * - `dest` Attribute to hold the created object(s) + * - `nargs` The number of command-line arguments that should be consumed. + * By default, one argument will be consumed and a single value will be + * produced. + * - `constant` Default value for an action with no value. + * - `defaultValue` The value to be produced if the option is not specified. + * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If + * None, 'string'. + * - `choices` The choices available. + * - `required` True if the action must always be specified at the command + * line. + * - `help` The help describing the argument. + * - `metavar` The name to be used for the option's argument with the help + * string. If None, the 'dest' value will be used as the name. + * + * ##### nargs supported values: + * + * - `N` (an integer) consumes N arguments (and produces a list) + * - `?` consumes zero or one arguments + * - `*` consumes zero or more arguments (and produces a list) + * - `+` consumes one or more arguments (and produces a list) + * + * Note: that the difference between the default and nargs=1 is that with the + * default, a single value will be produced, while with nargs=1, a list + * containing a single value will be produced. + **/ +var Action = module.exports = function Action(options) { + options = options || {}; + this.optionStrings = options.optionStrings || []; + this.dest = options.dest; + this.nargs = options.nargs !== undefined ? options.nargs : null; + this.constant = options.constant !== undefined ? options.constant : null; + this.defaultValue = options.defaultValue; + this.type = options.type !== undefined ? options.type : null; + this.choices = options.choices !== undefined ? options.choices : null; + this.required = options.required !== undefined ? options.required: false; + this.help = options.help !== undefined ? options.help : null; + this.metavar = options.metavar !== undefined ? options.metavar : null; + + if (!(this.optionStrings instanceof Array)) { + throw new Error('optionStrings should be an array'); + } + if (this.required !== undefined && typeof(this.required) !== 'boolean') { + throw new Error('required should be a boolean'); + } +}; + +/** + * Action#getName -> String + * + * Tells action name + **/ +Action.prototype.getName = function () { + if (this.optionStrings.length > 0) { + return this.optionStrings.join('/'); + } else if (this.metavar !== null && this.metavar !== $$.SUPPRESS) { + return this.metavar; + } else if (this.dest !== undefined && this.dest !== $$.SUPPRESS) { + return this.dest; + } + return null; +}; + +/** + * Action#isOptional -> Boolean + * + * Return true if optional + **/ +Action.prototype.isOptional = function () { + return !this.isPositional(); +}; + +/** + * Action#isPositional -> Boolean + * + * Return true if positional + **/ +Action.prototype.isPositional = function () { + return (this.optionStrings.length === 0); +}; + +/** + * Action#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Should be implemented in inherited classes + * + * ##### Example + * + * ActionCount.prototype.call = function (parser, namespace, values, optionString) { + * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); + * }; + * + **/ +Action.prototype.call = function () { + throw new Error('.call() not defined');// Not Implemented error +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append.js new file mode 100644 index 0000000..48c6dbe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append.js @@ -0,0 +1,55 @@ +/*:nodoc:* + * class ActionAppend + * + * This action stores a list, and appends each argument value to the list. + * This is useful to allow an option to be specified multiple times. + * This class inherided from [[Action]] + * + **/ + +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var $$ = require('../const'); + +/*:nodoc:* + * new ActionAppend(options) + * - options (object): options hash see [[Action.new]] + * + * Note: options.nargs should be optional for constants + * and more then zero for other + **/ +var ActionAppend = module.exports = function ActionAppend(options) { + options = options || {}; + if (this.nargs <= 0) { + throw new Error('nargs for append actions must be > 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate'); + } + if (!!this.constant && this.nargs !== $$.OPTIONAL) { + throw new Error('nargs must be OPTIONAL to supply const'); + } + Action.call(this, options); +}; +util.inherits(ActionAppend, Action); + +/*:nodoc:* + * ActionAppend#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionAppend.prototype.call = function (parser, namespace, values) { + var items = [].concat(namespace[this.dest] || []); // or _.clone + items.push(values); + namespace.set(this.dest, items); +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js new file mode 100644 index 0000000..90747ab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js @@ -0,0 +1,47 @@ +/*:nodoc:* + * class ActionAppendConstant + * + * This stores a list, and appends the value specified by + * the const keyword argument to the list. + * (Note that the const keyword argument defaults to null.) + * The 'appendConst' action is typically useful when multiple + * arguments need to store constants to the same list. + * + * This class inherited from [[Action]] + **/ + +'use strict'; + +var util = require('util'); + +var Action = require('../../action'); + +/*:nodoc:* + * new ActionAppendConstant(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { + options = options || {}; + options.nargs = 0; + if (options.constant === undefined) { + throw new Error('constant option is required for appendAction'); + } + Action.call(this, options); +}; +util.inherits(ActionAppendConstant, Action); + +/*:nodoc:* + * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionAppendConstant.prototype.call = function (parser, namespace) { + var items = [].concat(namespace[this.dest] || []); + items.push(this.constant); + namespace.set(this.dest, items); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/count.js new file mode 100644 index 0000000..d6a5899 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/count.js @@ -0,0 +1,40 @@ +/*:nodoc:* + * class ActionCount + * + * This counts the number of times a keyword argument occurs. + * For example, this is useful for increasing verbosity levels + * + * This class inherided from [[Action]] + * + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +/*:nodoc:* + * new ActionCount(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionCount = module.exports = function ActionCount(options) { + options = options || {}; + options.nargs = 0; + + Action.call(this, options); +}; +util.inherits(ActionCount, Action); + +/*:nodoc:* + * ActionCount#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionCount.prototype.call = function (parser, namespace) { + namespace.set(this.dest, (namespace[this.dest] || 0) + 1); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/help.js new file mode 100644 index 0000000..7f7b4e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/help.js @@ -0,0 +1,48 @@ +/*:nodoc:* + * class ActionHelp + * + * Support action for printing help + * This class inherided from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var $$ = require('../const'); + +/*:nodoc:* + * new ActionHelp(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionHelp = module.exports = function ActionHelp(options) { + options = options || {}; + if (options.defaultValue !== null) { + options.defaultValue = options.defaultValue; + } + else { + options.defaultValue = $$.SUPPRESS; + } + options.dest = (options.dest !== null ? options.dest: $$.SUPPRESS); + options.nargs = 0; + Action.call(this, options); + +}; +util.inherits(ActionHelp, Action); + +/*:nodoc:* + * ActionHelp#call(parser, namespace, values, optionString) + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Print help and exit + **/ +ActionHelp.prototype.call = function (parser) { + parser.printHelp(); + parser.exit(); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store.js new file mode 100644 index 0000000..8ebc974 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store.js @@ -0,0 +1,50 @@ +/*:nodoc:* + * class ActionStore + * + * This action just stores the argument’s value. This is the default action. + * + * This class inherited from [[Action]] + * + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var $$ = require('../const'); + + +/*:nodoc:* + * new ActionStore(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStore = module.exports = function ActionStore(options) { + options = options || {}; + if (this.nargs <= 0) { + throw new Error('nargs for store actions must be > 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate'); + + } + if (this.constant !== undefined && this.nargs !== $$.OPTIONAL) { + throw new Error('nargs must be OPTIONAL to supply const'); + } + Action.call(this, options); +}; +util.inherits(ActionStore, Action); + +/*:nodoc:* + * ActionStore#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionStore.prototype.call = function (parser, namespace, values) { + namespace.set(this.dest, values); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js new file mode 100644 index 0000000..8410fcf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js @@ -0,0 +1,43 @@ +/*:nodoc:* + * class ActionStoreConstant + * + * This action stores the value specified by the const keyword argument. + * (Note that the const keyword argument defaults to the rather unhelpful null.) + * The 'store_const' action is most commonly used with optional + * arguments that specify some sort of flag. + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../../action'); + +/*:nodoc:* + * new ActionStoreConstant(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { + options = options || {}; + options.nargs = 0; + if (options.constant === undefined) { + throw new Error('constant option is required for storeAction'); + } + Action.call(this, options); +}; +util.inherits(ActionStoreConstant, Action); + +/*:nodoc:* + * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionStoreConstant.prototype.call = function (parser, namespace) { + namespace.set(this.dest, this.constant); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js new file mode 100644 index 0000000..66417bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js @@ -0,0 +1,27 @@ +/*:nodoc:* + * class ActionStoreFalse + * + * This action store the values False respectively. + * This is special cases of 'storeConst' + * + * This class inherited from [[Action]] + **/ + +'use strict'; + +var util = require('util'); + +var ActionStoreConstant = require('./constant'); + +/*:nodoc:* + * new ActionStoreFalse(options) + * - options (object): hash of options see [[Action.new]] + * + **/ +var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { + options = options || {}; + options.constant = false; + options.defaultValue = options.defaultValue !== null ? options.defaultValue: true; + ActionStoreConstant.call(this, options); +}; +util.inherits(ActionStoreFalse, ActionStoreConstant); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js new file mode 100644 index 0000000..43ec708 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js @@ -0,0 +1,26 @@ +/*:nodoc:* + * class ActionStoreTrue + * + * This action store the values True respectively. + * This isspecial cases of 'storeConst' + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var ActionStoreConstant = require('./constant'); + +/*:nodoc:* + * new ActionStoreTrue(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { + options = options || {}; + options.constant = true; + options.defaultValue = options.defaultValue !== null ? options.defaultValue: false; + ActionStoreConstant.call(this, options); +}; +util.inherits(ActionStoreTrue, ActionStoreConstant); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js new file mode 100644 index 0000000..adecf65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js @@ -0,0 +1,148 @@ +/** internal + * class ActionSubparsers + * + * Support the creation of such sub-commands with the addSubparsers() + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); +var format = require('util').format; +var _ = require('underscore'); + + +var Action = require('../action'); + +// Constants +var $$ = require('../const'); + +// Errors +var argumentErrorHelper = require('../argument/error'); + + +/*:nodoc:* + * new ChoicesPseudoAction(name, help) + * + * Create pseudo action for correct help text + * + **/ +var ChoicesPseudoAction = function (name, help) { + var options = { + optionStrings: [], + dest: name, + help: help + }; + + Action.call(this, options); +}; +util.inherits(ChoicesPseudoAction, Action); + +/** + * new ActionSubparsers(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionSubparsers = module.exports = function ActionSubparsers(options) { + options = options || {}; + options.dest = options.dest || $$.SUPPRESS; + options.nargs = $$.PARSER; + + this.debug = (options.debug === true); + + this._progPrefix = options.prog; + this._parserClass = options.parserClass; + this._nameParserMap = {}; + this._choicesActions = []; + + options.choices = this._nameParserMap; + Action.call(this, options); +}; +util.inherits(ActionSubparsers, Action); + +/*:nodoc:* + * ActionSubparsers#addParser(name, options) -> ArgumentParser + * - name (string): sub-command name + * - options (object): see [[ArgumentParser.new]] + * + * Note: + * addParser supports an additional aliases option, + * which allows multiple strings to refer to the same subparser. + * This example, like svn, aliases co as a shorthand for checkout + * + **/ +ActionSubparsers.prototype.addParser = function (name, options) { + var parser; + + var self = this; + + options = options || {}; + + options.debug = (this.debug === true); + + // set program from the existing prefix + if (!options.prog) { + options.prog = this._progPrefix + ' ' + name; + } + + var aliases = options.aliases || []; + + // create a pseudo-action to hold the choice help + if (!!options.help || _.isString(options.help)) { + var help = options.help; + delete options.help; + + var choiceAction = new ChoicesPseudoAction(name, help); + this._choicesActions.push(choiceAction); + } + + // create the parser and add it to the map + parser = new this._parserClass(options); + this._nameParserMap[name] = parser; + + // make parser available under aliases also + aliases.forEach(function (alias) { + self._nameParserMap[alias] = parser; + }); + + return parser; +}; + +ActionSubparsers.prototype._getSubactions = function () { + return this._choicesActions; +}; + +/*:nodoc:* + * ActionSubparsers#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Parse input aguments + **/ +ActionSubparsers.prototype.call = function (parser, namespace, values) { + var parserName = values[0]; + var argStrings = values.slice(1); + + // set the parser name if requested + if (this.dest !== $$.SUPPRESS) { + namespace[this.dest] = parserName; + } + + // select the parser + if (!!this._nameParserMap[parserName]) { + parser = this._nameParserMap[parserName]; + } else { + throw argumentErrorHelper(format( + 'Unknown parser "%s" (choices: [%s]).', + parserName, + _.keys(this._nameParserMap).join(', ') + )); + } + + // parse all the remaining options into the namespace + parser.parseArgs(argStrings, namespace); +}; + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/version.js new file mode 100644 index 0000000..a17877c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/version.js @@ -0,0 +1,50 @@ +/*:nodoc:* + * class ActionVersion + * + * Support action for printing program version + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// +// Constants +// +var $$ = require('../const'); + +/*:nodoc:* + * new ActionVersion(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionVersion = module.exports = function ActionVersion(options) { + options = options || {}; + options.defaultValue = (!!options.defaultValue ? options.defaultValue: $$.SUPPRESS); + options.dest = (options.dest || $$.SUPPRESS); + options.nargs = 0; + this.version = options.version; + Action.call(this, options); +}; +util.inherits(ActionVersion, Action); + +/*:nodoc:* + * ActionVersion#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Print version and exit + **/ +ActionVersion.prototype.call = function (parser) { + var version = this.version || parser.version; + var formatter = parser._getFormatter(); + formatter.addText(version); + parser.exit(0, formatter.formatHelp()); +}; + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action_container.js new file mode 100644 index 0000000..dbe3e3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action_container.js @@ -0,0 +1,481 @@ +/** internal + * class ActionContainer + * + * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] + **/ + +'use strict'; + +var format = require('util').format; +var _ = require('underscore'); + +_.str = require('underscore.string'); + +// Constants +var $$ = require('./const'); + +//Actions +var ActionHelp = require('./action/help'); +var ActionAppend = require('./action/append'); +var ActionAppendConstant = require('./action/append/constant'); +var ActionCount = require('./action/count'); +var ActionStore = require('./action/store'); +var ActionStoreConstant = require('./action/store/constant'); +var ActionStoreTrue = require('./action/store/true'); +var ActionStoreFalse = require('./action/store/false'); +var ActionVersion = require('./action/version'); +var ActionSubparsers = require('./action/subparsers'); + +// Errors +var argumentErrorHelper = require('./argument/error'); + + + +/** + * new ActionContainer(options) + * + * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] + * + * ##### Options: + * + * - `description` -- A description of what the program does + * - `prefixChars` -- Characters that prefix optional arguments + * - `argumentDefault` -- The default value for all arguments + * - `conflictHandler` -- The conflict handler to use for duplicate arguments + **/ +var ActionContainer = module.exports = function ActionContainer(options) { + options = options || {}; + + this.description = options.description; + this.argumentDefault = options.argumentDefault; + this.prefixChars = options.prefixChars || ''; + this.conflictHandler = options.conflictHandler; + + // set up registries + this._registries = {}; + + // register actions + this.register('action', null, ActionStore); + this.register('action', 'store', ActionStore); + this.register('action', 'storeConst', ActionStoreConstant); + this.register('action', 'storeTrue', ActionStoreTrue); + this.register('action', 'storeFalse', ActionStoreFalse); + this.register('action', 'append', ActionAppend); + this.register('action', 'appendConst', ActionAppendConstant); + this.register('action', 'count', ActionCount); + this.register('action', 'help', ActionHelp); + this.register('action', 'version', ActionVersion); + this.register('action', 'parsers', ActionSubparsers); + + // raise an exception if the conflict handler is invalid + this._getHandler(); + + // action storage + this._actions = []; + this._optionStringActions = {}; + + // groups + this._actionGroups = []; + this._mutuallyExclusiveGroups = []; + + // defaults storage + this._defaults = {}; + + // determines whether an "option" looks like a negative number + // -1, -1.5 -5e+4 + this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$'); + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._hasNegativeNumberOptionals = []; +}; + +// Groups must be required, then ActionContainer already defined +var ArgumentGroup = require('./argument/group'); +var MutuallyExclusiveGroup = require('./argument/exclusive'); + +// +// Registration methods +// + +/** + * ActionContainer#register(registryName, value, object) -> Void + * - registryName (String) : object type action|type + * - value (string) : keyword + * - object (Object|Function) : handler + * + * Register handlers + **/ +ActionContainer.prototype.register = function (registryName, value, object) { + this._registries[registryName] = this._registries[registryName] || {}; + this._registries[registryName][value] = object; +}; + +ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) { + if (3 > arguments.length) { + defaultValue = null; + } + return this._registries[registryName][value] || defaultValue; +}; + +// +// Namespace default accessor methods +// + +/** + * ActionContainer#setDefaults(options) -> Void + * - options (object):hash of options see [[Action.new]] + * + * Set defaults + **/ +ActionContainer.prototype.setDefaults = function (options) { + options = options || {}; + for (var property in options) { + this._defaults[property] = options[property]; + } + + // if these defaults match any existing arguments, replace the previous + // default on the object with the new one + this._actions.forEach(function (action) { + if (action.dest in options) { + action.defaultValue = options[action.dest]; + } + }); +}; + +/** + * ActionContainer#getDefault(dest) -> Mixed + * - dest (string): action destination + * + * Return action default value + **/ +ActionContainer.prototype.getDefault = function (dest) { + var result = (_.has(this._defaults, dest)) ? this._defaults[dest] : null; + + this._actions.forEach(function (action) { + if (action.dest === dest && _.has(action, 'defaultValue')) { + result = action.defaultValue; + } + }); + + return result; +}; +// +// Adding argument actions +// + +/** + * ActionContainer#addArgument(args, options) -> Object + * - args (Array): array of argument keys + * - options (Object): action objects see [[Action.new]] + * + * #### Examples + * - addArgument([-f, --foo], {action:'store', defaultValue=1, ...}) + * - addArgument(['bar'], action: 'store', nargs:1, ...}) + **/ +ActionContainer.prototype.addArgument = function (args, options) { + args = args; + options = options || {}; + + if (!_.isArray(args)) { + throw new TypeError('addArgument first argument should be an array'); + } + if (!_.isObject(options) || _.isArray(options)) { + throw new TypeError('addArgument second argument should be a hash'); + } + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional argument + if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) { + if (args && !!options.dest) { + throw new Error('dest supplied twice for positional argument'); + } + options = this._getPositional(args, options); + + // otherwise, we're adding an optional argument + } else { + options = this._getOptional(args, options); + } + + // if no default was supplied, use the parser-level default + if (_.isUndefined(options.defaultValue)) { + var dest = options.dest; + if (_.has(this._defaults, dest)) { + options.defaultValue = this._defaults[dest]; + } else if (!_.isUndefined(this.argumentDefault)) { + options.defaultValue = this.argumentDefault; + } + } + + // create the action object, and add it to the parser + var ActionClass = this._popActionClass(options); + if (! _.isFunction(ActionClass)) { + throw new Error(format('Unknown action "%s".', ActionClass)); + } + var action = new ActionClass(options); + + // throw an error if the action type is not callable + var typeFunction = this._registryGet('type', action.type, action.type); + if (!_.isFunction(typeFunction)) { + throw new Error(format('"%s" is not callable', typeFunction)); + } + + return this._addAction(action); +}; + +/** + * ActionContainer#addArgumentGroup(options) -> ArgumentGroup + * - options (Object): hash of options see [[ArgumentGroup.new]] + * + * Create new arguments groups + **/ +ActionContainer.prototype.addArgumentGroup = function (options) { + var group = new ArgumentGroup(this, options); + this._actionGroups.push(group); + return group; +}; + +/** + * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup + * - options (Object): {required: false} + * + * Create new mutual exclusive groups + **/ +ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) { + var group = new MutuallyExclusiveGroup(this, options); + this._mutuallyExclusiveGroups.push(group); + return group; +}; + +ActionContainer.prototype._addAction = function (action) { + var self = this; + + // resolve any conflicts + this._checkConflict(action); + + // add to actions list + this._actions.push(action); + action.container = this; + + // index the action by any option strings it has + action.optionStrings.forEach(function (optionString) { + self._optionStringActions[optionString] = action; + }); + + // set the flag if any option strings look like negative numbers + action.optionStrings.forEach(function (optionString) { + if (optionString.match(self._regexpNegativeNumber)) { + if (!_.any(self._hasNegativeNumberOptionals)) { + self._hasNegativeNumberOptionals.push(true); + } + } + }); + + // return the created action + return action; +}; + +ActionContainer.prototype._removeAction = function (action) { + var actionIndex = this._actions.indexOf(action); + if (actionIndex >= 0) { + this._actions.splice(actionIndex, 1); + } +}; + +ActionContainer.prototype._addContainerActions = function (container) { + // collect groups by titles + var titleGroupMap = {}; + this._actionGroups.forEach(function (group) { + if (titleGroupMap[group.title]) { + throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title)); + } + titleGroupMap[group.title] = group; + }); + + // map each action to its group + var groupMap = {}; + function actionHash(action) { + // unique (hopefully?) string suitable as dictionary key + return action.getName(); + } + container._actionGroups.forEach(function (group) { + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!titleGroupMap[group.title]) { + titleGroupMap[group.title] = this.addArgumentGroup({ + title: group.title, + description: group.description + }); + } + + // map the actions to their new group + group._groupActions.forEach(function (action) { + groupMap[actionHash(action)] = titleGroupMap[group.title]; + }); + }, this); + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + var mutexGroup; + container._mutuallyExclusiveGroups.forEach(function (group) { + mutexGroup = this.addMutuallyExclusiveGroup({ + required: group.required + }); + // map the actions to their new mutex group + group._groupActions.forEach(function (action) { + groupMap[actionHash(action)] = mutexGroup; + }); + }, this); // forEach takes a 'this' argument + + // add all actions to this container or their group + container._actions.forEach(function (action) { + var key = actionHash(action); + if (!!groupMap[key]) { + groupMap[key]._addAction(action); + } + else + { + this._addAction(action); + } + }); +}; + +ActionContainer.prototype._getPositional = function (dest, options) { + if (_.isArray(dest)) { + dest = _.first(dest); + } + // make sure required is not specified + if (options.required) { + throw new Error('"required" is an invalid argument for positionals.'); + } + + // mark positional arguments as required if at least one is + // always required + if (options.nargs !== $$.OPTIONAL && options.nargs !== $$.ZERO_OR_MORE) { + options.required = true; + } + if (options.nargs === $$.ZERO_OR_MORE && options.defaultValue === undefined) { + options.required = true; + } + + // return the keyword arguments with no option strings + options.dest = dest; + options.optionStrings = []; + return options; +}; + +ActionContainer.prototype._getOptional = function (args, options) { + var prefixChars = this.prefixChars; + var optionStrings = []; + var optionStringsLong = []; + + // determine short and long option strings + args.forEach(function (optionString) { + // error on strings that don't start with an appropriate prefix + if (prefixChars.indexOf(optionString[0]) < 0) { + throw new Error(format('Invalid option string "%s": must start with a "%s".', + optionString, + prefixChars + )); + } + + // strings starting with two prefix characters are long options + optionStrings.push(optionString); + if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) { + optionStringsLong.push(optionString); + } + }); + + // infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + var dest = options.dest || null; + delete options.dest; + + if (!dest) { + var optionStringDest = optionStringsLong.length ? optionStringsLong[0] :optionStrings[0]; + dest = _.str.strip(optionStringDest, this.prefixChars); + + if (dest.length === 0) { + throw new Error( + format('dest= is required for options like "%s"', optionStrings.join(', ')) + ); + } + dest = dest.replace(/-/g, '_'); + } + + // return the updated keyword arguments + options.dest = dest; + options.optionStrings = optionStrings; + + return options; +}; + +ActionContainer.prototype._popActionClass = function (options, defaultValue) { + defaultValue = defaultValue || null; + + var action = (options.action || defaultValue); + delete options.action; + + var actionClass = this._registryGet('action', action, action); + return actionClass; +}; + +ActionContainer.prototype._getHandler = function () { + var handlerString = this.conflictHandler; + var handlerFuncName = "_handleConflict" + _.str.capitalize(handlerString); + var func = this[handlerFuncName]; + if (typeof func === 'undefined') { + var msg = "invalid conflict resolution value: " + handlerString; + throw new Error(msg); + } else { + return func; + } +}; + +ActionContainer.prototype._checkConflict = function (action) { + var optionStringActions = this._optionStringActions; + var conflictOptionals = []; + + // find all options that conflict with this option + // collect pairs, the string, and an existing action that it conflicts with + action.optionStrings.forEach(function (optionString) { + var conflOptional = optionStringActions[optionString]; + if (typeof conflOptional !== 'undefined') { + conflictOptionals.push([optionString, conflOptional]); + } + }); + + if (conflictOptionals.length > 0) { + var conflictHandler = this._getHandler(); + conflictHandler.call(this, action, conflictOptionals); + } +}; + +ActionContainer.prototype._handleConflictError = function (action, conflOptionals) { + var conflicts = _.map(conflOptionals, function (pair) {return pair[0]; }); + conflicts = conflicts.join(', '); + throw argumentErrorHelper( + action, + format('Conflicting option string(s): %s', conflicts) + ); +}; + +ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) { + // remove all conflicting options + var self = this; + conflOptionals.forEach(function (pair) { + var optionString = pair[0]; + var conflictingAction = pair[1]; + // remove the conflicting option string + var i = conflictingAction.optionStrings.indexOf(optionString); + if (i >= 0) { + conflictingAction.optionStrings.splice(i, 1); + } + delete self._optionStringActions[optionString]; + // if the option now has no option string, remove it from the + // container holding it + if (conflictingAction.optionStrings.length === 0) { + conflictingAction.container._removeAction(conflictingAction); + } + }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argparse.js new file mode 100644 index 0000000..f2a2c51 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argparse.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports.ArgumentParser = require('./argument_parser.js'); +module.exports.Namespace = require('./namespace'); +module.exports.Action = require('./action'); +module.exports.HelpFormatter = require('./help/formatter.js'); +module.exports.Const = require('./const.js'); + +module.exports.ArgumentDefaultsHelpFormatter = + require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; +module.exports.RawDescriptionHelpFormatter = + require('./help/added_formatters.js').RawDescriptionHelpFormatter; +module.exports.RawTextHelpFormatter = + require('./help/added_formatters.js').RawTextHelpFormatter; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js new file mode 100644 index 0000000..c8a02a0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js @@ -0,0 +1,50 @@ +'use strict'; + + +var format = require('util').format; + + +var ERR_CODE = 'ARGError'; + +/*:nodoc:* + * argumentError(argument, message) -> TypeError + * - argument (Object): action with broken argument + * - message (String): error message + * + * Error format helper. An error from creating or using an argument + * (optional or positional). The string value of this exception + * is the message, augmented with information + * about the argument that caused it. + * + * #####Example + * + * var argumentErrorHelper = require('./argument/error'); + * if (conflictOptionals.length > 0) { + * throw argumentErrorHelper( + * action, + * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) + * ); + * } + * + **/ +module.exports = function (argument, message) { + var argumentName = null; + var errMessage; + var err; + + if (argument.getName) { + argumentName = argument.getName(); + } else { + argumentName = '' + argument; + } + + if (!argumentName) { + errMessage = message; + } else { + errMessage = format('argument "%s": %s', argumentName, message); + } + + err = new TypeError(errMessage); + err.code = ERR_CODE; + return err; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js new file mode 100644 index 0000000..8287e00 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js @@ -0,0 +1,54 @@ +/** internal + * class MutuallyExclusiveGroup + * + * Group arguments. + * By default, ArgumentParser groups command-line arguments + * into “positional arguments” and “optional arguments” + * when displaying help messages. When there is a better + * conceptual grouping of arguments than this default one, + * appropriate groups can be created using the addArgumentGroup() method + * + * This class inherited from [[ArgumentContainer]] + **/ +'use strict'; + +var util = require('util'); + +var ArgumentGroup = require('./group'); + +/** + * new MutuallyExclusiveGroup(container, options) + * - container (object): main container + * - options (object): options.required -> true/false + * + * `required` could be an argument itself, but making it a property of + * the options argument is more consistent with the JS adaptation of the Python) + **/ +var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { + var required; + options = options || {}; + required = options.required || false; + ArgumentGroup.call(this, container); + this.required = required; + +}; +util.inherits(MutuallyExclusiveGroup, ArgumentGroup); + + +MutuallyExclusiveGroup.prototype._addAction = function (action) { + var msg; + if (action.required) { + msg = 'mutually exclusive arguments must be optional'; + throw new Error(msg); + } + action = this._container._addAction(action); + this._groupActions.push(action); + return action; +}; + + +MutuallyExclusiveGroup.prototype._removeAction = function (action) { + this._container._removeAction(action); + this._groupActions.remove(action); +}; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js new file mode 100644 index 0000000..58b271f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js @@ -0,0 +1,75 @@ +/** internal + * class ArgumentGroup + * + * Group arguments. + * By default, ArgumentParser groups command-line arguments + * into “positional arguments” and “optional arguments” + * when displaying help messages. When there is a better + * conceptual grouping of arguments than this default one, + * appropriate groups can be created using the addArgumentGroup() method + * + * This class inherited from [[ArgumentContainer]] + **/ +'use strict'; + +var util = require('util'); + +var ActionContainer = require('../action_container'); + + +/** + * new ArgumentGroup(container, options) + * - container (object): main container + * - options (object): hash of group options + * + * #### options + * - **prefixChars** group name prefix + * - **argumentDefault** default argument value + * - **title** group title + * - **description** group description + * + **/ +var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { + + options = options || {}; + + // add any missing keyword arguments by checking the container + options.conflictHandler = (options.conflictHandler || container.conflictHandler); + options.prefixChars = (options.prefixChars || container.prefixChars); + options.argumentDefault = (options.argumentDefault || container.argumentDefault); + + ActionContainer.call(this, options); + + // group attributes + this.title = options.title; + this._groupActions = []; + + // share most attributes with the container + this._container = container; + this._registries = container._registries; + this._actions = container._actions; + this._optionStringActions = container._optionStringActions; + this._defaults = container._defaults; + this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; + this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; +}; +util.inherits(ArgumentGroup, ActionContainer); + + +ArgumentGroup.prototype._addAction = function (action) { + // Parent add action + action = ActionContainer.prototype._addAction.call(this, action); + this._groupActions.push(action); + return action; +}; + + +ArgumentGroup.prototype._removeAction = function (action) { + // Parent remove action + ActionContainer.prototype._removeAction.call(this, action); + var actionIndex = this._groupActions.indexOf(action); + if (actionIndex >= 0) { + this._groupActions.splice(actionIndex, 1); + } +}; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js new file mode 100644 index 0000000..97cf098 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js @@ -0,0 +1,1165 @@ +/** + * class ArgumentParser + * + * Object for parsing command line strings into js objects. + * + * Inherited from [[ActionContainer]] + **/ +'use strict'; + +var util = require('util'); +var format = require('util').format; +var Path = require('path'); + +var _ = require('underscore'); +_.str = require('underscore.string'); + +// Constants +var $$ = require('./const'); + +var ActionContainer = require('./action_container'); + +// Errors +var argumentErrorHelper = require('./argument/error'); + +var HelpFormatter = require('./help/formatter'); + +var Namespace = require('./namespace'); + + +/** + * new ArgumentParser(options) + * + * Create a new ArgumentParser object. + * + * ##### Options: + * - `prog` The name of the program (default: sys.argv[0]) + * - `usage` A usage message (default: auto-generated from arguments) + * - `description` A description of what the program does + * - `epilog` Text following the argument descriptions + * - `parents` Parsers whose arguments should be copied into this one + * - `formatterClass` HelpFormatter class for printing help messages + * - `prefixChars` Characters that prefix optional arguments + * - `fromfilePrefixChars` Characters that prefix files containing additional arguments + * - `argumentDefault` The default value for all arguments + * - `addHelp` Add a -h/-help option + * - `conflictHandler` Specifies how to handle conflicting argument names + * - `debug` Enable debug mode. Argument errors throw exception in + * debug mode and process.exit in normal. Used for development and + * testing (default: false) + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects + **/ +var ArgumentParser = module.exports = function ArgumentParser(options) { + var self = this; + options = options || {}; + + options.description = (options.description || null); + options.argumentDefault = (options.argumentDefault || null); + options.prefixChars = (options.prefixChars || '-'); + options.conflictHandler = (options.conflictHandler || 'error'); + ActionContainer.call(this, options); + + options.addHelp = (options.addHelp === undefined || !!options.addHelp); + options.parents = (options.parents || []); + // default program name + options.prog = (options.prog || Path.basename(process.argv[1])); + this.prog = options.prog; + this.usage = options.usage; + this.epilog = options.epilog; + this.version = options.version; + + this.debug = (options.debug === true); + + this.formatterClass = (options.formatterClass || HelpFormatter); + this.fromfilePrefixChars = options.fromfilePrefixChars || null; + this._positionals = this.addArgumentGroup({title: 'Positional arguments'}); + this._optionals = this.addArgumentGroup({title: 'Optional arguments'}); + this._subparsers = null; + + // register types + var FUNCTION_IDENTITY = function (o) { + return o; + }; + this.register('type', 'auto', FUNCTION_IDENTITY); + this.register('type', null, FUNCTION_IDENTITY); + this.register('type', 'int', function (x) { + var result = parseInt(x, 10); + if (isNaN(result)) { + throw new Error(x + ' is not a valid integer.'); + } + return result; + }); + this.register('type', 'float', function (x) { + var result = parseFloat(x); + if (isNaN(result)) { + throw new Error(x + ' is not a valid float.'); + } + return result; + }); + this.register('type', 'string', function (x) { + return '' + x; + }); + + // add help and version arguments if necessary + var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; + if (options.addHelp) { + this.addArgument( + [defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help'], + { + action: 'help', + defaultValue: $$.SUPPRESS, + help: 'Show this help message and exit.' + } + ); + } + if (this.version !== undefined) { + this.addArgument( + [defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version'], + { + action: 'version', + version: this.version, + defaultValue: $$.SUPPRESS, + help: "Show program's version number and exit." + } + ); + } + + // add parent arguments and defaults + options.parents.forEach(function (parent) { + self._addContainerActions(parent); + if (parent._defaults !== undefined) { + for (var defaultKey in parent._defaults) { + if (parent._defaults.hasOwnProperty(defaultKey)) { + self._defaults[defaultKey] = parent._defaults[defaultKey]; + } + } + } + }); + +}; +util.inherits(ArgumentParser, ActionContainer); + +/** + * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] + * - options (object): hash of options see [[ActionSubparsers.new]] + * + * See also [subcommands][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands + **/ +ArgumentParser.prototype.addSubparsers = function (options) { + if (!!this._subparsers) { + this.error('Cannot have multiple subparser arguments.'); + } + + options = options || {}; + options.debug = (this.debug === true); + options.optionStrings = []; + options.parserClass = (options.parserClass || ArgumentParser); + + + if (!!options.title || !!options.description) { + + this._subparsers = this.addArgumentGroup({ + title: (options.title || 'subcommands'), + description: options.description + }); + delete options.title; + delete options.description; + + } else { + this._subparsers = this._positionals; + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (!options.prog) { + var formatter = this._getFormatter(); + var positionals = this._getPositionalActions(); + var groups = this._mutuallyExclusiveGroups; + formatter.addUsage(this.usage, positionals, groups, ''); + options.prog = _.str.strip(formatter.formatHelp()); + } + + // create the parsers action and add it to the positionals list + var ParsersClass = this._popActionClass(options, 'parsers'); + var action = new ParsersClass(options); + this._subparsers._addAction(action); + + // return the created parsers action + return action; +}; + +ArgumentParser.prototype._addAction = function (action) { + if (action.isOptional()) { + this._optionals._addAction(action); + } else { + this._positionals._addAction(action); + } + return action; +}; + +ArgumentParser.prototype._getOptionalActions = function () { + return this._actions.filter(function (action) { + return action.isOptional(); + }); +}; + +ArgumentParser.prototype._getPositionalActions = function () { + return this._actions.filter(function (action) { + return action.isPositional(); + }); +}; + + +/** + * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object + * - args (array): input elements + * - namespace (Namespace|Object): result object + * + * Parsed args and throws error if some arguments are not recognized + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method + **/ +ArgumentParser.prototype.parseArgs = function (args, namespace) { + var argv; + var result = this.parseKnownArgs(args, namespace); + + args = result[0]; + argv = result[1]; + if (argv && argv.length > 0) { + this.error( + format('Unrecognized arguments: %s.', argv.join(' ')) + ); + } + return args; +}; + +/** + * ArgumentParser#parseKnownArgs(args, namespace) -> array + * - args (array): input options + * - namespace (Namespace|Object): result object + * + * Parse known arguments and return tuple of result object + * and unknown args + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing + **/ +ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { + var self = this; + + // args default to the system args + args = args || process.argv.slice(2); + + // default Namespace built from parser defaults + namespace = namespace || new Namespace(); + + self._actions.forEach(function (action) { + if (action.dest !== $$.SUPPRESS) { + if (!_.has(namespace, action.dest)) { + if (action.defaultValue !== $$.SUPPRESS) { + var defaultValue = action.defaultValue; + if (_.isString(action.defaultValue)) { + defaultValue = self._getValue(action, defaultValue); + } + namespace[action.dest] = defaultValue; + } + } + } + }); + + _.keys(self._defaults).forEach(function (dest) { + namespace[dest] = self._defaults[dest]; + }); + + // parse the arguments and exit if there are any errors + try { + var res = this._parseKnownArgs(args, namespace); + + namespace = res[0]; + args = res[1]; + if (_.has(namespace, $$._UNRECOGNIZED_ARGS_ATTR)) { + args = _.union(args, namespace[$$._UNRECOGNIZED_ARGS_ATTR]); + delete namespace[$$._UNRECOGNIZED_ARGS_ATTR]; + } + return [namespace, args]; + } catch (e) { + this.error(e); + } +}; + +ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { + var self = this; + + var extras = []; + + // replace arg strings that are file references + if (this.fromfilePrefixChars !== null) { + argStrings = this._readArgsFromFiles(argStrings); + } + // map all mutually exclusive arguments to the other arguments + // they can't occur with + // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' + // though I can't conceive of a way in which an action could be a member + // of two different mutually exclusive groups. + + function actionHash(action) { + // some sort of hashable key for this action + // action itself cannot be a key in actionConflicts + // I think getName() (join of optionStrings) is unique enough + return action.getName(); + } + var conflicts, key; + var actionConflicts = {}; + this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { + mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { + key = actionHash(mutexAction); + if (!_.has(actionConflicts, key)) { + actionConflicts[key] = []; + } + conflicts = actionConflicts[key]; + conflicts.push.apply(conflicts, groupActions.slice(0, i)); + conflicts.push.apply(conflicts, groupActions.slice(i + 1)); + }); + }); + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + var optionStringIndices = {}; + + var argStringPatternParts = []; + + argStrings.forEach(function (argString, argStringIndex) { + if (argString === '--') { + argStringPatternParts.push('-'); + while (argStringIndex < argStrings.length) { + argStringPatternParts.push('A'); + argStringIndex++; + } + } + // otherwise, add the arg to the arg strings + // and note the index if it was an option + else { + var pattern; + var optionTuple = self._parseOptional(argString); + if (!optionTuple) { + pattern = 'A'; + } + else { + optionStringIndices[argStringIndex] = optionTuple; + pattern = 'O'; + } + argStringPatternParts.push(pattern); + } + }); + var argStringsPattern = argStringPatternParts.join(''); + + var seenActions = []; + var seenNonDefaultActions = []; + + + function takeAction(action, argumentStrings, optionString) { + seenActions.push(action); + var argumentValues = self._getValues(action, argumentStrings); + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argumentValues !== action.defaultValue) { + seenNonDefaultActions.push(action); + if (!!actionConflicts[actionHash(action)]) { + actionConflicts[actionHash(action)].forEach(function (actionConflict) { + if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { + throw argumentErrorHelper( + action, + format('Not allowed with argument "%s".', actionConflict.getName()) + ); + } + }); + } + } + + if (argumentValues !== $$.SUPPRESS) { + action.call(self, namespace, argumentValues, optionString); + } + } + + function consumeOptional(startIndex) { + // get the optional identified at this index + var optionTuple = optionStringIndices[startIndex]; + var action = optionTuple[0]; + var optionString = optionTuple[1]; + var explicitArg = optionTuple[2]; + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + var actionTuples = []; + + var args, argCount, start, stop; + + while (true) { + if (!action) { + extras.push(argStrings[startIndex]); + return startIndex + 1; + } + if (!!explicitArg) { + argCount = self._matchArgument(action, 'A'); + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + var chars = self.prefixChars; + if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { + actionTuples.push([action, [], optionString]); + optionString = optionString[0] + explicitArg[0]; + var newExplicitArg = explicitArg.slice(1) || null; + var optionalsMap = self._optionStringActions; + + if (_.keys(optionalsMap).indexOf(optionString) >= 0) { + action = optionalsMap[optionString]; + explicitArg = newExplicitArg; + } + else { + var msg = 'ignored explicit argument %r'; + throw argumentErrorHelper(action, msg); + } + } + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + else if (argCount === 1) { + stop = startIndex + 1; + args = [explicitArg]; + actionTuples.push([action, args, optionString]); + break; + } + // error if a double-dash option did not use the + // explicit argument + else { + var message = 'ignored explicit argument %r'; + throw argumentErrorHelper(action, _.str.sprintf(message, explicitArg)); + } + } + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + else { + + start = startIndex + 1; + var selectedPatterns = argStringsPattern.substr(start); + + argCount = self._matchArgument(action, selectedPatterns); + stop = start + argCount; + + + args = argStrings.slice(start, stop); + + actionTuples.push([action, args, optionString]); + break; + } + + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + if (actionTuples.length < 1) { + throw new Error('length should be > 0'); + } + for (var i = 0; i < actionTuples.length; i++) { + takeAction.apply(self, actionTuples[i]); + } + return stop; + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + var positionals = self._getPositionalActions(); + + function consumePositionals(startIndex) { + // match as many Positionals as possible + var selectedPattern = argStringsPattern.substr(startIndex); + var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + _.zip(positionals, argCounts).forEach(function (item) { + var action = item[0]; + var argCount = item[1]; + if (argCount === undefined) { + return; + } + var args = argStrings.slice(startIndex, startIndex + argCount); + + startIndex += argCount; + takeAction(action, args); + }); + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(argCounts.length); + return startIndex; + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + var startIndex = 0; + var position; + + var maxOptionStringIndex = -1; + if (!!optionStringIndices) { + for (position in optionStringIndices) { + maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); + } + } + + var positionalsEndIndex, nextOptionStringIndex; + + while (startIndex <= maxOptionStringIndex) { + // consume any Positionals preceding the next option + nextOptionStringIndex = null; + for (position in optionStringIndices) { + position = parseInt(position, 10); + if (position >= startIndex) { + if (nextOptionStringIndex !== null) { + nextOptionStringIndex = Math.min(nextOptionStringIndex, position); + } + else { + nextOptionStringIndex = position; + } + } + } + + if (startIndex !== nextOptionStringIndex) { + positionalsEndIndex = consumePositionals(startIndex); + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionalsEndIndex > startIndex) { + startIndex = positionalsEndIndex; + continue; + } + else { + startIndex = positionalsEndIndex; + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!optionStringIndices[startIndex]) { + var strings = argStrings.slice(startIndex, nextOptionStringIndex); + extras = extras.concat(strings); + startIndex = nextOptionStringIndex; + } + // consume the next optional and any arguments for it + startIndex = consumeOptional(startIndex); + } + + // consume any positionals following the last Optional + var stopIndex = consumePositionals(startIndex); + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(_.rest(argStrings, stopIndex)); + + // if we didn't use all the Positional objects, there were too few + // arg strings supplied. + if (positionals.length > 0) { + self.error('too few arguments'); + } + + // make sure all required actions were present + self._actions.forEach(function (action) { + if (action.required) { + if (_.indexOf(seenActions, action) < 0) { + self.error(format('Argument "%s" is required', action.getName())); + } + } + }); + + // make sure all required groups have one option present + var actionUsed = false; + self._mutuallyExclusiveGroups.forEach(function (group) { + if (group.required) { + actionUsed = _.any(group._groupActions, function (action) { + return _.contains(seenNonDefaultActions, action); + }); + + // if no actions were used, report the error + if (!actionUsed) { + var names = []; + group._groupActions.forEach(function (action) { + if (action.help !== $$.SUPPRESS) { + names.push(action.getName()); + } + }); + names = names.join(' '); + var msg = 'one of the arguments ' + names + ' is required'; + self.error(msg); + } + } + }); + + // return the updated namespace and the extra arguments + return [namespace, extras]; +}; + +ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { + // expand arguments referencing files + var _this = this; + var fs = require('fs'); + var newArgStrings = []; + argStrings.forEach(function (argString) { + if (_this.fromfilePrefixChars.indexOf(argString[0]) < 0) { + // for regular arguments, just add them back into the list + newArgStrings.push(argString); + } else { + // replace arguments referencing files with the file content + try { + var argstrs = []; + var filename = argString.slice(1); + var content = fs.readFileSync(filename, 'utf8'); + content = content.trim().split('\n'); + content.forEach(function (argLine) { + _this.convertArgLineToArgs(argLine).forEach(function (arg) { + argstrs.push(arg); + }); + argstrs = _this._readArgsFromFiles(argstrs); + }); + newArgStrings.push.apply(newArgStrings, argstrs); + } catch (error) { + return _this.error(error.message); + } + } + }); + return newArgStrings; +}; + +ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { + return [argLine]; +}; + +ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { + + // match the pattern for this action to the arg strings + var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); + var matches = regexpArgStrings.match(regexpNargs); + var message; + + // throw an exception if we weren't able to find a match + if (!matches) { + switch (action.nargs) { + case undefined: + case null: + message = 'Expected one argument.'; + break; + case $$.OPTIONAL: + message = 'Expected at most one argument.'; + break; + case $$.ONE_OR_MORE: + message = 'Expected at least one argument.'; + break; + default: + message = 'Expected %s argument(s)'; + } + + throw argumentErrorHelper( + action, + format(message, action.nargs) + ); + } + // return the number of arguments matched + return matches[1].length; +}; + +ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + var self = this; + var result = []; + var actionSlice, pattern, matches; + var i, j; + + var getLength = function (string) { + return string.length; + }; + + for (i = actions.length; i > 0; i -= 1) { + pattern = ''; + actionSlice = actions.slice(0, i); + for (j in actionSlice) { + pattern += self._getNargsPattern(actionSlice[j]); + } + + pattern = new RegExp('^' + pattern); + matches = regexpArgStrings.match(pattern); + + if (matches && matches.length > 0) { + // need only groups + matches = matches.splice(1); + result = result.concat(matches.map(getLength)); + break; + } + } + + // return the list of arg string counts + return result; +}; + +ArgumentParser.prototype._parseOptional = function (argString) { + var action, optionString, argExplicit, optionTuples; + + // if it's an empty string, it was meant to be a positional + if (!argString) { + return null; + } + + // if it doesn't start with a prefix, it was meant to be positional + if (this.prefixChars.indexOf(argString[0]) < 0) { + return null; + } + + // if the option string is present in the parser, return the action + if (!!this._optionStringActions[argString]) { + return [this._optionStringActions[argString], argString, null]; + } + + // if it's just a single character, it was meant to be positional + if (argString.length === 1) { + return null; + } + + // if the option string before the "=" is present, return the action + if (argString.indexOf('=') >= 0) { + var argStringSplit = argString.split('='); + optionString = argStringSplit[0]; + argExplicit = argStringSplit[1]; + + if (!!this._optionStringActions[optionString]) { + action = this._optionStringActions[optionString]; + return [action, optionString, argExplicit]; + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + optionTuples = this._getOptionTuples(argString); + + // if multiple actions match, the option string was ambiguous + if (optionTuples.length > 1) { + var optionStrings = optionTuples.map(function (optionTuple) { + return optionTuple[1]; + }); + this.error(format( + 'Ambiguous option: "%s" could match %s.', + argString, optionStrings.join(', ') + )); + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (optionTuples.length === 1) { + return optionTuples[0]; + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (argString.match(this._regexpNegativeNumber)) { + if (!_.any(this._hasNegativeNumberOptionals)) { + return null; + } + } + // if it contains a space, it was meant to be a positional + if (argString.search(' ') >= 0) { + return null; + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [null, argString, null]; +}; + +ArgumentParser.prototype._getOptionTuples = function (optionString) { + var result = []; + var chars = this.prefixChars; + var optionPrefix; + var argExplicit; + var action; + var actionOptionString; + + // option strings starting with two prefix characters are only split at + // the '=' + if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { + if (optionString.indexOf('=') >= 0) { + var optionStringSplit = optionString.split('=', 1); + + optionPrefix = optionStringSplit[0]; + argExplicit = optionStringSplit[1]; + } else { + optionPrefix = optionString; + argExplicit = null; + } + + for (actionOptionString in this._optionStringActions) { + if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { + action = this._optionStringActions[actionOptionString]; + result.push([action, actionOptionString, argExplicit]); + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { + optionPrefix = optionString; + argExplicit = null; + var optionPrefixShort = optionString.substr(0, 2); + var argExplicitShort = optionString.substr(2); + + for (actionOptionString in this._optionStringActions) { + action = this._optionStringActions[actionOptionString]; + if (actionOptionString === optionPrefixShort) { + result.push([action, actionOptionString, argExplicitShort]); + } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { + result.push([action, actionOptionString, argExplicit]); + } + } + + // shouldn't ever get here + } else { + throw new Error(format('Unexpected option string: %s.', optionString)); + } + // return the collected option tuples + return result; +}; + +ArgumentParser.prototype._getNargsPattern = function (action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + var regexpNargs; + + switch (action.nargs) { + // the default (null) is assumed to be a single argument + case undefined: + case null: + regexpNargs = '(-*A-*)'; + break; + // allow zero or more arguments + case $$.OPTIONAL: + regexpNargs = '(-*A?-*)'; + break; + // allow zero or more arguments + case $$.ZERO_OR_MORE: + regexpNargs = '(-*[A-]*)'; + break; + // allow one or more arguments + case $$.ONE_OR_MORE: + regexpNargs = '(-*A[A-]*)'; + break; + // allow any number of options or arguments + case $$.REMAINDER: + regexpNargs = '([-AO]*)'; + break; + // allow one argument followed by any number of options or arguments + case $$.PARSER: + regexpNargs = '(-*A[-AO]*)'; + break; + // all others should be integers + default: + regexpNargs = '(-*' + _.str.repeat('-*A', action.nargs) + '-*)'; + } + + // if this is an optional action, -- is not allowed + if (action.isOptional()) { + regexpNargs = regexpNargs.replace(/-\*/g, ''); + regexpNargs = regexpNargs.replace(/-/g, ''); + } + + // return the pattern + return regexpNargs; +}; + +// +// Value conversion methods +// + +ArgumentParser.prototype._getValues = function (action, argStrings) { + var self = this; + + // for everything but PARSER args, strip out '--' + if (action.nargs !== $$.PARSER && action.nargs !== $$.REMAINDER) { + argStrings = argStrings.filter(function (arrayElement) { + return arrayElement !== '--'; + }); + } + + var value, argString; + + // optional argument produces a default when not present + if (argStrings.length === 0 && action.nargs === $$.OPTIONAL) { + + value = (action.isOptional()) ? action.constant: action.defaultValue; + + if (typeof(value) === 'string') { + value = this._getValue(action, value); + this._checkValue(action, value); + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (argStrings.length === 0 && action.nargs === $$.ZERO_OR_MORE && + action.optionStrings.length === 0) { + + value = (action.defaultValue || argStrings); + this._checkValue(action, value); + + // single argument or optional argument produces a single value + } else if (argStrings.length === 1 && + (!action.nargs || action.nargs === $$.OPTIONAL)) { + + argString = argStrings[0]; + value = this._getValue(action, argString); + this._checkValue(action, value); + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === $$.REMAINDER) { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === $$.PARSER) { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + this._checkValue(action, value[0]); + + // all other types of nargs produce a list + } else { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + value.forEach(function (v) { + self._checkValue(action, v); + }); + } + + // return the converted value + return value; +}; + +ArgumentParser.prototype._getValue = function (action, argString) { + var result; + + var typeFunction = this._registryGet('type', action.type, action.type); + if (!_.isFunction(typeFunction)) { + var message = format('%s is not callable', typeFunction); + throw argumentErrorHelper(action, message); + } + + // convert the value to the appropriate type + try { + result = typeFunction(argString); + + // ArgumentTypeErrors indicate errors + // If action.type is not a registered string, it is a function + // Try to deduce its name for inclusion in the error message + // Failing that, include the error message it raised. + } catch (e) { + var name = null; + if (_.isString(action.type)) { + name = action.type; + } else { + name = action.type.name || action.type.displayName || ''; + } + var msg = format('Invalid %s value: %s', name, argString); + if (name === '') {msg += '\n' + e.message; } + throw argumentErrorHelper(action, msg); + } + // return the converted value + return result; +}; + +ArgumentParser.prototype._checkValue = function (action, value) { + // converted value must be one of the choices (if specified) + var choices = action.choices; + if (!!choices) { + // choise for argument can by array or string + if ((_.isString(choices) || _.isArray(choices)) && + choices.indexOf(value) !== -1) { + return; + } + // choise for subparsers can by only hash + if (_.isObject(choices) && !_.isArray(choices) && choices[value]) { + return; + } + + if (_.isString(choices)) { + choices = choices.split('').join(', '); + } + else if (_.isArray(choices)) { + choices = choices.join(', '); + } + else { + choices = _.keys(choices).join(', '); + } + var message = format('Invalid choice: %s (choose from [%s])', value, choices); + throw argumentErrorHelper(action, message); + } +}; + +// +// Help formatting methods +// + +/** + * ArgumentParser#formatUsage -> string + * + * Return usage string + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.formatUsage = function () { + var formatter = this._getFormatter(); + formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); + return formatter.formatHelp(); +}; + +/** + * ArgumentParser#formatHelp -> string + * + * Return help + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.formatHelp = function () { + var formatter = this._getFormatter(); + + // usage + formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); + + // description + formatter.addText(this.description); + + // positionals, optionals and user-defined groups + this._actionGroups.forEach(function (actionGroup) { + formatter.startSection(actionGroup.title); + formatter.addText(actionGroup.description); + formatter.addArguments(actionGroup._groupActions); + formatter.endSection(); + }); + + // epilog + formatter.addText(this.epilog); + + // determine help from format above + return formatter.formatHelp(); +}; + +ArgumentParser.prototype._getFormatter = function () { + var FormatterClass = this.formatterClass; + var formatter = new FormatterClass({prog: this.prog}); + return formatter; +}; + +// +// Print functions +// + +/** + * ArgumentParser#printUsage() -> Void + * + * Print usage + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.printUsage = function () { + this._printMessage(this.formatUsage()); +}; + +/** + * ArgumentParser#printHelp() -> Void + * + * Print help + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.printHelp = function () { + this._printMessage(this.formatHelp()); +}; + +ArgumentParser.prototype._printMessage = function (message, stream) { + if (!stream) { + stream = process.stdout; + } + if (message) { + stream.write('' + message); + } +}; + +// +// Exit functions +// + +/** + * ArgumentParser#exit(status=0, message) -> Void + * - status (int): exit status + * - message (string): message + * + * Print message in stderr/stdout and exit program + **/ +ArgumentParser.prototype.exit = function (status, message) { + if (!!message) { + if (status === 0) { + this._printMessage(message); + } + else { + this._printMessage(message, process.stderr); + } + } + + process.exit(status); +}; + +/** + * ArgumentParser#error(message) -> Void + * - err (Error|string): message + * + * Error method Prints a usage message incorporating the message to stderr and + * exits. If you override this in a subclass, + * it should not return -- it should + * either exit or throw an exception. + * + **/ +ArgumentParser.prototype.error = function (err) { + var message; + if (err instanceof Error) { + if (this.debug === true) { + throw err; + } + message = err.message; + } + else { + message = err; + } + var msg = format('%s: error: %s', this.prog, message) + $$.EOL; + + if (this.debug === true) { + throw new Error(msg); + } + + this.printUsage(process.stderr); + + return this.exit(2, msg); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/const.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/const.js new file mode 100644 index 0000000..de831ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/const.js @@ -0,0 +1,18 @@ +// +// Constants +// +module.exports.EOL = '\n'; + +module.exports.SUPPRESS = '==SUPPRESS=='; + +module.exports.OPTIONAL = '?'; + +module.exports.ZERO_OR_MORE = '*'; + +module.exports.ONE_OR_MORE = '+'; + +module.exports.PARSER = 'A...'; + +module.exports.REMAINDER = '...'; + +module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js new file mode 100644 index 0000000..cd2f369 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js @@ -0,0 +1,88 @@ +'use strict'; + +var util = require('util'); +var _ = require('underscore'); +_.str = require('underscore.string'); + +// Constants +var $$ = require('../const'); + +var HelpFormatter = require('./formatter.js'); + +/** + * new RawDescriptionHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) + * + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +var ArgumentDefaultsHelpFormatter = function ArgumentDefaultsHelpFormatter(options) { + HelpFormatter.call(this, options); +}; + +util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); + +ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { + var help = action.help; + if (action.help.indexOf('%(defaultValue)s') === -1) { + if (action.defaultValue !== $$.SUPPRESS) { + var defaulting_nargs = [$$.OPTIONAL, $$.ZERO_OR_MORE]; + if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { + help += ' (default: %(defaultValue)s)'; + } + } + } + return help; +}; + +module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; + +/** + * new RawDescriptionHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) + * + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +var RawDescriptionHelpFormatter = function RawDescriptionHelpFormatter(options) { + HelpFormatter.call(this, options); +}; + +util.inherits(RawDescriptionHelpFormatter, HelpFormatter); + +RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { + var lines = text.split('\n'); + lines = lines.map(function (line) { + return _.str.rtrim(indent + line); + }); + return lines.join('\n'); +}; +module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; + +/** + * new RawTextHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) + * + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +var RawTextHelpFormatter = function RawTextHelpFormatter(options) { + RawDescriptionHelpFormatter.call(this, options); +}; + +util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); + +RawTextHelpFormatter.prototype._splitLines = function (text) { + return text.split('\n'); +}; + +module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js new file mode 100644 index 0000000..541d918 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js @@ -0,0 +1,803 @@ +/** + * class HelpFormatter + * + * Formatter for generating usage messages and argument help strings. Only the + * name of this class is considered a public API. All the methods provided by + * the class are considered an implementation detail. + * + * Do not call in your code, use this class only for inherits your own forvatter + * + * ToDo add [additonal formatters][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#formatter-class + **/ +'use strict'; + +var _ = require('underscore'); +_.str = require('underscore.string'); + +// Constants +var $$ = require('../const'); + + +/*:nodoc:* internal + * new Support(parent, heding) + * - parent (object): parent section + * - heading (string): header string + * + **/ +function Section(parent, heading) { + this._parent = parent; + this._heading = heading; + this._items = []; +} + +/*:nodoc:* internal + * Section#addItem(callback) -> Void + * - callback (array): tuple with function and args + * + * Add function for single element + **/ +Section.prototype.addItem = function (callback) { + this._items.push(callback); +}; + +/*:nodoc:* internal + * Section#formatHelp(formatter) -> string + * - formatter (HelpFormatter): current formatter + * + * Form help section string + * + **/ +Section.prototype.formatHelp = function (formatter) { + var itemHelp, heading; + + // format the indented section + if (!!this._parent) { + formatter._indent(); + } + + itemHelp = this._items.map(function (item) { + var obj, func, args; + + obj = formatter; + func = item[0]; + args = item[1]; + return func.apply(obj, args); + }); + itemHelp = formatter._joinParts(itemHelp); + + if (!!this._parent) { + formatter._dedent(); + } + + // return nothing if the section was empty + if (!itemHelp) { + return ''; + } + + // add the heading if the section was non-empty + heading = ''; + if (!!this._heading && this._heading !== $$.SUPPRESS) { + var currentIndent = formatter.currentIndent; + heading = _.str.repeat(' ', currentIndent) + this._heading + ':' + $$.EOL; + } + + // join the section-initialize newline, the heading and the help + return formatter._joinParts([$$.EOL, heading, itemHelp, $$.EOL]); +}; + +/** + * new HelpFormatter(options) + * + * #### Options: + * - `prog`: program name + * - `indentIncriment`: indent step, default value 2 + * - `maxHelpPosition`: max help position, default value = 24 + * - `width`: line width + * + **/ +var HelpFormatter = module.exports = function HelpFormatter(options) { + options = options || {}; + + this._prog = options.prog; + + this._maxHelpPosition = options.maxHelpPosition || 24; + this._width = (options.width || ((process.env.COLUMNS || 80) - 2)); + + this._currentIndent = 0; + this._indentIncriment = options.indentIncriment || 2; + this._level = 0; + this._actionMaxLength = 0; + + this._rootSection = new Section(null); + this._currentSection = this._rootSection; + + this._whitespaceMatcher = new RegExp('\\s+', 'g'); + this._longBreakMatcher = new RegExp($$.EOL + $$.EOL + $$.EOL + '+', 'g'); +}; + +HelpFormatter.prototype._indent = function () { + this._currentIndent += this._indentIncriment; + this._level += 1; +}; + +HelpFormatter.prototype._dedent = function () { + this._currentIndent -= this._indentIncriment; + this._level -= 1; + if (this._currentIndent < 0) { + throw new Error('Indent decreased below 0.'); + } +}; + +HelpFormatter.prototype._addItem = function (func, args) { + this._currentSection.addItem([func, args]); +}; + +// +// Message building methods +// + +/** + * HelpFormatter#startSection(heading) -> Void + * - heading (string): header string + * + * Start new help section + * + * See alse [code example][1] + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.startSection = function (heading) { + this._indent(); + var section = new Section(this._currentSection, heading); + var func = section.formatHelp.bind(section); + this._addItem(func, [this]); + this._currentSection = section; +}; + +/** + * HelpFormatter#endSection -> Void + * + * End help section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + **/ +HelpFormatter.prototype.endSection = function () { + this._currentSection = this._currentSection._parent; + this._dedent(); +}; + +/** + * HelpFormatter#addText(text) -> Void + * - text (string): plain text + * + * Add plain text into current section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.addText = function (text) { + if (!!text && text !== $$.SUPPRESS) { + this._addItem(this._formatText, [text]); + } +}; + +/** + * HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void + * - usage (string): usage text + * - actions (array): actions list + * - groups (array): groups list + * - prefix (string): usage prefix + * + * Add usage data into current section + * + * ##### Example + * + * formatter.addUsage(this.usage, this._actions, []); + * return formatter.formatHelp(); + * + **/ +HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) { + if (usage !== $$.SUPPRESS) { + this._addItem(this._formatUsage, [usage, actions, groups, prefix]); + } +}; + +/** + * HelpFormatter#addArgument(action) -> Void + * - action (object): action + * + * Add argument into current section + * + * Single variant of [[HelpFormatter#addArguments]] + **/ +HelpFormatter.prototype.addArgument = function (action) { + if (action.help !== $$.SUPPRESS) { + var self = this; + + // find all invocations + var invocations = [this._formatActionInvocation(action)]; + var invocationLength = invocations[0].length; + + var actionLength; + + if (!!action._getSubactions) { + this._indent(); + action._getSubactions().forEach(function (subaction) { + + var invocationNew = self._formatActionInvocation(subaction); + invocations.push(invocationNew); + invocationLength = Math.max(invocationLength, invocationNew.length); + + }); + this._dedent(); + } + + // update the maximum item length + actionLength = invocationLength + this._currentIndent; + this._actionMaxLength = Math.max(this._actionMaxLength, actionLength); + + // add the item to the list + this._addItem(this._formatAction, [action]); + } +}; + +/** + * HelpFormatter#addArguments(actions) -> Void + * - actions (array): actions list + * + * Mass add arguments into current section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.addArguments = function (actions) { + var self = this; + actions.forEach(function (action) { + self.addArgument(action); + }); +}; + +// +// Help-formatting methods +// + +/** + * HelpFormatter#formatHelp -> string + * + * Format help + * + * ##### Example + * + * formatter.addText(this.epilog); + * return formatter.formatHelp(); + * + **/ +HelpFormatter.prototype.formatHelp = function () { + var help = this._rootSection.formatHelp(this); + if (help) { + help = help.replace(this._longBreakMatcher, $$.EOL + $$.EOL); + help = _.str.strip(help, $$.EOL) + $$.EOL; + } + return help; +}; + +HelpFormatter.prototype._joinParts = function (partStrings) { + return partStrings.filter(function (part) { + return (!!part && part !== $$.SUPPRESS); + }).join(''); +}; + +HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { + if (!prefix && !_.isString(prefix)) { + prefix = 'usage: '; + } + + actions = actions || []; + groups = groups || []; + + + // if usage is specified, use that + if (usage) { + usage = _.str.sprintf(usage, {prog: this._prog}); + + // if no optionals or positionals are available, usage is just prog + } else if (!usage && actions.length === 0) { + usage = this._prog; + + // if optionals and positionals are available, calculate usage + } else if (!usage) { + var prog = this._prog; + var optionals = []; + var positionals = []; + var actionUsage; + var textWidth; + + // split optionals from positionals + actions.forEach(function (action) { + if (action.isOptional()) { + optionals.push(action); + } else { + positionals.push(action); + } + }); + + // build full usage string + actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups); + usage = [prog, actionUsage].join(' '); + + // wrap the usage parts if it's too long + textWidth = this._width - this._currentIndent; + if ((prefix.length + usage.length) > textWidth) { + + // break usage into wrappable parts + var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g'); + var optionalUsage = this._formatActionsUsage(optionals, groups); + var positionalUsage = this._formatActionsUsage(positionals, groups); + + + var optionalParts = optionalUsage.match(regexpPart); + var positionalParts = positionalUsage.match(regexpPart) || []; + + if (optionalParts.join(' ') !== optionalUsage) { + throw new Error('assert "optionalParts.join(\' \') === optionalUsage"'); + } + if (positionalParts.join(' ') !== positionalUsage) { + throw new Error('assert "positionalParts.join(\' \') === positionalUsage"'); + } + + // helper for wrapping lines + var _getLines = function (parts, indent, prefix) { + var lines = []; + var line = []; + + var lineLength = !!prefix ? prefix.length - 1: indent.length - 1; + + parts.forEach(function (part) { + if (lineLength + 1 + part.length > textWidth) { + lines.push(indent + line.join(' ')); + line = []; + lineLength = indent.length - 1; + } + line.push(part); + lineLength += part.length + 1; + }); + + if (line) { + lines.push(indent + line.join(' ')); + } + if (prefix) { + lines[0] = lines[0].substr(indent.length); + } + return lines; + }; + + var lines, indent, parts; + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * textWidth) { + indent = _.str.repeat(' ', (prefix.length + prog.length + 1)); + if (optionalParts) { + lines = [].concat( + _getLines([prog].concat(optionalParts), indent, prefix), + _getLines(positionalParts, indent) + ); + } else if (positionalParts) { + lines = _getLines([prog].concat(positionalParts), indent, prefix); + } else { + lines = [prog]; + } + + // if prog is long, put it on its own line + } else { + indent = _.str.repeat(' ', prefix.length); + parts = optionalParts + positionalParts; + lines = _getLines(parts, indent); + if (lines.length > 1) { + lines = [].concat( + _getLines(optionalParts, indent), + _getLines(positionalParts, indent) + ); + } + lines = [prog] + lines; + } + // join lines into usage + usage = lines.join($$.EOL); + } + } + + // prefix with 'usage:' + return prefix + usage + $$.EOL + $$.EOL; +}; + +HelpFormatter.prototype._formatActionsUsage = function (actions, groups) { + // find group indices and identify actions in groups + var groupActions = []; + var inserts = []; + var self = this; + + groups.forEach(function (group) { + var end; + var i; + + var start = actions.indexOf(group._groupActions[0]); + if (start >= 0) { + end = start + group._groupActions.length; + + //if (actions.slice(start, end) === group._groupActions) { + if (_.isEqual(actions.slice(start, end), group._groupActions)) { + group._groupActions.forEach(function (action) { + groupActions.push(action); + }); + + if (!group.required) { + if (!!inserts[start]) { + inserts[start] += ' ['; + } + else { + inserts[start] = '['; + } + inserts[end] = ']'; + } else { + if (!!inserts[start]) { + inserts[start] += ' ('; + } + else { + inserts[start] = '('; + } + inserts[end] = ')'; + } + for (i = start + 1; i < end; i += 1) { + inserts[i] = '|'; + } + } + } + }); + + // collect all actions format strings + var parts = []; + + actions.forEach(function (action, actionIndex) { + var part; + var optionString; + var argsDefault; + var argsString; + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === $$.SUPPRESS) { + parts.push(null); + if (inserts[actionIndex] === '|') { + inserts.splice(actionIndex, actionIndex); + } else if (inserts[actionIndex + 1] === '|') { + inserts.splice(actionIndex + 1, actionIndex + 1); + } + + // produce all arg strings + } else if (!action.isOptional()) { + part = self._formatArgs(action, action.dest); + + // if it's in a group, strip the outer [] + if (groupActions.indexOf(action) >= 0) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1); + } + } + // add the action string to the list + parts.push(part); + + // produce the first way to invoke the option in brackets + } else { + optionString = action.optionStrings[0]; + + // if the Optional doesn't take a value, format is: -s or --long + if (action.nargs === 0) { + part = '' + optionString; + + // if the Optional takes a value, format is: -s ARGS or --long ARGS + } else { + argsDefault = action.dest.toUpperCase(); + argsString = self._formatArgs(action, argsDefault); + part = optionString + ' ' + argsString; + } + // make it look optional if it's not required or in a group + if (!action.required && groupActions.indexOf(action) < 0) { + part = '[' + part + ']'; + } + // add the action string to the list + parts.push(part); + } + }); + + // insert things at the necessary indices + for (var i = inserts.length - 1; i >= 0; --i) { + if (inserts[i] !== null) { + parts.splice(i, 0, inserts[i]); + } + } + + // join all the action items with spaces + var text = parts.filter(function (part) { + return !!part; + }).join(' '); + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1'); // remove spaces + text = text.replace(/ ([\])])/g, '$1'); + text = text.replace(/\[ *\]/g, ''); // remove empty groups + text = text.replace(/\( *\)/g, ''); + text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups + + text = _.str.strip(text); + + // return the text + return text; +}; + +HelpFormatter.prototype._formatText = function (text) { + text = _.str.sprintf(text, {prog: this._prog}); + var textWidth = this._width - this._currentIndent; + var indentIncriment = _.str.repeat(' ', this._currentIndent); + return this._fillText(text, textWidth, indentIncriment) + $$.EOL + $$.EOL; +}; + +HelpFormatter.prototype._formatAction = function (action) { + var self = this; + + var helpText; + var helpLines; + var parts; + var indentFirst; + + // determine the required width and the entry label + var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition); + var helpWidth = this._width - helpPosition; + var actionWidth = helpPosition - this._currentIndent - 2; + var actionHeader = this._formatActionInvocation(action); + + // no help; start on same line and add a final newline + if (!action.help) { + actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; + + // short action name; start on the same line and pad two spaces + } else if (actionHeader.length <= actionWidth) { + actionHeader = _.str.repeat(' ', this._currentIndent) + + actionHeader + + ' ' + + _.str.repeat(' ', actionWidth - actionHeader.length); + indentFirst = 0; + + // long action name; start on the next line + } else { + actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; + indentFirst = helpPosition; + } + + // collect the pieces of the action help + parts = [actionHeader]; + + // if there was help for the action, add lines of help text + if (!!action.help) { + helpText = this._expandHelp(action); + helpLines = this._splitLines(helpText, helpWidth); + parts.push(_.str.repeat(' ', indentFirst) + helpLines[0] + $$.EOL); + helpLines.slice(1).forEach(function (line) { + parts.push(_.str.repeat(' ', helpPosition) + line + $$.EOL); + }); + + // or add a newline if the description doesn't end with one + } else if (actionHeader.charAt(actionHeader.length - 1) !== $$.EOL) { + parts.push($$.EOL); + } + // if there are any sub-actions, add their help as well + if (!!action._getSubactions) { + this._indent(); + action._getSubactions().forEach(function (subaction) { + parts.push(self._formatAction(subaction)); + }); + this._dedent(); + } + // return a single string + return this._joinParts(parts); +}; + +HelpFormatter.prototype._formatActionInvocation = function (action) { + if (!action.isOptional()) { + var format_func = this._metavarFormatter(action, action.dest); + var metavars = format_func(1); + return metavars[0]; + } else { + var parts = []; + var argsDefault; + var argsString; + + // if the Optional doesn't take a value, format is: -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.optionStrings); + + // if the Optional takes a value, format is: -s ARGS, --long ARGS + } else { + argsDefault = action.dest.toUpperCase(); + argsString = this._formatArgs(action, argsDefault); + action.optionStrings.forEach(function (optionString) { + parts.push(optionString + ' ' + argsString); + }); + } + return parts.join(', '); + } +}; + +HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) { + var result; + + if (!!action.metavar || action.metavar === '') { + result = action.metavar; + } else if (!!action.choices) { + var choices = action.choices; + + if (_.isString(choices)) { + choices = choices.split('').join(', '); + } else if (_.isArray(choices)) { + choices = choices.join(','); + } + else + { + choices = _.keys(choices).join(','); + } + result = '{' + choices + '}'; + } else { + result = metavarDefault; + } + + return function (size) { + if (Array.isArray(result)) { + return result; + } else { + var metavars = []; + for (var i = 0; i < size; i += 1) { + metavars.push(result); + } + return metavars; + } + }; +}; + +HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { + var result; + var metavars; + + var buildMetavar = this._metavarFormatter(action, metavarDefault); + + switch (action.nargs) { + case undefined: + case null: + metavars = buildMetavar(1); + result = '' + metavars[0]; + break; + case $$.OPTIONAL: + metavars = buildMetavar(1); + result = '[' + metavars[0] + ']'; + break; + case $$.ZERO_OR_MORE: + metavars = buildMetavar(2); + result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; + break; + case $$.ONE_OR_MORE: + metavars = buildMetavar(2); + result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; + break; + case $$.REMAINDER: + result = '...'; + break; + case $$.PARSER: + metavars = buildMetavar(1); + result = metavars[0] + ' ...'; + break; + default: + metavars = buildMetavar(action.nargs); + result = metavars.join(' '); + } + return result; +}; + +HelpFormatter.prototype._expandHelp = function (action) { + var actionProperty; + var actionValue; + + var params = {prog: this._prog}; + + for (actionProperty in action) { + if (action.hasOwnProperty(actionProperty)) { + actionValue = action[actionProperty]; + + if (actionValue !== $$.SUPPRESS) { + params[actionProperty] = actionValue; + } + } + } + + if (!!params.choices) { + if (_.isString(params.choices)) { + params.choices = params.choices.split('').join(', '); + } + else if (_.isArray(params.choices)) { + params.choices = params.choices.join(', '); + } + else { + params.choices = _.keys(params.choices).join(', '); + } + } + + return _.str.sprintf(this._getHelpString(action), params); +}; + +HelpFormatter.prototype._splitLines = function (text, width) { + var lines = []; + var delimiters = [" ", ".", ",", "!", "?"]; + var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$'); + + text = text.replace(/[\n\|\t]/g, ' '); + + text = _.str.strip(text); + text = text.replace(this._whitespaceMatcher, ' '); + + // Wraps the single paragraph in text (a string) so every line + // is at most width characters long. + text.split($$.EOL).forEach(function (line) { + if (width >= line.length) { + lines.push(line); + return; + } + + var wrapStart = 0; + var wrapEnd = width; + var delimiterIndex = 0; + while (wrapEnd <= line.length) { + if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) { + delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index; + wrapEnd = wrapStart + delimiterIndex + 1; + } + lines.push(line.substring(wrapStart, wrapEnd)); + wrapStart = wrapEnd; + wrapEnd += width; + } + if (wrapStart < line.length) { + lines.push(line.substring(wrapStart, wrapEnd)); + } + }); + + return lines; +}; + +HelpFormatter.prototype._fillText = function (text, width, indent) { + var lines = this._splitLines(text, width); + lines = lines.map(function (line) { + return indent + line; + }); + return lines.join($$.EOL); +}; + +HelpFormatter.prototype._getHelpString = function (action) { + return action.help; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/namespace.js new file mode 100644 index 0000000..3546f2d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/namespace.js @@ -0,0 +1,77 @@ +/** + * class Namespace + * + * Simple object for storing attributes. Implements equality by attribute names + * and values, and provides a simple string representation. + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object + **/ +'use strict'; + +var _ = require('underscore'); + +/** + * new Namespace(options) + * - options(object): predefined propertis for result object + * + **/ +var Namespace = module.exports = function Namespace(options) { + _.extend(this, options); +}; + +/** + * Namespace#isset(key) -> Boolean + * - key (string|number): property name + * + * Tells whenever `namespace` contains given `key` or not. + **/ +Namespace.prototype.isset = function (key) { + return _.has(this, key); +}; + +/** + * Namespace#set(key, value) -> self + * -key (string|number|object): propery name + * -value (mixed): new property value + * + * Set the property named key with value. + * If key object then set all key properties to namespace object + **/ +Namespace.prototype.set = function (key, value) { + if (typeof (key) === 'object') { + _.extend(this, key); + } else { + this[key] = value; + } + return this; +}; + +/** + * Namespace#get(key, defaultValue) -> mixed + * - key (string|number): property name + * - defaultValue (mixed): default value + * + * Return the property key or defaulValue if not set + **/ +Namespace.prototype.get = function (key, defaultValue) { + return !this[key] ? defaultValue: this[key]; +}; + +/** + * Namespace#unset(key, defaultValue) -> mixed + * - key (string|number): property name + * - defaultValue (mixed): default value + * + * Return data[key](and delete it) or defaultValue + **/ +Namespace.prototype.unset = function (key, defaultValue) { + var value = this[key]; + if (value !== null) { + delete this[key]; + return value; + } else { + return defaultValue; + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml new file mode 100644 index 0000000..ab27b29 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml @@ -0,0 +1,8 @@ +language: ruby +rvm: + - 1.9.3 + +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 2 \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile new file mode 100644 index 0000000..aed29c3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem 'uglifier' +gem 'rake' diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock new file mode 100644 index 0000000..2c52be4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock @@ -0,0 +1,17 @@ +GEM + remote: https://rubygems.org/ + specs: + execjs (1.4.0) + multi_json (~> 1.0) + multi_json (1.3.6) + rake (0.9.2.2) + uglifier (1.3.0) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + +PLATFORMS + ruby + +DEPENDENCIES + rake + uglifier diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown new file mode 100644 index 0000000..1a39ad9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown @@ -0,0 +1,814 @@ +# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # + + + +Javascript lacks complete string manipulation operations. +This an attempt to fill that gap. List of build-in methods can be found +for example from [Dive Into JavaScript][d]. + +[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object + + +As name states this an extension for [Underscore.js][u], but it can be used +independently from **_s**-global variable. But with Underscore.js you can +use Object-Oriented style and chaining: + +[u]: http://documentcloud.github.com/underscore/ + +```javascript +_(" epeli ").chain().trim().capitalize().value() +=> "Epeli" +``` + +## Download ## + + * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* + * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* + + +## Node.js installation ## + +**npm package** + + npm install underscore.string + +**Standalone usage**: + +```javascript +var _s = require('underscore.string'); +``` + +**Integrate with Underscore.js**: + +```javascript +var _ = require('underscore'); + +// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) +_.str = require('underscore.string'); + +// Mix in non-conflict functions to Underscore namespace if you want +_.mixin(_.str.exports()); + +// All functions, include conflict, will be available through _.str object +_.str.include('Underscore.string', 'string'); // => true +``` + +**Or Integrate with Underscore.js without module loading** + +Run the following expression after Underscore.js and Underscore.string are loaded +```javascript +// _.str becomes a global variable if no module loading is detected +// Mix in non-conflict functions to Underscore namespace +_.mixin(_.str.exports()); +``` + +## String Functions ## + +For availability of functions in this way you need to mix in Underscore.string functions: + +```javascript +_.mixin(_.string.exports()); +``` + +otherwise functions from examples will be available through _.string or _.str objects: + +```javascript +_.str.capitalize('epeli') +=> "Epeli" +``` + +**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=',']) + +Formats the numbers. + +```javascript +_.numberFormat(1000, 2) +=> "1,000.00" + +_.numberFormat(123456789.123, 5, '.', ',') +=> "123,456,789.12300" +``` + + +**levenshtein** _.levenshtein(string1, string2) + +Calculates [Levenshtein distance][ld] between two strings. +[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance + +```javascript +_.levenshtein('kitten', 'kittah') +=> 2 +``` + +**capitalize** _.capitalize(string) + +Converts first letter of the string to uppercase. + +```javascript +_.capitalize("foo Bar") +=> "Foo Bar" +``` + +**chop** _.chop(string, step) + +```javascript +_.chop('whitespace', 3) +=> ['whi','tes','pac','e'] +``` + +**clean** _.clean(str) + +Compress some whitespaces to one. + +```javascript +_.clean(" foo bar ") +=> 'foo bar' +``` + +**chars** _.chars(str) + +```javascript +_.chars('Hello') +=> ['H','e','l','l','o'] +``` + +**swapCase** _.swapCase(str) + +Returns a copy of the string in which all the case-based characters have had their case swapped. + +```javascript +_.swapCase('hELLO') +=> 'Hello' +``` + +**include** available only through _.str object, because Underscore has function with the same name. + +```javascript +_.str.include("foobar", "ob") +=> true +``` + +(removed) **includes** _.includes(string, substring) + +Tests if string contains a substring. + +```javascript +_.includes("foobar", "ob") +=> true +``` + +**includes** function was removed + +But you can create it in this way, for compatibility with previous versions: + +```javascript +_.includes = _.str.include +``` + +**count** _.count(string, substring) + +```javascript +_('Hello world').count('l') +=> 3 +``` + +**escapeHTML** _.escapeHTML(string) + +Converts HTML special characters to their entity equivalents. + +```javascript +_('
    Blah blah blah
    ').escapeHTML(); +=> '<div>Blah blah blah</div>' +``` + +**unescapeHTML** _.unescapeHTML(string) + +Converts entity characters to HTML equivalents. + +```javascript +_('<div>Blah blah blah</div>').unescapeHTML(); +=> '
    Blah blah blah
    ' +``` + +**insert** _.insert(string, index, substing) + +```javascript +_('Hello ').insert(6, 'world') +=> 'Hello world' +``` + +**isBlank** _.isBlank(string) + +```javascript +_('').isBlank(); // => true +_('\n').isBlank(); // => true +_(' ').isBlank(); // => true +_('a').isBlank(); // => false +``` + +**join** _.join(separator, *strings) + +Joins strings together with given separator + +```javascript +_.join(" ", "foo", "bar") +=> "foo bar" +``` + +**lines** _.lines(str) + +```javascript +_.lines("Hello\nWorld") +=> ["Hello", "World"] +``` + +**reverse** available only through _.str object, because Underscore has function with the same name. + +Return reversed string: + +```javascript +_.str.reverse("foobar") +=> 'raboof' +``` + +**splice** _.splice(string, index, howmany, substring) + +Like a array splice. + +```javascript +_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') +=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' +``` + +**startsWith** _.startsWith(string, starts) + +This method checks whether string starts with starts. + +```javascript +_("image.gif").startsWith("image") +=> true +``` + +**endsWith** _.endsWith(string, ends) + +This method checks whether string ends with ends. + +```javascript +_("image.gif").endsWith("gif") +=> true +``` + +**succ** _.succ(str) + +Returns the successor to str. + +```javascript +_('a').succ() +=> 'b' + +_('A').succ() +=> 'B' +``` + +**supplant** + +Supplant function was removed, use Underscore.js [template function][p]. + +[p]: http://documentcloud.github.com/underscore/#template + +**strip** alias for *trim* + +**lstrip** alias for *ltrim* + +**rstrip** alias for *rtrim* + +**titleize** _.titleize(string) + +```javascript +_('my name is epeli').titleize() +=> 'My Name Is Epeli' +``` + +**camelize** _.camelize(string) + +Converts underscored or dasherized string to a camelized one + +```javascript +_('-moz-transform').camelize() +=> 'MozTransform' +``` + +**classify** _.classify(string) + +Converts string to camelized class name + +```javascript +_('some_class_name').classify() +=> 'SomeClassName' +``` + +**underscored** _.underscored(string) + +Converts a camelized or dasherized string into an underscored one + +```javascript +_('MozTransform').underscored() +=> 'moz_transform' +``` + +**dasherize** _.dasherize(string) + +Converts a underscored or camelized string into an dasherized one + +```javascript +_('MozTransform').dasherize() +=> '-moz-transform' +``` + +**humanize** _.humanize(string) + +Converts an underscored, camelized, or dasherized string into a humanized one. +Also removes beginning and ending whitespace, and removes the postfix '_id'. + +```javascript +_(' capitalize dash-CamelCase_underscore trim ').humanize() +=> 'Capitalize dash camel case underscore trim' +``` + +**trim** _.trim(string, [characters]) + +trims defined characters from begining and ending of the string. +Defaults to whitespace characters. + +```javascript +_.trim(" foobar ") +=> "foobar" + +_.trim("_-foobar-_", "_-") +=> "foobar" +``` + + +**ltrim** _.ltrim(string, [characters]) + +Left trim. Similar to trim, but only for left side. + + +**rtrim** _.rtrim(string, [characters]) + +Right trim. Similar to trim, but only for right side. + +**truncate** _.truncate(string, length, truncateString) + +```javascript +_('Hello world').truncate(5) +=> 'Hello...' + +_('Hello').truncate(10) +=> 'Hello' +``` + +**prune** _.prune(string, length, pruneString) + +Elegant version of truncate. +Makes sure the pruned string does not exceed the original length. +Avoid half-chopped words when truncating. + +```javascript +_('Hello, world').prune(5) +=> 'Hello...' + +_('Hello, world').prune(8) +=> 'Hello...' + +_('Hello, world').prune(5, ' (read a lot more)') +=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) + +_('Hello, cruel world').prune(15) +=> 'Hello, cruel...' + +_('Hello').prune(10) +=> 'Hello' +``` + +**words** _.words(str, delimiter=/\s+/) + +Split string by delimiter (String or RegExp), /\s+/ by default. + +```javascript +_.words(" I love you ") +=> ["I","love","you"] + +_.words("I_love_you", "_") +=> ["I","love","you"] + +_.words("I-love-you", /-/) +=> ["I","love","you"] + +_.words(" ") +=> [] +``` + +**sprintf** _.sprintf(string format, *arguments) + +C like string formatting. +Credits goes to [Alexandru Marasteanu][o]. +For more detailed documentation, see the [original page][o]. + +[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript + +```javascript +_.sprintf("%.1f", 1.17) +"1.2" +``` + +**pad** _.pad(str, length, [padStr, type]) + +pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. + +```javascript +_.pad("1", 8) +-> " 1"; + +_.pad("1", 8, '0') +-> "00000001"; + +_.pad("1", 8, '0', 'right') +-> "10000000"; + +_.pad("1", 8, '0', 'both') +-> "00001000"; + +_.pad("1", 8, 'bleepblorp', 'both') +-> "bbbb1bbb"; +``` + +**lpad** _.lpad(str, length, [padStr]) + +left-pad a string. Alias for `pad(str, length, padStr, 'left')` + +```javascript +_.lpad("1", 8, '0') +-> "00000001"; +``` + +**rpad** _.rpad(str, length, [padStr]) + +right-pad a string. Alias for `pad(str, length, padStr, 'right')` + +```javascript +_.rpad("1", 8, '0') +-> "10000000"; +``` + +**lrpad** _.lrpad(str, length, [padStr]) + +left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` + +```javascript +_.lrpad("1", 8, '0') +-> "00001000"; +``` + +**center** alias for **lrpad** + +**ljust** alias for *rpad* + +**rjust** alias for *lpad* + +**toNumber** _.toNumber(string, [decimals]) + +Parse string to number. Returns NaN if string can't be parsed to number. + +```javascript +_('2.556').toNumber() +=> 3 + +_('2.556').toNumber(1) +=> 2.6 +``` + +**strRight** _.strRight(string, pattern) + +Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strRight('_') +=> "is_a_test_string"; +``` + +**strRightBack** _.strRightBack(string, pattern) + +Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strRightBack('_') +=> "string"; +``` + +**strLeft** _.strLeft(string, pattern) + +Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strLeft('_') +=> "This"; +``` + +**strLeftBack** _.strLeftBack(string, pattern) + +Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strLeftBack('_') +=> "This_is_a_test"; +``` + +**stripTags** + +Removes all html tags from string. + +```javascript +_('a
    link').stripTags() +=> 'a link' + +_('a link').stripTags() +=> 'a linkalert("hello world!")' +``` + +**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) + +Join an array into a human readable sentence. + +```javascript +_.toSentence(['jQuery', 'Mootools', 'Prototype']) +=> 'jQuery, Mootools and Prototype'; + +_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') +=> 'jQuery, Mootools unt Prototype'; +``` + +**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter]) + +The same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma). + +```javascript +_.toSentenceSerial(['jQuery', 'Mootools']) +=> 'jQuery and Mootools'; + +_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype']) +=> 'jQuery, Mootools, and Prototype' + +_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt '); +=> 'jQuery, Mootools, unt Prototype'; +``` + +**repeat** _.repeat(string, count, [separator]) + +Repeats a string count times. + +```javascript +_.repeat("foo", 3) +=> 'foofoofoo'; + +_.repeat("foo", 3, "bar") +=> 'foobarfoobarfoo' +``` + +**surround** _.surround(string, wrap) + +Surround a string with another string. + +```javascript +_.surround("foo", "ab") +=> 'abfooab'; +``` + +**quote** _.quote(string, quoteChar) or _.q(string, quoteChar) + +Quotes a string. `quoteChar` defaults to `"`. + +```javascript +_.quote('foo', quoteChar) +=> '"foo"'; +``` +**unquote** _.unquote(string, quoteChar) + +Unquotes a string. `quoteChar` defaults to `"`. + +```javascript +_.unquote('"foo"') +=> 'foo'; +_.unquote("'foo'", "'") +=> 'foo'; +``` + + +**slugify** _.slugify(string) + +Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. + +```javascript +_.slugify("Un éléphant à l'orée du bois") +=> 'un-elephant-a-loree-du-bois'; +``` + +***Caution: this function is charset dependent*** + +**naturalCmp** array.sort(_.naturalCmp) + +Naturally sort strings like humans would do. + +```javascript +['foo20', 'foo5'].sort(_.naturalCmp) +=> [ 'foo5', 'foo20' ] +``` + +**toBoolean** _.toBoolean(string) or _.toBool(string) + +Turn strings that can be commonly considered as booleas to real booleans. Such as "true", "false", "1" and "0". This function is case insensitive. + +```javascript +_.toBoolean("true") +=> true +_.toBoolean("FALSE") +=> false +_.toBoolean("random") +=> undefined +``` + +It can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects. + +```javascript +_.toBoolean("truthy", ["truthy"], ["falsy"]) +=> true +_.toBoolean("true only at start", [/^true/]) +=> true +``` + +## Roadmap ## + +Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. + +#### Problems + +We lose two things for `include` and `reverse` methods from `_.string`: + +* Calls like `_('foobar').include('bar')` aren't available; +* Chaining isn't available too. + +But if you need this functionality you can create aliases for conflict functions which will be convenient for you: + +```javascript +_.mixin({ + includeString: _.str.include, + reverseString: _.str.reverse +}) + +// Now wrapper calls and chaining are available. +_('foobar').chain().reverseString().includeString('rab').value() +``` + +#### Standalone Usage + +If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias +But of course you can just reassign `_` variable with `_.string` + +```javascript +_ = _.string +``` + +## Changelog ## + +### 2.3.3 ### + +* Add `toBoolean` +* Add `unquote` +* Add quote char option to `quote` +* Support dash-separated words in `titleize` + +### 2.3.2 ### + +* Add `naturalCmp` +* Bug fix to `camelize` +* Add ă, ș, ț and ś to `slugify` +* Doc updates +* Add support for [component](http://component.io/) +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2) + +### 2.3.1 ### + +* Bug fixes to `escapeHTML`, `classify`, `substr` +* Faster `count` +* Documentation fixes +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1) + +### 2.3.0 ### + +* Added `numberformat` method +* Added `levenshtein` method (Levenshtein distance calculation) +* Added `swapCase` method +* Changed default behavior of `words` method +* Added `toSentenceSerial` method +* Added `surround` and `quote` methods + +### 2.2.1 ### + +* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama + +### 2.2.0 ### + +* Capitalize method behavior changed +* Various perfomance tweaks + +### 2.1.1### + +* Fixed words method bug +* Added classify method + +### 2.1.0 ### + +* AMD support +* Added toSentence method +* Added slugify method +* Lots of speed optimizations + +### 2.0.0 ### + +* Added prune, humanize functions +* Added _.string (_.str) namespace for Underscore.string library +* Removed includes function + +For upgrading to this version you need to mix in Underscore.string library to Underscore object: + +```javascript +_.mixin(_.string.exports()); +``` + +and all non-conflict Underscore.string functions will be available through Underscore object. +Also function `includes` has been removed, you should replace this function by `_.str.include` +or create alias `_.includes = _.str.include` and all your code will work fine. + +### 1.1.6 ### + +* Fixed reverse and truncate +* Added isBlank, stripTags, inlude(alias for includes) +* Added uglifier compression + +### 1.1.5 ### + +* Added strRight, strRightBack, strLeft, strLeftBack + +### 1.1.4 ### + +* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust +* Integration with Underscore 1.1.6 + +### 1.1.3 ### + +* Added methods: underscored, camelize, dasherize +* Support newer version of npm + +### 1.1.2 ### + +* Created functions: lines, chars, words functions + +### 1.0.2 ### + +* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) +* Removed 'reverse' function, because this function override underscore.js 'reverse' + +## Contribute ## + +* Fork & pull request. Don't forget about tests. +* If you planning add some feature please create issue before. + +Otherwise changes will be rejected. + +## Contributors list ## +[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors). + + +## Licence ## + +The MIT License + +Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile new file mode 100644 index 0000000..2cd9eed --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile @@ -0,0 +1,23 @@ +# encoding: utf-8 +task default: :test + +desc 'Use UglifyJS to compress Underscore.string' +task :build do + require 'uglifier' + source = File.read('lib/underscore.string.js', :encoding => 'utf-8') + compressed = Uglifier.compile(source, copyright: false) + File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } + compression_rate = compressed.length.to_f/source.length + puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" +end + +desc 'Run tests' +task :test do + puts "Running underscore.string test suite." + result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"} + + puts "Running Underscore test suite." + result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} + + exit(result1 && result2 ? 0 : 1) +end diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json new file mode 100644 index 0000000..ae91b65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json @@ -0,0 +1,11 @@ +{ + "name": "underscore.string", + "repo": "epeli/underscore.string", + "description": "String manipulation extensions for Underscore.js javascript library", + "version": "2.3.3", + "keywords": ["underscore", "string"], + "dependencies": {}, + "development": {}, + "main": "lib/underscore.string.js", + "scripts": ["lib/underscore.string.js"] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js new file mode 100644 index 0000000..4f6b2b9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js @@ -0,0 +1 @@ +!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;n.length>r;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(1>n)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;g>l;l++)if(d=e(t[l]),"string"===d)m.push(t[l]);else if("array"===d){if(a=t[l],a[2])for(i=u[p],o=0;a[2].length>o;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return e=null==e?"":n(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),r=~~r,r>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e),r=n(r);for(var t=0,u=0,i=r.length;;){if(u=e.indexOf(r,u),-1===u)break;t++,u+=i}return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r?!0:null==e?!1:-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e),e.slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){return null==e?"":(e=n(e).toLowerCase(),e.replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()}))},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",r>=e.length)return e;var u=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},i=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,u);return i=i.slice(i.length-2).match(/\w\w/)?i.replace(/\s*\S+$/,""):g.rtrim(i.slice(0,i.length-1)),(i+t).length>e.length?e:e.slice(0,i.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e),e.match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):0/0):0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",u=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(u,function(e){var n=r.indexOf(e);return t.charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;l>o;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return c>a?-1:1}}return u.length===i.length?u.length-i.length:r>e?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;r.length>=l;l++)for(var o=0;e.length>=o;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:(e=g.trim(e),r(e,n||["true","1"])?!0:r(e,t||["false","0"])?!1:void 0)}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js new file mode 100644 index 0000000..8761117 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js @@ -0,0 +1,673 @@ +// Underscore.string +// (c) 2010 Esa-Matti Suuronen +// Underscore.string is freely distributable under the terms of the MIT license. +// Documentation: https://github.com/epeli/underscore.string +// Some code is borrowed from MooTools and Alexandru Marasteanu. +// Version '2.3.2' + +!function(root, String){ + 'use strict'; + + // Defining helper functions. + + var nativeTrim = String.prototype.trim; + var nativeTrimRight = String.prototype.trimRight; + var nativeTrimLeft = String.prototype.trimLeft; + + var parseNumber = function(source) { return source * 1 || 0; }; + + var strRepeat = function(str, qty){ + if (qty < 1) return ''; + var result = ''; + while (qty > 0) { + if (qty & 1) result += str; + qty >>= 1, str += str; + } + return result; + }; + + var slice = [].slice; + + var defaultToWhiteSpace = function(characters) { + if (characters == null) + return '\\s'; + else if (characters.source) + return characters.source; + else + return '[' + _s.escapeRegExp(characters) + ']'; + }; + + // Helper for toBoolean + function boolMatch(s, matchers) { + var i, matcher, down = s.toLowerCase(); + matchers = [].concat(matchers); + for (i = 0; i < matchers.length; i += 1) { + matcher = matchers[i]; + if (!matcher) continue; + if (matcher.test && matcher.test(s)) return true; + if (matcher.toLowerCase() === down) return true; + } + } + + var escapeChars = { + lt: '<', + gt: '>', + quot: '"', + amp: '&', + apos: "'" + }; + + var reversedEscapeChars = {}; + for(var key in escapeChars) reversedEscapeChars[escapeChars[key]] = key; + reversedEscapeChars["'"] = '#39'; + + // sprintf() for JavaScript 0.7-beta1 + // http://www.diveintojavascript.com/projects/javascript-sprintf + // + // Copyright (c) Alexandru Marasteanu + // All rights reserved. + + var sprintf = (function() { + function get_type(variable) { + return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); + } + + var str_repeat = strRepeat; + + var str_format = function() { + if (!str_format.cache.hasOwnProperty(arguments[0])) { + str_format.cache[arguments[0]] = str_format.parse(arguments[0]); + } + return str_format.format.call(null, str_format.cache[arguments[0]], arguments); + }; + + str_format.format = function(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; + for (i = 0; i < tree_length; i++) { + node_type = get_type(parse_tree[i]); + if (node_type === 'string') { + output.push(parse_tree[i]); + } + else if (node_type === 'array') { + match = parse_tree[i]; // convenience purposes only + if (match[2]) { // keyword argument + arg = argv[cursor]; + for (k = 0; k < match[2].length; k++) { + if (!arg.hasOwnProperty(match[2][k])) { + throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); + } + arg = arg[match[2][k]]; + } + } else if (match[1]) { // positional argument (explicit) + arg = argv[match[1]]; + } + else { // positional argument (implicit) + arg = argv[cursor++]; + } + + if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { + throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); + } + switch (match[8]) { + case 'b': arg = arg.toString(2); break; + case 'c': arg = String.fromCharCode(arg); break; + case 'd': arg = parseInt(arg, 10); break; + case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; + case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; + case 'o': arg = arg.toString(8); break; + case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; + case 'u': arg = Math.abs(arg); break; + case 'x': arg = arg.toString(16); break; + case 'X': arg = arg.toString(16).toUpperCase(); break; + } + arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); + pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; + pad_length = match[6] - String(arg).length; + pad = match[6] ? str_repeat(pad_character, pad_length) : ''; + output.push(match[5] ? arg + pad : pad + arg); + } + } + return output.join(''); + }; + + str_format.cache = {}; + + str_format.parse = function(fmt) { + var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; + while (_fmt) { + if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { + parse_tree.push(match[0]); + } + else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { + parse_tree.push('%'); + } + else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1; + var field_list = [], replacement_field = match[2], field_match = []; + if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + } + else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + } + else { + throw new Error('[_.sprintf] huh?'); + } + } + } + else { + throw new Error('[_.sprintf] huh?'); + } + match[2] = field_list; + } + else { + arg_names |= 2; + } + if (arg_names === 3) { + throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); + } + parse_tree.push(match); + } + else { + throw new Error('[_.sprintf] huh?'); + } + _fmt = _fmt.substring(match[0].length); + } + return parse_tree; + }; + + return str_format; + })(); + + + + // Defining underscore.string + + var _s = { + + VERSION: '2.3.0', + + isBlank: function(str){ + if (str == null) str = ''; + return (/^\s*$/).test(str); + }, + + stripTags: function(str){ + if (str == null) return ''; + return String(str).replace(/<\/?[^>]+>/g, ''); + }, + + capitalize : function(str){ + str = str == null ? '' : String(str); + return str.charAt(0).toUpperCase() + str.slice(1); + }, + + chop: function(str, step){ + if (str == null) return []; + str = String(str); + step = ~~step; + return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str]; + }, + + clean: function(str){ + return _s.strip(str).replace(/\s+/g, ' '); + }, + + count: function(str, substr){ + if (str == null || substr == null) return 0; + + str = String(str); + substr = String(substr); + + var count = 0, + pos = 0, + length = substr.length; + + while (true) { + pos = str.indexOf(substr, pos); + if (pos === -1) break; + count++; + pos += length; + } + + return count; + }, + + chars: function(str) { + if (str == null) return []; + return String(str).split(''); + }, + + swapCase: function(str) { + if (str == null) return ''; + return String(str).replace(/\S/g, function(c){ + return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase(); + }); + }, + + escapeHTML: function(str) { + if (str == null) return ''; + return String(str).replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }); + }, + + unescapeHTML: function(str) { + if (str == null) return ''; + return String(str).replace(/\&([^;]+);/g, function(entity, entityCode){ + var match; + + if (entityCode in escapeChars) { + return escapeChars[entityCode]; + } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { + return String.fromCharCode(parseInt(match[1], 16)); + } else if (match = entityCode.match(/^#(\d+)$/)) { + return String.fromCharCode(~~match[1]); + } else { + return entity; + } + }); + }, + + escapeRegExp: function(str){ + if (str == null) return ''; + return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); + }, + + splice: function(str, i, howmany, substr){ + var arr = _s.chars(str); + arr.splice(~~i, ~~howmany, substr); + return arr.join(''); + }, + + insert: function(str, i, substr){ + return _s.splice(str, i, 0, substr); + }, + + include: function(str, needle){ + if (needle === '') return true; + if (str == null) return false; + return String(str).indexOf(needle) !== -1; + }, + + join: function() { + var args = slice.call(arguments), + separator = args.shift(); + + if (separator == null) separator = ''; + + return args.join(separator); + }, + + lines: function(str) { + if (str == null) return []; + return String(str).split("\n"); + }, + + reverse: function(str){ + return _s.chars(str).reverse().join(''); + }, + + startsWith: function(str, starts){ + if (starts === '') return true; + if (str == null || starts == null) return false; + str = String(str); starts = String(starts); + return str.length >= starts.length && str.slice(0, starts.length) === starts; + }, + + endsWith: function(str, ends){ + if (ends === '') return true; + if (str == null || ends == null) return false; + str = String(str); ends = String(ends); + return str.length >= ends.length && str.slice(str.length - ends.length) === ends; + }, + + succ: function(str){ + if (str == null) return ''; + str = String(str); + return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length-1) + 1); + }, + + titleize: function(str){ + if (str == null) return ''; + str = String(str).toLowerCase(); + return str.replace(/(?:^|\s|-)\S/g, function(c){ return c.toUpperCase(); }); + }, + + camelize: function(str){ + return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, c){ return c ? c.toUpperCase() : ""; }); + }, + + underscored: function(str){ + return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); + }, + + dasherize: function(str){ + return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase(); + }, + + classify: function(str){ + return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, ''); + }, + + humanize: function(str){ + return _s.capitalize(_s.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); + }, + + trim: function(str, characters){ + if (str == null) return ''; + if (!characters && nativeTrim) return nativeTrim.call(str); + characters = defaultToWhiteSpace(characters); + return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); + }, + + ltrim: function(str, characters){ + if (str == null) return ''; + if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str); + characters = defaultToWhiteSpace(characters); + return String(str).replace(new RegExp('^' + characters + '+'), ''); + }, + + rtrim: function(str, characters){ + if (str == null) return ''; + if (!characters && nativeTrimRight) return nativeTrimRight.call(str); + characters = defaultToWhiteSpace(characters); + return String(str).replace(new RegExp(characters + '+$'), ''); + }, + + truncate: function(str, length, truncateStr){ + if (str == null) return ''; + str = String(str); truncateStr = truncateStr || '...'; + length = ~~length; + return str.length > length ? str.slice(0, length) + truncateStr : str; + }, + + /** + * _s.prune: a more elegant version of truncate + * prune extra chars, never leaving a half-chopped word. + * @author github.com/rwz + */ + prune: function(str, length, pruneStr){ + if (str == null) return ''; + + str = String(str); length = ~~length; + pruneStr = pruneStr != null ? String(pruneStr) : '...'; + + if (str.length <= length) return str; + + var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; }, + template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA' + + if (template.slice(template.length-2).match(/\w\w/)) + template = template.replace(/\s*\S+$/, ''); + else + template = _s.rtrim(template.slice(0, template.length-1)); + + return (template+pruneStr).length > str.length ? str : str.slice(0, template.length)+pruneStr; + }, + + words: function(str, delimiter) { + if (_s.isBlank(str)) return []; + return _s.trim(str, delimiter).split(delimiter || /\s+/); + }, + + pad: function(str, length, padStr, type) { + str = str == null ? '' : String(str); + length = ~~length; + + var padlen = 0; + + if (!padStr) + padStr = ' '; + else if (padStr.length > 1) + padStr = padStr.charAt(0); + + switch(type) { + case 'right': + padlen = length - str.length; + return str + strRepeat(padStr, padlen); + case 'both': + padlen = length - str.length; + return strRepeat(padStr, Math.ceil(padlen/2)) + str + + strRepeat(padStr, Math.floor(padlen/2)); + default: // 'left' + padlen = length - str.length; + return strRepeat(padStr, padlen) + str; + } + }, + + lpad: function(str, length, padStr) { + return _s.pad(str, length, padStr); + }, + + rpad: function(str, length, padStr) { + return _s.pad(str, length, padStr, 'right'); + }, + + lrpad: function(str, length, padStr) { + return _s.pad(str, length, padStr, 'both'); + }, + + sprintf: sprintf, + + vsprintf: function(fmt, argv){ + argv.unshift(fmt); + return sprintf.apply(null, argv); + }, + + toNumber: function(str, decimals) { + if (!str) return 0; + str = _s.trim(str); + if (!str.match(/^-?\d+(?:\.\d+)?$/)) return NaN; + return parseNumber(parseNumber(str).toFixed(~~decimals)); + }, + + numberFormat : function(number, dec, dsep, tsep) { + if (isNaN(number) || number == null) return ''; + + number = number.toFixed(~~dec); + tsep = typeof tsep == 'string' ? tsep : ','; + + var parts = number.split('.'), fnums = parts[0], + decimals = parts[1] ? (dsep || '.') + parts[1] : ''; + + return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals; + }, + + strRight: function(str, sep){ + if (str == null) return ''; + str = String(str); sep = sep != null ? String(sep) : sep; + var pos = !sep ? -1 : str.indexOf(sep); + return ~pos ? str.slice(pos+sep.length, str.length) : str; + }, + + strRightBack: function(str, sep){ + if (str == null) return ''; + str = String(str); sep = sep != null ? String(sep) : sep; + var pos = !sep ? -1 : str.lastIndexOf(sep); + return ~pos ? str.slice(pos+sep.length, str.length) : str; + }, + + strLeft: function(str, sep){ + if (str == null) return ''; + str = String(str); sep = sep != null ? String(sep) : sep; + var pos = !sep ? -1 : str.indexOf(sep); + return ~pos ? str.slice(0, pos) : str; + }, + + strLeftBack: function(str, sep){ + if (str == null) return ''; + str += ''; sep = sep != null ? ''+sep : sep; + var pos = str.lastIndexOf(sep); + return ~pos ? str.slice(0, pos) : str; + }, + + toSentence: function(array, separator, lastSeparator, serial) { + separator = separator || ', '; + lastSeparator = lastSeparator || ' and '; + var a = array.slice(), lastMember = a.pop(); + + if (array.length > 2 && serial) lastSeparator = _s.rtrim(separator) + lastSeparator; + + return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember; + }, + + toSentenceSerial: function() { + var args = slice.call(arguments); + args[3] = true; + return _s.toSentence.apply(_s, args); + }, + + slugify: function(str) { + if (str == null) return ''; + + var from = "ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź", + to = "aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz", + regex = new RegExp(defaultToWhiteSpace(from), 'g'); + + str = String(str).toLowerCase().replace(regex, function(c){ + var index = from.indexOf(c); + return to.charAt(index) || '-'; + }); + + return _s.dasherize(str.replace(/[^\w\s-]/g, '')); + }, + + surround: function(str, wrapper) { + return [wrapper, str, wrapper].join(''); + }, + + quote: function(str, quoteChar) { + return _s.surround(str, quoteChar || '"'); + }, + + unquote: function(str, quoteChar) { + quoteChar = quoteChar || '"'; + if (str[0] === quoteChar && str[str.length-1] === quoteChar) + return str.slice(1,str.length-1); + else return str; + }, + + exports: function() { + var result = {}; + + for (var prop in this) { + if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse)$/)) continue; + result[prop] = this[prop]; + } + + return result; + }, + + repeat: function(str, qty, separator){ + if (str == null) return ''; + + qty = ~~qty; + + // using faster implementation if separator is not needed; + if (separator == null) return strRepeat(String(str), qty); + + // this one is about 300x slower in Google Chrome + for (var repeat = []; qty > 0; repeat[--qty] = str) {} + return repeat.join(separator); + }, + + naturalCmp: function(str1, str2){ + if (str1 == str2) return 0; + if (!str1) return -1; + if (!str2) return 1; + + var cmpRegex = /(\.\d+)|(\d+)|(\D+)/g, + tokens1 = String(str1).toLowerCase().match(cmpRegex), + tokens2 = String(str2).toLowerCase().match(cmpRegex), + count = Math.min(tokens1.length, tokens2.length); + + for(var i = 0; i < count; i++) { + var a = tokens1[i], b = tokens2[i]; + + if (a !== b){ + var num1 = parseInt(a, 10); + if (!isNaN(num1)){ + var num2 = parseInt(b, 10); + if (!isNaN(num2) && num1 - num2) + return num1 - num2; + } + return a < b ? -1 : 1; + } + } + + if (tokens1.length === tokens2.length) + return tokens1.length - tokens2.length; + + return str1 < str2 ? -1 : 1; + }, + + levenshtein: function(str1, str2) { + if (str1 == null && str2 == null) return 0; + if (str1 == null) return String(str2).length; + if (str2 == null) return String(str1).length; + + str1 = String(str1); str2 = String(str2); + + var current = [], prev, value; + + for (var i = 0; i <= str2.length; i++) + for (var j = 0; j <= str1.length; j++) { + if (i && j) + if (str1.charAt(j - 1) === str2.charAt(i - 1)) + value = prev; + else + value = Math.min(current[j], current[j - 1], prev) + 1; + else + value = i + j; + + prev = current[j]; + current[j] = value; + } + + return current.pop(); + }, + + toBoolean: function(str, trueValues, falseValues) { + if (typeof str === "number") str = "" + str; + if (typeof str !== "string") return !!str; + str = _s.trim(str); + if (boolMatch(str, trueValues || ["true", "1"])) return true; + if (boolMatch(str, falseValues || ["false", "0"])) return false; + } + }; + + // Aliases + + _s.strip = _s.trim; + _s.lstrip = _s.ltrim; + _s.rstrip = _s.rtrim; + _s.center = _s.lrpad; + _s.rjust = _s.lpad; + _s.ljust = _s.rpad; + _s.contains = _s.include; + _s.q = _s.quote; + _s.toBool = _s.toBoolean; + + // Exporting + + // CommonJS module is defined + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) + module.exports = _s; + + exports._s = _s; + } + + // Register as a named module with AMD. + if (typeof define === 'function' && define.amd) + define('underscore.string', [], function(){ return _s; }); + + + // Integrate with Underscore.js if defined + // or create our own underscore object. + root._ = root._ || {}; + root._.string = root._.str = _s; +}(this, String); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json new file mode 100644 index 0000000..9556365 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json @@ -0,0 +1,74 @@ +{ + "name": "underscore.string", + "version": "2.3.3", + "description": "String manipulation extensions for Underscore.js javascript library.", + "homepage": "http://epeli.github.com/underscore.string/", + "contributors": [ + { + "name": "Esa-Matti Suuronen", + "email": "esa-matti@suuronen.org", + "url": "http://esa-matti.suuronen.org/" + }, + { + "name": "Edward Tsech", + "email": "edtsech@gmail.com" + }, + { + "name": "Pavel Pravosud", + "email": "pavel@pravosud.com", + "url": "" + }, + { + "name": "Sasha Koss", + "email": "kossnocorp@gmail.com", + "url": "http://koss.nocorp.me/" + }, + { + "name": "Vladimir Dronnikov", + "email": "dronnikov@gmail.com" + }, + { + "name": "Pete Kruckenberg", + "email": "https://github.com/kruckenb", + "url": "" + }, + { + "name": "Paul Chavard", + "email": "paul@chavard.net", + "url": "" + }, + { + "name": "Ed Finkler", + "email": "coj@funkatron.com", + "url": "" + } + ], + "keywords": [ + "underscore", + "string" + ], + "main": "./lib/underscore.string", + "directories": { + "lib": "./lib" + }, + "engines": { + "node": "*" + }, + "repository": { + "type": "git", + "url": "https://github.com/epeli/underscore.string.git" + }, + "bugs": { + "url": "https://github.com/epeli/underscore.string/issues" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n**Or Integrate with Underscore.js without module loading**\n\nRun the following expression after Underscore.js and Underscore.string are loaded\n```javascript\n// _.str becomes a global variable if no module loading is detected\n// Mix in non-conflict functions to Underscore namespace\n_.mixin(_.str.exports());\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=','])\n\nFormats the numbers.\n\n```javascript\n_.numberFormat(1000, 2)\n=> \"1,000.00\"\n\n_.numberFormat(123456789.123, 5, '.', ',')\n=> \"123,456,789.12300\"\n```\n\n\n**levenshtein** _.levenshtein(string1, string2)\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\n_.levenshtein('kitten', 'kittah')\n=> 2\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**swapCase** _.swapCase(str)\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\n_.swapCase('hELLO')\n=> 'Hello'\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n(removed) **includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
    Blah blah blah
    ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
    Blah blah blah
    '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=/\\s+/)\n\nSplit string by delimiter (String or RegExp), /\\s+/ by default.\n\n```javascript\n_.words(\" I love you \")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\" \")\n=> []\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter])\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\n_.toSentenceSerial(['jQuery', 'Mootools'])\n=> 'jQuery and Mootools';\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools, and Prototype'\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ');\n=> 'jQuery, Mootools, unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**surround** _.surround(string, wrap)\n\nSurround a string with another string.\n\n```javascript\n_.surround(\"foo\", \"ab\")\n=> 'abfooab';\n```\n\n**quote** _.quote(string, quoteChar) or _.q(string, quoteChar)\n\nQuotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.quote('foo', quoteChar)\n=> '\"foo\"';\n```\n**unquote** _.unquote(string, quoteChar)\n\nUnquotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.unquote('\"foo\"')\n=> 'foo';\n_.unquote(\"'foo'\", \"'\")\n=> 'foo';\n```\n\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n**naturalCmp** array.sort(_.naturalCmp)\n\nNaturally sort strings like humans would do.\n\n```javascript\n['foo20', 'foo5'].sort(_.naturalCmp)\n=> [ 'foo5', 'foo20' ]\n```\n\n**toBoolean** _.toBoolean(string) or _.toBool(string)\n\nTurn strings that can be commonly considered as booleas to real booleans. Such as \"true\", \"false\", \"1\" and \"0\". This function is case insensitive.\n\n```javascript\n_.toBoolean(\"true\")\n=> true\n_.toBoolean(\"FALSE\")\n=> false\n_.toBoolean(\"random\")\n=> undefined\n```\n\nIt can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects.\n\n```javascript\n_.toBoolean(\"truthy\", [\"truthy\"], [\"falsy\"])\n=> true\n_.toBoolean(\"true only at start\", [/^true/])\n=> true\n```\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n\n## Changelog ##\n\n### 2.3.3 ###\n\n* Add `toBoolean`\n* Add `unquote`\n* Add quote char option to `quote`\n* Support dash-separated words in `titleize`\n\n### 2.3.2 ###\n\n* Add `naturalCmp`\n* Bug fix to `camelize`\n* Add ă, ș, ț and ś to `slugify`\n* Doc updates\n* Add support for [component](http://component.io/)\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2)\n\n### 2.3.1 ###\n\n* Bug fixes to `escapeHTML`, `classify`, `substr`\n* Faster `count`\n* Documentation fixes\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1)\n\n### 2.3.0 ###\n\n* Added `numberformat` method\n* Added `levenshtein` method (Levenshtein distance calculation)\n* Added `swapCase` method\n* Changed default behavior of `words` method\n* Added `toSentenceSerial` method\n* Added `surround` and `quote` methods\n\n### 2.2.1 ###\n\n* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama\n\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors).\n\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", + "readmeFilename": "README.markdown", + "_id": "underscore.string@2.3.3", + "_from": "underscore.string@~2.3.1", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js new file mode 100644 index 0000000..44a2167 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js @@ -0,0 +1,45 @@ +function waitFor(test, complete, timeout) { + var result, start = new Date().getTime() + setInterval(function interval() { + if ((new Date().getTime() - start < timeout) && !result) { + result = test() + } else { + if (!result) { + phantom.exit(1) + } else { + complete() + clearInterval(interval) + } + } + }, 100) +} + + +var fs = require('fs'), page = require('webpage').create(); +var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0]; + +page.onConsoleMessage = function(msg) { + console.log(msg) +} + +page.open(url, function(status) { + waitFor(function() { + return page.evaluate(function(){ + var el = document.getElementById('qunit-testresult') + return el && el.innerText.match('completed') + }) + }, function() { + var failures = page.evaluate(function() { + var el = document.getElementById('qunit-testresult'), + fails = document.getElementsByClassName('fail') + + for (var i = 0; i < fails.length; i++) + console.log(fails[i].innerText) + + console.log(el.innerText) + + return parseInt(el.getElementsByClassName('failed')[0].innerHTML) + }) + phantom.exit(failures > 0 ? 1 : 0) + }, 10000) +}) \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js new file mode 100644 index 0000000..9ceeea7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js @@ -0,0 +1,148 @@ +(function() { + + JSLitmus.test('levenshtein', function() { + return [ + _.levenshtein('pineapple', 'potato'), + _.levenshtein('seven', 'eight'), + _.levenshtein('the very same string', 'the very same string'), + _.levenshtein('very very very long string', 'something completely different') + ]; + }); + + + JSLitmus.test('trimNoNative', function() { + return _.trim(" foobar ", " "); + }); + + JSLitmus.test('trim', function() { + return _.trim(" foobar "); + }); + + JSLitmus.test('trim object-oriented', function() { + return _(" foobar ").trim(); + }); + + JSLitmus.test('trim jQuery', function() { + return jQuery.trim(" foobar "); + }); + + JSLitmus.test('ltrimp', function() { + return _.ltrim(" foobar ", " "); + }); + + JSLitmus.test('rtrimp', function() { + return _.rtrim(" foobar ", " "); + }); + + JSLitmus.test('startsWith', function() { + return _.startsWith("foobar", "foo"); + }); + + JSLitmus.test('endsWith', function() { + return _.endsWith("foobar", "xx"); + }); + + JSLitmus.test('chop', function(){ + return _('whitespace').chop(2); + }); + + JSLitmus.test('count', function(){ + return _('Hello worls').count('l'); + }); + + JSLitmus.test('insert', function() { + return _('Hello ').insert(6, 'world'); + }); + + JSLitmus.test('splice', function() { + return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); + }); + + JSLitmus.test('succ', function(){ + var let = 'a', alphabet = []; + + for (var i=0; i < 26; i++) { + alphabet.push(let); + let = _(let).succ(); + } + + return alphabet; + }); + + JSLitmus.test('titleize', function(){ + return _('the titleize string method').titleize(); + }); + + JSLitmus.test('truncate', function(){ + return _('Hello world').truncate(5); + }); + + JSLitmus.test('prune', function(){ + return _('Hello world').prune(5); + }); + + JSLitmus.test('isBlank', function(){ + return _('').isBlank(); + }); + + JSLitmus.test('escapeHTML', function(){ + _('
    Blah blah blah
    ').escapeHTML(); + }); + + JSLitmus.test('unescapeHTML', function(){ + _('<div>Blah blah blah</div>').unescapeHTML(); + }); + + JSLitmus.test('reverse', function(){ + _('Hello World').reverse(); + }); + + JSLitmus.test('pad default', function(){ + _('foo').pad(12); + }); + + JSLitmus.test('pad hash left', function(){ + _('foo').pad(12, '#'); + }); + + JSLitmus.test('pad hash right', function(){ + _('foo').pad(12, '#', 'right'); + }); + + JSLitmus.test('pad hash both', function(){ + _('foo').pad(12, '#', 'both'); + }); + + JSLitmus.test('pad hash both longPad', function(){ + _('foo').pad(12, 'f00f00f00', 'both'); + }); + + JSLitmus.test('toNumber', function(){ + _('10.232323').toNumber(2); + }); + + JSLitmus.test('strRight', function(){ + _('aaa_bbb_ccc').strRight('_'); + }); + + JSLitmus.test('strRightBack', function(){ + _('aaa_bbb_ccc').strRightBack('_'); + }); + + JSLitmus.test('strLeft', function(){ + _('aaa_bbb_ccc').strLeft('_'); + }); + + JSLitmus.test('strLeftBack', function(){ + _('aaa_bbb_ccc').strLeftBack('_'); + }); + + JSLitmus.test('join', function(){ + _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); + }); + + JSLitmus.test('slugify', function(){ + _("Un éléphant à l'orée du bois").slugify(); + }); + +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js new file mode 100644 index 0000000..77364f2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js @@ -0,0 +1,685 @@ +$(document).ready(function() { + + // Include Underscore.string methods to Underscore namespace + _.mixin(_.str.exports()); + + module('String extensions'); + + test('Strings: naturalSort', function() { + var arr = ['foo2', 'foo1', 'foo10', 'foo30', 'foo100', 'foo10bar'], + sorted = ['foo1', 'foo2', 'foo10', 'foo10bar', 'foo30', 'foo100']; + deepEqual(arr.sort(_.naturalCmp), sorted); + }); + + test('Strings: trim', function() { + equal(_.trim(123), '123', 'Non string'); + equal(_(' foo').trim(), 'foo'); + equal(_('foo ').trim(), 'foo'); + equal(_(' foo ').trim(), 'foo'); + equal(_(' foo ').trim(), 'foo'); + equal(_(' foo ').trim(' '), 'foo', 'Manually set whitespace'); + equal(_('\t foo \t ').trim(/\s/), 'foo', 'Manually set RegExp /\\s+/'); + + equal(_('ffoo').trim('f'), 'oo'); + equal(_('ooff').trim('f'), 'oo'); + equal(_('ffooff').trim('f'), 'oo'); + + + equal(_('_-foobar-_').trim('_-'), 'foobar'); + + equal(_('http://foo/').trim('/'), 'http://foo'); + equal(_('c:\\').trim('\\'), 'c:'); + + equal(_(123).trim(), '123'); + equal(_(123).trim(3), '12'); + equal(_('').trim(), '', 'Trim empty string should return empty string'); + equal(_(null).trim(), '', 'Trim null should return empty string'); + equal(_(undefined).trim(), '', 'Trim undefined should return empty string'); + }); + + test('String: levenshtein', function() { + equal(_.levenshtein('Godfather', 'Godfather'), 0); + equal(_.levenshtein('Godfather', 'Godfathe'), 1); + equal(_.levenshtein('Godfather', 'odfather'), 1); + equal(_.levenshtein('Godfather', 'Gdfthr'), 3); + equal(_.levenshtein('seven', 'eight'), 5); + equal(_.levenshtein('123', 123), 0); + equal(_.levenshtein(321, '321'), 0); + equal(_.levenshtein('lol', null), 3); + equal(_.levenshtein('lol'), 3); + equal(_.levenshtein(null, 'lol'), 3); + equal(_.levenshtein(undefined, 'lol'), 3); + equal(_.levenshtein(), 0); + }); + + test('Strings: ltrim', function() { + equal(_(' foo').ltrim(), 'foo'); + equal(_(' foo').ltrim(), 'foo'); + equal(_('foo ').ltrim(), 'foo '); + equal(_(' foo ').ltrim(), 'foo '); + equal(_('').ltrim(), '', 'ltrim empty string should return empty string'); + equal(_(null).ltrim(), '', 'ltrim null should return empty string'); + equal(_(undefined).ltrim(), '', 'ltrim undefined should return empty string'); + + equal(_('ffoo').ltrim('f'), 'oo'); + equal(_('ooff').ltrim('f'), 'ooff'); + equal(_('ffooff').ltrim('f'), 'ooff'); + + equal(_('_-foobar-_').ltrim('_-'), 'foobar-_'); + + equal(_(123).ltrim(1), '23'); + }); + + test('Strings: rtrim', function() { + equal(_('http://foo/').rtrim('/'), 'http://foo', 'clean trailing slash'); + equal(_(' foo').rtrim(), ' foo'); + equal(_('foo ').rtrim(), 'foo'); + equal(_('foo ').rtrim(), 'foo'); + equal(_('foo bar ').rtrim(), 'foo bar'); + equal(_(' foo ').rtrim(), ' foo'); + + equal(_('ffoo').rtrim('f'), 'ffoo'); + equal(_('ooff').rtrim('f'), 'oo'); + equal(_('ffooff').rtrim('f'), 'ffoo'); + + equal(_('_-foobar-_').rtrim('_-'), '_-foobar'); + + equal(_(123).rtrim(3), '12'); + equal(_('').rtrim(), '', 'rtrim empty string should return empty string'); + equal(_(null).rtrim(), '', 'rtrim null should return empty string'); + }); + + test('Strings: capitalize', function() { + equal(_('fabio').capitalize(), 'Fabio', 'First letter is upper case'); + equal(_.capitalize('fabio'), 'Fabio', 'First letter is upper case'); + equal(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); + equal(_(123).capitalize(), '123', 'Non string'); + equal(_.capitalize(''), '', 'Capitalizing empty string returns empty string'); + equal(_.capitalize(null), '', 'Capitalizing null returns empty string'); + equal(_.capitalize(undefined), '', 'Capitalizing undefined returns empty string'); + }); + + test('Strings: join', function() { + equal(_.join('', 'foo', 'bar'), 'foobar', 'basic join'); + equal(_.join('', 1, 'foo', 2), '1foo2', 'join numbers and strings'); + equal(_.join(' ','foo', 'bar'), 'foo bar', 'join with spaces'); + equal(_.join('1', '2', '2'), '212', 'join number strings'); + equal(_.join(1, 2, 2), '212', 'join numbers'); + equal(_.join('','foo', null), 'foo', 'join null with string returns string'); + equal(_.join(null,'foo', 'bar'), 'foobar', 'join strings with null returns string'); + equal(_(' ').join('foo', 'bar'), 'foo bar', 'join object oriented'); + }); + + test('Strings: reverse', function() { + equal(_.str.reverse('foo'), 'oof' ); + equal(_.str.reverse('foobar'), 'raboof' ); + equal(_.str.reverse('foo bar'), 'rab oof' ); + equal(_.str.reverse('saippuakauppias'), 'saippuakauppias' ); + equal(_.str.reverse(123), '321', 'Non string'); + equal(_.str.reverse(123.45), '54.321', 'Non string'); + equal(_.str.reverse(''), '', 'reversing empty string returns empty string' ); + equal(_.str.reverse(null), '', 'reversing null returns empty string' ); + equal(_.str.reverse(undefined), '', 'reversing undefined returns empty string' ); + }); + + test('Strings: clean', function() { + equal(_(' foo bar ').clean(), 'foo bar'); + equal(_(123).clean(), '123'); + equal(_('').clean(), '', 'claning empty string returns empty string'); + equal(_(null).clean(), '', 'claning null returns empty string'); + equal(_(undefined).clean(), '', 'claning undefined returns empty string'); + }); + + test('Strings: sprintf', function() { + // Should be very tested function already. Thanks to + // http://www.diveintojavascript.com/projects/sprintf-for-javascript + equal(_.sprintf('Hello %s', 'me'), 'Hello me', 'basic'); + equal(_('Hello %s').sprintf('me'), 'Hello me', 'object'); + equal(_('hello %s').chain().sprintf('me').capitalize().value(), 'Hello me', 'Chaining works'); + equal(_.sprintf('%.1f', 1.22222), '1.2', 'round'); + equal(_.sprintf('%.1f', 1.17), '1.2', 'round 2'); + equal(_.sprintf('%(id)d - %(name)s', {id: 824, name: 'Hello World'}), '824 - Hello World', 'Named replacements work'); + equal(_.sprintf('%(args[0].id)d - %(args[1].name)s', {args: [{id: 824}, {name: 'Hello World'}]}), '824 - Hello World', 'Named replacements with arrays work'); + }); + + + test('Strings: vsprintf', function() { + equal(_.vsprintf('Hello %s', ['me']), 'Hello me', 'basic'); + equal(_('Hello %s').vsprintf(['me']), 'Hello me', 'object'); + equal(_('hello %s').chain().vsprintf(['me']).capitalize().value(), 'Hello me', 'Chaining works'); + equal(_.vsprintf('%.1f', [1.22222]), '1.2', 'round'); + equal(_.vsprintf('%.1f', [1.17]), '1.2', 'round 2'); + equal(_.vsprintf('%(id)d - %(name)s', [{id: 824, name: 'Hello World'}]), '824 - Hello World', 'Named replacement works'); + equal(_.vsprintf('%(args[0].id)d - %(args[1].name)s', [{args: [{id: 824}, {name: 'Hello World'}]}]), '824 - Hello World', 'Named replacement with arrays works'); + }); + + test('Strings: startsWith', function() { + ok(_('foobar').startsWith('foo'), 'foobar starts with foo'); + ok(!_('oobar').startsWith('foo'), 'oobar does not start with foo'); + ok(_(12345).startsWith(123), '12345 starts with 123'); + ok(!_(2345).startsWith(123), '2345 does not start with 123'); + ok(_('').startsWith(''), 'empty string starts with empty string'); + ok(_(null).startsWith(''), 'null starts with empty string'); + ok(!_(null).startsWith('foo'), 'null starts with foo'); + }); + + test('Strings: endsWith', function() { + ok(_('foobar').endsWith('bar'), 'foobar ends with bar'); + ok(_.endsWith('foobar', 'bar'), 'foobar ends with bar'); + ok(_.endsWith('00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4', 'mp4'), 'endsWith .mp4'); + ok(!_('fooba').endsWith('bar'), 'fooba does not end with bar'); + ok(_.endsWith(12345, 45), '12345 ends with 45'); + ok(!_.endsWith(12345, 6), '12345 does not end with 6'); + ok(_('').endsWith(''), 'empty string ends with empty string'); + ok(_(null).endsWith(''), 'null ends with empty string'); + ok(!_(null).endsWith('foo'), 'null ends with foo'); + }); + + test('Strings: include', function() { + ok(_.str.include('foobar', 'bar'), 'foobar includes bar'); + ok(!_.str.include('foobar', 'buzz'), 'foobar does not includes buzz'); + ok(_.str.include(12345, 34), '12345 includes 34'); + ok(!_.str.contains(12345, 6), '12345 does not includes 6'); + ok(!_.str.include('', 34), 'empty string includes 34'); + ok(!_.str.include(null, 34), 'null includes 34'); + ok(_.str.include(null, ''), 'null includes empty string'); + }); + + test('String: chop', function(){ + ok(_('whitespace').chop(2).length === 5, 'output [wh, it, es, pa, ce]'); + ok(_('whitespace').chop(3).length === 4, 'output [whi, tes, pac, e]'); + ok(_('whitespace').chop()[0].length === 10, 'output [whitespace]'); + ok(_(12345).chop(1).length === 5, 'output [1, 2, 3, 4, 5]'); + }); + + test('String: clean', function(){ + equal(_.clean(' foo bar '), 'foo bar'); + equal(_.clean(''), ''); + equal(_.clean(null), ''); + equal(_.clean(1), '1'); + }); + + test('String: count', function(){ + equal(_('Hello world').count('l'), 3); + equal(_('Hello world').count('Hello'), 1); + equal(_('Hello world').count('foo'), 0); + equal(_('x.xx....x.x').count('x'), 5); + equal(_('').count('x'), 0); + equal(_(null).count('x'), 0); + equal(_(undefined).count('x'), 0); + equal(_(12345).count(1), 1); + equal(_(11345).count(1), 2); + }); + + test('String: insert', function(){ + equal(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); + equal(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); + equal(_('').insert(100, 'Jessy'), 'Jessy'); + equal(_(null).insert(100, 'Jessy'), 'Jessy'); + equal(_(undefined).insert(100, 'Jessy'), 'Jessy'); + equal(_(12345).insert(6, 'Jessy'), '12345Jessy'); + }); + + test('String: splice', function(){ + equal(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), + 'https://edtsech@bitbucket.org/epeli/underscore.strings'); + equal(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); + }); + + test('String: succ', function(){ + equal(_('a').succ(), 'b'); + equal(_('A').succ(), 'B'); + equal(_('+').succ(), ','); + equal(_(1).succ(), '2'); + }); + + test('String: titleize', function(){ + equal(_('the titleize string method').titleize(), 'The Titleize String Method'); + equal(_('the titleize string method').titleize(), 'The Titleize String Method'); + equal(_('').titleize(), '', 'Titleize empty string returns empty string'); + equal(_(null).titleize(), '', 'Titleize null returns empty string'); + equal(_(undefined).titleize(), '', 'Titleize undefined returns empty string'); + equal(_('let\'s have some fun').titleize(), 'Let\'s Have Some Fun'); + equal(_('a-dash-separated-string').titleize(), 'A-Dash-Separated-String'); + equal(_('A-DASH-SEPARATED-STRING').titleize(), 'A-Dash-Separated-String'); + equal(_(123).titleize(), '123'); + }); + + test('String: camelize', function(){ + equal(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); + equal(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); + equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); + equal(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); + equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); + equal(_('').camelize(), '', 'Camelize empty string returns empty string'); + equal(_(null).camelize(), '', 'Camelize null returns empty string'); + equal(_(undefined).camelize(), '', 'Camelize undefined returns empty string'); + equal(_(123).camelize(), '123'); + }); + + test('String: underscored', function(){ + equal(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); + equal(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); + equal(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); + equal(_(' the underscored string method').underscored(), 'the_underscored_string_method'); + equal(_('').underscored(), ''); + equal(_(null).underscored(), ''); + equal(_(undefined).underscored(), ''); + equal(_(123).underscored(), '123'); + }); + + test('String: dasherize', function(){ + equal(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); + equal(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); + equal(_('thisIsATest').dasherize(), 'this-is-a-test'); + equal(_('this Is A Test').dasherize(), 'this-is-a-test'); + equal(_('thisIsATest123').dasherize(), 'this-is-a-test123'); + equal(_('123thisIsATest').dasherize(), '123this-is-a-test'); + equal(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); + equal(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); + equal(_('téléphone').dasherize(), 'téléphone'); + equal(_('foo$bar').dasherize(), 'foo$bar'); + equal(_('').dasherize(), ''); + equal(_(null).dasherize(), ''); + equal(_(undefined).dasherize(), ''); + equal(_(123).dasherize(), '123'); + }); + + test('String: camelize', function(){ + equal(_.camelize('-moz-transform'), 'MozTransform'); + equal(_.camelize('webkit-transform'), 'webkitTransform'); + equal(_.camelize('under_scored'), 'underScored'); + equal(_.camelize(' with spaces'), 'withSpaces'); + equal(_('').camelize(), ''); + equal(_(null).camelize(), ''); + equal(_(undefined).camelize(), ''); + equal(_("_som eWeird---name-").camelize(), 'SomEWeirdName'); + }); + + test('String: join', function(){ + equal(_.join(1, 2, 3, 4), '21314'); + equal(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); + equal(_.join('',2,3,null), '23'); + equal(_.join(null,2,3), '23'); + }); + + test('String: classify', function(){ + equal(_.classify(1), '1'); + equal(_('some_class_name').classify(), 'SomeClassName'); + equal(_('my wonderfull class_name').classify(), 'MyWonderfullClassName'); + equal(_('my wonderfull.class.name').classify(), 'MyWonderfullClassName'); + }); + + test('String: humanize', function(){ + equal(_('the_humanize_string_method').humanize(), 'The humanize string method'); + equal(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); + equal(_('the humanize string method').humanize(), 'The humanize string method'); + equal(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); + equal(_('the humanize string method ').humanize(), 'The humanize string method'); + equal(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); + equal(_(123).humanize(), '123'); + equal(_('').humanize(), ''); + equal(_(null).humanize(), ''); + equal(_(undefined).humanize(), ''); + }); + + test('String: truncate', function(){ + equal(_('Hello world').truncate(6, 'read more'), 'Hello read more'); + equal(_('Hello world').truncate(5), 'Hello...'); + equal(_('Hello').truncate(10), 'Hello'); + equal(_('').truncate(10), ''); + equal(_(null).truncate(10), ''); + equal(_(undefined).truncate(10), ''); + equal(_(1234567890).truncate(5), '12345...'); + }); + + test('String: prune', function(){ + equal(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); + equal(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); + equal(_('Hello, world').prune(5), 'Hello...'); + equal(_('Hello, world').prune(8), 'Hello...'); + equal(_('Hello, cruel world').prune(15), 'Hello, cruel...'); + equal(_('Hello world').prune(22), 'Hello world'); + equal(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); + equal(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); + equal(_('Привет, мир').prune(6), 'Привет...'); + equal(_('Привет, мир').prune(8), 'Привет...'); + equal(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); + equal(_('Привет, мир').prune(22), 'Привет, мир'); + equal(_('alksjd!!!!!!....').prune(100, ''), 'alksjd!!!!!!....'); + equal(_(123).prune(10), '123'); + equal(_(123).prune(1, 321), '321'); + equal(_('').prune(5), ''); + equal(_(null).prune(5), ''); + equal(_(undefined).prune(5), ''); + }); + + test('String: isBlank', function(){ + ok(_('').isBlank()); + ok(_(' ').isBlank()); + ok(_('\n').isBlank()); + ok(!_('a').isBlank()); + ok(!_('0').isBlank()); + ok(!_(0).isBlank()); + ok(_('').isBlank()); + ok(_(null).isBlank()); + ok(_(undefined).isBlank()); + }); + + test('String: escapeRegExp', function(){ + equal(_.escapeRegExp(/hello(?=\sworld)/.source), 'hello\\(\\?\\=\\\\sworld\\)', 'with lookahead'); + equal(_.escapeRegExp(/hello(?!\shell)/.source), 'hello\\(\\?\\!\\\\shell\\)', 'with negative lookahead'); + }); + + test('String: escapeHTML', function(){ + equal(_('
    Blah & "blah" & \'blah\'
    ').escapeHTML(), + '<div>Blah & "blah" & 'blah'</div>'); + equal(_('<').escapeHTML(), '&lt;'); + equal(_(5).escapeHTML(), '5'); + equal(_('').escapeHTML(), ''); + equal(_(null).escapeHTML(), ''); + equal(_(undefined).escapeHTML(), ''); + }); + + test('String: unescapeHTML', function(){ + equal(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), + '
    Blah & "blah" & \'blah\'
    '); + equal(_('&lt;').unescapeHTML(), '<'); + equal(_(''').unescapeHTML(), '\''); + equal(_(''').unescapeHTML(), '\''); + equal(_(''').unescapeHTML(), '\''); + equal(_('J').unescapeHTML(), 'J'); + equal(_('J').unescapeHTML(), 'J'); + equal(_('J').unescapeHTML(), 'J'); + equal(_('&_#39;').unescapeHTML(), '&_#39;'); + equal(_(''_;').unescapeHTML(), ''_;'); + equal(_('&#38;').unescapeHTML(), '&'); + equal(_('&amp;').unescapeHTML(), '&'); + equal(_('').unescapeHTML(), ''); + equal(_(null).unescapeHTML(), ''); + equal(_(undefined).unescapeHTML(), ''); + equal(_(5).unescapeHTML(), '5'); + // equal(_(undefined).unescapeHTML(), ''); + }); + + test('String: words', function() { + deepEqual(_('I love you!').words(), ['I', 'love', 'you!']); + deepEqual(_(' I love you! ').words(), ['I', 'love', 'you!']); + deepEqual(_('I_love_you!').words('_'), ['I', 'love', 'you!']); + deepEqual(_('I-love-you!').words(/-/), ['I', 'love', 'you!']); + deepEqual(_(123).words(), ['123'], '123 number has one word "123".'); + deepEqual(_(0).words(), ['0'], 'Zero number has one word "0".'); + deepEqual(_('').words(), [], 'Empty strings has no words.'); + deepEqual(_(' ').words(), [], 'Blank strings has no words.'); + deepEqual(_(null).words(), [], 'null has no words.'); + deepEqual(_(undefined).words(), [], 'undefined has no words.'); + }); + + test('String: chars', function() { + equal(_('Hello').chars().length, 5); + equal(_(123).chars().length, 3); + equal(_('').chars().length, 0); + equal(_(null).chars().length, 0); + equal(_(undefined).chars().length, 0); + }); + + test('String: swapCase', function(){ + equal(_('AaBbCcDdEe').swapCase(), 'aAbBcCdDeE'); + equal(_('Hello World').swapCase(), 'hELLO wORLD'); + equal(_('').swapCase(), ''); + equal(_(null).swapCase(), ''); + equal(_(undefined).swapCase(), ''); + }); + + test('String: lines', function() { + equal(_('Hello\nWorld').lines().length, 2); + equal(_('Hello World').lines().length, 1); + equal(_(123).lines().length, 1); + equal(_('').lines().length, 1); + equal(_(null).lines().length, 0); + equal(_(undefined).lines().length, 0); + }); + + test('String: pad', function() { + equal(_('1').pad(8), ' 1'); + equal(_(1).pad(8), ' 1'); + equal(_('1').pad(8, '0'), '00000001'); + equal(_('1').pad(8, '0', 'left'), '00000001'); + equal(_('1').pad(8, '0', 'right'), '10000000'); + equal(_('1').pad(8, '0', 'both'), '00001000'); + equal(_('foo').pad(8, '0', 'both'), '000foo00'); + equal(_('foo').pad(7, '0', 'both'), '00foo00'); + equal(_('foo').pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); + equal(_('').pad(2), ' '); + equal(_(null).pad(2), ' '); + equal(_(undefined).pad(2), ' '); + }); + + test('String: lpad', function() { + equal(_('1').lpad(8), ' 1'); + equal(_(1).lpad(8), ' 1'); + equal(_('1').lpad(8, '0'), '00000001'); + equal(_('1').lpad(8, '0', 'left'), '00000001'); + equal(_('').lpad(2), ' '); + equal(_(null).lpad(2), ' '); + equal(_(undefined).lpad(2), ' '); + }); + + test('String: rpad', function() { + equal(_('1').rpad(8), '1 '); + equal(_(1).lpad(8), ' 1'); + equal(_('1').rpad(8, '0'), '10000000'); + equal(_('foo').rpad(8, '0'), 'foo00000'); + equal(_('foo').rpad(7, '0'), 'foo0000'); + equal(_('').rpad(2), ' '); + equal(_(null).rpad(2), ' '); + equal(_(undefined).rpad(2), ' '); + }); + + test('String: lrpad', function() { + equal(_('1').lrpad(8), ' 1 '); + equal(_(1).lrpad(8), ' 1 '); + equal(_('1').lrpad(8, '0'), '00001000'); + equal(_('foo').lrpad(8, '0'), '000foo00'); + equal(_('foo').lrpad(7, '0'), '00foo00'); + equal(_('foo').lrpad(7, '!@$%dofjrofj'), '!!foo!!'); + equal(_('').lrpad(2), ' '); + equal(_(null).lrpad(2), ' '); + equal(_(undefined).lrpad(2), ' '); + }); + + test('String: toNumber', function() { + deepEqual(_('not a number').toNumber(), NaN); + equal(_(0).toNumber(), 0); + equal(_('0').toNumber(), 0); + equal(_('0.0').toNumber(), 0); + equal(_('0.1').toNumber(), 0); + equal(_('0.1').toNumber(1), 0.1); + equal(_(' 0.1 ').toNumber(1), 0.1); + equal(_('0000').toNumber(), 0); + equal(_('2.345').toNumber(), 2); + equal(_('2.345').toNumber(NaN), 2); + equal(_('2.345').toNumber(2), 2.35); + equal(_('2.344').toNumber(2), 2.34); + equal(_('2').toNumber(2), 2.00); + equal(_(2).toNumber(2), 2.00); + equal(_(-2).toNumber(), -2); + equal(_('-2').toNumber(), -2); + equal(_('').toNumber(), 0); + equal(_(null).toNumber(), 0); + equal(_(undefined).toNumber(), 0); + }); + + test('String: numberFormat', function() { + equal(_.numberFormat(9000), '9,000'); + equal(_.numberFormat(9000, 0), '9,000'); + equal(_.numberFormat(9000, 0, '', ''), '9000'); + equal(_.numberFormat(90000, 2), '90,000.00'); + equal(_.numberFormat(1000.754), '1,001'); + equal(_.numberFormat(1000.754, 2), '1,000.75'); + equal(_.numberFormat(1000.754, 0, ',', '.'), '1.001'); + equal(_.numberFormat(1000.754, 2, ',', '.'), '1.000,75'); + equal(_.numberFormat(1000000.754, 2, ',', '.'), '1.000.000,75'); + equal(_.numberFormat(1000000000), '1,000,000,000'); + equal(_.numberFormat(100000000), '100,000,000'); + equal(_.numberFormat('not number'), ''); + equal(_.numberFormat(), ''); + equal(_.numberFormat(null, '.', ','), ''); + equal(_.numberFormat(undefined, '.', ','), ''); + equal(_.numberFormat(new Number(5000)), '5,000'); + }); + + test('String: strRight', function() { + equal(_('This_is_a_test_string').strRight('_'), 'is_a_test_string'); + equal(_('This_is_a_test_string').strRight('string'), ''); + equal(_('This_is_a_test_string').strRight(), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strRight('-'), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); + equal(_('').strRight('foo'), ''); + equal(_(null).strRight('foo'), ''); + equal(_(undefined).strRight('foo'), ''); + equal(_(12345).strRight(2), '345'); + }); + + test('String: strRightBack', function() { + equal(_('This_is_a_test_string').strRightBack('_'), 'string'); + equal(_('This_is_a_test_string').strRightBack('string'), ''); + equal(_('This_is_a_test_string').strRightBack(), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strRightBack(''), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strRightBack('-'), 'This_is_a_test_string'); + equal(_('').strRightBack('foo'), ''); + equal(_(null).strRightBack('foo'), ''); + equal(_(undefined).strRightBack('foo'), ''); + equal(_(12345).strRightBack(2), '345'); + }); + + test('String: strLeft', function() { + equal(_('This_is_a_test_string').strLeft('_'), 'This'); + equal(_('This_is_a_test_string').strLeft('This'), ''); + equal(_('This_is_a_test_string').strLeft(), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strLeft(''), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strLeft('-'), 'This_is_a_test_string'); + equal(_('').strLeft('foo'), ''); + equal(_(null).strLeft('foo'), ''); + equal(_(undefined).strLeft('foo'), ''); + equal(_(123454321).strLeft(3), '12'); + }); + + test('String: strLeftBack', function() { + equal(_('This_is_a_test_string').strLeftBack('_'), 'This_is_a_test'); + equal(_('This_is_a_test_string').strLeftBack('This'), ''); + equal(_('This_is_a_test_string').strLeftBack(), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strLeftBack(''), 'This_is_a_test_string'); + equal(_('This_is_a_test_string').strLeftBack('-'), 'This_is_a_test_string'); + equal(_('').strLeftBack('foo'), ''); + equal(_(null).strLeftBack('foo'), ''); + equal(_(undefined).strLeftBack('foo'), ''); + equal(_(123454321).strLeftBack(3), '123454'); + }); + + test('Strings: stripTags', function() { + equal(_('a link').stripTags(), 'a link'); + equal(_('a link + + + + + + + + +

    Underscore.string Test Suite

    +

    +

    +
      +
      +

      Underscore.string Speed Suite

      + +
      + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html new file mode 100644 index 0000000..9854c17 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html @@ -0,0 +1,18 @@ + + + + Underscore.strings Test Suite + + + + + + + + +

      Underscore.string Test Suite

      +

      +

      +
        + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js new file mode 100644 index 0000000..32252a3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js @@ -0,0 +1,200 @@ +$(document).ready(function() { + + module("Arrays"); + + test("first", function() { + equal(_.first([1,2,3]), 1, 'can pull out the first element of an array'); + equal(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); + equal(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); + equal(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); + equal(_.first([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to first'); + var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); + equal(result, 4, 'works on an arguments object.'); + result = _.map([[1,2,3],[1,2,3]], _.first); + equal(result.join(','), '1,1', 'works well with _.map'); + result = (function() { return _.take([1,2,3], 2); })(); + equal(result.join(','), '1,2', 'aliased as take'); + + equal(_.first(null), undefined, 'handles nulls'); + }); + + test("rest", function() { + var numbers = [1, 2, 3, 4]; + equal(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); + equal(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); + equal(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); + var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); + equal(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.rest); + equal(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); + result = (function(){ return _(arguments).drop(); })(1, 2, 3, 4); + equal(result.join(', '), '2, 3, 4', 'aliased as drop and works on arguments object'); + }); + + test("initial", function() { + equal(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); + equal(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); + var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); + equal(result.join(", "), "1, 2, 3", 'initial works on arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.initial); + equal(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); + }); + + test("last", function() { + equal(_.last([1,2,3]), 3, 'can pull out the last element of an array'); + equal(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); + equal(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); + equal(_.last([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to last'); + var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); + equal(result, 4, 'works on an arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.last); + equal(result.join(','), '3,3', 'works well with _.map'); + + equal(_.last(null), undefined, 'handles nulls'); + }); + + test("compact", function() { + equal(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); + var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); + equal(result, 3, 'works on an arguments object'); + }); + + test("flatten", function() { + if (window.JSON) { + var list = [1, [2], [3, [[[4]]]]]; + equal(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); + equal(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); + var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); + equal(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); + } + }); + + test("without", function() { + var list = [1, 2, 1, 0, 3, 1, 4]; + equal(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); + var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); + equal(result.join(', '), '2, 3, 4', 'works on an arguments object'); + + var list = [{one : 1}, {two : 2}]; + ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); + ok(_.without(list, list[0]).length == 1, 'ditto.'); + }); + + test("uniq", function() { + var list = [1, 2, 1, 3, 1, 4]; + equal(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); + + var list = [1, 1, 1, 2, 2, 3]; + equal(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); + + var list = [{name:'moe'}, {name:'curly'}, {name:'larry'}, {name:'curly'}]; + var iterator = function(value) { return value.name; }; + equal(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator'); + + var iterator = function(value) { return value +1; }; + var list = [1, 2, 2, 3, 4, 4]; + equal(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array'); + + var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); + equal(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); + }); + + test("intersection", function() { + var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; + equal(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); + equal(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); + var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); + equal(result.join(''), 'moe', 'works on an arguments object'); + }); + + test("union", function() { + var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); + equal(result.join(' '), '1 2 3 30 40', 'takes the union of a list of arrays'); + + var result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]); + equal(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); + }); + + test("difference", function() { + var result = _.difference([1, 2, 3], [2, 30, 40]); + equal(result.join(' '), '1 3', 'takes the difference of two arrays'); + + var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); + equal(result.join(' '), '3 4', 'takes the difference of three arrays'); + }); + + test('zip', function() { + var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; + var stooges = _.zip(names, ages, leaders); + equal(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); + }); + + test('object', function() { + var result = _.object(['moe', 'larry', 'curly'], [30, 40, 50]); + var shouldBe = {moe: 30, larry: 40, curly: 50}; + ok(_.isEqual(result, shouldBe), 'two arrays zipped together into an object'); + + result = _.object([['one', 1], ['two', 2], ['three', 3]]); + shouldBe = {one: 1, two: 2, three: 3}; + ok(_.isEqual(result, shouldBe), 'an array of pairs zipped together into an object'); + + var stooges = {moe: 30, larry: 40, curly: 50}; + ok(_.isEqual(_.object(_.pairs(stooges)), stooges), 'an object converted to pairs and back to an object'); + + ok(_.isEqual(_.object(null), {}), 'handles nulls'); + }); + + test("indexOf", function() { + var numbers = [1, 2, 3]; + numbers.indexOf = null; + equal(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); + var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); + equal(result, 1, 'works on an arguments object'); + equal(_.indexOf(null, 2), -1, 'handles nulls properly'); + + var numbers = [10, 20, 30, 40, 50], num = 35; + var index = _.indexOf(numbers, num, true); + equal(index, -1, '35 is not in the list'); + + numbers = [10, 20, 30, 40, 50]; num = 40; + index = _.indexOf(numbers, num, true); + equal(index, 3, '40 is in the list'); + + numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40; + index = _.indexOf(numbers, num, true); + equal(index, 1, '40 is in the list'); + + numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; + index = _.indexOf(numbers, 2, 5); + equal(index, 7, 'supports the fromIndex argument'); + }); + + test("lastIndexOf", function() { + var numbers = [1, 0, 1]; + equal(_.lastIndexOf(numbers, 1), 2); + + numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; + numbers.lastIndexOf = null; + equal(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); + equal(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); + var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); + equal(result, 5, 'works on an arguments object'); + equal(_.indexOf(null, 2), -1, 'handles nulls properly'); + + numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; + index = _.lastIndexOf(numbers, 2, 2); + equal(index, 1, 'supports the fromIndex argument'); + }); + + test("range", function() { + equal(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); + equal(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); + equal(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a<b generates an array of elements a,a+1,a+2,...,b-2,b-1'); + equal(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); + equal(_.range(3, 10, 3).join(' '), '3 6 9', 'range with three arguments a & b & c, c < b-a, a < b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) < c'); + equal(_.range(3, 10, 15).join(''), '3', 'range with three arguments a & b & c, c > b-a, a < b generates an array with a single element, equal to a'); + equal(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); + equal(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); + }); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js new file mode 100644 index 0000000..16cf7bf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js @@ -0,0 +1,59 @@ +$(document).ready(function() { + + module("Chaining"); + + test("map/flatten/reduce", function() { + var lyrics = [ + "I'm a lumberjack and I'm okay", + "I sleep all night and I work all day", + "He's a lumberjack and he's okay", + "He sleeps all night and he works all day" + ]; + var counts = _(lyrics).chain() + .map(function(line) { return line.split(''); }) + .flatten() + .reduce(function(hash, l) { + hash[l] = hash[l] || 0; + hash[l]++; + return hash; + }, {}).value(); + ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); + }); + + test("select/reject/sortBy", function() { + var numbers = [1,2,3,4,5,6,7,8,9,10]; + numbers = _(numbers).chain().select(function(n) { + return n % 2 == 0; + }).reject(function(n) { + return n % 4 == 0; + }).sortBy(function(n) { + return -n; + }).value(); + equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); + }); + + test("select/reject/sortBy in functional style", function() { + var numbers = [1,2,3,4,5,6,7,8,9,10]; + numbers = _.chain(numbers).select(function(n) { + return n % 2 == 0; + }).reject(function(n) { + return n % 4 == 0; + }).sortBy(function(n) { + return -n; + }).value(); + equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); + }); + + test("reverse/concat/unshift/pop/map", function() { + var numbers = [1,2,3,4,5]; + numbers = _(numbers).chain() + .reverse() + .concat([5, 5, 5]) + .unshift(17) + .pop() + .map(function(n){ return n * 2; }) + .value(); + equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); + }); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js new file mode 100644 index 0000000..e089626 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js @@ -0,0 +1,426 @@ +$(document).ready(function() { + + module("Collections"); + + test("each", function() { + _.each([1, 2, 3], function(num, i) { + equal(num, i + 1, 'each iterators provide value and iteration count'); + }); + + var answers = []; + _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); + equal(answers.join(', '), '5, 10, 15', 'context object property accessed'); + + answers = []; + _.forEach([1, 2, 3], function(num){ answers.push(num); }); + equal(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); + + answers = []; + var obj = {one : 1, two : 2, three : 3}; + obj.constructor.prototype.four = 4; + _.each(obj, function(value, key){ answers.push(key); }); + equal(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); + delete obj.constructor.prototype.four; + + answer = null; + _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); + ok(answer, 'can reference the original collection from inside the iterator'); + + answers = 0; + _.each(null, function(){ ++answers; }); + equal(answers, 0, 'handles a null properly'); + }); + + test('map', function() { + var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); + equal(doubled.join(', '), '2, 4, 6', 'doubled numbers'); + + doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); + equal(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); + + var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); + equal(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); + + var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); + equal(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); + + if (document.querySelectorAll) { + var ids = _.map(document.querySelectorAll('#map-test *'), function(n){ return n.id; }); + deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on NodeLists.'); + } + + var ids = _.map($('#map-test').children(), function(n){ return n.id; }); + deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on jQuery Array-likes.'); + + var ids = _.map(document.images, function(n){ return n.id; }); + ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); + + var ifnull = _.map(null, function(){}); + ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly'); + }); + + test('reduce', function() { + var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); + equal(sum, 6, 'can sum up an array'); + + var context = {multiplier : 3}; + sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); + equal(sum, 18, 'can reduce with a context object'); + + sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); + equal(sum, 6, 'aliased as "inject"'); + + sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); + equal(sum, 6, 'OO-style reduce'); + + var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); + equal(sum, 6, 'default initial value'); + + var ifnull; + try { + _.reduce(null, function(){}); + } catch (ex) { + ifnull = ex; + } + ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); + + ok(_.reduce(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); + equal(_.reduce([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); + raises(function() { _.reduce([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); + }); + + test('reduceRight', function() { + var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); + equal(list, 'bazbarfoo', 'can perform right folds'); + + var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); + equal(list, 'bazbarfoo', 'aliased as "foldr"'); + + var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); + equal(list, 'bazbarfoo', 'default initial value'); + + var ifnull; + try { + _.reduceRight(null, function(){}); + } catch (ex) { + ifnull = ex; + } + ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); + + var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(sum, num){ return sum + num; }); + equal(sum, 6, 'default initial value on object'); + + ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); + + equal(_.reduceRight([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); + raises(function() { _.reduceRight([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); + + // Assert that the correct arguments are being passed. + + var args, + memo = {}, + object = {a: 1, b: 2}, + lastKey = _.keys(object).pop(); + + var expected = lastKey == 'a' + ? [memo, 1, 'a', object] + : [memo, 2, 'b', object]; + + _.reduceRight(object, function() { + args || (args = _.toArray(arguments)); + }, memo); + + deepEqual(args, expected); + + // And again, with numeric keys. + + object = {'2': 'a', '1': 'b'}; + lastKey = _.keys(object).pop(); + args = null; + + expected = lastKey == '2' + ? [memo, 'a', '2', object] + : [memo, 'b', '1', object]; + + _.reduceRight(object, function() { + args || (args = _.toArray(arguments)); + }, memo); + + deepEqual(args, expected); + }); + + test('find', function() { + var array = [1, 2, 3, 4]; + strictEqual(_.find(array, function(n) { return n > 2; }), 3, 'should return first found `value`'); + strictEqual(_.find(array, function() { return false; }), void 0, 'should return `undefined` if `value` is not found'); + }); + + test('detect', function() { + var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); + equal(result, 2, 'found the first "2" and broke the loop'); + }); + + test('select', function() { + var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equal(evens.join(', '), '2, 4, 6', 'selected each even number'); + + evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equal(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); + }); + + test('reject', function() { + var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equal(odds.join(', '), '1, 3, 5', 'rejected each even number'); + + var context = "obj"; + + var evens = _.reject([1, 2, 3, 4, 5, 6], function(num){ + equal(context, "obj"); + return num % 2 != 0; + }, context); + equal(evens.join(', '), '2, 4, 6', 'rejected each odd number'); + }); + + test('all', function() { + ok(_.all([], _.identity), 'the empty set'); + ok(_.all([true, true, true], _.identity), 'all true values'); + ok(!_.all([true, false, true], _.identity), 'one false value'); + ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); + ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); + ok(_.all([1], _.identity) === true, 'cast to boolean - true'); + ok(_.all([0], _.identity) === false, 'cast to boolean - false'); + ok(_.every([true, true, true], _.identity), 'aliased as "every"'); + ok(!_.all([undefined, undefined, undefined], _.identity), 'works with arrays of undefined'); + }); + + test('any', function() { + var nativeSome = Array.prototype.some; + Array.prototype.some = null; + ok(!_.any([]), 'the empty set'); + ok(!_.any([false, false, false]), 'all false values'); + ok(_.any([false, false, true]), 'one true value'); + ok(_.any([null, 0, 'yes', false]), 'a string'); + ok(!_.any([null, 0, '', false]), 'falsy values'); + ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); + ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); + ok(_.any([1], _.identity) === true, 'cast to boolean - true'); + ok(_.any([0], _.identity) === false, 'cast to boolean - false'); + ok(_.some([false, false, true]), 'aliased as "some"'); + Array.prototype.some = nativeSome; + }); + + test('include', function() { + ok(_.include([1,2,3], 2), 'two is in the array'); + ok(!_.include([1,3,9], 2), 'two is not in the array'); + ok(_.contains({moe:1, larry:3, curly:9}, 3) === true, '_.include on objects checks their values'); + ok(_([1,2,3]).include(2), 'OO-style include'); + }); + + test('invoke', function() { + var list = [[5, 1, 7], [3, 2, 1]]; + var result = _.invoke(list, 'sort'); + equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); + }); + + test('invoke w/ function reference', function() { + var list = [[5, 1, 7], [3, 2, 1]]; + var result = _.invoke(list, Array.prototype.sort); + equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); + }); + + // Relevant when using ClojureScript + test('invoke when strings have a call method', function() { + String.prototype.call = function() { + return 42; + }; + var list = [[5, 1, 7], [3, 2, 1]]; + var s = "foo"; + equal(s.call(), 42, "call function exists"); + var result = _.invoke(list, 'sort'); + equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); + delete String.prototype.call; + equal(s.call, undefined, "call function removed"); + }); + + test('pluck', function() { + var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; + equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); + }); + + test('where', function() { + var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]; + var result = _.where(list, {a: 1}); + equal(result.length, 3); + equal(result[result.length - 1].b, 4); + result = _.where(list, {b: 2}); + equal(result.length, 2); + equal(result[0].a, 1); + }); + + test('max', function() { + equal(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); + + var neg = _.max([1, 2, 3], function(num){ return -num; }); + equal(neg, 1, 'can perform a computation-based max'); + + equal(-Infinity, _.max({}), 'Maximum value of an empty object'); + equal(-Infinity, _.max([]), 'Maximum value of an empty array'); + + equal(299999, _.max(_.range(1,300000)), "Maximum value of a too-big array"); + }); + + test('min', function() { + equal(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); + + var neg = _.min([1, 2, 3], function(num){ return -num; }); + equal(neg, 3, 'can perform a computation-based min'); + + equal(Infinity, _.min({}), 'Minimum value of an empty object'); + equal(Infinity, _.min([]), 'Minimum value of an empty array'); + + var now = new Date(9999999999); + var then = new Date(0); + equal(_.min([now, then]), then); + + equal(1, _.min(_.range(1,300000)), "Minimum value of a too-big array"); + }); + + test('sortBy', function() { + var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; + people = _.sortBy(people, function(person){ return person.age; }); + equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); + + var list = [undefined, 4, 1, undefined, 3, 2]; + equal(_.sortBy(list, _.identity).join(','), '1,2,3,4,,', 'sortBy with undefined values'); + + var list = ["one", "two", "three", "four", "five"]; + var sorted = _.sortBy(list, 'length'); + equal(sorted.join(' '), 'one two four five three', 'sorted by length'); + + function Pair(x, y) { + this.x = x; + this.y = y; + } + + var collection = [ + new Pair(1, 1), new Pair(1, 2), + new Pair(1, 3), new Pair(1, 4), + new Pair(1, 5), new Pair(1, 6), + new Pair(2, 1), new Pair(2, 2), + new Pair(2, 3), new Pair(2, 4), + new Pair(2, 5), new Pair(2, 6), + new Pair(undefined, 1), new Pair(undefined, 2), + new Pair(undefined, 3), new Pair(undefined, 4), + new Pair(undefined, 5), new Pair(undefined, 6) + ]; + + var actual = _.sortBy(collection, function(pair) { + return pair.x; + }); + + deepEqual(actual, collection, 'sortBy should be stable'); + }); + + test('groupBy', function() { + var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; }); + ok('0' in parity && '1' in parity, 'created a group for each value'); + equal(parity[0].join(', '), '2, 4, 6', 'put each even number in the right group'); + + var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; + var grouped = _.groupBy(list, 'length'); + equal(grouped['3'].join(' '), 'one two six ten'); + equal(grouped['4'].join(' '), 'four five nine'); + equal(grouped['5'].join(' '), 'three seven eight'); + + var context = {}; + _.groupBy([{}], function(){ ok(this === context); }, context); + + grouped = _.groupBy([4.2, 6.1, 6.4], function(num) { + return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; + }); + equal(grouped.constructor.length, 1); + equal(grouped.hasOwnProperty.length, 2); + + var array = [{}]; + _.groupBy(array, function(value, index, obj){ ok(obj === array); }); + }); + + test('countBy', function() { + var parity = _.countBy([1, 2, 3, 4, 5], function(num){ return num % 2 == 0; }); + equal(parity['true'], 2); + equal(parity['false'], 3); + + var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; + var grouped = _.countBy(list, 'length'); + equal(grouped['3'], 4); + equal(grouped['4'], 3); + equal(grouped['5'], 3); + + var context = {}; + _.countBy([{}], function(){ ok(this === context); }, context); + + grouped = _.countBy([4.2, 6.1, 6.4], function(num) { + return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; + }); + equal(grouped.constructor, 1); + equal(grouped.hasOwnProperty, 2); + + var array = [{}]; + _.countBy(array, function(value, index, obj){ ok(obj === array); }); + }); + + test('sortedIndex', function() { + var numbers = [10, 20, 30, 40, 50], num = 35; + var indexForNum = _.sortedIndex(numbers, num); + equal(indexForNum, 3, '35 should be inserted at index 3'); + + var indexFor30 = _.sortedIndex(numbers, 30); + equal(indexFor30, 2, '30 should be inserted at index 2'); + + var objects = [{x: 10}, {x: 20}, {x: 30}, {x: 40}]; + var iterator = function(obj){ return obj.x; }; + strictEqual(_.sortedIndex(objects, {x: 25}, iterator), 2); + strictEqual(_.sortedIndex(objects, {x: 35}, 'x'), 3); + + var context = {1: 2, 2: 3, 3: 4}; + iterator = function(obj){ return this[obj]; }; + strictEqual(_.sortedIndex([1, 3], 2, iterator, context), 1); + }); + + test('shuffle', function() { + var numbers = _.range(10); + var shuffled = _.shuffle(numbers).sort(); + notStrictEqual(numbers, shuffled, 'original object is unmodified'); + equal(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); + }); + + test('toArray', function() { + ok(!_.isArray(arguments), 'arguments object is not an array'); + ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); + var a = [1,2,3]; + ok(_.toArray(a) !== a, 'array is cloned'); + equal(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); + + var numbers = _.toArray({one : 1, two : 2, three : 3}); + equal(numbers.join(', '), '1, 2, 3', 'object flattened into array'); + }); + + test('size', function() { + equal(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); + equal(_.size([1, 2, 3]), 3, 'can compute the size of an array'); + + var func = function() { + return _.size(arguments); + }; + + equal(func(1, 2, 3, 4), 4, 'can test the size of the arguments object'); + + equal(_.size('hello'), 5, 'can compute the size of a string'); + + equal(_.size(null), 0, 'handles nulls'); + }); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js new file mode 100644 index 0000000..a529658 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js @@ -0,0 +1,259 @@ +$(document).ready(function() { + + module("Functions"); + + test("bind", function() { + var context = {name : 'moe'}; + var func = function(arg) { return "name: " + (this.name || arg); }; + var bound = _.bind(func, context); + equal(bound(), 'name: moe', 'can bind a function to a context'); + + bound = _(func).bind(context); + equal(bound(), 'name: moe', 'can do OO-style binding'); + + bound = _.bind(func, null, 'curly'); + equal(bound(), 'name: curly', 'can bind without specifying a context'); + + func = function(salutation, name) { return salutation + ': ' + name; }; + func = _.bind(func, this, 'hello'); + equal(func('moe'), 'hello: moe', 'the function was partially applied in advance'); + + var func = _.bind(func, this, 'curly'); + equal(func(), 'hello: curly', 'the function was completely applied in advance'); + + var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; }; + func = _.bind(func, this, 'hello', 'moe', 'curly'); + equal(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); + + func = function(context, message) { equal(this, context, message); }; + _.bind(func, 0, 0, 'can bind a function to `0`')(); + _.bind(func, '', '', 'can bind a function to an empty string')(); + _.bind(func, false, false, 'can bind a function to `false`')(); + + // These tests are only meaningful when using a browser without a native bind function + // To test this with a modern browser, set underscore's nativeBind to undefined + var F = function () { return this; }; + var Boundf = _.bind(F, {hello: "moe curly"}); + equal(new Boundf().hello, undefined, "function should not be bound to the context, to comply with ECMAScript 5"); + equal(Boundf().hello, "moe curly", "When called without the new operator, it's OK to be bound to the context"); + }); + + test("bindAll", function() { + var curly = {name : 'curly'}, moe = { + name : 'moe', + getName : function() { return 'name: ' + this.name; }, + sayHi : function() { return 'hi: ' + this.name; } + }; + curly.getName = moe.getName; + _.bindAll(moe, 'getName', 'sayHi'); + curly.sayHi = moe.sayHi; + equal(curly.getName(), 'name: curly', 'unbound function is bound to current object'); + equal(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); + + curly = {name : 'curly'}; + moe = { + name : 'moe', + getName : function() { return 'name: ' + this.name; }, + sayHi : function() { return 'hi: ' + this.name; } + }; + _.bindAll(moe); + curly.sayHi = moe.sayHi; + equal(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); + }); + + test("memoize", function() { + var fib = function(n) { + return n < 2 ? n : fib(n - 1) + fib(n - 2); + }; + var fastFib = _.memoize(fib); + equal(fib(10), 55, 'a memoized version of fibonacci produces identical results'); + equal(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); + + var o = function(str) { + return str; + }; + var fastO = _.memoize(o); + equal(o('toString'), 'toString', 'checks hasOwnProperty'); + equal(fastO('toString'), 'toString', 'checks hasOwnProperty'); + }); + + asyncTest("delay", 2, function() { + var delayed = false; + _.delay(function(){ delayed = true; }, 100); + setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); + setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150); + }); + + asyncTest("defer", 1, function() { + var deferred = false; + _.defer(function(bool){ deferred = bool; }, true); + _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); + }); + + asyncTest("throttle", 2, function() { + var counter = 0; + var incr = function(){ counter++; }; + var throttledIncr = _.throttle(incr, 100); + throttledIncr(); throttledIncr(); throttledIncr(); + setTimeout(throttledIncr, 70); + setTimeout(throttledIncr, 120); + setTimeout(throttledIncr, 140); + setTimeout(throttledIncr, 190); + setTimeout(throttledIncr, 220); + setTimeout(throttledIncr, 240); + _.delay(function(){ equal(counter, 1, "incr was called immediately"); }, 30); + _.delay(function(){ equal(counter, 4, "incr was throttled"); start(); }, 400); + }); + + asyncTest("throttle arguments", 2, function() { + var value = 0; + var update = function(val){ value = val; }; + var throttledUpdate = _.throttle(update, 100); + throttledUpdate(1); throttledUpdate(2); throttledUpdate(3); + setTimeout(function(){ throttledUpdate(4); }, 120); + setTimeout(function(){ throttledUpdate(5); }, 140); + setTimeout(function(){ throttledUpdate(6); }, 250); + _.delay(function(){ equal(value, 1, "updated to latest value"); }, 40); + _.delay(function(){ equal(value, 6, "updated to latest value"); start(); }, 400); + }); + + asyncTest("throttle once", 2, function() { + var counter = 0; + var incr = function(){ return ++counter; }; + var throttledIncr = _.throttle(incr, 100); + var result = throttledIncr(); + _.delay(function(){ + equal(result, 1, "throttled functions return their value"); + equal(counter, 1, "incr was called once"); start(); + }, 220); + }); + + asyncTest("throttle twice", 1, function() { + var counter = 0; + var incr = function(){ counter++; }; + var throttledIncr = _.throttle(incr, 100); + throttledIncr(); throttledIncr(); + _.delay(function(){ equal(counter, 2, "incr was called twice"); start(); }, 220); + }); + + asyncTest("throttle repeatedly with results", 9, function() { + var counter = 0; + var incr = function(){ return ++counter; }; + var throttledIncr = _.throttle(incr, 100); + var results = []; + var saveResult = function() { results.push(throttledIncr()); }; + saveResult(); saveResult(); saveResult(); + setTimeout(saveResult, 70); + setTimeout(saveResult, 120); + setTimeout(saveResult, 140); + setTimeout(saveResult, 190); + setTimeout(saveResult, 240); + setTimeout(saveResult, 260); + _.delay(function() { + equal(results[0], 1, "incr was called once"); + equal(results[1], 1, "incr was throttled"); + equal(results[2], 1, "incr was throttled"); + equal(results[3], 1, "incr was throttled"); + equal(results[4], 2, "incr was called twice"); + equal(results[5], 2, "incr was throttled"); + equal(results[6], 2, "incr was throttled"); + equal(results[7], 3, "incr was called thrice"); + equal(results[8], 3, "incr was throttled"); + start(); + }, 400); + }); + + asyncTest("debounce", 1, function() { + var counter = 0; + var incr = function(){ counter++; }; + var debouncedIncr = _.debounce(incr, 50); + debouncedIncr(); debouncedIncr(); debouncedIncr(); + setTimeout(debouncedIncr, 30); + setTimeout(debouncedIncr, 60); + setTimeout(debouncedIncr, 90); + setTimeout(debouncedIncr, 120); + setTimeout(debouncedIncr, 150); + _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); + }); + + asyncTest("debounce asap", 5, function() { + var a, b, c; + var counter = 0; + var incr = function(){ return ++counter; }; + var debouncedIncr = _.debounce(incr, 50, true); + a = debouncedIncr(); + b = debouncedIncr(); + c = debouncedIncr(); + equal(a, 1); + equal(b, 1); + equal(c, 1); + equal(counter, 1, 'incr was called immediately'); + setTimeout(debouncedIncr, 30); + setTimeout(debouncedIncr, 60); + setTimeout(debouncedIncr, 90); + setTimeout(debouncedIncr, 120); + setTimeout(debouncedIncr, 150); + _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); + }); + + asyncTest("debounce asap recursively", 2, function() { + var counter = 0; + var debouncedIncr = _.debounce(function(){ + counter++; + if (counter < 5) debouncedIncr(); + }, 50, true); + debouncedIncr(); + equal(counter, 1, 'incr was called immediately'); + _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 70); + }); + + test("once", function() { + var num = 0; + var increment = _.once(function(){ num++; }); + increment(); + increment(); + equal(num, 1); + }); + + test("wrap", function() { + var greet = function(name){ return "hi: " + name; }; + var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); + equal(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); + + var inner = function(){ return "Hello "; }; + var obj = {name : "Moe"}; + obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; }); + equal(obj.hi(), "Hello Moe"); + + var noop = function(){}; + var wrapped = _.wrap(noop, function(fn){ return Array.prototype.slice.call(arguments, 0); }); + var ret = wrapped(['whats', 'your'], 'vector', 'victor'); + deepEqual(ret, [noop, ['whats', 'your'], 'vector', 'victor']); + }); + + test("compose", function() { + var greet = function(name){ return "hi: " + name; }; + var exclaim = function(sentence){ return sentence + '!'; }; + var composed = _.compose(exclaim, greet); + equal(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); + + composed = _.compose(greet, exclaim); + equal(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); + }); + + test("after", function() { + var testAfter = function(afterAmount, timesCalled) { + var afterCalled = 0; + var after = _.after(afterAmount, function() { + afterCalled++; + }); + while (timesCalled--) after(); + return afterCalled; + }; + + equal(testAfter(5, 5), 1, "after(N) should fire after being called N times"); + equal(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); + equal(testAfter(0, 0), 1, "after(0) should fire immediately"); + }); + +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html new file mode 100644 index 0000000..064fa98 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html @@ -0,0 +1,45 @@ + + + + Underscore Test Suite + + + + + + + + + + + + + + + + +
        +
        +
        +
        +
        +
        +
        +
        +

        Underscore Speed Suite

        +

        + A representative sample of the functions are benchmarked here, to provide + a sense of how fast they might run in different browsers. + Each iteration runs on an array of 1000 elements.

        + For example, the 'intersection' test measures the number of times you can + find the intersection of two thousand-element arrays in one second. +

        +
        + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js new file mode 100644 index 0000000..22949c3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js @@ -0,0 +1,548 @@ +$(document).ready(function() { + + module("Objects"); + + test("keys", function() { + equal(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); + // the test above is not safe because it relies on for-in enumeration order + var a = []; a[1] = 0; + equal(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); + raises(function() { _.keys(null); }, TypeError, 'throws an error for `null` values'); + raises(function() { _.keys(void 0); }, TypeError, 'throws an error for `undefined` values'); + raises(function() { _.keys(1); }, TypeError, 'throws an error for number primitives'); + raises(function() { _.keys('a'); }, TypeError, 'throws an error for string primitives'); + raises(function() { _.keys(true); }, TypeError, 'throws an error for boolean primitives'); + }); + + test("values", function() { + equal(_.values({one: 1, two: 2}).join(', '), '1, 2', 'can extract the values from an object'); + equal(_.values({one: 1, two: 2, length: 3}).join(', '), '1, 2, 3', '... even when one of them is "length"'); + }); + + test("pairs", function() { + deepEqual(_.pairs({one: 1, two: 2}), [['one', 1], ['two', 2]], 'can convert an object into pairs'); + deepEqual(_.pairs({one: 1, two: 2, length: 3}), [['one', 1], ['two', 2], ['length', 3]], '... even when one of them is "length"'); + }); + + test("invert", function() { + var obj = {first: 'Moe', second: 'Larry', third: 'Curly'}; + equal(_.keys(_.invert(obj)).join(' '), 'Moe Larry Curly', 'can invert an object'); + ok(_.isEqual(_.invert(_.invert(obj)), obj), 'two inverts gets you back where you started'); + + var obj = {length: 3}; + ok(_.invert(obj)['3'] == 'length', 'can invert an object with "length"') + }); + + test("functions", function() { + var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; + ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); + + var Animal = function(){}; + Animal.prototype.run = function(){}; + equal(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); + }); + + test("extend", function() { + var result; + equal(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); + equal(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); + equal(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); + result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); + ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); + result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); + ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); + result = _.extend({}, {a: void 0, b: null}); + equal(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); + }); + + test("pick", function() { + var result; + result = _.pick({a:1, b:2, c:3}, 'a', 'c'); + ok(_.isEqual(result, {a:1, c:3}), 'can restrict properties to those named'); + result = _.pick({a:1, b:2, c:3}, ['b', 'c']); + ok(_.isEqual(result, {b:2, c:3}), 'can restrict properties to those named in an array'); + result = _.pick({a:1, b:2, c:3}, ['a'], 'b'); + ok(_.isEqual(result, {a:1, b:2}), 'can restrict properties to those named in mixed args'); + + var Obj = function(){}; + Obj.prototype = {a: 1, b: 2, c: 3}; + ok(_.isEqual(_.pick(new Obj, 'a', 'c'), {a:1, c: 3}), 'include prototype props'); + }); + + test("omit", function() { + var result; + result = _.omit({a:1, b:2, c:3}, 'b'); + ok(_.isEqual(result, {a:1, c:3}), 'can omit a single named property'); + result = _.omit({a:1, b:2, c:3}, 'a', 'c'); + ok(_.isEqual(result, {b:2}), 'can omit several named properties'); + result = _.omit({a:1, b:2, c:3}, ['b', 'c']); + ok(_.isEqual(result, {a:1}), 'can omit properties named in an array'); + + var Obj = function(){}; + Obj.prototype = {a: 1, b: 2, c: 3}; + ok(_.isEqual(_.omit(new Obj, 'b'), {a:1, c: 3}), 'include prototype props'); + }); + + test("defaults", function() { + var result; + var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; + + _.defaults(options, {zero: 1, one: 10, twenty: 20}); + equal(options.zero, 0, 'value exists'); + equal(options.one, 1, 'value exists'); + equal(options.twenty, 20, 'default applied'); + + _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); + equal(options.empty, "", 'value exists'); + ok(_.isNaN(options.nan), "NaN isn't overridden"); + equal(options.word, "word", 'new value is added, first one wins'); + }); + + test("clone", function() { + var moe = {name : 'moe', lucky : [13, 27, 34]}; + var clone = _.clone(moe); + equal(clone.name, 'moe', 'the clone as the attributes of the original'); + + clone.name = 'curly'; + ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); + + clone.lucky.push(101); + equal(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); + + equal(_.clone(undefined), void 0, 'non objects should not be changed by clone'); + equal(_.clone(1), 1, 'non objects should not be changed by clone'); + equal(_.clone(null), null, 'non objects should not be changed by clone'); + }); + + test("isEqual", function() { + function First() { + this.value = 1; + } + First.prototype.value = 1; + function Second() { + this.value = 1; + } + Second.prototype.value = 2; + + // Basic equality and identity comparisons. + ok(_.isEqual(null, null), "`null` is equal to `null`"); + ok(_.isEqual(), "`undefined` is equal to `undefined`"); + + ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); + ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); + ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); + ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); + + // String object and primitive comparisons. + ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); + ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); + ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); + ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); + + ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); + ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); + ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); + + // Number object and primitive comparisons. + ok(_.isEqual(75, 75), "Identical number primitives are equal"); + ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); + ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); + ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); + ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); + ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); + + ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); + ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); + + // Comparisons involving `NaN`. + ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); + ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); + ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); + ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); + + // Boolean object and primitive comparisons. + ok(_.isEqual(true, true), "Identical boolean primitives are equal"); + ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); + ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); + ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); + ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); + + // Common type coercions. + ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); + ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); + ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); + ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); + ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); + ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); + ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); + ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); + ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); + + // Dates. + ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); + ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); + ok(!_.isEqual(new Date(2009, 11, 13), { + getTime: function(){ + return 12606876e5; + } + }), "Date objects and objects with a `getTime` method are not equal"); + ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); + + // Functions. + ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); + + // RegExps. + ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); + ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); + ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); + ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); + ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); + + // Empty arrays, array-like objects, and object literals. + ok(_.isEqual({}, {}), "Empty object literals are equal"); + ok(_.isEqual([], []), "Empty array literals are equal"); + ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); + ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); + ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); + + ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); + ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); + + // Arrays with primitive and object values. + ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); + ok(_.isEqual([(/Moe/g), new Date(2009, 9, 25)], [(/Moe/g), new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); + + // Multi-dimensional arrays. + var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; + var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; + ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); + + // Overwrite the methods defined in ES 5.1 section 15.4.4. + a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; + b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; + + // Array elements and properties. + ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); + a.push("White Rocks"); + ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); + a.push("East Boulder"); + b.push("Gunbarrel Ranch", "Teller Farm"); + ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); + + // Sparse arrays. + ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); + ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); + + // Simple objects. + ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); + ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); + ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); + ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); + ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); + ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); + ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); + + // `A` contains nested objects and arrays. + a = { + name: new String("Moe Howard"), + age: new Number(77), + stooge: true, + hobbies: ["acting"], + film: { + name: "Sing a Song of Six Pants", + release: new Date(1947, 9, 30), + stars: [new String("Larry Fine"), "Shemp Howard"], + minutes: new Number(16), + seconds: 54 + } + }; + + // `B` contains equivalent nested objects and arrays. + b = { + name: new String("Moe Howard"), + age: new Number(77), + stooge: true, + hobbies: ["acting"], + film: { + name: "Sing a Song of Six Pants", + release: new Date(1947, 9, 30), + stars: [new String("Larry Fine"), "Shemp Howard"], + minutes: new Number(16), + seconds: 54 + } + }; + ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); + + // Instances. + ok(_.isEqual(new First, new First), "Object instances are equal"); + ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); + ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); + ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); + + // Circular Arrays. + (a = []).push(a); + (b = []).push(b); + ok(_.isEqual(a, b), "Arrays containing circular references are equal"); + a.push(new String("Larry")); + b.push(new String("Larry")); + ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); + a.push("Shemp"); + b.push("Curly"); + ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); + + // More circular arrays #767. + a = ["everything is checked but", "this", "is not"]; + a[1] = a; + b = ["everything is checked but", ["this", "array"], "is not"]; + ok(!_.isEqual(a, b), "Comparison of circular references with non-circular references are not equal"); + + // Circular Objects. + a = {abc: null}; + b = {abc: null}; + a.abc = a; + b.abc = b; + ok(_.isEqual(a, b), "Objects containing circular references are equal"); + a.def = 75; + b.def = 75; + ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); + a.def = new Number(75); + b.def = new Number(63); + ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); + + // More circular objects #767. + a = {everything: "is checked", but: "this", is: "not"}; + a.but = a; + b = {everything: "is checked", but: {that:"object"}, is: "not"}; + ok(!_.isEqual(a, b), "Comparison of circular references with non-circular object references are not equal"); + + // Cyclic Structures. + a = [{abc: null}]; + b = [{abc: null}]; + (a[0].abc = a).push(a); + (b[0].abc = b).push(b); + ok(_.isEqual(a, b), "Cyclic structures are equal"); + a[0].def = "Larry"; + b[0].def = "Larry"; + ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); + a[0].def = new String("Larry"); + b[0].def = new String("Curly"); + ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); + + // Complex Circular References. + a = {foo: {b: {foo: {c: {foo: null}}}}}; + b = {foo: {b: {foo: {c: {foo: null}}}}}; + a.foo.b.foo.c.foo = a; + b.foo.b.foo.c.foo = b; + ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); + + // Chaining. + ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); + equal(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); + + // Custom `isEqual` methods. + var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; + var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; + + ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); + ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); + ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); + ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); + + // Objects from another frame. + ok(_.isEqual({}, iObject)); + }); + + test("isEmpty", function() { + ok(!_([1]).isEmpty(), '[1] is not empty'); + ok(_.isEmpty([]), '[] is empty'); + ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); + ok(_.isEmpty({}), '{} is empty'); + ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); + ok(_.isEmpty(null), 'null is empty'); + ok(_.isEmpty(), 'undefined is empty'); + ok(_.isEmpty(''), 'the empty string is empty'); + ok(!_.isEmpty('moe'), 'but other strings are not'); + + var obj = {one : 1}; + delete obj.one; + ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); + }); + + // Setup remote variables for iFrame tests. + var iframe = document.createElement('iframe'); + jQuery(iframe).appendTo(document.body); + var iDoc = iframe.contentDocument || iframe.contentWindow.document; + iDoc.write( + "" + ); + iDoc.close(); + + test("isElement", function() { + ok(!_.isElement('div'), 'strings are not dom elements'); + ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); + ok(_.isElement(iElement), 'even from another frame'); + }); + + test("isArguments", function() { + var args = (function(){ return arguments; })(1, 2, 3); + ok(!_.isArguments('string'), 'a string is not an arguments object'); + ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); + ok(_.isArguments(args), 'but the arguments object is an arguments object'); + ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); + ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); + ok(_.isArguments(iArguments), 'even from another frame'); + }); + + test("isObject", function() { + ok(_.isObject(arguments), 'the arguments object is object'); + ok(_.isObject([1, 2, 3]), 'and arrays'); + ok(_.isObject($('html')[0]), 'and DOM element'); + ok(_.isObject(iElement), 'even from another frame'); + ok(_.isObject(function () {}), 'and functions'); + ok(_.isObject(iFunction), 'even from another frame'); + ok(!_.isObject(null), 'but not null'); + ok(!_.isObject(undefined), 'and not undefined'); + ok(!_.isObject('string'), 'and not string'); + ok(!_.isObject(12), 'and not number'); + ok(!_.isObject(true), 'and not boolean'); + ok(_.isObject(new String('string')), 'but new String()'); + }); + + test("isArray", function() { + ok(!_.isArray(arguments), 'the arguments object is not an array'); + ok(_.isArray([1, 2, 3]), 'but arrays are'); + ok(_.isArray(iArray), 'even from another frame'); + }); + + test("isString", function() { + ok(!_.isString(document.body), 'the document body is not a string'); + ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); + ok(_.isString(iString), 'even from another frame'); + }); + + test("isNumber", function() { + ok(!_.isNumber('string'), 'a string is not a number'); + ok(!_.isNumber(arguments), 'the arguments object is not a number'); + ok(!_.isNumber(undefined), 'undefined is not a number'); + ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); + ok(_.isNumber(NaN), 'NaN *is* a number'); + ok(_.isNumber(Infinity), 'Infinity is a number'); + ok(_.isNumber(iNumber), 'even from another frame'); + ok(!_.isNumber('1'), 'numeric strings are not numbers'); + }); + + test("isBoolean", function() { + ok(!_.isBoolean(2), 'a number is not a boolean'); + ok(!_.isBoolean("string"), 'a string is not a boolean'); + ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); + ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); + ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); + ok(!_.isBoolean(undefined), 'undefined is not a boolean'); + ok(!_.isBoolean(NaN), 'NaN is not a boolean'); + ok(!_.isBoolean(null), 'null is not a boolean'); + ok(_.isBoolean(true), 'but true is'); + ok(_.isBoolean(false), 'and so is false'); + ok(_.isBoolean(iBoolean), 'even from another frame'); + }); + + test("isFunction", function() { + ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); + ok(!_.isFunction('moe'), 'strings are not functions'); + ok(_.isFunction(_.isFunction), 'but functions are'); + ok(_.isFunction(iFunction), 'even from another frame'); + }); + + test("isDate", function() { + ok(!_.isDate(100), 'numbers are not dates'); + ok(!_.isDate({}), 'objects are not dates'); + ok(_.isDate(new Date()), 'but dates are'); + ok(_.isDate(iDate), 'even from another frame'); + }); + + test("isRegExp", function() { + ok(!_.isRegExp(_.identity), 'functions are not RegExps'); + ok(_.isRegExp(/identity/), 'but RegExps are'); + ok(_.isRegExp(iRegExp), 'even from another frame'); + }); + + test("isFinite", function() { + ok(!_.isFinite(undefined), 'undefined is not Finite'); + ok(!_.isFinite(null), 'null is not Finite'); + ok(!_.isFinite(NaN), 'NaN is not Finite'); + ok(!_.isFinite(Infinity), 'Infinity is not Finite'); + ok(!_.isFinite(-Infinity), '-Infinity is not Finite'); + ok(!_.isFinite('12'), 'Strings are not numbers'); + var obj = new Number(5); + ok(_.isFinite(obj), 'Number instances can be finite'); + ok(_.isFinite(0), '0 is Finite'); + ok(_.isFinite(123), 'Ints are Finite'); + ok(_.isFinite(-12.44), 'Floats are Finite'); + }); + + test("isNaN", function() { + ok(!_.isNaN(undefined), 'undefined is not NaN'); + ok(!_.isNaN(null), 'null is not NaN'); + ok(!_.isNaN(0), '0 is not NaN'); + ok(_.isNaN(NaN), 'but NaN is'); + ok(_.isNaN(iNaN), 'even from another frame'); + ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); + }); + + test("isNull", function() { + ok(!_.isNull(undefined), 'undefined is not null'); + ok(!_.isNull(NaN), 'NaN is not null'); + ok(_.isNull(null), 'but null is'); + ok(_.isNull(iNull), 'even from another frame'); + }); + + test("isUndefined", function() { + ok(!_.isUndefined(1), 'numbers are defined'); + ok(!_.isUndefined(null), 'null is defined'); + ok(!_.isUndefined(false), 'false is defined'); + ok(!_.isUndefined(NaN), 'NaN is defined'); + ok(_.isUndefined(), 'nothing is undefined'); + ok(_.isUndefined(undefined), 'undefined is undefined'); + ok(_.isUndefined(iUndefined), 'even from another frame'); + }); + + if (window.ActiveXObject) { + test("IE host objects", function() { + var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); + ok(!_.isNumber(xml)); + ok(!_.isBoolean(xml)); + ok(!_.isNaN(xml)); + ok(!_.isFunction(xml)); + ok(!_.isNull(xml)); + ok(!_.isUndefined(xml)); + }); + } + + test("tap", function() { + var intercepted = null; + var interceptor = function(obj) { intercepted = obj; }; + var returned = _.tap(1, interceptor); + equal(intercepted, 1, "passes tapped object to interceptor"); + equal(returned, 1, "returns tapped object"); + + returned = _([1,2,3]).chain(). + map(function(n){ return n * 2; }). + max(). + tap(interceptor). + value(); + ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js new file mode 100644 index 0000000..05e3f2a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js @@ -0,0 +1,75 @@ +(function() { + + var numbers = []; + for (var i=0; i<1000; i++) numbers.push(i); + var objects = _.map(numbers, function(n){ return {num : n}; }); + var randomized = _.sortBy(numbers, function(){ return Math.random(); }); + var deep = _.map(_.range(100), function() { return _.range(1000); }); + + JSLitmus.test('_.each()', function() { + var timesTwo = []; + _.each(numbers, function(num){ timesTwo.push(num * 2); }); + return timesTwo; + }); + + JSLitmus.test('_(list).each()', function() { + var timesTwo = []; + _(numbers).each(function(num){ timesTwo.push(num * 2); }); + return timesTwo; + }); + + JSLitmus.test('jQuery.each()', function() { + var timesTwo = []; + jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); + return timesTwo; + }); + + JSLitmus.test('_.map()', function() { + return _.map(objects, function(obj){ return obj.num; }); + }); + + JSLitmus.test('jQuery.map()', function() { + return jQuery.map(objects, function(obj){ return obj.num; }); + }); + + JSLitmus.test('_.pluck()', function() { + return _.pluck(objects, 'num'); + }); + + JSLitmus.test('_.uniq()', function() { + return _.uniq(randomized); + }); + + JSLitmus.test('_.uniq() (sorted)', function() { + return _.uniq(numbers, true); + }); + + JSLitmus.test('_.sortBy()', function() { + return _.sortBy(numbers, function(num){ return -num; }); + }); + + JSLitmus.test('_.isEqual()', function() { + return _.isEqual(numbers, randomized); + }); + + JSLitmus.test('_.keys()', function() { + return _.keys(objects); + }); + + JSLitmus.test('_.values()', function() { + return _.values(objects); + }); + + JSLitmus.test('_.intersection()', function() { + return _.intersection(numbers, randomized); + }); + + JSLitmus.test('_.range()', function() { + return _.range(1000); + }); + + JSLitmus.test('_.flatten()', function() { + return _.flatten(deep); + }); + +})(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js new file mode 100644 index 0000000..c9be20a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js @@ -0,0 +1,249 @@ +$(document).ready(function() { + + var templateSettings; + + module("Utility", { + + setup: function() { + templateSettings = _.clone(_.templateSettings); + }, + + teardown: function() { + _.templateSettings = templateSettings; + } + + }); + + test("#750 - Return _ instance.", 2, function() { + var instance = _([]); + ok(_(instance) === instance); + ok(new _(instance) === instance); + }); + + test("identity", function() { + var moe = {name : 'moe'}; + equal(_.identity(moe), moe, 'moe is the same as his identity'); + }); + + test("uniqueId", function() { + var ids = [], i = 0; + while(i++ < 100) ids.push(_.uniqueId()); + equal(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); + }); + + test("times", function() { + var vals = []; + _.times(3, function (i) { vals.push(i); }); + ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); + // + vals = []; + _(3).times(function (i) { vals.push(i); }); + ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); + }); + + test("mixin", function() { + _.mixin({ + myReverse: function(string) { + return string.split('').reverse().join(''); + } + }); + equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); + equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); + }); + + test("_.escape", function() { + equal(_.escape("Curly & Moe"), "Curly & Moe"); + equal(_.escape("Curly & Moe"), "Curly &amp; Moe"); + equal(_.escape(null), ''); + }); + + test("_.unescape", function() { + var string = "Curly & Moe"; + equal(_.unescape("Curly & Moe"), string); + equal(_.unescape("Curly &amp; Moe"), "Curly & Moe"); + equal(_.unescape(null), ''); + equal(_.unescape(_.escape(string)), string); + }); + + test("template", function() { + var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); + var result = basicTemplate({thing : 'This'}); + equal(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); + + var sansSemicolonTemplate = _.template("A <% this %> B"); + equal(sansSemicolonTemplate(), "A B"); + + var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); + equal(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); + + var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); + equal(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); + + var fancyTemplate = _.template("
          <% \ + for (key in people) { \ + %>
        • <%= people[key] %>
        • <% } %>
        "); + result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); + equal(result, "
        • Moe
        • Larry
        • Curly
        ", 'can run arbitrary javascript in templates'); + + var escapedCharsInJavascriptTemplate = _.template("
          <% _.each(numbers.split('\\n'), function(item) { %>
        • <%= item %>
        • <% }) %>
        "); + result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); + equal(result, "
        • one
        • two
        • three
        • four
        ", 'Can use escaped characters (e.g. \\n) in Javascript'); + + var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
        \">
        <% }); %>"); + result = namespaceCollisionTemplate({ + pageCount: 3, + thumbnails: { + 1: "p1-thumbnail.gif", + 2: "p2-thumbnail.gif", + 3: "p3-thumbnail.gif" + } + }); + equal(result, "3 p3-thumbnail.gif
        "); + + var noInterpolateTemplate = _.template("

        Just some text. Hey, I know this is silly but it aids consistency.

        "); + result = noInterpolateTemplate(); + equal(result, "

        Just some text. Hey, I know this is silly but it aids consistency.

        "); + + var quoteTemplate = _.template("It's its, not it's"); + equal(quoteTemplate({}), "It's its, not it's"); + + var quoteInStatementAndBody = _.template("<%\ + if(foo == 'bar'){ \ + %>Statement quotes and 'quotes'.<% } %>"); + equal(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); + + var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); + equal(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); + + var template = _.template("<%- value %>"); + var result = template({value: " + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js new file mode 100644 index 0000000..2cf0ca5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js @@ -0,0 +1 @@ +module.exports = require('./underscore'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json new file mode 100644 index 0000000..014ab26 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json @@ -0,0 +1,35 @@ +{ + "name": "underscore", + "description": "JavaScript's functional programming helper library.", + "homepage": "http://underscorejs.org", + "keywords": [ + "util", + "functional", + "server", + "client", + "browser" + ], + "author": { + "name": "Jeremy Ashkenas", + "email": "jeremy@documentcloud.org" + }, + "repository": { + "type": "git", + "url": "git://github.com/documentcloud/underscore.git" + }, + "main": "underscore.js", + "version": "1.4.4", + "devDependencies": { + "phantomjs": "0.2.2" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" + }, + "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/documentcloud/underscore/issues" + }, + "_id": "underscore@1.4.4", + "_from": "underscore@~1.4.3" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js new file mode 100644 index 0000000..c1d9d3a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js @@ -0,0 +1 @@ +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js new file mode 100644 index 0000000..a12f0d9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js @@ -0,0 +1,1226 @@ +// Underscore.js 1.4.4 +// http://underscorejs.org +// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `global` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Establish the object that gets returned to break out of a loop iteration. + var breaker = {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeForEach = ArrayProto.forEach, + nativeMap = ArrayProto.map, + nativeReduce = ArrayProto.reduce, + nativeReduceRight = ArrayProto.reduceRight, + nativeFilter = ArrayProto.filter, + nativeEvery = ArrayProto.every, + nativeSome = ArrayProto.some, + nativeIndexOf = ArrayProto.indexOf, + nativeLastIndexOf = ArrayProto.lastIndexOf, + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object via a string identifier, + // for Closure Compiler "advanced" mode. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.4.4'; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles objects with the built-in `forEach`, arrays, and raw objects. + // Delegates to **ECMAScript 5**'s native `forEach` if available. + var each = _.each = _.forEach = function(obj, iterator, context) { + if (obj == null) return; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + for (var key in obj) { + if (_.has(obj, key)) { + if (iterator.call(context, obj[key], key, obj) === breaker) return; + } + } + } + }; + + // Return the results of applying the iterator to each element. + // Delegates to **ECMAScript 5**'s native `map` if available. + _.map = _.collect = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); + each(obj, function(value, index, list) { + results[results.length] = iterator.call(context, value, index, list); + }); + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. + _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduce && obj.reduce === nativeReduce) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + } + each(obj, function(value, index, list) { + if (!initial) { + memo = value; + initial = true; + } else { + memo = iterator.call(context, memo, value, index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. + _.reduceRight = _.foldr = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + } + var length = obj.length; + if (length !== +length) { + var keys = _.keys(obj); + length = keys.length; + } + each(obj, function(value, index, list) { + index = keys ? keys[--length] : --length; + if (!initial) { + memo = obj[index]; + initial = true; + } else { + memo = iterator.call(context, memo, obj[index], index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, iterator, context) { + var result; + any(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Delegates to **ECMAScript 5**'s native `filter` if available. + // Aliased as `select`. + _.filter = _.select = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); + each(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) results[results.length] = value; + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, iterator, context) { + return _.filter(obj, function(value, index, list) { + return !iterator.call(context, value, index, list); + }, context); + }; + + // Determine whether all of the elements match a truth test. + // Delegates to **ECMAScript 5**'s native `every` if available. + // Aliased as `all`. + _.every = _.all = function(obj, iterator, context) { + iterator || (iterator = _.identity); + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); + each(obj, function(value, index, list) { + if (!(result = result && iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if at least one element in the object matches a truth test. + // Delegates to **ECMAScript 5**'s native `some` if available. + // Aliased as `any`. + var any = _.some = _.any = function(obj, iterator, context) { + iterator || (iterator = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); + each(obj, function(value, index, list) { + if (result || (result = iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; + return any(obj, function(value) { + return value === target; + }); + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + return (isFunc ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, function(value){ return value[key]; }); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs, first) { + if (_.isEmpty(attrs)) return first ? null : []; + return _[first ? 'find' : 'filter'](obj, function(value) { + for (var key in attrs) { + if (attrs[key] !== value[key]) return false; + } + return true; + }); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.where(obj, attrs, true); + }; + + // Return the maximum element or (element-based computation). + // Can't optimize arrays of integers longer than 65,535 elements. + // See: https://bugs.webkit.org/show_bug.cgi?id=80797 + _.max = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.max.apply(Math, obj); + } + if (!iterator && _.isEmpty(obj)) return -Infinity; + var result = {computed : -Infinity, value: -Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed >= result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.min.apply(Math, obj); + } + if (!iterator && _.isEmpty(obj)) return Infinity; + var result = {computed : Infinity, value: Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed < result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Shuffle an array. + _.shuffle = function(obj) { + var rand; + var index = 0; + var shuffled = []; + each(obj, function(value) { + rand = _.random(index++); + shuffled[index - 1] = shuffled[rand]; + shuffled[rand] = value; + }); + return shuffled; + }; + + // An internal function to generate lookup iterators. + var lookupIterator = function(value) { + return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, value, context) { + var iterator = lookupIterator(value); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value : value, + index : index, + criteria : iterator.call(context, value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index < right.index ? -1 : 1; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(obj, value, context, behavior) { + var result = {}; + var iterator = lookupIterator(value || _.identity); + each(obj, function(value, index) { + var key = iterator.call(context, value, index, obj); + behavior(result, key, value); + }); + return result; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = function(obj, value, context) { + return group(obj, value, context, function(result, key, value) { + (_.has(result, key) ? result[key] : (result[key] = [])).push(value); + }); + }; + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = function(obj, value, context) { + return group(obj, value, context, function(result, key) { + if (!_.has(result, key)) result[key] = 0; + result[key]++; + }); + }; + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iterator, context) { + iterator = iterator == null ? _.identity : lookupIterator(iterator); + var value = iterator.call(context, obj); + var low = 0, high = array.length; + while (low < high) { + var mid = (low + high) >>> 1; + iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + } + return low; + }; + + // Safely convert anything iterable into a real, live array. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if ((n != null) && !guard) { + return slice.call(array, Math.max(array.length - n, 0)); + } else { + return array[array.length - 1]; + } + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, (n == null) || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, output) { + each(input, function(value) { + if (_.isArray(value)) { + shallow ? push.apply(output, value) : flatten(value, shallow, output); + } else { + output.push(value); + } + }); + return output; + }; + + // Return a completely flattened version of an array. + _.flatten = function(array, shallow) { + return flatten(array, shallow, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iterator, context) { + if (_.isFunction(isSorted)) { + context = iterator; + iterator = isSorted; + isSorted = false; + } + var initial = iterator ? _.map(array, iterator, context) : array; + var results = []; + var seen = []; + each(initial, function(value, index) { + if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { + seen.push(value); + results.push(array[index]); + } + }); + return results; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(concat.apply(ArrayProto, arguments)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var rest = slice.call(arguments, 1); + return _.filter(_.uniq(array), function(item) { + return _.every(rest, function(other) { + return _.indexOf(other, item) >= 0; + }); + }); + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); + return _.filter(array, function(value){ return !_.contains(rest, value); }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + var args = slice.call(arguments); + var length = _.max(_.pluck(args, 'length')); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(args, "" + i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, l = list.length; i < l; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), + // we need this function. Return the position of the first occurrence of an + // item in an array, or -1 if the item is not included in the array. + // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, l = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); + for (; i < l; i++) if (array[i] === item) return i; + return -1; + }; + + // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var hasIndex = from != null; + if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { + return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + } + var i = (hasIndex ? from : array.length); + while (i--) if (array[i] === item) return i; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = arguments[2] || 1; + + var len = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(len); + + while(idx < len) { + range[idx++] = start; + start += step; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + var args = slice.call(arguments, 2); + return function() { + return func.apply(context, args.concat(slice.call(arguments))); + }; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. + _.partial = function(func) { + var args = slice.call(arguments, 1); + return function() { + return func.apply(this, args.concat(slice.call(arguments))); + }; + }; + + // Bind all of an object's methods to that object. Useful for ensuring that + // all callbacks defined on an object belong to it. + _.bindAll = function(obj) { + var funcs = slice.call(arguments, 1); + if (funcs.length === 0) funcs = _.functions(obj); + each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memo = {}; + hasher || (hasher = _.identity); + return function() { + var key = hasher.apply(this, arguments); + return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + }; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ return func.apply(null, args); }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. + _.throttle = function(func, wait) { + var context, args, timeout, result; + var previous = 0; + var later = function() { + previous = new Date; + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) result = func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) result = func.apply(context, args); + return result; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = function(func) { + var ran = false, memo; + return function() { + if (ran) return memo; + ran = true; + memo = func.apply(this, arguments); + func = null; + return memo; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return function() { + var args = [func]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var funcs = arguments; + return function() { + var args = arguments; + for (var i = funcs.length - 1; i >= 0; i--) { + args = [funcs[i].apply(this, args)]; + } + return args[0]; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + if (times <= 0) return func(); + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = nativeKeys || function(obj) { + if (obj !== Object(obj)) throw new TypeError('Invalid object'); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var values = []; + for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var pairs = []; + for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + each(keys, function(key) { + if (key in obj) copy[key] = obj[key]; + }); + return copy; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + for (var key in obj) { + if (!_.contains(keys, key)) copy[key] = obj[key]; + } + return copy; + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + if (obj[prop] == null) obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. + if (a === b) return a !== 0 || 1 / a == 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className != toString.call(b)) return false; + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) return bStack[length] == b; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0, result = true; + // Recursively compare objects and arrays. + if (className == '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size == b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor))) { + return false; + } + // Deep compare objects. + for (var key in a) { + if (_.has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (_.has(b, key) && !(size--)) break; + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) == '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + return obj === Object(obj); + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) == '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return !!(obj && _.has(obj, 'callee')); + }; + } + + // Optimize `isFunction` if appropriate. + if (typeof (/./) !== 'function') { + _.isFunction = function(obj) { + return typeof obj === 'function'; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj != +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iterators. + _.identity = function(value) { + return value; + }; + + // Run a function **n** times. + _.times = function(n, iterator, context) { + var accum = Array(n); + for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // List of HTML entities for escaping. + var entityMap = { + escape: { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '/': '/' + } + }; + entityMap.unescape = _.invert(entityMap.escape); + + // Regexes containing the keys and values listed immediately above. + var entityRegexes = { + escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), + unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + }; + + // Functions for escaping and unescaping strings to/from HTML interpolation. + _.each(['escape', 'unescape'], function(method) { + _[method] = function(string) { + if (string == null) return ''; + return ('' + string).replace(entityRegexes[method], function(match) { + return entityMap[method][match]; + }); + }; + }); + + // If the value of the named property is a function then invoke it; + // otherwise, return it. + _.result = function(object, property) { + if (object == null) return null; + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + each(_.functions(obj), function(name){ + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + var render; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset) + .replace(escaper, function(match) { return '\\' + escapes[match]; }); + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + index = offset + match.length; + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + "return __p;\n"; + + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function, which will delegate to the wrapper. + _.chain = function(obj) { + return _(obj).chain(); + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + _.extend(_.prototype, { + + // Start chaining a wrapped Underscore object. + chain: function() { + this._chain = true; + return this; + }, + + // Extracts the result from a wrapped and chained object. + value: function() { + return this._wrapped; + } + + }); + +}).call(this); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json new file mode 100644 index 0000000..09382f8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json @@ -0,0 +1,50 @@ +{ + "name": "argparse", + "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", + "version": "0.1.15", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "homepage": "https://github.com/nodeca/argparse", + "contributors": [ + { + "name": "Eugene Shkuropat" + }, + { + "name": "Paul Jacobson" + } + ], + "bugs": { + "url": "https://github.com/nodeca/argparse/issues" + }, + "license": { + "type": "MIT", + "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodeca/argparse.git" + }, + "main": "./index.js", + "scripts": { + "test": "make test" + }, + "dependencies": { + "underscore": "~1.4.3", + "underscore.string": "~2.3.1" + }, + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">= 0.6.0" + }, + "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", + "readmeFilename": "README.md", + "_id": "argparse@0.1.15", + "_from": "argparse@~ 0.1.11" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md new file mode 100644 index 0000000..a74bd12 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md @@ -0,0 +1,73 @@ +**Esprima** ([esprima.org](http://esprima.org)) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/ariya/esprima/contributors). + +Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as +[Node.js](http://nodejs.org). + +### Features + +- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262) +- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla +[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) +- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage) +- Optional tracking of syntax node location (index-based and line-column) +- Experimental support for ES6/Harmony (module, class, destructuring, ...) + +Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)). +It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html) +with the new generation of fast parsers. + +### Applications + +Esprima serves as the basis for many popular JavaScript development tools: + +- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul) +- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck) +- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS), +[Sweet.js](http://sweetjs.org/) (macro) +- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr) +- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html)) +- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter), +- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen) + +### Questions? +- [Documentation](http://esprima.org/doc) +- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect) +and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement) +- [Mailing list](http://groups.google.com/group/esprima) +- [Contribution guide](http://esprima.org/doc/index.html#contribution) + +Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the +development updates. +Feedback and contribution are welcomed! + +### License + +Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) + and other contributors. + +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. + +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 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. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js new file mode 100755 index 0000000..3e7bb81 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js @@ -0,0 +1,117 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } +}); + +if (typeof fname !== 'string') { + console.log('Error: no input file.'); + process.exit(1); +} + +try { + content = fs.readFileSync(fname, 'utf-8'); + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, null, 4)); +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js new file mode 100755 index 0000000..e0af3f7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,177 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ + +var fs, esprima, options, fnames, count; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else { + fnames.push(entry); + } +}); + +if (fnames.length === 0) { + console.log('Error: no input file.'); + process.exit(1); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; +fnames.forEach(function (fname) { + var content, timestamp, syntax, name; + try { + content = fs.readFileSync(fname, 'utf-8'); + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log('Error: ' + e.message); + } + } +}); + +if (options.format === 'junit') { + console.log(''); +} + +if (count > 0) { + process.exit(1); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js new file mode 100644 index 0000000..f1320da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js @@ -0,0 +1,3908 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Mathias Bynens + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Kris Kowal + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint bitwise:true plusplus:true */ +/*global esprima:true, define:true, exports:true, window: true, +throwError: true, createLiteral: true, generateStatement: true, +parseAssignmentExpression: true, parseBlock: true, parseExpression: true, +parseFunctionDeclaration: true, parseFunctionExpression: true, +parseFunctionSourceElements: true, parseVariableIdentifier: true, +parseLeftHandSideExpression: true, +parseStatement: true, parseSourceElement: true */ + +(function (root, factory) { + 'use strict'; + + // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, + // Rhino, and plain browser loading. + if (typeof define === 'function' && define.amd) { + define(['exports'], factory); + } else if (typeof exports !== 'undefined') { + factory(exports); + } else { + factory((root.esprima = {})); + } +}(this, function (exports) { + 'use strict'; + + var Token, + TokenName, + Syntax, + PropertyKind, + Messages, + Regex, + source, + strict, + index, + lineNumber, + lineStart, + length, + buffer, + state, + extra; + + Token = { + BooleanLiteral: 1, + EOF: 2, + Identifier: 3, + Keyword: 4, + NullLiteral: 5, + NumericLiteral: 6, + Punctuator: 7, + StringLiteral: 8 + }; + + TokenName = {}; + TokenName[Token.BooleanLiteral] = 'Boolean'; + TokenName[Token.EOF] = ''; + TokenName[Token.Identifier] = 'Identifier'; + TokenName[Token.Keyword] = 'Keyword'; + TokenName[Token.NullLiteral] = 'Null'; + TokenName[Token.NumericLiteral] = 'Numeric'; + TokenName[Token.Punctuator] = 'Punctuator'; + TokenName[Token.StringLiteral] = 'String'; + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + }; + + PropertyKind = { + Data: 1, + Get: 2, + Set: 4 + }; + + // Error messages should be identical to V8. + Messages = { + UnexpectedToken: 'Unexpected token %0', + UnexpectedNumber: 'Unexpected number', + UnexpectedString: 'Unexpected string', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedEOS: 'Unexpected end of input', + NewlineAfterThrow: 'Illegal newline after throw', + InvalidRegExp: 'Invalid regular expression', + UnterminatedRegExp: 'Invalid regular expression: missing /', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NoCatchOrFinally: 'Missing catch or finally after try', + UnknownLabel: 'Undefined label \'%0\'', + Redeclaration: '%0 \'%1\' has already been declared', + IllegalContinue: 'Illegal continue statement', + IllegalBreak: 'Illegal break statement', + IllegalReturn: 'Illegal return statement', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', + AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', + AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode' + }; + + // See also tools/generate-unicode-regex.py. + Regex = { + NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), + NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') + }; + + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + + function assert(condition, message) { + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + + function sliceSource(from, to) { + return source.slice(from, to); + } + + if (typeof 'esprima'[0] === 'undefined') { + sliceSource = function sliceArraySource(from, to) { + return source.slice(from, to).join(''); + }; + } + + function isDecimalDigit(ch) { + return '0123456789'.indexOf(ch) >= 0; + } + + function isHexDigit(ch) { + return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; + } + + function isOctalDigit(ch) { + return '01234567'.indexOf(ch) >= 0; + } + + + // 7.2 White Space + + function isWhiteSpace(ch) { + return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || + (ch === '\u000C') || (ch === '\u00A0') || + (ch.charCodeAt(0) >= 0x1680 && + '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); + } + + // 7.6 Identifier Names and Identifiers + + function isIdentifierStart(ch) { + return (ch === '$') || (ch === '_') || (ch === '\\') || + (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); + } + + function isIdentifierPart(ch) { + return (ch === '$') || (ch === '_') || (ch === '\\') || + (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + ((ch >= '0') && (ch <= '9')) || + ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); + } + + // 7.6.1.2 Future Reserved Words + + function isFutureReservedWord(id) { + switch (id) { + + // Future reserved words. + case 'class': + case 'enum': + case 'export': + case 'extends': + case 'import': + case 'super': + return true; + } + + return false; + } + + function isStrictModeReservedWord(id) { + switch (id) { + + // Strict Mode reserved words. + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'yield': + case 'let': + return true; + } + + return false; + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + // 7.6.1.1 Keywords + + function isKeyword(id) { + var keyword = false; + switch (id.length) { + case 2: + keyword = (id === 'if') || (id === 'in') || (id === 'do'); + break; + case 3: + keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); + break; + case 4: + keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); + break; + case 5: + keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); + break; + case 6: + keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); + break; + case 7: + keyword = (id === 'default') || (id === 'finally'); + break; + case 8: + keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); + break; + case 10: + keyword = (id === 'instanceof'); + break; + } + + if (keyword) { + return true; + } + + switch (id) { + // Future reserved words. + // 'const' is specialized as Keyword in V8. + case 'const': + return true; + + // For compatiblity to SpiderMonkey and ES.next + case 'yield': + case 'let': + return true; + } + + if (strict && isStrictModeReservedWord(id)) { + return true; + } + + return isFutureReservedWord(id); + } + + // 7.4 Comments + + function skipComment() { + var ch, blockComment, lineComment; + + blockComment = false; + lineComment = false; + + while (index < length) { + ch = source[index]; + + if (lineComment) { + ch = source[index++]; + if (isLineTerminator(ch)) { + lineComment = false; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } + } else if (blockComment) { + if (isLineTerminator(ch)) { + if (ch === '\r' && source[index + 1] === '\n') { + ++index; + } + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + ch = source[index++]; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + if (ch === '*') { + ch = source[index]; + if (ch === '/') { + ++index; + blockComment = false; + } + } + } + } else if (ch === '/') { + ch = source[index + 1]; + if (ch === '/') { + index += 2; + lineComment = true; + } else if (ch === '*') { + index += 2; + blockComment = true; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + break; + } + } else if (isWhiteSpace(ch)) { + ++index; + } else if (isLineTerminator(ch)) { + ++index; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } else { + break; + } + } + } + + function scanHexEscape(prefix) { + var i, len, ch, code = 0; + + len = (prefix === 'u') ? 4 : 2; + for (i = 0; i < len; ++i) { + if (index < length && isHexDigit(source[index])) { + ch = source[index++]; + code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); + } else { + return ''; + } + } + return String.fromCharCode(code); + } + + function scanIdentifier() { + var ch, start, id, restore; + + ch = source[index]; + if (!isIdentifierStart(ch)) { + return; + } + + start = index; + if (ch === '\\') { + ++index; + if (source[index] !== 'u') { + return; + } + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + if (ch === '\\' || !isIdentifierStart(ch)) { + return; + } + id = ch; + } else { + index = restore; + id = 'u'; + } + } else { + id = source[index++]; + } + + while (index < length) { + ch = source[index]; + if (!isIdentifierPart(ch)) { + break; + } + if (ch === '\\') { + ++index; + if (source[index] !== 'u') { + return; + } + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + if (ch === '\\' || !isIdentifierPart(ch)) { + return; + } + id += ch; + } else { + index = restore; + id += 'u'; + } + } else { + id += source[index++]; + } + } + + // There is no keyword or literal with only one character. + // Thus, it must be an identifier. + if (id.length === 1) { + return { + type: Token.Identifier, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (isKeyword(id)) { + return { + type: Token.Keyword, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.1 Null Literals + + if (id === 'null') { + return { + type: Token.NullLiteral, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.2 Boolean Literals + + if (id === 'true' || id === 'false') { + return { + type: Token.BooleanLiteral, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + return { + type: Token.Identifier, + value: id, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.7 Punctuators + + function scanPunctuator() { + var start = index, + ch1 = source[index], + ch2, + ch3, + ch4; + + // Check for most common single-character punctuators. + + if (ch1 === ';' || ch1 === '{' || ch1 === '}') { + ++index; + return { + type: Token.Punctuator, + value: ch1, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === ',' || ch1 === '(' || ch1 === ')') { + ++index; + return { + type: Token.Punctuator, + value: ch1, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // Dot (.) can also start a floating-point number, hence the need + // to check the next character. + + ch2 = source[index + 1]; + if (ch1 === '.' && !isDecimalDigit(ch2)) { + return { + type: Token.Punctuator, + value: source[index++], + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // Peek more characters. + + ch3 = source[index + 2]; + ch4 = source[index + 3]; + + // 4-character punctuator: >>>= + + if (ch1 === '>' && ch2 === '>' && ch3 === '>') { + if (ch4 === '=') { + index += 4; + return { + type: Token.Punctuator, + value: '>>>=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // 3-character punctuators: === !== >>> <<= >>= + + if (ch1 === '=' && ch2 === '=' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '===', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '!' && ch2 === '=' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '!==', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '>' && ch2 === '>' && ch3 === '>') { + index += 3; + return { + type: Token.Punctuator, + value: '>>>', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '<' && ch2 === '<' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '<<=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + if (ch1 === '>' && ch2 === '>' && ch3 === '=') { + index += 3; + return { + type: Token.Punctuator, + value: '>>=', + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 2-character punctuators: <= >= == != ++ -- << >> && || + // += -= *= %= &= |= ^= /= + + if (ch2 === '=') { + if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { + index += 2; + return { + type: Token.Punctuator, + value: ch1 + ch2, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { + if ('+-<>&|'.indexOf(ch2) >= 0) { + index += 2; + return { + type: Token.Punctuator, + value: ch1 + ch2, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // The remaining 1-character punctuators. + + if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { + return { + type: Token.Punctuator, + value: source[index++], + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + } + + // 7.8.3 Numeric Literals + + function scanNumericLiteral() { + var number, start, ch; + + ch = source[index]; + assert(isDecimalDigit(ch) || (ch === '.'), + 'Numeric literal must start with a decimal digit or a decimal point'); + + start = index; + number = ''; + if (ch !== '.') { + number = source[index++]; + ch = source[index]; + + // Hex number starts with '0x'. + // Octal number starts with '0'. + if (number === '0') { + if (ch === 'x' || ch === 'X') { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isHexDigit(ch)) { + break; + } + number += source[index++]; + } + + if (number.length <= 2) { + // only 0x + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + return { + type: Token.NumericLiteral, + value: parseInt(number, 16), + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } else if (isOctalDigit(ch)) { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isOctalDigit(ch)) { + break; + } + number += source[index++]; + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch) || isDecimalDigit(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + return { + type: Token.NumericLiteral, + value: parseInt(number, 8), + octal: true, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // decimal number starts with '0' such as '09' is illegal. + if (isDecimalDigit(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } + + if (ch === '.') { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } + + if (ch === 'e' || ch === 'E') { + number += source[index++]; + + ch = source[index]; + if (ch === '+' || ch === '-') { + number += source[index++]; + } + + ch = source[index]; + if (isDecimalDigit(ch)) { + number += source[index++]; + while (index < length) { + ch = source[index]; + if (!isDecimalDigit(ch)) { + break; + } + number += source[index++]; + } + } else { + ch = 'character ' + ch; + if (index >= length) { + ch = ''; + } + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + if (index < length) { + ch = source[index]; + if (isIdentifierStart(ch)) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } + + return { + type: Token.NumericLiteral, + value: parseFloat(number), + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + // 7.8.4 String Literals + + function scanStringLiteral() { + var str = '', quote, start, ch, code, unescaped, restore, octal = false; + + quote = source[index]; + assert((quote === '\'' || quote === '"'), + 'String literal must starts with a quote'); + + start = index; + ++index; + + while (index < length) { + ch = source[index++]; + + if (ch === quote) { + quote = ''; + break; + } else if (ch === '\\') { + ch = source[index++]; + if (!isLineTerminator(ch)) { + switch (ch) { + case 'n': + str += '\n'; + break; + case 'r': + str += '\r'; + break; + case 't': + str += '\t'; + break; + case 'u': + case 'x': + restore = index; + unescaped = scanHexEscape(ch); + if (unescaped) { + str += unescaped; + } else { + index = restore; + str += ch; + } + break; + case 'b': + str += '\b'; + break; + case 'f': + str += '\f'; + break; + case 'v': + str += '\x0B'; + break; + + default: + if (isOctalDigit(ch)) { + code = '01234567'.indexOf(ch); + + // \0 is not octal escape sequence + if (code !== 0) { + octal = true; + } + + if (index < length && isOctalDigit(source[index])) { + octal = true; + code = code * 8 + '01234567'.indexOf(source[index++]); + + // 3 digits are only allowed when string starts + // with 0, 1, 2, 3 + if ('0123'.indexOf(ch) >= 0 && + index < length && + isOctalDigit(source[index])) { + code = code * 8 + '01234567'.indexOf(source[index++]); + } + } + str += String.fromCharCode(code); + } else { + str += ch; + } + break; + } + } else { + ++lineNumber; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + } + } else if (isLineTerminator(ch)) { + break; + } else { + str += ch; + } + } + + if (quote !== '') { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + return { + type: Token.StringLiteral, + value: str, + octal: octal, + lineNumber: lineNumber, + lineStart: lineStart, + range: [start, index] + }; + } + + function scanRegExp() { + var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; + + buffer = null; + skipComment(); + + start = index; + ch = source[index]; + assert(ch === '/', 'Regular expression literal must start with a slash'); + str = source[index++]; + + while (index < length) { + ch = source[index++]; + str += ch; + if (ch === '\\') { + ch = source[index++]; + // ECMA-262 7.8.5 + if (isLineTerminator(ch)) { + throwError({}, Messages.UnterminatedRegExp); + } + str += ch; + } else if (classMarker) { + if (ch === ']') { + classMarker = false; + } + } else { + if (ch === '/') { + terminated = true; + break; + } else if (ch === '[') { + classMarker = true; + } else if (isLineTerminator(ch)) { + throwError({}, Messages.UnterminatedRegExp); + } + } + } + + if (!terminated) { + throwError({}, Messages.UnterminatedRegExp); + } + + // Exclude leading and trailing slash. + pattern = str.substr(1, str.length - 2); + + flags = ''; + while (index < length) { + ch = source[index]; + if (!isIdentifierPart(ch)) { + break; + } + + ++index; + if (ch === '\\' && index < length) { + ch = source[index]; + if (ch === 'u') { + ++index; + restore = index; + ch = scanHexEscape('u'); + if (ch) { + flags += ch; + str += '\\u'; + for (; restore < index; ++restore) { + str += source[restore]; + } + } else { + index = restore; + flags += 'u'; + str += '\\u'; + } + } else { + str += '\\'; + } + } else { + flags += ch; + str += ch; + } + } + + try { + value = new RegExp(pattern, flags); + } catch (e) { + throwError({}, Messages.InvalidRegExp); + } + + return { + literal: str, + value: value, + range: [start, index] + }; + } + + function isIdentifierName(token) { + return token.type === Token.Identifier || + token.type === Token.Keyword || + token.type === Token.BooleanLiteral || + token.type === Token.NullLiteral; + } + + function advance() { + var ch, token; + + skipComment(); + + if (index >= length) { + return { + type: Token.EOF, + lineNumber: lineNumber, + lineStart: lineStart, + range: [index, index] + }; + } + + token = scanPunctuator(); + if (typeof token !== 'undefined') { + return token; + } + + ch = source[index]; + + if (ch === '\'' || ch === '"') { + return scanStringLiteral(); + } + + if (ch === '.' || isDecimalDigit(ch)) { + return scanNumericLiteral(); + } + + token = scanIdentifier(); + if (typeof token !== 'undefined') { + return token; + } + + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + + function lex() { + var token; + + if (buffer) { + index = buffer.range[1]; + lineNumber = buffer.lineNumber; + lineStart = buffer.lineStart; + token = buffer; + buffer = null; + return token; + } + + buffer = null; + return advance(); + } + + function lookahead() { + var pos, line, start; + + if (buffer !== null) { + return buffer; + } + + pos = index; + line = lineNumber; + start = lineStart; + buffer = advance(); + index = pos; + lineNumber = line; + lineStart = start; + + return buffer; + } + + // Return true if there is a line terminator before the next token. + + function peekLineTerminator() { + var pos, line, start, found; + + pos = index; + line = lineNumber; + start = lineStart; + skipComment(); + found = lineNumber !== line; + index = pos; + lineNumber = line; + lineStart = start; + + return found; + } + + // Throw an exception + + function throwError(token, messageFormat) { + var error, + args = Array.prototype.slice.call(arguments, 2), + msg = messageFormat.replace( + /%(\d)/g, + function (whole, index) { + return args[index] || ''; + } + ); + + if (typeof token.lineNumber === 'number') { + error = new Error('Line ' + token.lineNumber + ': ' + msg); + error.index = token.range[0]; + error.lineNumber = token.lineNumber; + error.column = token.range[0] - lineStart + 1; + } else { + error = new Error('Line ' + lineNumber + ': ' + msg); + error.index = index; + error.lineNumber = lineNumber; + error.column = index - lineStart + 1; + } + + throw error; + } + + function throwErrorTolerant() { + try { + throwError.apply(null, arguments); + } catch (e) { + if (extra.errors) { + extra.errors.push(e); + } else { + throw e; + } + } + } + + + // Throw an exception because of the token. + + function throwUnexpected(token) { + if (token.type === Token.EOF) { + throwError(token, Messages.UnexpectedEOS); + } + + if (token.type === Token.NumericLiteral) { + throwError(token, Messages.UnexpectedNumber); + } + + if (token.type === Token.StringLiteral) { + throwError(token, Messages.UnexpectedString); + } + + if (token.type === Token.Identifier) { + throwError(token, Messages.UnexpectedIdentifier); + } + + if (token.type === Token.Keyword) { + if (isFutureReservedWord(token.value)) { + throwError(token, Messages.UnexpectedReserved); + } else if (strict && isStrictModeReservedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictReservedWord); + return; + } + throwError(token, Messages.UnexpectedToken, token.value); + } + + // BooleanLiteral, NullLiteral, or Punctuator. + throwError(token, Messages.UnexpectedToken, token.value); + } + + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + + function expect(value) { + var token = lex(); + if (token.type !== Token.Punctuator || token.value !== value) { + throwUnexpected(token); + } + } + + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + + function expectKeyword(keyword) { + var token = lex(); + if (token.type !== Token.Keyword || token.value !== keyword) { + throwUnexpected(token); + } + } + + // Return true if the next token matches the specified punctuator. + + function match(value) { + var token = lookahead(); + return token.type === Token.Punctuator && token.value === value; + } + + // Return true if the next token matches the specified keyword + + function matchKeyword(keyword) { + var token = lookahead(); + return token.type === Token.Keyword && token.value === keyword; + } + + // Return true if the next token is an assignment operator + + function matchAssign() { + var token = lookahead(), + op = token.value; + + if (token.type !== Token.Punctuator) { + return false; + } + return op === '=' || + op === '*=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + } + + function consumeSemicolon() { + var token, line; + + // Catch the very common case first. + if (source[index] === ';') { + lex(); + return; + } + + line = lineNumber; + skipComment(); + if (lineNumber !== line) { + return; + } + + if (match(';')) { + lex(); + return; + } + + token = lookahead(); + if (token.type !== Token.EOF && !match('}')) { + throwUnexpected(token); + } + } + + // Return true if provided expression is LeftHandSideExpression + + function isLeftHandSide(expr) { + return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; + } + + // 11.1.4 Array Initialiser + + function parseArrayInitialiser() { + var elements = []; + + expect('['); + + while (!match(']')) { + if (match(',')) { + lex(); + elements.push(null); + } else { + elements.push(parseAssignmentExpression()); + + if (!match(']')) { + expect(','); + } + } + } + + expect(']'); + + return { + type: Syntax.ArrayExpression, + elements: elements + }; + } + + // 11.1.5 Object Initialiser + + function parsePropertyFunction(param, first) { + var previousStrict, body; + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (first && strict && isRestrictedWord(param[0].name)) { + throwErrorTolerant(first, Messages.StrictParamName); + } + strict = previousStrict; + + return { + type: Syntax.FunctionExpression, + id: null, + params: param, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + function parseObjectPropertyKey() { + var token = lex(); + + // Note: This function is called only from parseObjectProperty(), where + // EOF and Punctuator tokens are already filtered out. + + if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { + if (strict && token.octal) { + throwErrorTolerant(token, Messages.StrictOctalLiteral); + } + return createLiteral(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseObjectProperty() { + var token, key, id, param; + + token = lookahead(); + + if (token.type === Token.Identifier) { + + id = parseObjectPropertyKey(); + + // Property Assignment: Getter and Setter. + + if (token.value === 'get' && !match(':')) { + key = parseObjectPropertyKey(); + expect('('); + expect(')'); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction([]), + kind: 'get' + }; + } else if (token.value === 'set' && !match(':')) { + key = parseObjectPropertyKey(); + expect('('); + token = lookahead(); + if (token.type !== Token.Identifier) { + expect(')'); + throwErrorTolerant(token, Messages.UnexpectedToken, token.value); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction([]), + kind: 'set' + }; + } else { + param = [ parseVariableIdentifier() ]; + expect(')'); + return { + type: Syntax.Property, + key: key, + value: parsePropertyFunction(param, token), + kind: 'set' + }; + } + } else { + expect(':'); + return { + type: Syntax.Property, + key: id, + value: parseAssignmentExpression(), + kind: 'init' + }; + } + } else if (token.type === Token.EOF || token.type === Token.Punctuator) { + throwUnexpected(token); + } else { + key = parseObjectPropertyKey(); + expect(':'); + return { + type: Syntax.Property, + key: key, + value: parseAssignmentExpression(), + kind: 'init' + }; + } + } + + function parseObjectInitialiser() { + var properties = [], property, name, kind, map = {}, toString = String; + + expect('{'); + + while (!match('}')) { + property = parseObjectProperty(); + + if (property.key.type === Syntax.Identifier) { + name = property.key.name; + } else { + name = toString(property.key.value); + } + kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; + if (Object.prototype.hasOwnProperty.call(map, name)) { + if (map[name] === PropertyKind.Data) { + if (strict && kind === PropertyKind.Data) { + throwErrorTolerant({}, Messages.StrictDuplicateProperty); + } else if (kind !== PropertyKind.Data) { + throwErrorTolerant({}, Messages.AccessorDataProperty); + } + } else { + if (kind === PropertyKind.Data) { + throwErrorTolerant({}, Messages.AccessorDataProperty); + } else if (map[name] & kind) { + throwErrorTolerant({}, Messages.AccessorGetSet); + } + } + map[name] |= kind; + } else { + map[name] = kind; + } + + properties.push(property); + + if (!match('}')) { + expect(','); + } + } + + expect('}'); + + return { + type: Syntax.ObjectExpression, + properties: properties + }; + } + + // 11.1.6 The Grouping Operator + + function parseGroupExpression() { + var expr; + + expect('('); + + expr = parseExpression(); + + expect(')'); + + return expr; + } + + + // 11.1 Primary Expressions + + function parsePrimaryExpression() { + var token = lookahead(), + type = token.type; + + if (type === Token.Identifier) { + return { + type: Syntax.Identifier, + name: lex().value + }; + } + + if (type === Token.StringLiteral || type === Token.NumericLiteral) { + if (strict && token.octal) { + throwErrorTolerant(token, Messages.StrictOctalLiteral); + } + return createLiteral(lex()); + } + + if (type === Token.Keyword) { + if (matchKeyword('this')) { + lex(); + return { + type: Syntax.ThisExpression + }; + } + + if (matchKeyword('function')) { + return parseFunctionExpression(); + } + } + + if (type === Token.BooleanLiteral) { + lex(); + token.value = (token.value === 'true'); + return createLiteral(token); + } + + if (type === Token.NullLiteral) { + lex(); + token.value = null; + return createLiteral(token); + } + + if (match('[')) { + return parseArrayInitialiser(); + } + + if (match('{')) { + return parseObjectInitialiser(); + } + + if (match('(')) { + return parseGroupExpression(); + } + + if (match('/') || match('/=')) { + return createLiteral(scanRegExp()); + } + + return throwUnexpected(lex()); + } + + // 11.2 Left-Hand-Side Expressions + + function parseArguments() { + var args = []; + + expect('('); + + if (!match(')')) { + while (index < length) { + args.push(parseAssignmentExpression()); + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + return args; + } + + function parseNonComputedProperty() { + var token = lex(); + + if (!isIdentifierName(token)) { + throwUnexpected(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseNonComputedMember() { + expect('.'); + + return parseNonComputedProperty(); + } + + function parseComputedMember() { + var expr; + + expect('['); + + expr = parseExpression(); + + expect(']'); + + return expr; + } + + function parseNewExpression() { + var expr; + + expectKeyword('new'); + + expr = { + type: Syntax.NewExpression, + callee: parseLeftHandSideExpression(), + 'arguments': [] + }; + + if (match('(')) { + expr['arguments'] = parseArguments(); + } + + return expr; + } + + function parseLeftHandSideExpressionAllowCall() { + var expr; + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[') || match('(')) { + if (match('(')) { + expr = { + type: Syntax.CallExpression, + callee: expr, + 'arguments': parseArguments() + }; + } else if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + } + } + + return expr; + } + + + function parseLeftHandSideExpression() { + var expr; + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[')) { + if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + } + } + + return expr; + } + + // 11.3 Postfix Expressions + + function parsePostfixExpression() { + var expr = parseLeftHandSideExpressionAllowCall(), token; + + token = lookahead(); + if (token.type !== Token.Punctuator) { + return expr; + } + + if ((match('++') || match('--')) && !peekLineTerminator()) { + // 11.3.1, 11.3.2 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant({}, Messages.StrictLHSPostfix); + } + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + expr = { + type: Syntax.UpdateExpression, + operator: lex().value, + argument: expr, + prefix: false + }; + } + + return expr; + } + + // 11.4 Unary Operators + + function parseUnaryExpression() { + var token, expr; + + token = lookahead(); + if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { + return parsePostfixExpression(); + } + + if (match('++') || match('--')) { + token = lex(); + expr = parseUnaryExpression(); + // 11.4.4, 11.4.5 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant({}, Messages.StrictLHSPrefix); + } + + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + expr = { + type: Syntax.UpdateExpression, + operator: token.value, + argument: expr, + prefix: true + }; + return expr; + } + + if (match('+') || match('-') || match('~') || match('!')) { + expr = { + type: Syntax.UnaryExpression, + operator: lex().value, + argument: parseUnaryExpression(), + prefix: true + }; + return expr; + } + + if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { + expr = { + type: Syntax.UnaryExpression, + operator: lex().value, + argument: parseUnaryExpression(), + prefix: true + }; + if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { + throwErrorTolerant({}, Messages.StrictDelete); + } + return expr; + } + + return parsePostfixExpression(); + } + + // 11.5 Multiplicative Operators + + function parseMultiplicativeExpression() { + var expr = parseUnaryExpression(); + + while (match('*') || match('/') || match('%')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseUnaryExpression() + }; + } + + return expr; + } + + // 11.6 Additive Operators + + function parseAdditiveExpression() { + var expr = parseMultiplicativeExpression(); + + while (match('+') || match('-')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseMultiplicativeExpression() + }; + } + + return expr; + } + + // 11.7 Bitwise Shift Operators + + function parseShiftExpression() { + var expr = parseAdditiveExpression(); + + while (match('<<') || match('>>') || match('>>>')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseAdditiveExpression() + }; + } + + return expr; + } + // 11.8 Relational Operators + + function parseRelationalExpression() { + var expr, previousAllowIn; + + previousAllowIn = state.allowIn; + state.allowIn = true; + + expr = parseShiftExpression(); + + while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseShiftExpression() + }; + } + + state.allowIn = previousAllowIn; + return expr; + } + + // 11.9 Equality Operators + + function parseEqualityExpression() { + var expr = parseRelationalExpression(); + + while (match('==') || match('!=') || match('===') || match('!==')) { + expr = { + type: Syntax.BinaryExpression, + operator: lex().value, + left: expr, + right: parseRelationalExpression() + }; + } + + return expr; + } + + // 11.10 Binary Bitwise Operators + + function parseBitwiseANDExpression() { + var expr = parseEqualityExpression(); + + while (match('&')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '&', + left: expr, + right: parseEqualityExpression() + }; + } + + return expr; + } + + function parseBitwiseXORExpression() { + var expr = parseBitwiseANDExpression(); + + while (match('^')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '^', + left: expr, + right: parseBitwiseANDExpression() + }; + } + + return expr; + } + + function parseBitwiseORExpression() { + var expr = parseBitwiseXORExpression(); + + while (match('|')) { + lex(); + expr = { + type: Syntax.BinaryExpression, + operator: '|', + left: expr, + right: parseBitwiseXORExpression() + }; + } + + return expr; + } + + // 11.11 Binary Logical Operators + + function parseLogicalANDExpression() { + var expr = parseBitwiseORExpression(); + + while (match('&&')) { + lex(); + expr = { + type: Syntax.LogicalExpression, + operator: '&&', + left: expr, + right: parseBitwiseORExpression() + }; + } + + return expr; + } + + function parseLogicalORExpression() { + var expr = parseLogicalANDExpression(); + + while (match('||')) { + lex(); + expr = { + type: Syntax.LogicalExpression, + operator: '||', + left: expr, + right: parseLogicalANDExpression() + }; + } + + return expr; + } + + // 11.12 Conditional Operator + + function parseConditionalExpression() { + var expr, previousAllowIn, consequent; + + expr = parseLogicalORExpression(); + + if (match('?')) { + lex(); + previousAllowIn = state.allowIn; + state.allowIn = true; + consequent = parseAssignmentExpression(); + state.allowIn = previousAllowIn; + expect(':'); + + expr = { + type: Syntax.ConditionalExpression, + test: expr, + consequent: consequent, + alternate: parseAssignmentExpression() + }; + } + + return expr; + } + + // 11.13 Assignment Operators + + function parseAssignmentExpression() { + var token, expr; + + token = lookahead(); + expr = parseConditionalExpression(); + + if (matchAssign()) { + // LeftHandSideExpression + if (!isLeftHandSide(expr)) { + throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + } + + // 11.13.1 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + throwErrorTolerant(token, Messages.StrictLHSAssignment); + } + + expr = { + type: Syntax.AssignmentExpression, + operator: lex().value, + left: expr, + right: parseAssignmentExpression() + }; + } + + return expr; + } + + // 11.14 Comma Operator + + function parseExpression() { + var expr = parseAssignmentExpression(); + + if (match(',')) { + expr = { + type: Syntax.SequenceExpression, + expressions: [ expr ] + }; + + while (index < length) { + if (!match(',')) { + break; + } + lex(); + expr.expressions.push(parseAssignmentExpression()); + } + + } + return expr; + } + + // 12.1 Block + + function parseStatementList() { + var list = [], + statement; + + while (index < length) { + if (match('}')) { + break; + } + statement = parseSourceElement(); + if (typeof statement === 'undefined') { + break; + } + list.push(statement); + } + + return list; + } + + function parseBlock() { + var block; + + expect('{'); + + block = parseStatementList(); + + expect('}'); + + return { + type: Syntax.BlockStatement, + body: block + }; + } + + // 12.2 Variable Statement + + function parseVariableIdentifier() { + var token = lex(); + + if (token.type !== Token.Identifier) { + throwUnexpected(token); + } + + return { + type: Syntax.Identifier, + name: token.value + }; + } + + function parseVariableDeclaration(kind) { + var id = parseVariableIdentifier(), + init = null; + + // 12.2.1 + if (strict && isRestrictedWord(id.name)) { + throwErrorTolerant({}, Messages.StrictVarName); + } + + if (kind === 'const') { + expect('='); + init = parseAssignmentExpression(); + } else if (match('=')) { + lex(); + init = parseAssignmentExpression(); + } + + return { + type: Syntax.VariableDeclarator, + id: id, + init: init + }; + } + + function parseVariableDeclarationList(kind) { + var list = []; + + do { + list.push(parseVariableDeclaration(kind)); + if (!match(',')) { + break; + } + lex(); + } while (index < length); + + return list; + } + + function parseVariableStatement() { + var declarations; + + expectKeyword('var'); + + declarations = parseVariableDeclarationList(); + + consumeSemicolon(); + + return { + type: Syntax.VariableDeclaration, + declarations: declarations, + kind: 'var' + }; + } + + // kind may be `const` or `let` + // Both are experimental and not in the specification yet. + // see http://wiki.ecmascript.org/doku.php?id=harmony:const + // and http://wiki.ecmascript.org/doku.php?id=harmony:let + function parseConstLetDeclaration(kind) { + var declarations; + + expectKeyword(kind); + + declarations = parseVariableDeclarationList(kind); + + consumeSemicolon(); + + return { + type: Syntax.VariableDeclaration, + declarations: declarations, + kind: kind + }; + } + + // 12.3 Empty Statement + + function parseEmptyStatement() { + expect(';'); + + return { + type: Syntax.EmptyStatement + }; + } + + // 12.4 Expression Statement + + function parseExpressionStatement() { + var expr = parseExpression(); + + consumeSemicolon(); + + return { + type: Syntax.ExpressionStatement, + expression: expr + }; + } + + // 12.5 If statement + + function parseIfStatement() { + var test, consequent, alternate; + + expectKeyword('if'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + consequent = parseStatement(); + + if (matchKeyword('else')) { + lex(); + alternate = parseStatement(); + } else { + alternate = null; + } + + return { + type: Syntax.IfStatement, + test: test, + consequent: consequent, + alternate: alternate + }; + } + + // 12.6 Iteration Statements + + function parseDoWhileStatement() { + var body, test, oldInIteration; + + expectKeyword('do'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + expectKeyword('while'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + if (match(';')) { + lex(); + } + + return { + type: Syntax.DoWhileStatement, + body: body, + test: test + }; + } + + function parseWhileStatement() { + var test, body, oldInIteration; + + expectKeyword('while'); + + expect('('); + + test = parseExpression(); + + expect(')'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + return { + type: Syntax.WhileStatement, + test: test, + body: body + }; + } + + function parseForVariableDeclaration() { + var token = lex(); + + return { + type: Syntax.VariableDeclaration, + declarations: parseVariableDeclarationList(), + kind: token.value + }; + } + + function parseForStatement() { + var init, test, update, left, right, body, oldInIteration; + + init = test = update = null; + + expectKeyword('for'); + + expect('('); + + if (match(';')) { + lex(); + } else { + if (matchKeyword('var') || matchKeyword('let')) { + state.allowIn = false; + init = parseForVariableDeclaration(); + state.allowIn = true; + + if (init.declarations.length === 1 && matchKeyword('in')) { + lex(); + left = init; + right = parseExpression(); + init = null; + } + } else { + state.allowIn = false; + init = parseExpression(); + state.allowIn = true; + + if (matchKeyword('in')) { + // LeftHandSideExpression + if (!isLeftHandSide(init)) { + throwErrorTolerant({}, Messages.InvalidLHSInForIn); + } + + lex(); + left = init; + right = parseExpression(); + init = null; + } + } + + if (typeof left === 'undefined') { + expect(';'); + } + } + + if (typeof left === 'undefined') { + + if (!match(';')) { + test = parseExpression(); + } + expect(';'); + + if (!match(')')) { + update = parseExpression(); + } + } + + expect(')'); + + oldInIteration = state.inIteration; + state.inIteration = true; + + body = parseStatement(); + + state.inIteration = oldInIteration; + + if (typeof left === 'undefined') { + return { + type: Syntax.ForStatement, + init: init, + test: test, + update: update, + body: body + }; + } + + return { + type: Syntax.ForInStatement, + left: left, + right: right, + body: body, + each: false + }; + } + + // 12.7 The continue statement + + function parseContinueStatement() { + var token, label = null; + + expectKeyword('continue'); + + // Optimize the most common form: 'continue;'. + if (source[index] === ';') { + lex(); + + if (!state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: null + }; + } + + if (peekLineTerminator()) { + if (!state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: null + }; + } + + token = lookahead(); + if (token.type === Token.Identifier) { + label = parseVariableIdentifier(); + + if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { + throwError({}, Messages.UnknownLabel, label.name); + } + } + + consumeSemicolon(); + + if (label === null && !state.inIteration) { + throwError({}, Messages.IllegalContinue); + } + + return { + type: Syntax.ContinueStatement, + label: label + }; + } + + // 12.8 The break statement + + function parseBreakStatement() { + var token, label = null; + + expectKeyword('break'); + + // Optimize the most common form: 'break;'. + if (source[index] === ';') { + lex(); + + if (!(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: null + }; + } + + if (peekLineTerminator()) { + if (!(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: null + }; + } + + token = lookahead(); + if (token.type === Token.Identifier) { + label = parseVariableIdentifier(); + + if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { + throwError({}, Messages.UnknownLabel, label.name); + } + } + + consumeSemicolon(); + + if (label === null && !(state.inIteration || state.inSwitch)) { + throwError({}, Messages.IllegalBreak); + } + + return { + type: Syntax.BreakStatement, + label: label + }; + } + + // 12.9 The return statement + + function parseReturnStatement() { + var token, argument = null; + + expectKeyword('return'); + + if (!state.inFunctionBody) { + throwErrorTolerant({}, Messages.IllegalReturn); + } + + // 'return' followed by a space and an identifier is very common. + if (source[index] === ' ') { + if (isIdentifierStart(source[index + 1])) { + argument = parseExpression(); + consumeSemicolon(); + return { + type: Syntax.ReturnStatement, + argument: argument + }; + } + } + + if (peekLineTerminator()) { + return { + type: Syntax.ReturnStatement, + argument: null + }; + } + + if (!match(';')) { + token = lookahead(); + if (!match('}') && token.type !== Token.EOF) { + argument = parseExpression(); + } + } + + consumeSemicolon(); + + return { + type: Syntax.ReturnStatement, + argument: argument + }; + } + + // 12.10 The with statement + + function parseWithStatement() { + var object, body; + + if (strict) { + throwErrorTolerant({}, Messages.StrictModeWith); + } + + expectKeyword('with'); + + expect('('); + + object = parseExpression(); + + expect(')'); + + body = parseStatement(); + + return { + type: Syntax.WithStatement, + object: object, + body: body + }; + } + + // 12.10 The swith statement + + function parseSwitchCase() { + var test, + consequent = [], + statement; + + if (matchKeyword('default')) { + lex(); + test = null; + } else { + expectKeyword('case'); + test = parseExpression(); + } + expect(':'); + + while (index < length) { + if (match('}') || matchKeyword('default') || matchKeyword('case')) { + break; + } + statement = parseStatement(); + if (typeof statement === 'undefined') { + break; + } + consequent.push(statement); + } + + return { + type: Syntax.SwitchCase, + test: test, + consequent: consequent + }; + } + + function parseSwitchStatement() { + var discriminant, cases, clause, oldInSwitch, defaultFound; + + expectKeyword('switch'); + + expect('('); + + discriminant = parseExpression(); + + expect(')'); + + expect('{'); + + cases = []; + + if (match('}')) { + lex(); + return { + type: Syntax.SwitchStatement, + discriminant: discriminant, + cases: cases + }; + } + + oldInSwitch = state.inSwitch; + state.inSwitch = true; + defaultFound = false; + + while (index < length) { + if (match('}')) { + break; + } + clause = parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + throwError({}, Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + + state.inSwitch = oldInSwitch; + + expect('}'); + + return { + type: Syntax.SwitchStatement, + discriminant: discriminant, + cases: cases + }; + } + + // 12.13 The throw statement + + function parseThrowStatement() { + var argument; + + expectKeyword('throw'); + + if (peekLineTerminator()) { + throwError({}, Messages.NewlineAfterThrow); + } + + argument = parseExpression(); + + consumeSemicolon(); + + return { + type: Syntax.ThrowStatement, + argument: argument + }; + } + + // 12.14 The try statement + + function parseCatchClause() { + var param; + + expectKeyword('catch'); + + expect('('); + if (match(')')) { + throwUnexpected(lookahead()); + } + + param = parseVariableIdentifier(); + // 12.14.1 + if (strict && isRestrictedWord(param.name)) { + throwErrorTolerant({}, Messages.StrictCatchVariable); + } + + expect(')'); + + return { + type: Syntax.CatchClause, + param: param, + body: parseBlock() + }; + } + + function parseTryStatement() { + var block, handlers = [], finalizer = null; + + expectKeyword('try'); + + block = parseBlock(); + + if (matchKeyword('catch')) { + handlers.push(parseCatchClause()); + } + + if (matchKeyword('finally')) { + lex(); + finalizer = parseBlock(); + } + + if (handlers.length === 0 && !finalizer) { + throwError({}, Messages.NoCatchOrFinally); + } + + return { + type: Syntax.TryStatement, + block: block, + guardedHandlers: [], + handlers: handlers, + finalizer: finalizer + }; + } + + // 12.15 The debugger statement + + function parseDebuggerStatement() { + expectKeyword('debugger'); + + consumeSemicolon(); + + return { + type: Syntax.DebuggerStatement + }; + } + + // 12 Statements + + function parseStatement() { + var token = lookahead(), + expr, + labeledBody; + + if (token.type === Token.EOF) { + throwUnexpected(token); + } + + if (token.type === Token.Punctuator) { + switch (token.value) { + case ';': + return parseEmptyStatement(); + case '{': + return parseBlock(); + case '(': + return parseExpressionStatement(); + default: + break; + } + } + + if (token.type === Token.Keyword) { + switch (token.value) { + case 'break': + return parseBreakStatement(); + case 'continue': + return parseContinueStatement(); + case 'debugger': + return parseDebuggerStatement(); + case 'do': + return parseDoWhileStatement(); + case 'for': + return parseForStatement(); + case 'function': + return parseFunctionDeclaration(); + case 'if': + return parseIfStatement(); + case 'return': + return parseReturnStatement(); + case 'switch': + return parseSwitchStatement(); + case 'throw': + return parseThrowStatement(); + case 'try': + return parseTryStatement(); + case 'var': + return parseVariableStatement(); + case 'while': + return parseWhileStatement(); + case 'with': + return parseWithStatement(); + default: + break; + } + } + + expr = parseExpression(); + + // 12.12 Labelled Statements + if ((expr.type === Syntax.Identifier) && match(':')) { + lex(); + + if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { + throwError({}, Messages.Redeclaration, 'Label', expr.name); + } + + state.labelSet[expr.name] = true; + labeledBody = parseStatement(); + delete state.labelSet[expr.name]; + + return { + type: Syntax.LabeledStatement, + label: expr, + body: labeledBody + }; + } + + consumeSemicolon(); + + return { + type: Syntax.ExpressionStatement, + expression: expr + }; + } + + // 13 Function Definition + + function parseFunctionSourceElements() { + var sourceElement, sourceElements = [], token, directive, firstRestricted, + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; + + expect('{'); + + while (index < length) { + token = lookahead(); + if (token.type !== Token.StringLiteral) { + break; + } + + sourceElement = parseSourceElement(); + sourceElements.push(sourceElement); + if (sourceElement.expression.type !== Syntax.Literal) { + // this is not directive + break; + } + directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + if (directive === 'use strict') { + strict = true; + if (firstRestricted) { + throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + } + } else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + + oldLabelSet = state.labelSet; + oldInIteration = state.inIteration; + oldInSwitch = state.inSwitch; + oldInFunctionBody = state.inFunctionBody; + + state.labelSet = {}; + state.inIteration = false; + state.inSwitch = false; + state.inFunctionBody = true; + + while (index < length) { + if (match('}')) { + break; + } + sourceElement = parseSourceElement(); + if (typeof sourceElement === 'undefined') { + break; + } + sourceElements.push(sourceElement); + } + + expect('}'); + + state.labelSet = oldLabelSet; + state.inIteration = oldInIteration; + state.inSwitch = oldInSwitch; + state.inFunctionBody = oldInFunctionBody; + + return { + type: Syntax.BlockStatement, + body: sourceElements + }; + } + + function parseFunctionDeclaration() { + var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; + + expectKeyword('function'); + token = lookahead(); + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + + expect('('); + + if (!match(')')) { + paramSet = {}; + while (index < length) { + token = lookahead(); + param = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + stricted = token; + message = Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + stricted = token; + message = Messages.StrictParamDupe; + } + } else if (!firstRestricted) { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + firstRestricted = token; + message = Messages.StrictParamDupe; + } + } + params.push(param); + paramSet[param.name] = true; + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (strict && firstRestricted) { + throwError(firstRestricted, message); + } + if (strict && stricted) { + throwErrorTolerant(stricted, message); + } + strict = previousStrict; + + return { + type: Syntax.FunctionDeclaration, + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + function parseFunctionExpression() { + var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; + + expectKeyword('function'); + + if (!match('(')) { + token = lookahead(); + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + throwErrorTolerant(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + } + + expect('('); + + if (!match(')')) { + paramSet = {}; + while (index < length) { + token = lookahead(); + param = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + stricted = token; + message = Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + stricted = token; + message = Messages.StrictParamDupe; + } + } else if (!firstRestricted) { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { + firstRestricted = token; + message = Messages.StrictParamDupe; + } + } + params.push(param); + paramSet[param.name] = true; + if (match(')')) { + break; + } + expect(','); + } + } + + expect(')'); + + previousStrict = strict; + body = parseFunctionSourceElements(); + if (strict && firstRestricted) { + throwError(firstRestricted, message); + } + if (strict && stricted) { + throwErrorTolerant(stricted, message); + } + strict = previousStrict; + + return { + type: Syntax.FunctionExpression, + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }; + } + + // 14 Program + + function parseSourceElement() { + var token = lookahead(); + + if (token.type === Token.Keyword) { + switch (token.value) { + case 'const': + case 'let': + return parseConstLetDeclaration(token.value); + case 'function': + return parseFunctionDeclaration(); + default: + return parseStatement(); + } + } + + if (token.type !== Token.EOF) { + return parseStatement(); + } + } + + function parseSourceElements() { + var sourceElement, sourceElements = [], token, directive, firstRestricted; + + while (index < length) { + token = lookahead(); + if (token.type !== Token.StringLiteral) { + break; + } + + sourceElement = parseSourceElement(); + sourceElements.push(sourceElement); + if (sourceElement.expression.type !== Syntax.Literal) { + // this is not directive + break; + } + directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + if (directive === 'use strict') { + strict = true; + if (firstRestricted) { + throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + } + } else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + + while (index < length) { + sourceElement = parseSourceElement(); + if (typeof sourceElement === 'undefined') { + break; + } + sourceElements.push(sourceElement); + } + return sourceElements; + } + + function parseProgram() { + var program; + strict = false; + program = { + type: Syntax.Program, + body: parseSourceElements() + }; + return program; + } + + // The following functions are needed only when the option to preserve + // the comments is active. + + function addComment(type, value, start, end, loc) { + assert(typeof start === 'number', 'Comment must have valid position'); + + // Because the way the actual token is scanned, often the comments + // (if any) are skipped twice during the lexical analysis. + // Thus, we need to skip adding a comment if the comment array already + // handled it. + if (extra.comments.length > 0) { + if (extra.comments[extra.comments.length - 1].range[1] > start) { + return; + } + } + + extra.comments.push({ + type: type, + value: value, + range: [start, end], + loc: loc + }); + } + + function scanComment() { + var comment, ch, loc, start, blockComment, lineComment; + + comment = ''; + blockComment = false; + lineComment = false; + + while (index < length) { + ch = source[index]; + + if (lineComment) { + ch = source[index++]; + if (isLineTerminator(ch)) { + loc.end = { + line: lineNumber, + column: index - lineStart - 1 + }; + lineComment = false; + addComment('Line', comment, start, index - 1, loc); + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + comment = ''; + } else if (index >= length) { + lineComment = false; + comment += ch; + loc.end = { + line: lineNumber, + column: length - lineStart + }; + addComment('Line', comment, start, length, loc); + } else { + comment += ch; + } + } else if (blockComment) { + if (isLineTerminator(ch)) { + if (ch === '\r' && source[index + 1] === '\n') { + ++index; + comment += '\r\n'; + } else { + comment += ch; + } + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + ch = source[index++]; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + comment += ch; + if (ch === '*') { + ch = source[index]; + if (ch === '/') { + comment = comment.substr(0, comment.length - 1); + blockComment = false; + ++index; + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Block', comment, start, index, loc); + comment = ''; + } + } + } + } else if (ch === '/') { + ch = source[index + 1]; + if (ch === '/') { + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + start = index; + index += 2; + lineComment = true; + if (index >= length) { + loc.end = { + line: lineNumber, + column: index - lineStart + }; + lineComment = false; + addComment('Line', comment, start, index, loc); + } + } else if (ch === '*') { + start = index; + index += 2; + blockComment = true; + loc = { + start: { + line: lineNumber, + column: index - lineStart - 2 + } + }; + if (index >= length) { + throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + } + } else { + break; + } + } else if (isWhiteSpace(ch)) { + ++index; + } else if (isLineTerminator(ch)) { + ++index; + if (ch === '\r' && source[index] === '\n') { + ++index; + } + ++lineNumber; + lineStart = index; + } else { + break; + } + } + } + + function filterCommentLocation() { + var i, entry, comment, comments = []; + + for (i = 0; i < extra.comments.length; ++i) { + entry = extra.comments[i]; + comment = { + type: entry.type, + value: entry.value + }; + if (extra.range) { + comment.range = entry.range; + } + if (extra.loc) { + comment.loc = entry.loc; + } + comments.push(comment); + } + + extra.comments = comments; + } + + function collectToken() { + var start, loc, token, range, value; + + skipComment(); + start = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + token = extra.advance(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + if (token.type !== Token.EOF) { + range = [token.range[0], token.range[1]]; + value = sliceSource(token.range[0], token.range[1]); + extra.tokens.push({ + type: TokenName[token.type], + value: value, + range: range, + loc: loc + }); + } + + return token; + } + + function collectRegex() { + var pos, loc, regex, token; + + skipComment(); + + pos = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + regex = extra.scanRegExp(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + // Pop the previous token, which is likely '/' or '/=' + if (extra.tokens.length > 0) { + token = extra.tokens[extra.tokens.length - 1]; + if (token.range[0] === pos && token.type === 'Punctuator') { + if (token.value === '/' || token.value === '/=') { + extra.tokens.pop(); + } + } + } + + extra.tokens.push({ + type: 'RegularExpression', + value: regex.literal, + range: [pos, index], + loc: loc + }); + + return regex; + } + + function filterTokenLocation() { + var i, entry, token, tokens = []; + + for (i = 0; i < extra.tokens.length; ++i) { + entry = extra.tokens[i]; + token = { + type: entry.type, + value: entry.value + }; + if (extra.range) { + token.range = entry.range; + } + if (extra.loc) { + token.loc = entry.loc; + } + tokens.push(token); + } + + extra.tokens = tokens; + } + + function createLiteral(token) { + return { + type: Syntax.Literal, + value: token.value + }; + } + + function createRawLiteral(token) { + return { + type: Syntax.Literal, + value: token.value, + raw: sliceSource(token.range[0], token.range[1]) + }; + } + + function createLocationMarker() { + var marker = {}; + + marker.range = [index, index]; + marker.loc = { + start: { + line: lineNumber, + column: index - lineStart + }, + end: { + line: lineNumber, + column: index - lineStart + } + }; + + marker.end = function () { + this.range[1] = index; + this.loc.end.line = lineNumber; + this.loc.end.column = index - lineStart; + }; + + marker.applyGroup = function (node) { + if (extra.range) { + node.groupRange = [this.range[0], this.range[1]]; + } + if (extra.loc) { + node.groupLoc = { + start: { + line: this.loc.start.line, + column: this.loc.start.column + }, + end: { + line: this.loc.end.line, + column: this.loc.end.column + } + }; + } + }; + + marker.apply = function (node) { + if (extra.range) { + node.range = [this.range[0], this.range[1]]; + } + if (extra.loc) { + node.loc = { + start: { + line: this.loc.start.line, + column: this.loc.start.column + }, + end: { + line: this.loc.end.line, + column: this.loc.end.column + } + }; + } + }; + + return marker; + } + + function trackGroupExpression() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + expect('('); + + expr = parseExpression(); + + expect(')'); + + marker.end(); + marker.applyGroup(expr); + + return expr; + } + + function trackLeftHandSideExpression() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[')) { + if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + marker.end(); + marker.apply(expr); + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + marker.end(); + marker.apply(expr); + } + } + + return expr; + } + + function trackLeftHandSideExpressionAllowCall() { + var marker, expr; + + skipComment(); + marker = createLocationMarker(); + + expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + + while (match('.') || match('[') || match('(')) { + if (match('(')) { + expr = { + type: Syntax.CallExpression, + callee: expr, + 'arguments': parseArguments() + }; + marker.end(); + marker.apply(expr); + } else if (match('[')) { + expr = { + type: Syntax.MemberExpression, + computed: true, + object: expr, + property: parseComputedMember() + }; + marker.end(); + marker.apply(expr); + } else { + expr = { + type: Syntax.MemberExpression, + computed: false, + object: expr, + property: parseNonComputedMember() + }; + marker.end(); + marker.apply(expr); + } + } + + return expr; + } + + function filterGroup(node) { + var n, i, entry; + + n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; + for (i in node) { + if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { + entry = node[i]; + if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { + n[i] = entry; + } else { + n[i] = filterGroup(entry); + } + } + } + return n; + } + + function wrapTrackingFunction(range, loc) { + + return function (parseFunction) { + + function isBinary(node) { + return node.type === Syntax.LogicalExpression || + node.type === Syntax.BinaryExpression; + } + + function visit(node) { + var start, end; + + if (isBinary(node.left)) { + visit(node.left); + } + if (isBinary(node.right)) { + visit(node.right); + } + + if (range) { + if (node.left.groupRange || node.right.groupRange) { + start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; + end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; + node.range = [start, end]; + } else if (typeof node.range === 'undefined') { + start = node.left.range[0]; + end = node.right.range[1]; + node.range = [start, end]; + } + } + if (loc) { + if (node.left.groupLoc || node.right.groupLoc) { + start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; + end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; + node.loc = { + start: start, + end: end + }; + } else if (typeof node.loc === 'undefined') { + node.loc = { + start: node.left.loc.start, + end: node.right.loc.end + }; + } + } + } + + return function () { + var marker, node; + + skipComment(); + + marker = createLocationMarker(); + node = parseFunction.apply(null, arguments); + marker.end(); + + if (range && typeof node.range === 'undefined') { + marker.apply(node); + } + + if (loc && typeof node.loc === 'undefined') { + marker.apply(node); + } + + if (isBinary(node)) { + visit(node); + } + + return node; + }; + }; + } + + function patch() { + + var wrapTracking; + + if (extra.comments) { + extra.skipComment = skipComment; + skipComment = scanComment; + } + + if (extra.raw) { + extra.createLiteral = createLiteral; + createLiteral = createRawLiteral; + } + + if (extra.range || extra.loc) { + + extra.parseGroupExpression = parseGroupExpression; + extra.parseLeftHandSideExpression = parseLeftHandSideExpression; + extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; + parseGroupExpression = trackGroupExpression; + parseLeftHandSideExpression = trackLeftHandSideExpression; + parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; + + wrapTracking = wrapTrackingFunction(extra.range, extra.loc); + + extra.parseAdditiveExpression = parseAdditiveExpression; + extra.parseAssignmentExpression = parseAssignmentExpression; + extra.parseBitwiseANDExpression = parseBitwiseANDExpression; + extra.parseBitwiseORExpression = parseBitwiseORExpression; + extra.parseBitwiseXORExpression = parseBitwiseXORExpression; + extra.parseBlock = parseBlock; + extra.parseFunctionSourceElements = parseFunctionSourceElements; + extra.parseCatchClause = parseCatchClause; + extra.parseComputedMember = parseComputedMember; + extra.parseConditionalExpression = parseConditionalExpression; + extra.parseConstLetDeclaration = parseConstLetDeclaration; + extra.parseEqualityExpression = parseEqualityExpression; + extra.parseExpression = parseExpression; + extra.parseForVariableDeclaration = parseForVariableDeclaration; + extra.parseFunctionDeclaration = parseFunctionDeclaration; + extra.parseFunctionExpression = parseFunctionExpression; + extra.parseLogicalANDExpression = parseLogicalANDExpression; + extra.parseLogicalORExpression = parseLogicalORExpression; + extra.parseMultiplicativeExpression = parseMultiplicativeExpression; + extra.parseNewExpression = parseNewExpression; + extra.parseNonComputedProperty = parseNonComputedProperty; + extra.parseObjectProperty = parseObjectProperty; + extra.parseObjectPropertyKey = parseObjectPropertyKey; + extra.parsePostfixExpression = parsePostfixExpression; + extra.parsePrimaryExpression = parsePrimaryExpression; + extra.parseProgram = parseProgram; + extra.parsePropertyFunction = parsePropertyFunction; + extra.parseRelationalExpression = parseRelationalExpression; + extra.parseStatement = parseStatement; + extra.parseShiftExpression = parseShiftExpression; + extra.parseSwitchCase = parseSwitchCase; + extra.parseUnaryExpression = parseUnaryExpression; + extra.parseVariableDeclaration = parseVariableDeclaration; + extra.parseVariableIdentifier = parseVariableIdentifier; + + parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); + parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); + parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); + parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); + parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); + parseBlock = wrapTracking(extra.parseBlock); + parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); + parseCatchClause = wrapTracking(extra.parseCatchClause); + parseComputedMember = wrapTracking(extra.parseComputedMember); + parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); + parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); + parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); + parseExpression = wrapTracking(extra.parseExpression); + parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); + parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); + parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); + parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); + parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); + parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); + parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); + parseNewExpression = wrapTracking(extra.parseNewExpression); + parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); + parseObjectProperty = wrapTracking(extra.parseObjectProperty); + parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); + parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); + parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); + parseProgram = wrapTracking(extra.parseProgram); + parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); + parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); + parseStatement = wrapTracking(extra.parseStatement); + parseShiftExpression = wrapTracking(extra.parseShiftExpression); + parseSwitchCase = wrapTracking(extra.parseSwitchCase); + parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); + parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); + parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); + } + + if (typeof extra.tokens !== 'undefined') { + extra.advance = advance; + extra.scanRegExp = scanRegExp; + + advance = collectToken; + scanRegExp = collectRegex; + } + } + + function unpatch() { + if (typeof extra.skipComment === 'function') { + skipComment = extra.skipComment; + } + + if (extra.raw) { + createLiteral = extra.createLiteral; + } + + if (extra.range || extra.loc) { + parseAdditiveExpression = extra.parseAdditiveExpression; + parseAssignmentExpression = extra.parseAssignmentExpression; + parseBitwiseANDExpression = extra.parseBitwiseANDExpression; + parseBitwiseORExpression = extra.parseBitwiseORExpression; + parseBitwiseXORExpression = extra.parseBitwiseXORExpression; + parseBlock = extra.parseBlock; + parseFunctionSourceElements = extra.parseFunctionSourceElements; + parseCatchClause = extra.parseCatchClause; + parseComputedMember = extra.parseComputedMember; + parseConditionalExpression = extra.parseConditionalExpression; + parseConstLetDeclaration = extra.parseConstLetDeclaration; + parseEqualityExpression = extra.parseEqualityExpression; + parseExpression = extra.parseExpression; + parseForVariableDeclaration = extra.parseForVariableDeclaration; + parseFunctionDeclaration = extra.parseFunctionDeclaration; + parseFunctionExpression = extra.parseFunctionExpression; + parseGroupExpression = extra.parseGroupExpression; + parseLeftHandSideExpression = extra.parseLeftHandSideExpression; + parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; + parseLogicalANDExpression = extra.parseLogicalANDExpression; + parseLogicalORExpression = extra.parseLogicalORExpression; + parseMultiplicativeExpression = extra.parseMultiplicativeExpression; + parseNewExpression = extra.parseNewExpression; + parseNonComputedProperty = extra.parseNonComputedProperty; + parseObjectProperty = extra.parseObjectProperty; + parseObjectPropertyKey = extra.parseObjectPropertyKey; + parsePrimaryExpression = extra.parsePrimaryExpression; + parsePostfixExpression = extra.parsePostfixExpression; + parseProgram = extra.parseProgram; + parsePropertyFunction = extra.parsePropertyFunction; + parseRelationalExpression = extra.parseRelationalExpression; + parseStatement = extra.parseStatement; + parseShiftExpression = extra.parseShiftExpression; + parseSwitchCase = extra.parseSwitchCase; + parseUnaryExpression = extra.parseUnaryExpression; + parseVariableDeclaration = extra.parseVariableDeclaration; + parseVariableIdentifier = extra.parseVariableIdentifier; + } + + if (typeof extra.scanRegExp === 'function') { + advance = extra.advance; + scanRegExp = extra.scanRegExp; + } + } + + function stringToArray(str) { + var length = str.length, + result = [], + i; + for (i = 0; i < length; ++i) { + result[i] = str.charAt(i); + } + return result; + } + + function parse(code, options) { + var program, toString; + + toString = String; + if (typeof code !== 'string' && !(code instanceof String)) { + code = toString(code); + } + + source = code; + index = 0; + lineNumber = (source.length > 0) ? 1 : 0; + lineStart = 0; + length = source.length; + buffer = null; + state = { + allowIn: true, + labelSet: {}, + inFunctionBody: false, + inIteration: false, + inSwitch: false + }; + + extra = {}; + if (typeof options !== 'undefined') { + extra.range = (typeof options.range === 'boolean') && options.range; + extra.loc = (typeof options.loc === 'boolean') && options.loc; + extra.raw = (typeof options.raw === 'boolean') && options.raw; + if (typeof options.tokens === 'boolean' && options.tokens) { + extra.tokens = []; + } + if (typeof options.comment === 'boolean' && options.comment) { + extra.comments = []; + } + if (typeof options.tolerant === 'boolean' && options.tolerant) { + extra.errors = []; + } + } + + if (length > 0) { + if (typeof source[0] === 'undefined') { + // Try first to convert to a string. This is good as fast path + // for old IE which understands string indexing for string + // literals only and not for string object. + if (code instanceof String) { + source = code.valueOf(); + } + + // Force accessing the characters via an array. + if (typeof source[0] === 'undefined') { + source = stringToArray(code); + } + } + } + + patch(); + try { + program = parseProgram(); + if (typeof extra.comments !== 'undefined') { + filterCommentLocation(); + program.comments = extra.comments; + } + if (typeof extra.tokens !== 'undefined') { + filterTokenLocation(); + program.tokens = extra.tokens; + } + if (typeof extra.errors !== 'undefined') { + program.errors = extra.errors; + } + if (extra.range || extra.loc) { + program.body = filterGroup(program.body); + } + } catch (e) { + throw e; + } finally { + unpatch(); + extra = {}; + } + + return program; + } + + // Sync with package.json. + exports.version = '1.0.4'; + + exports.parse = parse; + + // Deep copy. + exports.Syntax = (function () { + var name, types = {}; + + if (typeof Object.create === 'function') { + types = Object.create(null); + } + + for (name in Syntax) { + if (Syntax.hasOwnProperty(name)) { + types[name] = Syntax[name]; + } + } + + if (typeof Object.freeze === 'function') { + Object.freeze(types); + } + + return types; + }()); + +})); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json new file mode 100644 index 0000000..9a2294a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json @@ -0,0 +1,59 @@ +{ + "name": "esprima", + "description": "ECMAScript parsing infrastructure for multipurpose analysis", + "homepage": "http://esprima.org", + "main": "esprima.js", + "bin": { + "esparse": "./bin/esparse.js", + "esvalidate": "./bin/esvalidate.js" + }, + "files": [ + "bin", + "test/run.js", + "test/runner.js", + "test/test.js", + "test/compat.js", + "test/reflect.js", + "esprima.js" + ], + "version": "1.0.4", + "engines": { + "node": ">=0.4.0" + }, + "maintainers": [ + { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com", + "url": "http://ariya.ofilabs.com" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/ariya/esprima.git" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD" + } + ], + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax" + ], + "scripts": { + "test": "node test/run.js", + "benchmark": "node test/benchmarks.js", + "benchmark-quick": "node test/benchmarks.js quick" + }, + "readme": "**Esprima** ([esprima.org](http://esprima.org)) is a high performance,\nstandard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\nparser written in ECMAScript (also popularly known as\n[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).\nEsprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),\nwith the help of [many contributors](https://github.com/ariya/esprima/contributors).\n\nEsprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as\n[Node.js](http://nodejs.org).\n\n### Features\n\n- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262)\n- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla\n[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\n- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage)\n- Optional tracking of syntax node location (index-based and line-column)\n- Experimental support for ES6/Harmony (module, class, destructuring, ...)\n\nEsprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)).\nIt is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html)\nwith the new generation of fast parsers.\n\n### Applications\n\nEsprima serves as the basis for many popular JavaScript development tools:\n\n- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul)\n- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck)\n- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS),\n[Sweet.js](http://sweetjs.org/) (macro)\n- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr)\n- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html))\n- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter),\n- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen)\n\n### Questions?\n- [Documentation](http://esprima.org/doc)\n- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect)\nand [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement)\n- [Mailing list](http://groups.google.com/group/esprima)\n- [Contribution guide](http://esprima.org/doc/index.html#contribution)\n\nFollow [@Esprima](http://twitter.com/Esprima) on Twitter to get the\ndevelopment updates.\nFeedback and contribution are welcomed!\n\n### License\n\nCopyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)\n and other contributors.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/ariya/esprima/issues" + }, + "_id": "esprima@1.0.4", + "_from": "esprima@~ 1.0.2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js new file mode 100644 index 0000000..ee3a629 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js @@ -0,0 +1,239 @@ +/* + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2011 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint node: true */ +/*global document: true, window:true, esprima: true, testReflect: true */ + +var runTests; + +function getContext(esprima, reportCase, reportFailure) { + 'use strict'; + + var Reflect, Pattern; + + // Maps Mozilla Reflect object to our Esprima parser. + Reflect = { + parse: function (code) { + var result; + + reportCase(code); + + try { + result = esprima.parse(code); + } catch (error) { + result = error; + } + + return result; + } + }; + + // This is used by Reflect test suite to match a syntax tree. + Pattern = function (obj) { + var pattern; + + // Poor man's deep object cloning. + pattern = JSON.parse(JSON.stringify(obj)); + + // Special handling for regular expression literal since we need to + // convert it to a string literal, otherwise it will be decoded + // as object "{}" and the regular expression would be lost. + if (obj.type && obj.type === 'Literal') { + if (obj.value instanceof RegExp) { + pattern = { + type: obj.type, + value: obj.value.toString() + }; + } + } + + // Special handling for branch statement because SpiderMonkey + // prefers to put the 'alternate' property before 'consequent'. + if (obj.type && obj.type === 'IfStatement') { + pattern = { + type: pattern.type, + test: pattern.test, + consequent: pattern.consequent, + alternate: pattern.alternate + }; + } + + // Special handling for do while statement because SpiderMonkey + // prefers to put the 'test' property before 'body'. + if (obj.type && obj.type === 'DoWhileStatement') { + pattern = { + type: pattern.type, + body: pattern.body, + test: pattern.test + }; + } + + function adjustRegexLiteralAndRaw(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } else if (key === 'raw' && typeof value === "string") { + // Ignore Esprima-specific 'raw' property. + return undefined; + } + return value; + } + + if (obj.type && (obj.type === 'Program')) { + pattern.assert = function (tree) { + var actual, expected; + actual = JSON.stringify(tree, adjustRegexLiteralAndRaw, 4); + expected = JSON.stringify(obj, null, 4); + + if (expected !== actual) { + reportFailure(expected, actual); + } + }; + } + + return pattern; + }; + + return { + Reflect: Reflect, + Pattern: Pattern + }; +} + +if (typeof window !== 'undefined') { + // Run all tests in a browser environment. + runTests = function () { + 'use strict'; + + var total = 0, + failures = 0; + + function setText(el, str) { + if (typeof el.innerText === 'string') { + el.innerText = str; + } else { + el.textContent = str; + } + } + + function reportCase(code) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + total += 1; + } + + function reportFailure(expected, actual) { + var report, e; + + failures += 1; + + report = document.getElementById('report'); + + e = document.createElement('p'); + setText(e, 'Expected'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'expected'); + setText(e, expected); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Actual'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'actual'); + setText(e, actual); + report.appendChild(e); + } + + setText(document.getElementById('version'), esprima.version); + + window.setTimeout(function () { + var tick, context = getContext(esprima, reportCase, reportFailure); + + tick = new Date(); + testReflect(context.Reflect, context.Pattern); + tick = (new Date()) - tick; + + if (failures > 0) { + setText(document.getElementById('status'), total + ' tests. ' + + 'Failures: ' + failures + '. ' + tick + ' ms'); + } else { + setText(document.getElementById('status'), total + ' tests. ' + + 'No failure. ' + tick + ' ms'); + } + }, 513); + }; +} else { + (function (global) { + 'use strict'; + var esprima = require('../esprima'), + tick, + total = 0, + failures = [], + header, + current, + context; + + function reportCase(code) { + total += 1; + current = code; + } + + function reportFailure(expected, actual) { + failures.push({ + source: current, + expected: expected.toString(), + actual: actual.toString() + }); + } + + context = getContext(esprima, reportCase, reportFailure); + + tick = new Date(); + require('./reflect').testReflect(context.Reflect, context.Pattern); + tick = (new Date()) - tick; + + header = total + ' tests. ' + failures.length + ' failures. ' + + tick + ' ms'; + if (failures.length) { + console.error(header); + failures.forEach(function (failure) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + }); + } else { + console.log(header); + } + process.exit(failures.length === 0 ? 0 : 1); + }(this)); +} +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js new file mode 100644 index 0000000..dba1ba8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js @@ -0,0 +1,422 @@ +// This is modified from Mozilla Reflect.parse test suite (the file is located +// at js/src/tests/js1_8_5/extensions/reflect-parse.js in the source tree). +// +// Some notable changes: +// * Removed unsupported features (destructuring, let, comprehensions...). +// * Removed tests for E4X (ECMAScript for XML). +// * Removed everything related to builder. +// * Enclosed every 'Pattern' construct with a scope. +// * Tweaked some expected tree to remove generator field. +// * Removed the test for bug 632030 and bug 632024. + +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +(function (exports) { + +function testReflect(Reflect, Pattern) { + +function program(elts) { return Pattern({ type: "Program", body: elts }) } +function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } +function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } +function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } +function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } +function lit(val) { return Pattern({ type: "Literal", value: val }) } +var thisExpr = Pattern({ type: "ThisExpression" }); +function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", + id: id, + params: params, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } +function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } +function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } +function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } +function ident(name) { return Pattern({ type: "Identifier", name: name }) } +function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } +function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } +function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } +function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } +function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } +function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } +function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } +function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } +var emptyStmt = Pattern({ type: "EmptyStatement" }); +function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } +function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } +function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } +function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } +function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } +function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } +function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } +function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } +function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } +function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }) } +function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } +function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", + id: id, + params: args, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } +function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", + id: id, + params: args, + defaults: [], + body: body, + rest: null, + generator: false, + expression: false + }) } + +function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } +function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } +function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } +function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } +function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } + +function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } +function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } +function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } +function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } +function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } +function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } +function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } + +function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } +function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } + +function localSrc(src) { return "(function(){ " + src + " })" } +function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } +function blockSrc(src) { return "(function(){ { " + src + " } })" } +function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } + +function assertBlockStmt(src, patt) { + blockPatt(patt).assert(Reflect.parse(blockSrc(src))); +} + +function assertBlockExpr(src, patt) { + assertBlockStmt(src, exprStmt(patt)); +} + +function assertBlockDecl(src, patt, builder) { + blockPatt(patt).assert(Reflect.parse(blockSrc(src), {builder: builder})); +} + +function assertLocalStmt(src, patt) { + localPatt(patt).assert(Reflect.parse(localSrc(src))); +} + +function assertLocalExpr(src, patt) { + assertLocalStmt(src, exprStmt(patt)); +} + +function assertLocalDecl(src, patt) { + localPatt(patt).assert(Reflect.parse(localSrc(src))); +} + +function assertGlobalStmt(src, patt, builder) { + program([patt]).assert(Reflect.parse(src, {builder: builder})); +} + +function assertGlobalExpr(src, patt, builder) { + program([exprStmt(patt)]).assert(Reflect.parse(src, {builder: builder})); + //assertStmt(src, exprStmt(patt)); +} + +function assertGlobalDecl(src, patt) { + program([patt]).assert(Reflect.parse(src)); +} + +function assertProg(src, patt) { + program(patt).assert(Reflect.parse(src)); +} + +function assertStmt(src, patt) { + assertLocalStmt(src, patt); + assertGlobalStmt(src, patt); + assertBlockStmt(src, patt); +} + +function assertExpr(src, patt) { + assertLocalExpr(src, patt); + assertGlobalExpr(src, patt); + assertBlockExpr(src, patt); +} + +function assertDecl(src, patt) { + assertLocalDecl(src, patt); + assertGlobalDecl(src, patt); + assertBlockDecl(src, patt); +} + +function assertError(src, errorType) { + try { + Reflect.parse(src); + } catch (e) { + return; + } + throw new Error("expected " + errorType.name + " for " + uneval(src)); +} + + +// general tests + +// NB: These are useful but for now jit-test doesn't do I/O reliably. + +//program(_).assert(Reflect.parse(snarf('data/flapjax.txt'))); +//program(_).assert(Reflect.parse(snarf('data/jquery-1.4.2.txt'))); +//program(_).assert(Reflect.parse(snarf('data/prototype.js'))); +//program(_).assert(Reflect.parse(snarf('data/dojo.js.uncompressed.js'))); +//program(_).assert(Reflect.parse(snarf('data/mootools-1.2.4-core-nc.js'))); + + +// declarations + +assertDecl("var x = 1, y = 2, z = 3", + varDecl([declarator(ident("x"), lit(1)), + declarator(ident("y"), lit(2)), + declarator(ident("z"), lit(3))])); +assertDecl("var x, y, z", + varDecl([declarator(ident("x"), null), + declarator(ident("y"), null), + declarator(ident("z"), null)])); +assertDecl("function foo() { }", + funDecl(ident("foo"), [], blockStmt([]))); +assertDecl("function foo() { return 42 }", + funDecl(ident("foo"), [], blockStmt([returnStmt(lit(42))]))); + + +// Bug 591437: rebound args have their defs turned into uses +assertDecl("function f(a) { function a() { } }", + funDecl(ident("f"), [ident("a")], blockStmt([funDecl(ident("a"), [], blockStmt([]))]))); +assertDecl("function f(a,b,c) { function b() { } }", + funDecl(ident("f"), [ident("a"),ident("b"),ident("c")], blockStmt([funDecl(ident("b"), [], blockStmt([]))]))); + +// expressions + +assertExpr("true", lit(true)); +assertExpr("false", lit(false)); +assertExpr("42", lit(42)); +assertExpr("(/asdf/)", lit(/asdf/)); +assertExpr("this", thisExpr); +assertExpr("foo", ident("foo")); +assertExpr("foo.bar", dotExpr(ident("foo"), ident("bar"))); +assertExpr("foo[bar]", memExpr(ident("foo"), ident("bar"))); +assertExpr("(function(){})", funExpr(null, [], blockStmt([]))); +assertExpr("(function f() {})", funExpr(ident("f"), [], blockStmt([]))); +assertExpr("(function f(x,y,z) {})", funExpr(ident("f"), [ident("x"),ident("y"),ident("z")], blockStmt([]))); +assertExpr("(++x)", updExpr("++", ident("x"), true)); +assertExpr("(x++)", updExpr("++", ident("x"), false)); +assertExpr("(+x)", unExpr("+", ident("x"))); +assertExpr("(-x)", unExpr("-", ident("x"))); +assertExpr("(!x)", unExpr("!", ident("x"))); +assertExpr("(~x)", unExpr("~", ident("x"))); +assertExpr("(delete x)", unExpr("delete", ident("x"))); +assertExpr("(typeof x)", unExpr("typeof", ident("x"))); +assertExpr("(void x)", unExpr("void", ident("x"))); +assertExpr("(x == y)", binExpr("==", ident("x"), ident("y"))); +assertExpr("(x != y)", binExpr("!=", ident("x"), ident("y"))); +assertExpr("(x === y)", binExpr("===", ident("x"), ident("y"))); +assertExpr("(x !== y)", binExpr("!==", ident("x"), ident("y"))); +assertExpr("(x < y)", binExpr("<", ident("x"), ident("y"))); +assertExpr("(x <= y)", binExpr("<=", ident("x"), ident("y"))); +assertExpr("(x > y)", binExpr(">", ident("x"), ident("y"))); +assertExpr("(x >= y)", binExpr(">=", ident("x"), ident("y"))); +assertExpr("(x << y)", binExpr("<<", ident("x"), ident("y"))); +assertExpr("(x >> y)", binExpr(">>", ident("x"), ident("y"))); +assertExpr("(x >>> y)", binExpr(">>>", ident("x"), ident("y"))); +assertExpr("(x + y)", binExpr("+", ident("x"), ident("y"))); +assertExpr("(w + x + y + z)", binExpr("+", binExpr("+", binExpr("+", ident("w"), ident("x")), ident("y")), ident("z"))); +assertExpr("(x - y)", binExpr("-", ident("x"), ident("y"))); +assertExpr("(w - x - y - z)", binExpr("-", binExpr("-", binExpr("-", ident("w"), ident("x")), ident("y")), ident("z"))); +assertExpr("(x * y)", binExpr("*", ident("x"), ident("y"))); +assertExpr("(x / y)", binExpr("/", ident("x"), ident("y"))); +assertExpr("(x % y)", binExpr("%", ident("x"), ident("y"))); +assertExpr("(x | y)", binExpr("|", ident("x"), ident("y"))); +assertExpr("(x ^ y)", binExpr("^", ident("x"), ident("y"))); +assertExpr("(x & y)", binExpr("&", ident("x"), ident("y"))); +assertExpr("(x in y)", binExpr("in", ident("x"), ident("y"))); +assertExpr("(x instanceof y)", binExpr("instanceof", ident("x"), ident("y"))); +assertExpr("(x = y)", aExpr("=", ident("x"), ident("y"))); +assertExpr("(x += y)", aExpr("+=", ident("x"), ident("y"))); +assertExpr("(x -= y)", aExpr("-=", ident("x"), ident("y"))); +assertExpr("(x *= y)", aExpr("*=", ident("x"), ident("y"))); +assertExpr("(x /= y)", aExpr("/=", ident("x"), ident("y"))); +assertExpr("(x %= y)", aExpr("%=", ident("x"), ident("y"))); +assertExpr("(x <<= y)", aExpr("<<=", ident("x"), ident("y"))); +assertExpr("(x >>= y)", aExpr(">>=", ident("x"), ident("y"))); +assertExpr("(x >>>= y)", aExpr(">>>=", ident("x"), ident("y"))); +assertExpr("(x |= y)", aExpr("|=", ident("x"), ident("y"))); +assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); +assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); +assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); +assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); +assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) +assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); +assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) +assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) +assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); +assertExpr("(new Object)", newExpr(ident("Object"), [])); +assertExpr("(new Object())", newExpr(ident("Object"), [])); +assertExpr("(new Object(42))", newExpr(ident("Object"), [lit(42)])); +assertExpr("(new Object(1,2,3))", newExpr(ident("Object"), [lit(1),lit(2),lit(3)])); +assertExpr("(String())", callExpr(ident("String"), [])); +assertExpr("(String(42))", callExpr(ident("String"), [lit(42)])); +assertExpr("(String(1,2,3))", callExpr(ident("String"), [lit(1),lit(2),lit(3)])); +assertExpr("[]", arrExpr([])); +assertExpr("[1]", arrExpr([lit(1)])); +assertExpr("[1,2]", arrExpr([lit(1),lit(2)])); +assertExpr("[1,2,3]", arrExpr([lit(1),lit(2),lit(3)])); +assertExpr("[1,,2,3]", arrExpr([lit(1),,lit(2),lit(3)])); +assertExpr("[1,,,2,3]", arrExpr([lit(1),,,lit(2),lit(3)])); +assertExpr("[1,,,2,,3]", arrExpr([lit(1),,,lit(2),,lit(3)])); +assertExpr("[1,,,2,,,3]", arrExpr([lit(1),,,lit(2),,,lit(3)])); +assertExpr("[,1,2,3]", arrExpr([,lit(1),lit(2),lit(3)])); +assertExpr("[,,1,2,3]", arrExpr([,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3]", arrExpr([,,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3,]", arrExpr([,,,lit(1),lit(2),lit(3)])); +assertExpr("[,,,1,2,3,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined])); +assertExpr("[,,,1,2,3,,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined,undefined])); +assertExpr("[,,,,,]", arrExpr([undefined,undefined,undefined,undefined,undefined])); +assertExpr("({})", objExpr([])); +assertExpr("({x:1})", objExpr([objProp(ident("x"), lit(1), "init")])); +assertExpr("({x:1, y:2})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(ident("y"), lit(2), "init")])); +assertExpr("({x:1, y:2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(ident("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({x:1, 'y':2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({'x':1, 'y':2, z:3})", objExpr([objProp(lit("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(ident("z"), lit(3), "init") ])); +assertExpr("({'x':1, 'y':2, 3:3})", objExpr([objProp(lit("x"), lit(1), "init"), + objProp(lit("y"), lit(2), "init"), + objProp(lit(3), lit(3), "init") ])); + +// Bug 571617: eliminate constant-folding +assertExpr("2 + 3", binExpr("+", lit(2), lit(3))); + +// Bug 632026: constant-folding +assertExpr("typeof(0?0:a)", unExpr("typeof", condExpr(lit(0), lit(0), ident("a")))); + +// Bug 632056: constant-folding +program([exprStmt(ident("f")), + ifStmt(lit(1), + funDecl(ident("f"), [], blockStmt([])), + null)]).assert(Reflect.parse("f; if (1) function f(){}")); + +// statements + +assertStmt("throw 42", throwStmt(lit(42))); +assertStmt("for (;;) break", forStmt(null, null, null, breakStmt(null))); +assertStmt("for (x; y; z) break", forStmt(ident("x"), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (var x; y; z) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), ident("y"), ident("z"), breakStmt(null))); +assertStmt("for (x; ; z) break", forStmt(ident("x"), null, ident("z"), breakStmt(null))); +assertStmt("for (var x; ; z) break", forStmt(varDecl([declarator(ident("x"), null)]), null, ident("z"), breakStmt(null))); +assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), null, ident("z"), breakStmt(null))); +assertStmt("for (x; y; ) break", forStmt(ident("x"), ident("y"), null, breakStmt(null))); +assertStmt("for (var x; y; ) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), null, breakStmt(null))); +assertStmt("for (var x = 42; y; ) break", forStmt(varDecl([declarator(ident("x"),lit(42))]), ident("y"), null, breakStmt(null))); +assertStmt("for (var x in y) break", forInStmt(varDecl([declarator(ident("x"),null)]), ident("y"), breakStmt(null))); +assertStmt("for (x in y) break", forInStmt(ident("x"), ident("y"), breakStmt(null))); +assertStmt("{ }", blockStmt([])); +assertStmt("{ throw 1; throw 2; throw 3; }", blockStmt([ throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))])); +assertStmt(";", emptyStmt); +assertStmt("if (foo) throw 42;", ifStmt(ident("foo"), throwStmt(lit(42)), null)); +assertStmt("if (foo) throw 42; else true;", ifStmt(ident("foo"), throwStmt(lit(42)), exprStmt(lit(true)))); +assertStmt("if (foo) { throw 1; throw 2; throw 3; }", + ifStmt(ident("foo"), + blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), + null)); +assertStmt("if (foo) { throw 1; throw 2; throw 3; } else true;", + ifStmt(ident("foo"), + blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), + exprStmt(lit(true)))); +assertStmt("foo: for(;;) break foo;", labStmt(ident("foo"), forStmt(null, null, null, breakStmt(ident("foo"))))); +assertStmt("foo: for(;;) continue foo;", labStmt(ident("foo"), forStmt(null, null, null, continueStmt(ident("foo"))))); +assertStmt("with (obj) { }", withStmt(ident("obj"), blockStmt([]))); +assertStmt("with (obj) { obj; }", withStmt(ident("obj"), blockStmt([exprStmt(ident("obj"))]))); +assertStmt("while (foo) { }", whileStmt(ident("foo"), blockStmt([]))); +assertStmt("while (foo) { foo; }", whileStmt(ident("foo"), blockStmt([exprStmt(ident("foo"))]))); +assertStmt("do { } while (foo);", doStmt(blockStmt([]), ident("foo"))); +assertStmt("do { foo; } while (foo)", doStmt(blockStmt([exprStmt(ident("foo"))]), ident("foo"))); +assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; }", + switchStmt(ident("foo"), + [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), + caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), + defaultClause([ exprStmt(lit(3)) ]) ])); +assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; case 42: 42; }", + switchStmt(ident("foo"), + [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), + caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), + defaultClause([ exprStmt(lit(3)) ]), + caseClause(lit(42), [ exprStmt(lit(42)) ]) ])); +assertStmt("try { } catch (e) { }", + tryStmt(blockStmt([]), + [], + [ catchClause(ident("e"), null, blockStmt([])) ], + null)); +assertStmt("try { } catch (e) { } finally { }", + tryStmt(blockStmt([]), + [], + [ catchClause(ident("e"), null, blockStmt([])) ], + blockStmt([]))); +assertStmt("try { } finally { }", + tryStmt(blockStmt([]), + [], + [], + blockStmt([]))); + +// redeclarations (TOK_NAME nodes with lexdef) + +assertStmt("function f() { function g() { } function g() { } }", + funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), + funDecl(ident("g"), [], blockStmt([]))]))); + +assertStmt("function f() { function g() { } function g() { return 42 } }", + funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), + funDecl(ident("g"), [], blockStmt([returnStmt(lit(42))]))]))); + +assertStmt("function f() { var x = 42; var x = 43; }", + funDecl(ident("f"), [], blockStmt([varDecl([declarator(ident("x"),lit(42))]), + varDecl([declarator(ident("x"),lit(43))])]))); + +// getters and setters + + assertExpr("({ get x() { return 42 } })", + objExpr([ objProp(ident("x"), + funExpr(null, [], blockStmt([returnStmt(lit(42))])), + "get" ) ])); + assertExpr("({ set x(v) { return 42 } })", + objExpr([ objProp(ident("x"), + funExpr(null, [ident("v")], blockStmt([returnStmt(lit(42))])), + "set" ) ])); + +} + +exports.testReflect = testReflect; + +}(typeof exports === 'undefined' ? this : exports)); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js new file mode 100644 index 0000000..32ca3fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js @@ -0,0 +1,66 @@ +/* + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + 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. + + 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 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. +*/ + +/*jslint node:true */ + +(function () { + 'use strict'; + + var child = require('child_process'), + nodejs = '"' + process.execPath + '"', + ret = 0, + suites, + index; + + suites = [ + 'runner', + 'compat' + ]; + + function nextTest() { + var suite = suites[index]; + + if (index < suites.length) { + child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) { + if (stdout) { + process.stdout.write(suite + ': ' + stdout); + } + if (stderr) { + process.stderr.write(suite + ': ' + stderr); + } + if (err) { + ret = err.code; + } + index += 1; + nextTest(); + }); + } else { + process.exit(ret); + } + } + + index = 0; + nextTest(); +}()); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js new file mode 100644 index 0000000..c1a3fc9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js @@ -0,0 +1,387 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Yusuke Suzuki + Copyright (C) 2011 Arpad Borsos + + 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. + + 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 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. +*/ + +/*jslint browser:true node:true */ +/*global esprima:true, testFixture:true */ + +var runTests; + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + 'use strict'; + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +function NotMatchingError(expected, actual) { + 'use strict'; + Error.call(this, 'Expected '); + this.expected = expected; + this.actual = actual; +} +NotMatchingError.prototype = new Error(); + +function errorToObject(e) { + 'use strict'; + var msg = e.toString(); + + // Opera 9.64 produces an non-standard string in toString(). + if (msg.substr(0, 6) !== 'Error:') { + if (typeof e.message === 'string') { + msg = 'Error: ' + e.message; + } + } + + return { + index: e.index, + lineNumber: e.lineNumber, + column: e.column, + message: msg + }; +} + +function testParse(esprima, code, syntax) { + 'use strict'; + var expected, tree, actual, options, StringObject, i, len, err; + + // alias, so that JSLint does not complain. + StringObject = String; + + options = { + comment: (typeof syntax.comments !== 'undefined'), + range: true, + loc: true, + tokens: (typeof syntax.tokens !== 'undefined'), + raw: true, + tolerant: (typeof syntax.errors !== 'undefined') + }; + + if (typeof syntax.tokens !== 'undefined') { + if (syntax.tokens.length > 0) { + options.range = (typeof syntax.tokens[0].range !== 'undefined'); + options.loc = (typeof syntax.tokens[0].loc !== 'undefined'); + } + } + + if (typeof syntax.comments !== 'undefined') { + if (syntax.comments.length > 0) { + options.range = (typeof syntax.comments[0].range !== 'undefined'); + options.loc = (typeof syntax.comments[0].loc !== 'undefined'); + } + } + + expected = JSON.stringify(syntax, null, 4); + try { + tree = esprima.parse(code, options); + tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; + + if (options.tolerant) { + for (i = 0, len = tree.errors.length; i < len; i += 1) { + tree.errors[i] = errorToObject(tree.errors[i]); + } + } + + actual = JSON.stringify(tree, adjustRegexLiteral, 4); + + // Only to ensure that there is no error when using string object. + esprima.parse(new StringObject(code), options); + + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } + + function filter(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return (key === 'loc' || key === 'range') ? undefined : value; + } + + if (options.tolerant) { + return; + } + + + // Check again without any location info. + options.range = false; + options.loc = false; + expected = JSON.stringify(syntax, filter, 4); + try { + tree = esprima.parse(code, options); + tree = (options.comment || options.tokens) ? tree : tree.body[0]; + + if (options.tolerant) { + for (i = 0, len = tree.errors.length; i < len; i += 1) { + tree.errors[i] = errorToObject(tree.errors[i]); + } + } + + actual = JSON.stringify(tree, filter, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + +function testError(esprima, code, exception) { + 'use strict'; + var i, options, expected, actual, handleInvalidRegexFlag; + + // Different parsing options should give the same error. + options = [ + {}, + { comment: true }, + { raw: true }, + { raw: true, comment: true } + ]; + + // If handleInvalidRegexFlag is true, an invalid flag in a regular expression + // will throw an exception. In some old version V8, this is not the case + // and hence handleInvalidRegexFlag is false. + handleInvalidRegexFlag = false; + try { + 'test'.match(new RegExp('[a-z]', 'x')); + } catch (e) { + handleInvalidRegexFlag = true; + } + + expected = JSON.stringify(exception); + + for (i = 0; i < options.length; i += 1) { + + try { + esprima.parse(code, options[i]); + } catch (e) { + actual = JSON.stringify(errorToObject(e)); + } + + if (expected !== actual) { + + // Compensate for old V8 which does not handle invalid flag. + if (exception.message.indexOf('Invalid regular expression') > 0) { + if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { + return; + } + } + + throw new NotMatchingError(expected, actual); + } + + } +} + +function testAPI(esprima, code, result) { + 'use strict'; + var expected, res, actual; + + expected = JSON.stringify(result.result, null, 4); + try { + if (typeof result.property !== 'undefined') { + res = esprima[result.property]; + } else { + res = esprima[result.call].apply(esprima, result.args); + } + actual = JSON.stringify(res, adjustRegexLiteral, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + +function runTest(esprima, code, result) { + 'use strict'; + if (result.hasOwnProperty('lineNumber')) { + testError(esprima, code, result); + } else if (result.hasOwnProperty('result')) { + testAPI(esprima, code, result); + } else { + testParse(esprima, code, result); + } +} + +if (typeof window !== 'undefined') { + // Run all tests in a browser environment. + runTests = function () { + 'use strict'; + var total = 0, + failures = 0, + category, + fixture, + source, + tick, + expected, + index, + len; + + function setText(el, str) { + if (typeof el.innerText === 'string') { + el.innerText = str; + } else { + el.textContent = str; + } + } + + function startCategory(category) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('h4'); + setText(e, category); + report.appendChild(e); + } + + function reportSuccess(code) { + var report, e; + report = document.getElementById('report'); + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + } + + function reportFailure(code, expected, actual) { + var report, e; + + report = document.getElementById('report'); + + e = document.createElement('p'); + setText(e, 'Code:'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'code'); + setText(e, code); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Expected'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'expected'); + setText(e, expected); + report.appendChild(e); + + e = document.createElement('p'); + setText(e, 'Actual'); + report.appendChild(e); + + e = document.createElement('pre'); + e.setAttribute('class', 'actual'); + setText(e, actual); + report.appendChild(e); + } + + setText(document.getElementById('version'), esprima.version); + + tick = new Date(); + for (category in testFixture) { + if (testFixture.hasOwnProperty(category)) { + startCategory(category); + fixture = testFixture[category]; + for (source in fixture) { + if (fixture.hasOwnProperty(source)) { + expected = fixture[source]; + total += 1; + try { + runTest(esprima, source, expected); + reportSuccess(source, JSON.stringify(expected, null, 4)); + } catch (e) { + failures += 1; + reportFailure(source, e.expected, e.actual); + } + } + } + } + } + tick = (new Date()) - tick; + + if (failures > 0) { + setText(document.getElementById('status'), total + ' tests. ' + + 'Failures: ' + failures + '. ' + tick + ' ms'); + } else { + setText(document.getElementById('status'), total + ' tests. ' + + 'No failure. ' + tick + ' ms'); + } + }; +} else { + (function () { + 'use strict'; + + var esprima = require('../esprima'), + vm = require('vm'), + fs = require('fs'), + total = 0, + failures = [], + tick = new Date(), + expected, + header; + + vm.runInThisContext(fs.readFileSync(__dirname + '/test.js', 'utf-8')); + + Object.keys(testFixture).forEach(function (category) { + Object.keys(testFixture[category]).forEach(function (source) { + total += 1; + expected = testFixture[category][source]; + try { + runTest(esprima, source, expected); + } catch (e) { + e.source = source; + failures.push(e); + } + }); + }); + tick = (new Date()) - tick; + + header = total + ' tests. ' + failures.length + ' failures. ' + + tick + ' ms'; + if (failures.length) { + console.error(header); + failures.forEach(function (failure) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + }); + } else { + console.log(header); + } + process.exit(failures.length === 0 ? 0 : 1); + }()); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js new file mode 100644 index 0000000..8ceee54 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js @@ -0,0 +1,20238 @@ +/* + Copyright (C) 2012 Ariya Hidayat + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Yusuke Suzuki + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Yusuke Suzuki + Copyright (C) 2011 Arpad Borsos + + 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. + + 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 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. +*/ + +var testFixture = { + + 'Primary Expression': { + + 'this\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ThisExpression', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + }, + tokens: [{ + type: 'Keyword', + value: 'this', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + 'null\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: null, + raw: 'null', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 0 } + }, + tokens: [{ + type: 'Null', + value: 'null', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + '\n 42\n\n': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [5, 9], + loc: { + start: { line: 2, column: 4 }, + end: { line: 4, column: 0 } + } + }], + range: [5, 9], + loc: { + start: { line: 2, column: 4 }, + end: { line: 4, column: 0 } + }, + tokens: [{ + type: 'Numeric', + value: '42', + range: [5, 7], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }] + }, + + '(1 + 2 ) * 3': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [1, 6], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Literal', + value: 3, + raw: '3', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + } + + }, + + 'Grouping Operator': { + + '(1) + (2 ) + 3': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + right: { + type: 'Literal', + value: 3, + raw: '3', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '4 + 5 << (6)': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 4, + raw: '4', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 5, + raw: '5', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 6, + raw: '6', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + } + + }, + + 'Array Initializer': { + + 'x = []': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + }, + tokens: [{ + type: 'Identifier', + value: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: 'Punctuator', + value: '=', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Punctuator', + value: '[', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: ']', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }] + }, + + 'x = [ ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x = [ 42 ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }], + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'x = [ 42, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }], + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x = [ ,, 42 ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [ + null, + null, + { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'x = [ 1, 2, 3, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Literal', + value: 2, + raw: '2', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = [ 1, 2,, 3, ]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Literal', + value: 2, + raw: '2', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, null, { + type: 'Literal', + value: 3, + raw: '3', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + '日本語 = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '日本語', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'T\u203F = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u203F', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'T\u200C = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u200C', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'T\u200D = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'T\u200D', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\u2163\u2161 = []': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '\u2163\u2161', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\u2163\u2161\u200A=\u2009[]': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: '\u2163\u2161', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Object Initializer': { + + 'x = {}': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x = { }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x = { answer: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'answer', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + kind: 'init', + range: [6, 16], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 16 } + } + }], + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'x = { if: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + kind: 'init', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x = { true: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + kind: 'init', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = { false: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'x = { null: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + kind: 'init', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }], + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'x = { "answer": 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'answer', + raw: '"answer"', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [16, 18], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'x = { x: 1, x: 2 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [ + { + type: 'Property', + key: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + kind: 'init', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + { + type: 'Property', + key: { + type: 'Identifier', + name: 'x', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + kind: 'init', + range: [12, 16], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 16 } + } + } + ], + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'x = { get width() { return m_width } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'm_width', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + range: [20, 35], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 35 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + kind: 'get', + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }], + range: [4, 38], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'x = { get undef() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'undef', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'get', + range: [6, 20], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } + } + }], + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'x = { get if() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + kind: 'get', + range: [6, 17], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 17 } + } + }], + range: [4, 19], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'x = { get true() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + kind: 'get', + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'x = { get false() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'get', + range: [6, 20], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } + } + }], + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'x = { get null() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 19], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 19 } + } + }, + kind: 'get', + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'x = { get "undef"() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'undef', + raw: '"undef"', + range: [10, 17], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + kind: 'get', + range: [6, 22], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } + } + }], + range: [4, 24], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'x = { get 10() {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 10, + raw: '10', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + kind: 'get', + range: [6, 17], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 17 } + } + }], + range: [4, 19], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'x = { set width(w) { m_width = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_width', + range: [21, 28], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set if(w) { m_if = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'if', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_if', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + range: [18, 26], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 26 } + } + }, + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + range: [16, 28], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [16, 28], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 28 } + } + }, + kind: 'set', + range: [6, 28], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 28 } + } + }], + range: [4, 30], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'x = { set true(w) { m_true = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'true', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_true', + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + kind: 'set', + range: [6, 32], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 32 } + } + }], + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'x = { set false(w) { m_false = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'false', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_false', + range: [21, 28], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + }, + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set null(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'null', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + kind: 'set', + range: [6, 32], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 32 } + } + }], + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'x = { set "null"(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'null', + raw: '"null"', + range: [10, 16], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [22, 28], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + range: [22, 32], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 32 } + } + }, + range: [22, 33], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 33 } + } + }], + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }], + range: [4, 36], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'x = { set 10(w) { m_null = w } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 10, + raw: '10', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'w', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_null', + range: [18, 24], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 24 } + } + }, + right: { + type: 'Identifier', + name: 'w', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }], + range: [16, 30], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [16, 30], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 30 } + } + }, + kind: 'set', + range: [6, 30], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 30 } + } + }], + range: [4, 32], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 32 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'x = { get: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'get', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + kind: 'init', + range: [6, 13], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + 'x = { set: 43 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'set', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'Literal', + value: 43, + raw: '43', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + kind: 'init', + range: [6, 13], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 13 } + } + }], + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + } + + }, + + 'Comments': { + + '/* block comment */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + + '42 /*The*/ /*Answer*/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + comments: [{ + type: 'Block', + value: 'The', + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Block', + value: 'Answer', + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }] + }, + + '42 /*the*/ /*answer*/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2] + }, + range: [0, 21] + }], + range: [0, 21], + comments: [{ + type: 'Block', + value: 'the', + range: [3, 10] + }, { + type: 'Block', + value: 'answer', + range: [11, 21] + }] + }, + + '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + + '/*a\r\nb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [9, 11], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\r\nb', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\rb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\rb', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\nb*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nb', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '/*a\nc*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nc', + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }, + + '// line comment\n42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [16, 18], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [16, 18], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + + '42 // line comment': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + comments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } + }] + }, + + '// Hello, world!\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [17, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '// Hello, world!\n': { + type: 'Program', + body: [], + range: [17, 17], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '// Hallo, world!\n': { + type: 'Program', + body: [], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hallo, world!', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] + }, + + '//\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }, + + '//': { + type: 'Program', + body: [], + range: [2, 2], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }, + + '// ': { + type: 'Program', + body: [], + range: [3, 3], + comments: [{ + type: 'Line', + value: ' ', + range: [0, 3] + }] + }, + + '/**/42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + comments: [{ + type: 'Block', + value: '', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }, + + '// Hello, world!\n\n// Another hello\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }, + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }], + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], + loc: { + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } + } + }] + }, + + 'if (x) { // Some comment\ndoThat(); }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [25, 31], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }, + 'arguments': [], + range: [25, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 8 } + } + }, + range: [25, 34], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 9 } + } + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 11 } + } + }, + alternate: null, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 11 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] + }, + + 'switch (answer) { case 42: /* perfect */ bingo() }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + 'arguments': [], + range: [41, 48], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 48 } + } + }, + range: [41, 49], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 49 } + } + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 50 } + } + }], + range: [0, 50], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 50 } + }, + comments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] + } + + }, + + 'Numeric Literals': { + + '0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + '42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '3': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1] + }, + range: [0, 1] + }], + range: [0, 1], + tokens: [{ + type: 'Numeric', + value: '3', + range: [0, 1] + }] + }, + + '5': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 5, + raw: '5', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + tokens: [{ + type: 'Numeric', + value: '5', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }] + }, + + '.14': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0.14, + raw: '.14', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '3.14159': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3.14159, + raw: '3.14159', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '6.02214179e+23': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 6.02214179e+23, + raw: '6.02214179e+23', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '1.492417830e-10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 1.49241783e-10, + raw: '1.492417830e-10', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '0x0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '0e+100': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '0xabc': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0xabc, + raw: '0xabc', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0xdef': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0xdef, + raw: '0xdef', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0X1A': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x1A, + raw: '0X1A', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '0x10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x10, + raw: '0x10', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '0x100': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0x100, + raw: '0x100', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '0X04': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0X04, + raw: '0X04', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '02': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '02', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '012': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 10, + raw: '012', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '0012': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 10, + raw: '0012', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + } + + }, + + 'String Literals': { + + '"Hello"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello', + raw: '"Hello"', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '\n\r\t\x0B\b\f\\\'"\x00', + raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '"\\u0061"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'a', + raw: '"\\u0061"', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + '"\\x61"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'a', + raw: '"\\x61"', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '"\\u00"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'u00', + raw: '"\\u00"', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '"\\xt"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'xt', + raw: '"\\xt"', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '"Hello\\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\nworld', + raw: '"Hello\\nworld"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '"Hello\\\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\nworld"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 14 } + } + }, + + '"Hello\\02World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0002World', + raw: '"Hello\\02World"', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + '"Hello\\012World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u000AWorld', + raw: '"Hello\\012World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\122World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\122World', + raw: '"Hello\\122World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\0122World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u000A2World', + raw: '"Hello\\0122World"', + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + '"Hello\\312World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u00CAWorld', + raw: '"Hello\\312World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\412World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\412World', + raw: '"Hello\\412World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\812World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello812World', + raw: '"Hello\\812World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\712World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\712World', + raw: '"Hello\\712World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '"Hello\\0World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0000World', + raw: '"Hello\\0World"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '"Hello\\\r\nworld"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\r\nworld"', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '"Hello\\1World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u0001World', + raw: '"Hello\\1World"', + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + }, + + 'Regular Expression Literals': { + + 'var x = /[a-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-z]/i', + raw: '/[a-z]/i', + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }], + kind: 'var', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/i', + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] + }, + + 'var x = /[x-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5] + }, + init: { + type: 'Literal', + value: '/[x-z]/i', + raw: '/[x-z]/i', + range: [8, 16] + }, + range: [4, 16] + }], + kind: 'var', + range: [0, 16] + }], + range: [0, 16], + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3] + }, { + type: 'Identifier', + value: 'x', + range: [4, 5] + }, { + type: 'Punctuator', + value: '=', + range: [6, 7] + }, { + type: 'RegularExpression', + value: '/[x-z]/i', + range: [8, 16] + }] + }, + + 'var x = /[a-c]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-c]/i', + raw: '/[a-c]/i', + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + } + }], + kind: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-c]/i', + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] + }, + + 'var x = /[P QR]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/i', + raw: '/[P QR]/i', + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }, + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }], + kind: 'var', + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }], + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/i', + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }] + }, + + 'var x = /[\\]/]/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: new RegExp('[\\]/]').toString(), + raw: '/[\\]/]/', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + range: [4, 15], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\]/]/', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }] + }, + + 'var x = /foo\\/bar/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/foo\\/bar/', + raw: '/foo\\/bar/', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/foo\\/bar/', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] + }, + + 'var x = /=([^=\\s])+/g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/=([^=\\s])+/g', + raw: '/=([^=\\s])+/g', + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }, + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } + } + }], + kind: 'var', + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/=([^=\\s])+/g', + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }] + }, + + 'var x = /[P QR]/\\u0067': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/g', + raw: '/[P QR]/\\u0067', + range: [8, 22], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 22 } + } + }, + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/\\u0067', + range: [8, 22], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 22 } + } + }] + }, + + 'var x = /[P QR]/\\g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[P QR]/g', + raw: '/[P QR]/\\g', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/\\g', + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] + } + + }, + + 'Left-Hand-Side Expression': { + + 'new Button': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'Button', + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + 'arguments': [], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'new Button()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'Button', + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, + 'arguments': [], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + 'new new foo': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'new new foo()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'new foo().bar()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + 'arguments': [], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + 'new foo[bar]': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + range: [4, 12], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + 'new foo.bar()': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [8, 11], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } + } + }, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + '( new foo).bar()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + 'arguments': [], + range: [2, 9], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 9 } + } + }, + property: { + type: 'Identifier', + name: 'bar', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + 'arguments': [], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + 'foo(bar, baz)': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'bar', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, { + type: 'Identifier', + name: 'baz', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + '( foo )()': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'universe.milkyway': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'universe.milkyway.solarsystem': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + property: { + type: 'Identifier', + name: 'solarsystem', + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'universe.milkyway.solarsystem.Earth': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + property: { + type: 'Identifier', + name: 'solarsystem', + range: [18, 29], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + property: { + type: 'Identifier', + name: 'Earth', + range: [30, 35], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'universe[galaxyName, otherUselessName]': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'galaxyName', + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, { + type: 'Identifier', + name: 'otherUselessName', + range: [21, 37], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 37 } + } + }], + range: [9, 37], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'universe[galaxyName]': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'galaxyName', + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'universe[42].galaxies': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'universe(42).galaxies': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'universe(42).galaxies(14, 3, 77).milkyway': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 14, + raw: '14', + range: [22, 24], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 24 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: 'Literal', + value: 77, + raw: '77', + range: [29, 31], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'earth.asia.Indonesia.prepareForElection(2014)': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'earth', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + property: { + type: 'Identifier', + name: 'asia', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + property: { + type: 'Identifier', + name: 'Indonesia', + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + property: { + type: 'Identifier', + name: 'prepareForElection', + range: [21, 39], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 39 } + } + }, + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 2014, + raw: '2014', + range: [40, 44], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 44 } + } + }], + range: [0, 45], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 45 } + } + }, + range: [0, 45], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 45 } + } + }, + + 'universe.if': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'if', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'universe.true': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'true', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'universe.false': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'false', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'universe.null': { + type: 'ExpressionStatement', + expression: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'null', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + } + + }, + + 'Postfix Expressions': { + + 'x++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'x--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'eval++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + prefix: false, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'eval--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + prefix: false, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'arguments++': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + prefix: false, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'arguments--': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + prefix: false, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + } + + }, + + 'Unary Operators': { + + '++x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '--x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '++eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '--eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + '++arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, + prefix: true, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '--arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, + prefix: true, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '+x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '+', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '-x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '-', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '~x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '~', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '!x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '!', + argument: { + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + prefix: true, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + 'void x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'void', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: true, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'delete x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + prefix: true, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'typeof x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'typeof', + argument: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + prefix: true, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + + }, + + 'Multiplicative Operators': { + + 'x * y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x / y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x % y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Additive Operators': { + + 'x + y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x - y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Bitwise Shift Operator': { + + 'x << y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >>> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Relational Operators': { + + 'x < y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x > y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x <= y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x >= y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x in y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x instanceof y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: 'instanceof', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x < y < z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Equality Operators': { + + 'x == y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x != y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x === y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '===', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x !== y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Binary Bitwise Operators': { + + 'x & y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x ^ y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x | y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Binary Expressions': { + + 'x + y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x - y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x % y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x << y << z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x | y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x ^ y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Binary Logical Operators': { + + 'x || y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x && y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x || y || z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x && y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + } + + }, + + 'Conditional Operator': { + + 'y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'Identifier', + name: 'y', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x && y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + + }, + + 'Assignment Operators': { + + 'x = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'eval = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'arguments = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x *= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '*=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x /= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '/=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x %= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '%=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x += 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '+=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x -= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '-=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x <<= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '<<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x &= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '&=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x ^= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '^=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + 'x |= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '|=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + } + + }, + + 'Block': { + + '{ foo }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'foo', + range: [2, 5], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } + } + }, + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '{ doThis(); doThat(); }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThis', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [], + range: [2, 10], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 10 } + } + }, + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [12, 18], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 18 } + } + }, + 'arguments': [], + range: [12, 20], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 20 } + } + }, + range: [12, 21], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '{}': { + type: 'BlockStatement', + body: [], + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + } + + }, + + 'Variable Statement': { + + 'var x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'var x, y;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + init: null, + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], + kind: 'var', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'var x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }, + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + + 'var eval = 42, arguments = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [4, 8], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var x = 14, y = 3, z = 1977': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }, + range: [4, 10], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [12, 17], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 17 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + kind: 'var', + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'var implements, interface, package': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'implements', + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, + init: null, + range: [4, 14], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'interface', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + init: null, + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'package', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + init: null, + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var private, protected, public, static': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'private', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + init: null, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'protected', + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'public', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + init: null, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'static', + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }, + init: null, + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + 'Let Statement': { + + 'let x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'let', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '{ let x }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: null, + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }], + kind: 'let', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + '{ let x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'let', + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }], + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '{ let x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }, + range: [21, 29], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 29 } + } + }], + kind: 'let', + range: [2, 30], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 30 } + } + }], + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + } + + }, + + 'Const Statement': { + + 'const x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'const', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + + '{ const x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }], + kind: 'const', + range: [2, 15], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 15 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + + '{ const x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + kind: 'const', + range: [2, 32], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 32 } + } + }], + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + } + + }, + + 'Empty Statement': { + + ';': { + type: 'EmptyStatement', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + } + + }, + + 'Expression Statement': { + + 'x': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + 'x, y': { + type: 'ExpressionStatement', + expression: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: 'Identifier', + name: 'y', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }], + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + + '\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'a', + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'a\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\\ua': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'ua', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + 'a\\u': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'au', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + } + + }, + + 'If Statement': { + + 'if (morning) goodMorning()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + alternate: null, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'if (morning) (function(){})': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [24, 26], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 26 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: null, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'if (morning) var x = 0;': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [17, 22], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [13, 23], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 23 } + } + }, + alternate: null, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + 'if (morning) function a(){}': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'a', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: null, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'if (morning) goodMorning(); else goodDay()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 27], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } + } + }, + alternate: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodDay', + range: [33, 40], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 42], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 42 } + } + } + + }, + + 'Iteration Statements': { + + 'do keep(); while (true)': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + 'do keep(); while (true);': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'do { x++; y--; } while (x < 10)': { + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: false, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + prefix: false, + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }], + range: [3, 16], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 16 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [28, 30], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 30 } + } + }, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + '{ do { } while (false) false }': { + type: 'BlockStatement', + body: [{ + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [], + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + test: { + type: 'Literal', + value: false, + raw: 'false', + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, + range: [2, 22], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 22 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: false, + raw: 'false', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + range: [23, 29], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 29 } + } + }], + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'while (true) doSomething()': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doSomething', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (x < 10) { x++; y--; }': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [22, 25], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 25 } + } + }, + range: [22, 26], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 26 } + } + }], + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'for(;;);': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'for(;;){}': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BlockStatement', + body: [], + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'for(x = 0;;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'for(var x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'var', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'for(let x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'let', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }, + + 'for(var x = 0, y = 1;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }], + kind: 'var', + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: null, + body: { + type: 'EmptyStatement', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'for(x = 0; x < 42; x++);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42; x++) process(x);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [24, 31], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 31 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'for(x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [15, 22], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 22 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }], + range: [15, 25], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 25 } + } + }, + range: [15, 26], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 26 } + } + }, + each: false, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'for (var x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (let x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'let', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (let x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'let', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (var i = function() { return 10 in [] } in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'i', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Literal', + value: 10, + raw: '10', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 43], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + range: [9, 43], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [5, 43], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 43 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [47, 51], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 51 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [53, 60], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 60 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [61, 62], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 62 } + } + }], + range: [53, 63], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 63 } + } + }, + range: [53, 64], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 64 } + } + }, + each: false, + range: [0, 64], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 64 } + } + } + + }, + + 'continue statement': { + + 'while (true) { continue; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (true) { continue }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 25], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 25 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'done: while (true) { continue done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 36], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 36 } + } + }, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'done: while (true) { continue done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 37], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 37 } + } + }, + range: [6, 37], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + } + + }, + + 'break statement': { + + 'while (true) { break }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: null, + range: [15, 21], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 21 } + } + } + ], + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'done: while (true) { break done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 33], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 33 } + } + }, + range: [6, 33], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 33 } + } + }, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'done: while (true) { break done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + } + + }, + + 'return statement': { + + '(function(){ return })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 21], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '(function(){ return; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 22], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 22], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function(){ return x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + '(function(){ return x * y })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + } + ], + range: [11, 27], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 27], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + } + }, + + 'with statement': { + + 'with (x) foo = bar': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'with (x) foo = bar;': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'with (x) { foo = bar }': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }], + range: [9, 22], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + } + + }, + + 'switch statement': { + + 'switch (x) {}': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + cases:[], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'switch (answer) { case 42: hi(); break; }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'switch (answer) { case 42: hi(); break; default: break }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }, { + type: 'SwitchCase', + test: null, + consequent: [{ + type: 'BreakStatement', + label: null, + range: [49, 55], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 55 } + } + }], + range: [40, 55], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 56], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 56 } + } + } + + }, + + 'Labelled Statements': { + + 'start: for (;;) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + range: [16, 27], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 27 } + } + }, + range: [7, 27], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'start: while (true) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + range: [7, 31], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 31 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + } + + }, + + 'throw statement': { + + 'throw x;': { + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'throw x * y': { + type: 'ThrowStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'throw { message: "Error" }': { + type: 'ThrowStatement', + argument: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'message', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 'Error', + raw: '"Error"', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + kind: 'init', + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + range: [6, 26], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + } + + }, + + 'try statement': { + + 'try { } catch (e) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [18, 21], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } + } + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }], + finalizer: null, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'try { } catch (eval) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [15, 19], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + finalizer: null, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'try { } catch (arguments) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, + range: [8, 29], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 29 } + } + }], + finalizer: null, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'try { } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }], + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [8, 28], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 28 } + } + }], + finalizer: null, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'try { } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [18, 25], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }], + range: [16, 34], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'try { doThat(); } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: null, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [49, 56], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 56 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [57, 62], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 62 } + } + }], + range: [49, 63], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 63 } + } + }, + range: [49, 64], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 64 } + } + }], + range: [47, 65], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 65 } + } + }, + range: [0, 65], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 65 } + } + } + + }, + + 'debugger statement': { + + 'debugger;': { + type: 'DebuggerStatement', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Function Definition': { + + 'function hello() { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [19, 24], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [19, 26], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'function eval() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'function arguments() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'function test(t, t) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, { + type: 'Identifier', + name: 't', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function test(t, t) { })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'test', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 't', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'function eval() { function inner() { "use strict" } }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'inner', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\"use strict\"', + range: [37, 49], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 49 } + } + }, + range: [37, 50], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 50 } + } + }], + range: [35, 51], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 51 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 51], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 51 } + } + }], + range: [16, 53], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 53 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 53], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 53 } + } + }, + + 'function hello(a) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [], + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + range: [20, 28], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 28 } + } + }], + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'function hello(a, b) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 'b', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + 'arguments': [], + range: [23, 30], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 30 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'var hi = function() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [], + range: [22, 29], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 29 } + } + }, + range: [22, 30], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 30 } + } + }], + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 31], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 31 } + } + }, + range: [4, 31], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'var hi = function eval() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 28], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 28 } + } + }, + range: [4, 28], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var hi = function arguments() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 33], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 33 } + } + }, + range: [4, 33], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 33 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var hello = function hi() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hello', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'hi', + range: [21, 23], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [], + range: [28, 35], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 35 } + } + }, + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }], + range: [26, 37], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 37], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 37 } + } + }, + range: [4, 37], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 37 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + '(function(){})': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 13], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + } + + }, + + 'Automatic semicolon insertion': { + + '{ x\n++y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '{ x\n--y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + 'var x /* comment */;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + '{ var x = 14, y = 3\nz; }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }], + kind: 'var', + range: [2, 20], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'z', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 4 } + } + }, + + 'while (true) { continue\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 32], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [35, 40], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [35, 41], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [47, 52], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [47, 53], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 55], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + 'while (true) { break\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [21, 26], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [21, 27], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [32, 37], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [32, 38], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [44, 49], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [44, 50], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 52], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 52], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + '(function(){ return\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return // Comment\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [31, 32], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [31, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 35], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 35], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return/* Multiline\nComment */x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [42, 43], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 11 } + } + }, + range: [42, 44], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 12 } + } + } + ], + range: [11, 46], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 46], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '{ throw error\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 14], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [14, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [14, 20], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error// Comment\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 24], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 0 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error/* Multiline\nComment */error; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 36], + loc: { + start: { line: 1, column: 2 }, + end: { line: 2, column: 10 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [36, 41], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [36, 42], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + } + + }, + + 'Source elements': { + + '': { + type: 'Program', + body: [], + range: [0, 0], + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 } + }, + tokens: [] + } + }, + + 'Invalid syntax': { + + '{': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '}': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token }' + }, + + '3ea': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in []': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e+': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e-': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x0': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '09': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '018': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '01a': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in[]': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x3in[]': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"Hello\nWorld"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u005c': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u002a': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /(s/g': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Invalid regular expression' + }, + + '/': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\ux': { + index: 18, + lineNumber: 1, + column: 19, + message: 'Error: Line 1: Invalid regular expression' + }, + + '3 = 4': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'func() = 4': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '(1 + 1) = 10': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1++': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1--': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '++1': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '--1': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'for((1 + 1) in list) process(x);': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + '[': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '[,': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + {': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + { t:t ': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected end of input' + }, + + '1 + { t:t,': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'var x = /\n/': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = "\n': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var if = 42': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token if' + }, + + 'i + 2 = 42': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '+i = 42': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + '1 + (': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + '\n\n\n{': { + index: 4, + lineNumber: 4, + column: 2, + message: 'Error: Line 4: Unexpected end of input' + }, + + '\n/* Some multiline\ncomment */\n)': { + index: 30, + lineNumber: 4, + column: 1, + message: 'Error: Line 4: Unexpected token )' + }, + + '{ set 1 }': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + '{ get 2 }': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + '({ set: s(if) { } })': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token if' + }, + + '({ set s(.) { } })': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token .' + }, + + '({ set s() { } })': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token )' + }, + + '({ set: s() { } })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ set: s(a, b) { } })': { + index: 16, + lineNumber: 1, + column: 17, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ get: g(d) { } })': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Unexpected token {' + }, + + '({ get i() { }, i: 42 })': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ i: 42, get i() { } })': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ set i(x) { }, i: 42 })': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ i: 42, set i(x) { } })': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }, + + '({ get i() { }, get i() { } })': { + index: 27, + lineNumber: 1, + column: 28, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }, + + '({ set i(x) { }, set i(x) { } })': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }, + + 'function t(if) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token if' + }, + + 'function t(true) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token true' + }, + + 'function t(false) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token false' + }, + + 'function t(null) { }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token null' + }, + + 'function null() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token null' + }, + + 'function true() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token true' + }, + + 'function false() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token false' + }, + + 'function if() { }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token if' + }, + + 'a b;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected identifier' + }, + + 'if.a;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token .' + }, + + 'a if;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token if' + }, + + 'a class;': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected reserved word' + }, + + 'break\n': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal break statement' + }, + + 'break 1;': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected number' + }, + + 'continue\n': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'continue 2;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected number' + }, + + 'throw': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'throw;': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'throw\n': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal newline after throw' + }, + + 'for (var i, i2 in {});': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Unexpected token in' + }, + + 'for ((i in {}));': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token )' + }, + + 'for (i + 1 in {});': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + 'for (+i in {});': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }, + + 'if(false)': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'if(false) doThis(); else': { + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'do': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'while(false)': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'for(;;)': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'with(x)': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'try { }': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Missing catch or finally after try' + }, + + 'try {} catch (42) {} ': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected number' + }, + + 'try {} catch (answer()) {} ': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Unexpected token (' + }, + + 'try {} catch (-x) {} ': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token -' + }, + + + '\u203F = 10': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'const x = 12, y;': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'const x, y = 12;': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ,' + }, + + 'const x;': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ;' + }, + + 'if(true) let a = 1;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token let' + }, + + 'if(true) const a = 1;': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token const' + }, + + 'switch (c) { default: default: }': { + index: 30, + lineNumber: 1, + column: 31, + message: 'Error: Line 1: More than one default clause in switch statement' + }, + + 'new X()."s"': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Unexpected string' + }, + + '/*': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*\n\n\n': { + index: 5, + lineNumber: 4, + column: 1, + message: 'Error: Line 4: Unexpected token ILLEGAL' + }, + + '/**': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*\n\n*': { + index: 5, + lineNumber: 3, + column: 2, + message: 'Error: Line 3: Unexpected token ILLEGAL' + }, + + '/*hello': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/*hello *': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\n]': { + index: 1, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\r]': { + index: 1, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\r\n]': { + index: 2, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '\n\r]': { + index: 2, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '//\r\n]': { + index: 4, + lineNumber: 2, + column: 1, + message: 'Error: Line 2: Unexpected token ]' + }, + + '//\n\r]': { + index: 4, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/a\\\n/': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '//\r \n]': { + index: 5, + lineNumber: 3, + column: 1, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/*\r\n*/]': { + index: 6, + lineNumber: 2, + column: 3, + message: 'Error: Line 2: Unexpected token ]' + }, + + '/*\n\r*/]': { + index: 6, + lineNumber: 3, + column: 3, + message: 'Error: Line 3: Unexpected token ]' + }, + + '/*\r \n*/]': { + index: 7, + lineNumber: 3, + column: 3, + message: 'Error: Line 3: Unexpected token ]' + }, + + '\\\\': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\u005c': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + + '\\x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\u0000': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\u200C = []': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\u200D = []': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'try { } catch() {}': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Unexpected token )' + }, + + 'return': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Illegal return statement' + }, + + 'break': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Illegal break statement' + }, + + 'continue': { + index: 8, + lineNumber: 1, + column: 9, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'switch (x) { default: continue; }': { + index: 31, + lineNumber: 1, + column: 32, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'do { x } *': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token *' + }, + + 'while (true) { break x; }': { + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'while (true) { continue x; }': { + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { break x; }); }': { + index: 40, + lineNumber: 1, + column: 41, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { continue x; }); }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Undefined label \'x\'' + }, + + 'x: while (true) { (function () { break; }); }': { + index: 39, + lineNumber: 1, + column: 40, + message: 'Error: Line 1: Illegal break statement' + }, + + 'x: while (true) { (function () { continue; }); }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Illegal continue statement' + }, + + 'x: while (true) { x: while (true) { } }': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Label \'x\' has already been declared' + }, + + '(function () { \'use strict\'; delete i; }())': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' + }, + + '(function () { \'use strict\'; with (i); }())': { + index: 28, + lineNumber: 1, + column: 29, + message: 'Error: Line 1: Strict mode code may not include a with statement' + }, + + 'function hello() {\'use strict\'; ({ i: 42, i: 42 }) }': { + index: 47, + lineNumber: 1, + column: 48, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ hasOwnProperty: 42, hasOwnProperty: 42 }) }': { + index: 73, + lineNumber: 1, + column: 74, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; var eval = 10; }': { + index: 40, + lineNumber: 1, + column: 41, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; var arguments = 10; }': { + index: 45, + lineNumber: 1, + column: 46, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; try { } catch (eval) { } }': { + index: 51, + lineNumber: 1, + column: 52, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; try { } catch (arguments) { } }': { + index: 56, + lineNumber: 1, + column: 57, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; eval = 10; }': { + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; arguments = 10; }': { + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ++eval; }': { + index: 38, + lineNumber: 1, + column: 39, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; --eval; }': { + index: 38, + lineNumber: 1, + column: 39, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; ++arguments; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; --arguments; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; eval++; }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; eval--; }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; arguments++; }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; arguments--; }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }, + + 'function hello() {\'use strict\'; function eval() { } }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; function arguments() { } }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function eval() {\'use strict\'; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function arguments() {\'use strict\'; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; (function eval() { }()) }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; (function arguments() { }()) }': { + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function eval() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function arguments() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function hello() {\'use strict\'; ({ s: function eval() { } }); }': { + index: 47, + lineNumber: 1, + column: 48, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + '(function package() {\'use strict\'; })()': { + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() {\'use strict\'; ({ i: 10, set s(eval) { } }); }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ set s(eval) { } }); }': { + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() {\'use strict\'; ({ s: function s(eval) { } }); }': { + index: 49, + lineNumber: 1, + column: 50, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello(eval) {\'use strict\';}': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello(arguments) {\'use strict\';}': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() { \'use strict\'; function inner(eval) {} }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function hello() { \'use strict\'; function inner(arguments) {} }': { + index: 48, + lineNumber: 1, + column: 49, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + ' "\\1"; \'use strict\';': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; "\\1"; }': { + index: 33, + lineNumber: 1, + column: 34, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; 021; }': { + index: 33, + lineNumber: 1, + column: 34, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; ({ "\\1": 42 }); }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { \'use strict\'; ({ 021: 42 }); }': { + index: 36, + lineNumber: 1, + column: 37, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "octal directive\\1"; "use strict"; }': { + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "octal directive\\1"; "octal directive\\2"; "use strict"; }': { + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "use strict"; function inner() { "octal directive\\1"; } }': { + index: 52, + lineNumber: 1, + column: 53, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + 'function hello() { "use strict"; var implements; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var interface; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var package; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var private; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var protected; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var public; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var static; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var yield; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var let; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello(static) { "use strict"; }': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function static() { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'var yield': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token yield' + }, + + 'var let': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token let' + }, + + '"use strict"; function static() { }': { + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a(t, t) { "use strict"; }': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a(eval) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function a(package) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a() { "use strict"; function b(t, t) { }; }': { + index: 43, + lineNumber: 1, + column: 44, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '(function a(t, t) { "use strict"; })': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a() { "use strict"; (function b(t, t) { }); }': { + index: 44, + lineNumber: 1, + column: 45, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '(function a(eval) { "use strict"; })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(function a(package) { "use strict"; })': { + index: 12, + lineNumber: 1, + column: 13, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'var': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'let': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected end of input' + }, + + 'const': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected end of input' + } + + }, + + 'API': { + 'parse()': { + call: 'parse', + args: [], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(null)': { + call: 'parse', + args: [null], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: null + } + }] + } + }, + + 'parse(42)': { + call: 'parse', + args: [42], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42 + } + }] + } + }, + + 'parse(true)': { + call: 'parse', + args: [true], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true + } + }] + } + }, + + 'parse(undefined)': { + call: 'parse', + args: [void 0], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(new String("test"))': { + call: 'parse', + args: [new String('test')], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test' + } + }] + } + }, + + 'parse(new Number(42))': { + call: 'parse', + args: [new Number(42)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42 + } + }] + } + }, + + 'parse(new Boolean(true))': { + call: 'parse', + args: [new Boolean(true)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true + } + }] + } + }, + + 'Syntax': { + property: 'Syntax', + result: { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + } + } + + }, + + 'Tolerant parse': { + 'return': { + type: 'Program', + body: [{ + type: 'ReturnStatement', + 'argument': null, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + }, + errors: [{ + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Illegal return statement' + }] + }, + + '(function () { \'use strict\'; with (i); }())': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [15, 27], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 27 } + } + }, + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + body: { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + range: [29, 38], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 38 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 40 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 40], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [1, 42], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + } + }], + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + }, + errors: [{ + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Strict mode code may not include a with statement' + }] + }, + + '(function () { \'use strict\'; 021 }())': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [15, 27], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 27 } + } + }, + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 17, + raw: "021", + range: [29, 32], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 32 } + } + }, + range: [29, 33], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 33 } + } + }], + range: [13, 34], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 34], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 34 } + } + }, + 'arguments': [], + range: [1, 36], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + }], + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + }, + errors: [{ + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; delete x': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { + type: 'Identifier', + name: 'x', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + prefix: true, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + }, + errors: [{ + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' + }] + }, + + '"use strict"; try {} catch (eval) {}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [28, 32], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 32 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [34, 36], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 36 } + } + }, + range: [21, 36], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 36 } + } + }], + finalizer: null, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; try {} catch (arguments) {}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [28, 37], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 37 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [21, 41], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 41 } + } + }], + finalizer: null, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; var eval;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }], + kind: 'var', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 22, + lineNumber: 1, + column: 23, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; var arguments;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + init: null, + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + kind: 'var', + range: [14, 28], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 28 } + } + }], + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + }, + errors: [{ + index: 27, + lineNumber: 1, + column: 28, + message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; eval = 0;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; eval++;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [14, 20], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 20 } + } + }, + range: [14, 21], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + errors: [{ + index: 18, + lineNumber: 1, + column: 19, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; --eval;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'eval', + range: [16, 20], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 20 } + } + }, + prefix: true, + range: [14, 20], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 20 } + } + }, + range: [14, 21], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + }, + errors: [{ + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; arguments = 0;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'arguments', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + } + }, + range: [14, 28], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 28 } + } + }], + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + }, + errors: [{ + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; arguments--;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'arguments', + range: [14, 23], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [14, 25], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 25 } + } + }, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }], + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + '"use strict"; ++arguments;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'arguments', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + prefix: true, + range: [14, 25], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 25 } + } + }, + range: [14, 26], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } + } + }], + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' + }] + }, + + + '"use strict";x={y:1,y:1}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + kind: 'init', + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + value: { + type: 'Literal', + value: 1, + raw: '1', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + kind: 'init', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }], + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' + }] + }, + + '"use strict"; function eval() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 32], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 32], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 32 } + } + }, { + type: 'EmptyStatement', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; function arguments() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [23, 32], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [35, 37], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 37], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 37 } + } + }, { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }], + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; function interface() {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'interface', + range: [23, 32], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [35, 37], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 37], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 37 } + } + }, { + type: 'EmptyStatement', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }], + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + }, + errors: [{ + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }] + }, + + '"use strict"; (function eval() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [24, 28], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 28 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [31, 33], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 33], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 33 } + } + }, + range: [14, 35], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 35 } + } + }], + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; (function arguments() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [24, 33], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 33 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 38], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 38 } + } + }, + range: [14, 40], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 40 } + } + }], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }] + }, + + '"use strict"; (function interface() {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'interface', + range: [24, 33], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 33 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 38], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 38 } + } + }, + range: [14, 40], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 40 } + } + }], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }] + }, + + '"use strict"; function f(eval) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'eval', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [31, 33], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 33], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 33 } + } + }, { + type: 'EmptyStatement', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; function f(arguments) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'arguments', + range: [25, 34], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 34 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 38], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 38 } + } + }, { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + }, + errors: [{ + index: 25, + lineNumber: 1, + column: 26, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; function f(foo, foo) {};': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + params: [{ + type: 'Identifier', + name: 'foo', + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, { + type: 'Identifier', + name: 'foo', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [36, 38], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 38], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 38 } + } + }, { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 39], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 39 } + }, + errors: [{ + index: 31, + lineNumber: 1, + column: 32, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }] + }, + + '"use strict"; (function f(eval) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'eval', + range: [26, 30], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 30 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 34], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 34 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + + '"use strict"; (function f(arguments) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'arguments', + range: [26, 35], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 35 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [37, 39], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 39 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 39], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 39 } + } + }, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + '"use strict"; (function f(foo, foo) {});': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + params: [{ + type: 'Identifier', + name: 'foo', + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, { + type: 'Identifier', + name: 'foo', + range: [32, 35], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 35 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [37, 39], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 39 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 39], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 39 } + } + }, + range: [14, 41], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 41 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + }, + errors: [{ + index: 32, + lineNumber: 1, + column: 33, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }] + }, + + '"use strict"; x = { set f(eval) {} }' : { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'f', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + value : { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [26, 30], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 30 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + kind: 'set', + range: [20, 34], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 34 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }, + range: [14, 36], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + }, + errors: [{ + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }] + }, + + 'function hello() { "octal directive\\1"; "use strict"; }': { + type: 'Program', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'octal directive\u0001', + raw: '"octal directive\\1"', + range: [19, 38], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 38 } + } + }, + range: [19, 39], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 39 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [40, 52], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 52 } + } + }, + range: [40, 53], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 53 } + } + }], + range: [17, 55], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 55 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 55 } + }, + errors: [{ + index: 19, + lineNumber: 1, + column: 20, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"\\1"; \'use strict\';': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '\u0001', + raw: '"\\1"', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }, + range: [6, 19], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 19 } + } + }], + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + }, + errors: [{ + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; var x = { 014: 3}': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 12, + raw: '014', + range: [24, 27], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 27 } + } + }, + value: { + type: 'Literal', + value: 3, + raw: '3', + range: [29, 30], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 30 } + } + }, + kind: 'init', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }], + range: [22, 31], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 31 } + } + }, + range: [18, 31], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [14, 31], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + }, + errors: [{ + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }] + }, + + '"use strict"; var x = { get i() {}, get i() {} }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + rest: null, + generator: false, + expression: false, + range: [32, 34], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 34 } + } + }, + kind: 'get', + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [44, 46], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 46 } + } + }, + rest: null, + generator: false, + expression: false, + range: [44, 46], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 46 } + } + }, + kind: 'get', + range: [36, 46], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 46 } + } + }], + range: [22, 48], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 48 } + } + }, + range: [18, 48], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 48 } + } + }], + kind: 'var', + range: [14, 48], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 48 } + } + }], + range: [0, 48], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 48 } + }, + errors: [{ + index: 46, + lineNumber: 1, + column: 47, + message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' + }] + }, + + '"use strict"; var x = { i: 42, get i() {} }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + kind: 'init', + range: [24, 29], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 29 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + rest: null, + generator: false, + expression: false, + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + kind: 'get', + range: [31, 41], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 41 } + } + }], + range: [22, 43], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 43 } + } + }, + range: [18, 43], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [14, 43], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 43 } + } + }], + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 43 } + }, + errors: [{ + index: 41, + lineNumber: 1, + column: 42, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }] + }, + + '"use strict"; var x = { set i(x) {}, i: 42 }': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + init: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [30, 31], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 31 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + rest: null, + generator: false, + expression: false, + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + kind: 'set', + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'i', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [40, 42], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 42 } + } + }, + kind: 'init', + range: [37, 42], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 42 } + } + }], + range: [22, 44], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 44 } + } + }, + range: [18, 44], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 44 } + } + }], + kind: 'var', + range: [14, 44], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 44 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + errors: [{ + index: 42, + lineNumber: 1, + column: 43, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' + }] + + + }, + + '({ set s() { } })': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 's', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + kind: 'set', + range: [3, 14], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 14 } + } + }], + range: [1, 16], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + }], + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + }, + errors: [{ + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token )' + }] + }, + + 'foo("bar") = baz': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 'bar', + raw: '"bar"', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'baz', + range: [13, 16], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + errors: [{ + index: 10, + lineNumber: 1, + column: 11, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '1 = 2': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Literal', + value: 1, + raw: '1', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 2, + raw: '2', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + }, + errors: [{ + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '3++': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + prefix: false, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + }, + errors: [{ + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + '--4': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Literal', + value: 4, + raw: '4', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + prefix: true, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + }, + errors: [{ + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }] + }, + + 'for (5 in []) {}': { + type: 'Program', + body: [{ + type: 'ForInStatement', + left: { + type: 'Literal', + value: 5, + raw: '5', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + each: false, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }], + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + }, + errors: [{ + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid left-hand side in for-in' + }] + } + + + } +}; + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json new file mode 100644 index 0000000..ee10b47 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json @@ -0,0 +1,60 @@ +{ + "name": "js-yaml", + "version": "2.1.3", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "author": { + "name": "Dervus Grim", + "email": "dervus.grim@gmail.com" + }, + "contributors": [ + { + "name": "Aleksey V Zapparov", + "email": "ixti@member.fsf.org", + "url": "http://www.ixti.net/" + }, + { + "name": "Martin Grenfell", + "email": "martin.grenfell@gmail.com", + "url": "http://got-ravings.blogspot.com" + } + ], + "bugs": { + "url": "https://github.com/nodeca/js-yaml/issues" + }, + "license": { + "type": "MIT", + "url": "https://github.com/nodeca/js-yaml/blob/master/LICENSE" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodeca/js-yaml.git" + }, + "main": "./index.js", + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "argparse": "~ 0.1.11", + "esprima": "~ 1.0.2" + }, + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">= 0.6.0" + }, + "readme": "JS-YAML - YAML 1.2 parser and serializer for JavaScript\n=======================================================\n\n[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml)\n\n[Online Demo](http://nodeca.github.com/js-yaml/)\n\n\nThis is an implementation of [YAML](http://yaml.org/), a human friendly data\nserialization language. Started as [PyYAML](http://pyyaml.org/) port, it was\ncompletely rewritten from scratch. Now it's very fast, and supports 1.2 spec.\n\n\nInstallation\n------------\n\n### YAML module for node.js\n\n```\nnpm install js-yaml\n```\n\n\n### CLI executable\n\nIf you want to inspect your YAML files from CLI, install js-yaml globally:\n\n```\nnpm install js-yaml -g\n```\n\n#### Usage\n\n```\nusage: js-yaml [-h] [-v] [-c] [-j] [-t] file\n\nPositional arguments:\n file File with YAML document(s)\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -c, --compact Display errors in compact mode\n -j, --to-json Output a non-funky boring JSON\n -t, --trace Show stack trace on error\n```\n\n\n### Bundled YAML library for browsers\n\n``` html\n\n\n```\n\nBrowser support was done mostly for online demo. If you find any errors - feel\nfree to send pull requests with fixes. Also note, that IE and other old browsers\nneeds [es5-shims](https://github.com/kriskowal/es5-shim) to operate.\n\n\nAPI\n---\n\nHere we cover the most 'useful' methods. If you need advanced details (creating\nyour own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more\ninfo.\n\nIn node.js JS-YAML automatically registers handlers for `.yml` and `.yaml`\nfiles. You can load them just with `require`. That's mostly equivalent to\ncalling `safeLoad()` on fetched content of a file. Just with one string!\n\n``` javascript\nrequire('js-yaml');\n\n// Get document, or throw exception on error\ntry {\n var doc = require('/home/ixti/example.yml');\n console.log(doc);\n} catch (e) {\n console.log(e);\n}\n```\n\n\n### safeLoad (string [ , options ])\n\n**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript\nobject or throws `YAMLException` on error. By default, does not support regexps,\nfunctions and undefined. This method is safe for untrusted data.\n\noptions:\n\n- `filename` _(default: null)_ - string to be used as a file path in\n error/warning messages.\n- `strict` _(default - false)_ makes the loader to throw errors instead of\n warnings.\n- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.\n - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:\n http://www.yaml.org/spec/1.2/spec.html#id2802346\n - `JSON_SCHEMA` - all JSON-supported types:\n http://www.yaml.org/spec/1.2/spec.html#id2803231\n - `CORE_SCHEMA` - same as `JSON_SCHEMA`:\n http://www.yaml.org/spec/1.2/spec.html#id2804923\n - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones\n (`!!js/undefined`, `!!js/regexp` and `!!js/function`):\n http://yaml.org/type/\n - `DEFAULT_FULL_SCHEMA` - all supported YAML types.\n\nNOTE: This function **does not** understand multi-document sources, it throws\nexception on those.\n\nNOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.\nSo, JSON schema is not such strict as defined in the YAML specification.\nIt allows numbers in any notaion, use `Null` and `NULL` as `null`, etc.\nCore schema also has no such restrictions. It allows binary notation for integers.\n\n\n### load (string [ , options ])\n\n**Use with care with untrusted sources**. The same as `safeLoad()` but uses\n`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:\n`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you\nmust additionally validate object structure, to avoid injections:\n\n``` javascript\nvar untrusted_code = '\"toString\": ! \"function (){very_evil_thing();}\"';\n\n// I'm just converting that string, what could possibly go wrong?\nrequire('js-yaml').load(untrusted_code) + ''\n```\n\n\n### safeLoadAll (string, iterator [ , options ])\n\nSame as `safeLoad()`, but understands multi-document sources and apply\n`iterator` to each document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\nyaml.safeLoadAll(data, function (doc) {\n console.log(doc);\n});\n```\n\n\n### loadAll (string, iterator [ , options ])\n\nSame as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.\n\n\n### safeDump (object [ , options ])\n\nSerializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will\nthrow exception if you try to dump regexps or functions. However, you can\ndisable exceptions by `skipInvalid` option.\n\noptions:\n\n- `indent` _(default: 2)_ - indentation width to use (in spaces).\n- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function\n in the safe schema) and skip pairs and single values with such types.\n- `flowLevel` (default: -1) - specifies level of nesting, when to switch from\n block to flow style for collections. -1 means block style everwhere\n- `styles` - \"tag\" => \"style\" map. Each tag may have own set of styles.\n- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.\n\nstyles:\n\n``` none\n!!null\n \"canonical\" => \"~\"\n\n!!int\n \"binary\" => \"0b1\", \"0b101010\", \"0b1110001111010\"\n \"octal\" => \"01\", \"052\", \"016172\"\n \"decimal\" => \"1\", \"42\", \"7290\"\n \"hexadecimal\" => \"0x1\", \"0x2A\", \"0x1C7A\"\n\n!!null, !!bool, !!float\n \"lowercase\" => \"null\", \"true\", \"false\", \".nan\", '.inf'\n \"uppercase\" => \"NULL\", \"TRUE\", \"FALSE\", \".NAN\", '.INF'\n \"camelcase\" => \"Null\", \"True\", \"False\", \".NaN\", '.Inf'\n```\n\nBy default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.\n\n\n\n### dump (object [ , options ])\n\nSame as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default).\n\n\nSupported YAML types\n--------------------\n\nThe list of standard YAML tags and corresponding JavaScipt types. See also\n[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and\n[YAML types repository](http://yaml.org/type/).\n\n```\n!!null '' # null\n!!bool 'yes' # bool\n!!int '3...' # number\n!!float '3.14...' # number\n!!binary '...base64...' # buffer\n!!timestamp 'YYYY-...' # date\n!!omap [ ... ] # array of key-value pairs\n!!pairs [ ... ] # array or array pairs\n!!set { ... } # array of objects with given keys and null values\n!!str '...' # string\n!!seq [ ... ] # array\n!!map { ... } # object\n```\n\n**JavaScript-specific tags**\n\n```\n!!js/regexp /pattern/gim # RegExp\n!!js/undefined '' # Undefined\n!!js/function 'function () {...}' # Function\n```\n\nCaveats\n-------\n\nNote, that you use arrays or objects as key in JS-YAML. JS do not allows objects\nor array as keys, and stringifies (by calling .toString method) them at the\nmoment of adding them.\n\n``` yaml\n---\n? [ foo, bar ]\n: - baz\n? { foo: bar }\n: - baz\n - baz\n```\n\n``` javascript\n{ \"foo,bar\": [\"baz\"], \"[object Object]\": [\"baz\", \"baz\"] }\n```\n\nAlso, reading of properties on implicit block mapping keys is not supported yet.\nSo, the following YAML document cannot be loaded.\n\n``` yaml\n&anchor foo:\n foo: bar\n *anchor: duplicate key\n baz: bat\n *anchor: duplicate key\n```\n\n\nBreaking changes in 1.x.x -> 2.0.x\n----------------------------------\n\nIf your have not used __custom__ tags or loader classes - no changes needed. Just\nupgrade library and enjoy high parse speed.\n\nIn other case, you should rewrite your tag constructors and custom loader\nclasses, to conform new schema-based API. See\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and\n[wiki](https://github.com/nodeca/js-yaml/wiki) for details.\nNote, that parser internals were completely rewritten.\n\n\nLicense\n-------\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file\n(MIT).\n", + "readmeFilename": "README.md", + "_id": "js-yaml@2.1.3", + "_from": "js-yaml@~2.1.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json new file mode 100644 index 0000000..68c4b34 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json @@ -0,0 +1,61 @@ +{ + "name": "configstore", + "version": "0.1.7", + "description": "Easily load and persist config without having to think about where and how", + "keywords": [ + "conf", + "config", + "configuration", + "settings", + "store", + "editable", + "yaml", + "yml" + ], + "homepage": "https://github.com/yeoman/configstore", + "bugs": { + "url": "https://github.com/yeoman/configstore/issues" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "main": "configstore.js", + "repository": { + "type": "git", + "url": "git://github.com/yeoman/configstore.git" + }, + "scripts": { + "test": "mocha" + }, + "engines": { + "node": ">=0.8.0" + }, + "licenses": [ + { + "type": "BSD" + } + ], + "dependencies": { + "lodash": "~2.4.1", + "mkdirp": "~0.3.5", + "js-yaml": "~2.1.0", + "osenv": "0.0.3", + "graceful-fs": "~2.0.1" + }, + "devDependencies": { + "mocha": "~1.15.1" + }, + "files": [ + "configstore.js" + ], + "readme": "# configstore [![Build Status](https://secure.travis-ci.org/yeoman/configstore.png?branch=master)](http://travis-ci.org/yeoman/configstore)\n\nEasily load and persist config without having to think about where and how.\n\nConfig is stored in a YAML file to make it simple for users to edit the config directly themselves. The file is located in `$XDG_CONFIG_HOME` or `~/.config`. Eg: `~/.config/configstore/id-of-your-choosing.yml`\n\n\n## Example usage\n\n```js\nvar Configstore = require('configstore');\nvar packageName = require('./package').name;\n\n// Init a Configstore instance with an unique ID eg. package name\n// and optionally some default values\nvar conf = new Configstore(packageName, { foo: 'bar' });\n\nconf.set('awesome', true);\nconsole.log(conf.get('awesome')); // true\nconsole.log(conf.get('foo')); // bar\n\nconf.del('awesome');\nconsole.log(conf.get('awesome')); // undefined\n```\n\n\n## Documentation\n\n### Methods\n\n#### .set(key, val)\n\nSet an item\n\n#### .get(key)\n\nGet an item\n\n#### .del(key)\n\nDelete an item\n\n### Properties\n\n#### .all\n\nGet all items as an object or replace the current config with an object:\n\n```js\nconf.all = {\n\thello: 'world'\n};\n```\n\n#### .size\n\nGet the item count\n\n#### .path\n\nGet the path to the config file. Can be used to show the user where the config file is located or even better open it for them.\n\n\n## License\n\n[BSD license](http://opensource.org/licenses/bsd-license.php) \nCopyright Google\n", + "readmeFilename": "readme.md", + "_id": "configstore@0.1.7", + "dist": { + "shasum": "57dc701bc2a51eb804d6e1733c8abb9d82a5cede" + }, + "_from": "configstore@~0.1.0", + "_resolved": "https://registry.npmjs.org/configstore/-/configstore-0.1.7.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md new file mode 100644 index 0000000..264ddb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md @@ -0,0 +1,67 @@ +# configstore [![Build Status](https://secure.travis-ci.org/yeoman/configstore.png?branch=master)](http://travis-ci.org/yeoman/configstore) + +Easily load and persist config without having to think about where and how. + +Config is stored in a YAML file to make it simple for users to edit the config directly themselves. The file is located in `$XDG_CONFIG_HOME` or `~/.config`. Eg: `~/.config/configstore/id-of-your-choosing.yml` + + +## Example usage + +```js +var Configstore = require('configstore'); +var packageName = require('./package').name; + +// Init a Configstore instance with an unique ID eg. package name +// and optionally some default values +var conf = new Configstore(packageName, { foo: 'bar' }); + +conf.set('awesome', true); +console.log(conf.get('awesome')); // true +console.log(conf.get('foo')); // bar + +conf.del('awesome'); +console.log(conf.get('awesome')); // undefined +``` + + +## Documentation + +### Methods + +#### .set(key, val) + +Set an item + +#### .get(key) + +Get an item + +#### .del(key) + +Delete an item + +### Properties + +#### .all + +Get all items as an object or replace the current config with an object: + +```js +conf.all = { + hello: 'world' +}; +``` + +#### .size + +Get the item count + +#### .path + +Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them. + + +## License + +[BSD license](http://opensource.org/licenses/bsd-license.php) +Copyright Google diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/package.json new file mode 100644 index 0000000..35866e2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/package.json @@ -0,0 +1,49 @@ +{ + "name": "update-notifier", + "version": "0.1.7", + "description": "Update notifier for your package", + "keywords": [ + "npm", + "update", + "notify", + "check" + ], + "homepage": "https://github.com/yeoman/update-notifier", + "bugs": { + "url": "https://github.com/yeoman/update-notifier/issues" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "main": "lib/update-notifier.js", + "repository": { + "type": "git", + "url": "git://github.com/yeoman/update-notifier.git" + }, + "scripts": { + "test": "mocha --timeout 20000" + }, + "dependencies": { + "request": "~2.27.0", + "configstore": "~0.1.0", + "semver": "~2.1.0", + "chalk": "~0.2.1" + }, + "devDependencies": { + "mocha": "~1.13.0" + }, + "engines": { + "node": ">=0.8.0" + }, + "licenses": [ + { + "type": "BSD" + } + ], + "readme": "# update-notifier [![Build Status](https://secure.travis-ci.org/yeoman/update-notifier.png?branch=master)](http://travis-ci.org/yeoman/update-notifier)\n\n##### Update notifier for your Node.js NPM package\n\n![screenshot](https://raw.github.com/yeoman/update-notifier/master/screenshot.png)\n\nInform your package users of updates in a non-intrusive way. Mainly targets global CLI apps.\n\nWhenever you initiate the update notifier and it's not within the interval threshold, it will asynchronously check with NPM in the background for available updates, then persist the result. The next time the notifier is initiated the result will be loaded into the `.update` property. This prevents any impact on your package startup performance.\nThe check process is done with [fork](http://nodejs.org/api/child_process.html#child_process_child_fork). This means that if you call `process.exit`, the check will still be performed in its own process.\n\n\n## About\n\nThe idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.\n\nThere are a few projects using it:\n\n- [Yeoman](http://yeoman.io) - modern workflows for modern webapps\n\n- [Bower](http://bower.io) - a package manager for the web\n\n- [Roots](http://roots.cx) - a toolkit for advanced front-end development\n\n- [Automaton](https://github.com/IndigoUnited/automaton) - task automation tool\n\n- [Spoon.js CLI](https://npmjs.org/package/spoonjs)\n\n- [Node GH](http://nodegh.io) - GitHub command line tool\n\n- [Hoodie CLI](http://hood.ie) - Hoodie command line tool\n\n## Example usage\n\n```js\nvar updateNotifier = require('update-notifier');\n\n// Checks for available update and returns an instance\nvar notifier = updateNotifier();\n\nif (notifier.update) {\n\t// Notify using the built-in convenience method\n\tnotifier.notify();\n}\n\n// `notifier.update` contains some useful info about the update\nconsole.log(notifier.update);\n/*\n{\n\tlatest: '0.9.5',\n\tcurrent: '0.9.3',\n\ttype: 'patch', // possible values: latest, major, minor, patch\n\tdate: '2012-11-05T14:32:37.603Z',\n\tname: 'yeoman'\n}\n*/\n```\n\n## Example with settings and custom message\n\n```js\nvar notifier = updateNotifier({\n\tupdateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week\n});\n\nif (notifier.update) {\n\tnotifier.notify('Update available: ' + notifier.update.latest);\n}\n```\n\n\n## Documentation\n\n\n### updateNotifier([settings])\n\nChecks if there is an available update. Accepts settings defined below. Returns an object with update info if there is an available update, otherwise `undefined`.\n\n### updateNotifier.notify([message || defer])\n\nA convenience method that will inform the user about an available update (see screenshot). By default it will display the message right away. However, if you supply a custom message or `true` it will be displayed right before the process exits.\n\n\n### Settings\n\n\n#### callback\n\nType: `function` \nDefault: `null`\n\nIf provided, a callback function will be called,\npassed `(error[, update])`\n\n`update` is equal to `notifier.update`\n\n\n#### packagePath\n\nType: `string` \nDefault: `'package.json'`\n\nRelative path to your module `package.json`.\n\n\n#### packageName\n\nType: `string` \nDefault: Inferred from `packageFile`\n\nUsed instead of inferring it from `packageFile`. \nRequires you to also specify `packageVersion`.\n\n\n#### packageVersion\n\nType: `string` \nDefault: Inferred from `packageFile`\n\nUsed instead of inferring it from `packageFile`. \nRequires you to also specify `packageName`.\n\n\n#### updateCheckInterval\n\nType: `number` \nDefault: `1000 * 60 * 60 * 24` (1 day)\n\nHow often it should check for updates.\n\n\n#### updateCheckTimeout\n\nType: `number` \nDefault: `20000` (20 secs)\n\nHow long the update can take. \nIf it takes longer than the timeout, it will be aborted.\n\n#### registryUrl\n\nType: `string` \nDefault: `'http://registry.npmjs.org/%s'`\n\nAlternative registry mirrors:\n\n- `http://85.10.209.91/%s`\n- `http://165.225.128.50:8000/%s`\n\n\n### Proxy settings\n\nIf you are behind a proxy server the `process.env` property is used to take the proxy server value from `HTTP_PROXY` or `HTTPS_PROXY` in order to make the call to the server. This means that you need to [set](https://github.com/sindresorhus/guides/blob/master/set-environment-variables.md) those properties as environment variables.\n\n\n### User settings\n\nUsers of your module have the ability to opt-out of the update notifier by changing the `optOut` property to `true` in `~/.config/configstore/update-notifier-[your-module-name].yml`. The path is available in `notifier.config.path`.\n\nYou could also let the user opt-out on a per run basis:\n\n```js\nif (process.argv.indexOf('--no-update-notifier') === -1) {\n\t// run updateNotifier()\n}\n```\n\n\n## License\n\n[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google\n", + "readmeFilename": "readme.md", + "_id": "update-notifier@0.1.7", + "_from": "update-notifier@~0.1.3" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/readme.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/readme.md new file mode 100644 index 0000000..94a19ff --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/update-notifier/readme.md @@ -0,0 +1,171 @@ +# update-notifier [![Build Status](https://secure.travis-ci.org/yeoman/update-notifier.png?branch=master)](http://travis-ci.org/yeoman/update-notifier) + +##### Update notifier for your Node.js NPM package + +![screenshot](https://raw.github.com/yeoman/update-notifier/master/screenshot.png) + +Inform your package users of updates in a non-intrusive way. Mainly targets global CLI apps. + +Whenever you initiate the update notifier and it's not within the interval threshold, it will asynchronously check with NPM in the background for available updates, then persist the result. The next time the notifier is initiated the result will be loaded into the `.update` property. This prevents any impact on your package startup performance. +The check process is done with [fork](http://nodejs.org/api/child_process.html#child_process_child_fork). This means that if you call `process.exit`, the check will still be performed in its own process. + + +## About + +The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications. + +There are a few projects using it: + +- [Yeoman](http://yeoman.io) - modern workflows for modern webapps + +- [Bower](http://bower.io) - a package manager for the web + +- [Roots](http://roots.cx) - a toolkit for advanced front-end development + +- [Automaton](https://github.com/IndigoUnited/automaton) - task automation tool + +- [Spoon.js CLI](https://npmjs.org/package/spoonjs) + +- [Node GH](http://nodegh.io) - GitHub command line tool + +- [Hoodie CLI](http://hood.ie) - Hoodie command line tool + +## Example usage + +```js +var updateNotifier = require('update-notifier'); + +// Checks for available update and returns an instance +var notifier = updateNotifier(); + +if (notifier.update) { + // Notify using the built-in convenience method + notifier.notify(); +} + +// `notifier.update` contains some useful info about the update +console.log(notifier.update); +/* +{ + latest: '0.9.5', + current: '0.9.3', + type: 'patch', // possible values: latest, major, minor, patch + date: '2012-11-05T14:32:37.603Z', + name: 'yeoman' +} +*/ +``` + +## Example with settings and custom message + +```js +var notifier = updateNotifier({ + updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week +}); + +if (notifier.update) { + notifier.notify('Update available: ' + notifier.update.latest); +} +``` + + +## Documentation + + +### updateNotifier([settings]) + +Checks if there is an available update. Accepts settings defined below. Returns an object with update info if there is an available update, otherwise `undefined`. + +### updateNotifier.notify([message || defer]) + +A convenience method that will inform the user about an available update (see screenshot). By default it will display the message right away. However, if you supply a custom message or `true` it will be displayed right before the process exits. + + +### Settings + + +#### callback + +Type: `function` +Default: `null` + +If provided, a callback function will be called, +passed `(error[, update])` + +`update` is equal to `notifier.update` + + +#### packagePath + +Type: `string` +Default: `'package.json'` + +Relative path to your module `package.json`. + + +#### packageName + +Type: `string` +Default: Inferred from `packageFile` + +Used instead of inferring it from `packageFile`. +Requires you to also specify `packageVersion`. + + +#### packageVersion + +Type: `string` +Default: Inferred from `packageFile` + +Used instead of inferring it from `packageFile`. +Requires you to also specify `packageName`. + + +#### updateCheckInterval + +Type: `number` +Default: `1000 * 60 * 60 * 24` (1 day) + +How often it should check for updates. + + +#### updateCheckTimeout + +Type: `number` +Default: `20000` (20 secs) + +How long the update can take. +If it takes longer than the timeout, it will be aborted. + +#### registryUrl + +Type: `string` +Default: `'http://registry.npmjs.org/%s'` + +Alternative registry mirrors: + +- `http://85.10.209.91/%s` +- `http://165.225.128.50:8000/%s` + + +### Proxy settings + +If you are behind a proxy server the `process.env` property is used to take the proxy server value from `HTTP_PROXY` or `HTTPS_PROXY` in order to make the call to the server. This means that you need to [set](https://github.com/sindresorhus/guides/blob/master/set-environment-variables.md) those properties as environment variables. + + +### User settings + +Users of your module have the ability to opt-out of the update notifier by changing the `optOut` property to `true` in `~/.config/configstore/update-notifier-[your-module-name].yml`. The path is available in `notifier.config.path`. + +You could also let the user opt-out on a per run basis: + +```js +if (process.argv.indexOf('--no-update-notifier') === -1) { + // run updateNotifier() +} +``` + + +## License + +[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/README.md new file mode 100644 index 0000000..ff1eb53 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/README.md @@ -0,0 +1,5 @@ +The "which" util from npm's guts. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/bin/which b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/bin/which new file mode 100755 index 0000000..8432ce2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/bin/which @@ -0,0 +1,14 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) { + console.error("Usage: which ") + process.exit(1) +} + +which(process.argv[2], function (er, thing) { + if (er) { + console.error(er.message) + process.exit(er.errno || 127) + } + console.log(thing) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/package.json new file mode 100644 index 0000000..de76ae3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/package.json @@ -0,0 +1,32 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "1.0.5", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "which": "./bin/which" + }, + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": {}, + "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.5", + "_from": "which@~1.0.5", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/which.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/which.js new file mode 100644 index 0000000..db7e8f7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/node_modules/which/which.js @@ -0,0 +1,104 @@ +module.exports = which +which.sync = whichSync + +var path = require("path") + , fs + , COLON = process.platform === "win32" ? ";" : ":" + , isExe + +try { + fs = require("graceful-fs") +} catch (ex) { + fs = require("fs") +} + +if (process.platform == "win32") { + // On windows, there is no good way to check that a file is executable + isExe = function isExe () { return true } +} else { + isExe = function isExe (mod, uid, gid) { + //console.error(mod, uid, gid); + //console.error("isExe?", (mod & 0111).toString(8)) + var ret = (mod & 0001) + || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0100) && process.getuid && uid === process.getuid() + //console.error("isExe?", ret) + return ret + } +} + + + +function which (cmd, cb) { + if (isAbsolute(cmd)) return cb(null, cmd) + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + //console.error("pathEnv", pathEnv) + ;(function F (i, l) { + if (i === l) return cb(new Error("not found: "+cmd)) + var p = path.resolve(pathEnv[i], cmd) + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + //console.error(p + ext) + fs.stat(p + ext, function (er, stat) { + if (!er && + stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) { + //console.error("yes, exe!", p + ext) + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd) { + if (isAbsolute(cmd)) return cmd + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var p = path.join(pathEnv[i], cmd) + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var stat + try { stat = fs.statSync(cur) } catch (ex) {} + if (stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) return cur + } + } + throw new Error("not found: "+cmd) +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/package.json new file mode 100644 index 0000000..3b6571f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/package.json @@ -0,0 +1,93 @@ +{ + "name": "bower", + "version": "1.2.8", + "description": "The browser package manager.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/bower/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/bower.git" + }, + "main": "lib", + "homepage": "http://bower.io", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "abbrev": "~1.0.4", + "archy": "0.0.2", + "bower-config": "~0.5.0", + "bower-endpoint-parser": "~0.2.0", + "bower-json": "~0.4.0", + "bower-logger": "~0.2.1", + "bower-registry-client": "~0.1.4", + "cardinal": "~0.4.0", + "chalk": "~0.2.0", + "chmodr": "~0.1.0", + "decompress-zip": "~0.0.3", + "fstream": "~0.1.22", + "fstream-ignore": "~0.0.6", + "glob": "~3.2.1", + "graceful-fs": "~2.0.0", + "handlebars": "~1.0.11", + "inquirer": "~0.3.0", + "junk": "~0.2.0", + "mkdirp": "~0.3.5", + "mout": "~0.7.0", + "nopt": "~2.1.1", + "lru-cache": "~2.3.0", + "open": "~0.0.3", + "osenv": "0.0.3", + "promptly": "~0.2.0", + "q": "~0.9.2", + "request": "~2.27.0", + "request-progress": "~0.3.0", + "retry": "~0.6.0", + "rimraf": "~2.2.0", + "semver": "~2.1.0", + "stringify-object": "~0.1.4", + "sudo-block": "~0.2.0", + "tar": "~0.1.17", + "tmp": "~0.0.20", + "update-notifier": "~0.1.3", + "which": "~1.0.5", + "p-throttler": "~0.0.1" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "grunt": "~0.4.1", + "grunt-simple-mocha": "~0.4.0", + "grunt-contrib-watch": "~0.5.0", + "grunt-contrib-jshint": "~0.6.0", + "grunt-exec": "~0.4.2", + "mocha": "~1.12.0", + "nock": "~0.22.0", + "istanbul": "~0.1.42", + "proxyquire": "~0.5.0" + }, + "scripts": { + "test": "grunt test" + }, + "bin": { + "bower": "bin/bower" + }, + "preferGlobal": true, + "readme": "# Bower\n\n[![Build Status](https://secure.travis-ci.org/bower/bower.png?branch=master)](http://travis-ci.org/bower/bower) [![Views in the last 24 hours](https://sourcegraph.com/api/repos/github.com/bower/bower/counters/views-24h.png)](https://sourcegraph.com/github.com/bower/bower)\n\n\n\nBower is a package manager for the web. It offers a generic, unopinionated\nsolution to the problem of **front-end package management**, while exposing the\npackage dependency model via an API that can be consumed by a more opinionated\nbuild stack. There are no system wide dependencies, no dependencies are shared\nbetween different apps, and the dependency tree is flat.\n\nBower runs over Git, and is package-agnostic. A packaged component can be made\nup of any type of asset, and use any type of transport (e.g., AMD, CommonJS,\netc.).\n\n[View all packages available through Bower's registry](http://sindresorhus.com/bower-components/).\n\n\n## Installing Bower\n\nBower depends on [Node](http://nodejs.org/) and [npm](http://npmjs.org/). It's\ninstalled globally using npm:\n\n```\nnpm install -g bower\n```\n\nAlso make sure that [git](http://git-scm.com/) is installed as some bower\npackages require it to be fetched and installed.\n\n\n## Usage\n\nMuch more information is available via `bower help` once it's installed. This\nis just enough to get you started.\n\n### Installing packages and dependencies\n\nBower offers several ways to install packages:\n\n#####Using the dependencies listed in the current directory's bower.json\n```\nbower install\n```\n##### Using a local or remote package\n```\nbower install \n```\n##### Using a specific version of a package\n```\nbower install #\n```\n##### Using a different name and a specific version of a package\n```\nbower install =#\n```\n\nWhere `` can be any one of the following:\n\n* A name that maps to a package registered with Bower, e.g, `jquery`. ‡\n* A remote Git endpoint, e.g., `git://github.com/someone/some-package.git`. Can be\n public or private. ‡\n* A local endpoint, i.e., a folder that's a Git repository. ‡\n* A shorthand endpoint, e.g., `someone/some-package` (defaults to GitHub). ‡\n* A URL to a file, including `zip` and `tar` files. Its contents will be\n extracted.\n\n‡ These types of `` might have versions available. You can specify a\n[semver](http://semver.org/) compatible version to fetch a specific release, and lock the\npackage to that version. You can also use ranges to specify a range of versions.\n\nAll package contents are installed in the `bower_components` directory by default.\nYou should **never** directly modify the contents of this directory.\n\nUsing `bower list` will show all the packages that are installed locally.\n\n**N.B.** If you aren't authoring a package that is intended to be consumed by\nothers (e.g., you're building a web app), you should always [check installed\npackages into source control](http://addyosmani.com/blog/checking-in-front-end-dependencies/).\n\n### Finding packages\n\nTo search for packages registered with Bower:\n\n```\nbower search []\n```\n\nUsing just `bower search` will list all packages in the registry.\n\n### Using packages\n\nThe easiest approach is to use Bower statically, just reference the package's\ninstalled components manually using a `script` tag:\n\n```html\n\n```\n\nFor more complex projects, you'll probably want to concatenate your scripts or\nuse a module loader. Bower is just a package manager, but there are plenty of\nother tools -- such as [Sprockets](https://github.com/sstephenson/sprockets)\nand [RequireJS](http://requirejs.org/) -- that will help you do this.\n\n### Uninstalling packages\n\nTo uninstall a locally installed package:\n\n```\nbower uninstall \n```\n\n\n#### Warning\n\nOn `prezto` or `oh-my-zsh`, do not forget to `alias bower='noglob bower'` or `bower install jquery\\#1.9.1`\n\n#### Running commands with sudo\n\nBower is a user command, there is no need to execute it with superuser permissions.\nHowever, if you still want to run commands with sudo, use `--allow-root` option.\n\n#### A note for Windows users\n\nTo use Bower on Windows, you must install\n[msysgit](http://code.google.com/p/msysgit/) correctly. Be sure to check the\noption shown below:\n\n![msysgit](http://f.cl.ly/items/2V2O3i1p3R2F1r2v0a12/mysgit.png)\n\nNote that if you use TortoiseGit and if Bower keeps asking for your SSH\npassword, you should add the following environment variable: `GIT_SSH -\nC:\\Program Files\\TortoiseGit\\bin\\TortoisePlink.exe`. Adjust the `TortoisePlink`\npath if needed.\n\n### Using bower's cache\n\nBower supports installing packages from its local cache (without internet connection), if the packages were installed before.\n```\nbower install --offline\n```\nThe content of the cache can be listed with:\n```\nbower cache list\n```\nThe cache can be cleaned with:\n```\nbower cache clean\n```\n\n## Configuration\n\nBower can be configured using JSON in a `.bowerrc` file.\n\nThe current spec can be read\n[here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/edit#heading=h.4pzytc1f9j8k)\nin the `Configuration` section.\n\n\n## Defining a package\n\nYou must create a `bower.json` in your project's root, and specify all of its\ndependencies. This is similar to Node's `package.json`, or Ruby's `Gemfile`,\nand is useful for locking down a project's dependencies.\n\n*NOTE:* In versions of Bower before 0.9.0 the package metadata file was called\n`component.json` rather than `bower.json`. This has changed to avoid a name\nclash with another tool. You can still use `component.json` for now but it is\ndeprecated and the automatic fallback is likely to be removed in an upcoming\nrelease.\n\nYou can interactively create a `bower.json` with the following command:\n\n```\nbower init\n```\n\nThe `bower.json` defines several options:\n\n* `name` (required): The name of your package.\n* `version`: A semantic version number (see [semver](http://semver.org/)).\n* `main` [string|array]: The primary endpoints of your package.\n* `ignore` [array]: An array of paths not needed in production that you want\n Bower to ignore when installing your package.\n* `dependencies` [hash]: Packages your package depends upon in production.\n* `devDependencies` [hash]: Development dependencies.\n* `private` [boolean]: Set to true if you want to keep the package private and \n do not want to register the package in future.\n\n```json\n{\n \"name\": \"my-project\",\n \"version\": \"1.0.0\",\n \"main\": \"path/to/main.css\",\n \"ignore\": [\n \".jshintrc\",\n \"**/*.txt\"\n ],\n \"dependencies\": {\n \"\": \"\",\n \"\": \"\",\n \"\": \"\"\n },\n \"devDependencies\": {\n \"\": \"\"\n }\n}\n```\n\n### Registering packages\n\nTo register a new package:\n\n* There **must** be a valid manifest JSON in the current working directory.\n* Your package should use [semver](http://semver.org/) Git tags.\n* Your package **must** be available at a Git endpoint (e.g., GitHub); remember\n to push your Git tags!\n\nThen use the following command:\n\n```\nbower register \n```\n\nThe Bower registry does not have authentication or user management at this point\nin time. It's on a first come, first served basis. Think of it like a URL\nshortener. Now anyone can run `bower install `, and get your\nlibrary installed.\n\nThere is no direct way to unregister a package yet. For now, you can [request a\npackage be unregistered](https://github.com/bower/bower/issues/120).\n\n\n## Consuming a package\n\nBower also makes available a source mapping. This can be used by build tools to\neasily consume Bower packages.\n\nIf you pass the `--paths` option to Bower's `list` command, you will get a\nsimple path-to-name mapping:\n\n```json\n{\n \"backbone\": \"bower_components/backbone/index.js\",\n \"jquery\": \"bower_components/jquery/index.js\",\n \"underscore\": \"bower_components/underscore/index.js\"\n}\n```\n\nAlternatively, every command supports the `--json` option that makes bower\noutput JSON. Command result is outputted to `stdout` and error/logs to\n`stderr`.\n\n\n## Programmatic API\n\nBower provides a powerful, programmatic API. All commands can be accessed\nthrough the `bower.commands` object.\n\n```js\nvar bower = require('bower');\n\nbower.commands\n.install(['jquery'], { save: true }, { /* custom config */ })\n.on('end', function (installed) {\n console.log(installed);\n});\n\nbower.commands\n.search('jquery', {})\n.on('end', function (results) {\n console.log(results);\n});\n```\n\nCommands emit four types of events: `log`, `prompt`, `end`, `error`.\n\n* `log` is emitted to report the state/progress of the command.\n* `prompt` is emitted whenever the user needs to be prompted.\n* `error` will only be emitted if something goes wrong.\n* `end` is emitted when the command successfully ends.\n\nFor a better of idea how this works, you may want to check out [our bin\nfile](https://github.com/bower/bower/blob/master/bin/bower).\n\nWhen using bower programmatically, prompting is disabled by default. Though you can enable it when calling commands with `interactive: true` in the config.\nThis requires you to listen for the `prompt` event and handle the prompting yourself. The easiest way is to use the [inquirer](https://npmjs.org/package/inquirer) npm module like so:\n\n```js\nvar inquirer = require('inquirer');\n\nbower.commands\n.install(['jquery'], { save: true }, { interactive: true })\n// ..\n.on('prompt', function (prompts, callback) {\n inquirer.prompt(prompts, callback);\n});\n```\n\n\n## Completion (experimental)\n\n_NOTE_: Completion is still not implemented for the 1.0.0 release\n\nBower now has an experimental `completion` command that is based on, and works\nsimilarly to the [npm completion](https://npmjs.org/doc/completion.html). It is\nnot available for Windows users.\n\nThis command will output a Bash / ZSH script to put into your `~/.bashrc`,\n`~/.bash_profile`, or `~/.zshrc` file.\n\n```\nbower completion >> ~/.bash_profile\n```\n\n\n## Contact\n\nHave a question?\n\n* [StackOverflow](http://stackoverflow.com/questions/tagged/bower)\n* [Mailinglist](http://groups.google.com/group/twitter-bower) - twitter-bower@googlegroups.com\n* [\\#bower](http://webchat.freenode.net/?channels=bower) on Freenode\n\n\n## Contributing to this project\n\nAnyone and everyone is welcome to contribute. Please take a moment to\nreview the [guidelines for contributing](CONTRIBUTING.md).\n\n* [Bug reports](CONTRIBUTING.md#bugs)\n* [Feature requests](CONTRIBUTING.md#features)\n* [Pull requests](CONTRIBUTING.md#pull-requests)\n\n\n## Authors\n\n* [@fat](https://github.com/fat)\n* [@maccman](https://github.com/maccman)\n* [@satazor](https://github.com/satazor)\n\nThanks for assistance and contributions:\n\n[@addyosmani](https://github.com/addyosmani),\n[@angus-c](https://github.com/angus-c),\n[@borismus](https://github.com/borismus),\n[@carsonmcdonald](https://github.com/carsonmcdonald),\n[@chriseppstein](https://github.com/chriseppstein),\n[@danwrong](https://github.com/danwrong),\n[@davidmaxwaterman](https://github.com/davidmaxwaterman),\n[@desandro](https://github.com/desandro),\n[@hemanth](https://github.com/hemanth),\n[@isaacs](https://github.com/isaacs),\n[@josh](https://github.com/josh),\n[@jrburke](https://github.com/jrburke),\n[@marcelombc](https://github.com/marcelombc),\n[@marcooliveira](https://github.com/marcooliveira),\n[@mklabs](https://github.com/mklabs),\n[@MrDHat](https://github.com/MrDHat),\n[@necolas](https://github.com/necolas),\n[@paulirish](https://github.com/paulirish),\n[@richo](https://github.com/richo),\n[@rvagg](https://github.com/rvagg),\n[@sindresorhus](https://github.com/sindresorhus),\n[@SlexAxton](https://github.com/SlexAxton),\n[@sstephenson](https://github.com/sstephenson),\n[@svnlto](https://github.com/svnlto),\n[@tomdale](https://github.com/tomdale),\n[@uzquiano](https://github.com/uzquiano),\n[@visionmedia](https://github.com/visionmedia),\n[@wagenet](https://github.com/wagenet),\n[@wibblymat](https://github.com/wibblymat),\n[@wycats](https://github.com/wycats)\n\n\n## License\n\nCopyright 2012 Twitter, Inc.\n\nLicensed under the MIT License\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/bower/issues" + }, + "_id": "bower@1.2.8", + "dist": { + "shasum": "54c558dedf7ac63a179bd91292cdf1224ca166bc" + }, + "_from": "bower@~1.2.8", + "_resolved": "https://registry.npmjs.org/bower/-/bower-1.2.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/colors.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/colors.js new file mode 100644 index 0000000..f9727b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/colors.js @@ -0,0 +1,20 @@ +var chalk = require('chalk'); + +var templateColors = [ + 'yellow', + 'green', + 'cyan', + 'red', + 'white', + 'magenta' +]; + +function colors(Handlebars) { + templateColors.forEach(function (color) { + Handlebars.registerHelper(color, function (context) { + return chalk[color](context.fn(this)); + }); + }); +} + +module.exports = colors; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/condense.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/condense.js new file mode 100644 index 0000000..3b8d366 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/condense.js @@ -0,0 +1,22 @@ +var mout = require('mout'); +var leadLinesRegExp = /^\r?\n/; +var multipleLinesRegExp = /\r?\n(\r?\n)+/mg; + +function condense(Handlebars) { + Handlebars.registerHelper('condense', function (context) { + var str = context.fn(this); + + // Remove multiple lines + str = str.replace(multipleLinesRegExp, '$1'); + + // Remove leading new lines (while keeping indentation) + str = str.replace(leadLinesRegExp, ''); + + // Remove trailing whitespaces (including new lines); + str = mout.string.rtrim(str); + + return str; + }); +} + +module.exports = condense; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/indent.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/indent.js new file mode 100644 index 0000000..7738f62 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/indent.js @@ -0,0 +1,12 @@ +var mout = require('mout'); + +function indent(Handlebars) { + Handlebars.registerHelper('indent', function (context) { + var hash = context.hash; + var indentStr = mout.string.repeat(' ', parseInt(hash.level, 10)); + + return context.fn(this).replace(/\n/g, '\n' + indentStr); + }); +} + +module.exports = indent; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/index.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/index.js new file mode 100644 index 0000000..fcc17a4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/index.js @@ -0,0 +1,7 @@ +module.exports = { + colors: require('./colors'), + condense: require('./condense'), + indent: require('./indent'), + rpad: require('./rpad'), + sum: require('./sum') +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/rpad.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/rpad.js new file mode 100644 index 0000000..d5201d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/rpad.js @@ -0,0 +1,13 @@ +var mout = require('mout'); + +function rpad(Handlebars) { + Handlebars.registerHelper('rpad', function (context) { + var hash = context.hash; + var length = parseInt(hash.length, 10); + var chr = hash.char; + + return mout.string.rpad(context.fn(this), length, chr); + }); +} + +module.exports = rpad; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/sum.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/sum.js new file mode 100644 index 0000000..62e0b3c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/helpers/sum.js @@ -0,0 +1,7 @@ +function sum(Handlebars) { + Handlebars.registerHelper('sum', function (val1, val2) { + return val1 + val2; + }); +} + +module.exports = sum; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache.json new file mode 100644 index 0000000..fbd99cc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache.json @@ -0,0 +1,11 @@ +{ + "command": "cache", + "usage": [ + "cache [] []" + ], + "commands": { + "clean": "Clean cached packages", + "list": "List cached packages" + }, + "options": [] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/clean.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/clean.json new file mode 100644 index 0000000..daf5ee6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/clean.json @@ -0,0 +1,16 @@ +{ + "command": "cache list", + "description": "Cleans cached packages.", + "usage": [ + "cache clean []", + "cache clean [ ...] []", + "cache clean # [# ..] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/list.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/list.json new file mode 100644 index 0000000..2abf375 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-cache/list.json @@ -0,0 +1,15 @@ +{ + "command": "cache clean", + "description": "Lists cached packages.", + "usage": [ + "cache list []", + "cache list [ ...] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-home.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-home.json new file mode 100644 index 0000000..e4d0222 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-home.json @@ -0,0 +1,16 @@ +{ + "command": "home", + "description": "Opens a package homepage into your favorite browser.\n\nIf no is passed, opens the homepage of the local package.", + "usage": [ + "home []", + "home []", + "home # []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-info.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-info.json new file mode 100644 index 0000000..2167249 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-info.json @@ -0,0 +1,16 @@ +{ + "command": "info", + "description": "Displays overall information of a package or of a particular version.", + "usage": [ + "info []", + "info [] []", + "info # [] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-init.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-init.json new file mode 100644 index 0000000..774e0b4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-init.json @@ -0,0 +1,14 @@ +{ + "command": "init", + "description": "Creates a bower.json file based on answers to questions.", + "usage": [ + "init []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-install.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-install.json new file mode 100644 index 0000000..8e118d2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-install.json @@ -0,0 +1,35 @@ +{ + "command": "install", + "description": "Installs the project dependencies or a specific set of endpoints.\nEndpoints can have multiple forms:\n- \n- #\n- =#\n\nWhere:\n- is a package URL, physical location or registry name\n- is a valid range, commit, branch, etc.\n- is the name it should have locally.", + "usage": [ + "install []", + "install [ ..] []" + ], + "options": [ + { + "shorthand": "-F", + "flag": "--force-latest", + "description": "Force latest version on conflict" + }, + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--production", + "description": "Do not install project devDependencies" + }, + { + "shorthand": "-S", + "flag": "--save", + "description": "Save installed packages into the project's bower.json dependencies" + }, + { + "shorthand": "-D", + "flag": "--save-dev", + "description": "Save installed packages into the project's bower.json devDependencies" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-link.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-link.json new file mode 100644 index 0000000..01cab43 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-link.json @@ -0,0 +1,15 @@ +{ + "command": "link", + "description": "The link functionality allows developers to easily test their packages.\nLinking is a two-step process.\n\nUsing 'bower link' in a project folder will create a global link.\nThen, in some other package, 'bower link ' will create a link in the components folder pointing to the previously created link.\n\nThis allows to easily test a package because changes will be reflected immediately.\nPlease note that bower will not fetch the linked package dependencies.\n\nBower will overwrite the link when installing/updating.", + "usage": [ + "link []", + "link [] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-list.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-list.json new file mode 100644 index 0000000..2e6a7c0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-list.json @@ -0,0 +1,24 @@ +{ + "command": "list", + "description": "List local packages.", + "usage": [ + "list []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--paths", + "description": "Generates a simple JSON source mapping" + }, + { + "shorthand": "-r", + "flag": "--relative", + "description": "Make paths relative to the directory config property, which defaults to bower_components" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-lookup.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-lookup.json new file mode 100644 index 0000000..26080b7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-lookup.json @@ -0,0 +1,14 @@ +{ + "command": "lookup", + "description": "Looks up a package URL by name.", + "usage": [ + "lookup []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-prune.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-prune.json new file mode 100644 index 0000000..676debc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-prune.json @@ -0,0 +1,14 @@ +{ + "command": "prune", + "description": "Uninstalls local extraneous packages.", + "usage": [ + "prune []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-register.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-register.json new file mode 100644 index 0000000..8e01ce4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-register.json @@ -0,0 +1,14 @@ +{ + "command": "register", + "description": "Registers a package.", + "usage": [ + "register []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-search.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-search.json new file mode 100644 index 0000000..7298b82 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-search.json @@ -0,0 +1,15 @@ +{ + "command": "search", + "description": "Finds all packages or a specific package.", + "usage": [ + "search []", + "search []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-uninstall.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-uninstall.json new file mode 100644 index 0000000..b4c4a19 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-uninstall.json @@ -0,0 +1,24 @@ +{ + "command": "uninstall", + "description": "Uninstalls a package locally from your bower_components directory", + "usage": [ + "uninstall [ ..] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-s", + "flag": "--save", + "description": "Save installed packages into the project's bower.json dependencies" + }, + { + "shorthand": "-D", + "flag": "--save-dev", + "description": "Save installed packages into the project's bower.json devDependencies" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-update.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-update.json new file mode 100644 index 0000000..2d98255 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help-update.json @@ -0,0 +1,24 @@ +{ + "command": "update", + "description": "Updates installed packages to their newest version according to bower.json.", + "usage": [ + "update [ ..] []" + ], + "options": [ + { + "shorthand": "-F", + "flag": "--force-latest", + "description": "Force latest version on conflict" + }, + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--production", + "description": "Do not install project devDependencies" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help.json new file mode 100644 index 0000000..45a3a2f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/json/help.json @@ -0,0 +1,62 @@ +{ + "usage": [ + " [] []" + ], + "commands": { + "cache": "Manage bower cache", + "help": "Display help information about Bower", + "home": "Opens a package homepage into your favorite browser", + "info": "Info of a particular package", + "init": "Interactively create a bower.json file", + "install": "Install a package locally", + "link": "Symlink a package folder", + "list": "List local packages", + "lookup": "Look up a package URL by name", + "prune": "Removes local extraneous packages", + "register": "Register a package", + "search": "Search for a package by name", + "update": "Update a local package", + "uninstall": "Remove a local package" + }, + "options": [ + { + "shorthand": "-f", + "flag": "--force", + "description": "Makes various commands more forceful" + }, + { + "shorthand": "-j", + "flag": "--json", + "description": "Output consumable JSON" + }, + { + "shorthand": "-l", + "flag": "--log-level", + "description": "What level of logs to report" + }, + { + "shorthand": "-o", + "flag": "--offline", + "description": "Do not hit the network" + }, + { + "shorthand": "-q", + "flag": "--quiet", + "description": "Only output important information" + }, + { + "shorthand": "-s", + "flag": "--silent", + "description": "Do not output anything, besides errors" + }, + { + "shorthand": "-V", + "flag": "--verbose", + "description": "Makes output more verbose" + }, + { + "flag": "--allow-root", + "description": "Allows running commands as root" + } + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict-resolved.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict-resolved.std new file mode 100644 index 0000000..52534cf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict-resolved.std @@ -0,0 +1,9 @@ +{{#yellow}}Please note that,{{/yellow}} +{{#condense}} +{{#each picks}} + {{#if dependants}}{{#white}}{{dependants}}{{/white}}{{else}}none{{/if}} depend on {{#cyan}}{{endpoint.name}}#{{endpoint.target}}{{/cyan}}{{#if pkgMeta._release}} which resolved to {{#white}}{{pkgMeta._release}}{{/white}}{{/if}} +{{/each}} +{{/condense}} + +Resort to using {{#cyan}}{{suitable.endpoint.name}}#{{resolution}}{{/cyan}} which resolved to {{#white}}{{suitable.pkgMeta._release}}{{/white}} +Code incompatibilities may occur. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict.std new file mode 100644 index 0000000..d2268ae --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/conflict.std @@ -0,0 +1,9 @@ +{{#yellow}}Unable to find a suitable version for {{name}}, please choose one:{{/yellow}} +{{#condense}} +{{#each picks}} + {{#magenta}}{{sum @index 1}}){{/magenta}} {{#cyan}}{{endpoint.name}}#{{endpoint.target}}{{/cyan}}{{#if pkgMeta._release}} which resolved to {{#white}}{{pkgMeta._release}}{{/white}}{{/if}}{{#if dependants}} and has {{#white}}{{dependants}}{{/white}} as dependants{{/if}} +{{/each}} +{{/condense}} +{{#unless saveResolutions}} +Prefix the choice with ! to persist it to bower.json +{{/unless}} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-cache.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-cache.std new file mode 100644 index 0000000..369968f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-cache.std @@ -0,0 +1,16 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Commands: + +{{#condense}} +{{#each commands}} + {{#rpad length="23"}}{{@key}}{{/rpad}} {{.}} +{{/each}} +{{/condense}} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-generic.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-generic.std new file mode 100644 index 0000000..b573a97 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help-generic.std @@ -0,0 +1,22 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Options: + +{{#condense}} +{{#each options}} + {{#yellow}}{{#rpad length="23"}}{{#if shorthand}}{{shorthand}}, {{/if}}{{flag}}{{/rpad}}{{/yellow}} {{description}} +{{/each}} +{{/condense}} + + Additionally all global options listed in 'bower help' are available + +Description: + + {{#indent level="4"}}{{description}}{{/indent}} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help.std new file mode 100644 index 0000000..7f1127e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/help.std @@ -0,0 +1,26 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Commands: + +{{#condense}} +{{#each commands}} + {{#rpad length="23"}}{{@key}}{{/rpad}} {{.}} +{{/each}} +{{/condense}} + +Options: + +{{#condense}} +{{#each options}} + {{#yellow}}{{#rpad length="23"}}{{#if shorthand}}{{shorthand}}, {{/if}}{{flag}}{{/rpad}}{{/yellow}} {{description}} +{{/each}} +{{/condense}} + +See 'bower help ' for more information on a specific command. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/info.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/info.std new file mode 100644 index 0000000..ffa9ab6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/info.std @@ -0,0 +1,10 @@ +{{#if versions}}{{#cyan}}Available versions:{{/cyan}} +{{#condense}} +{{#versions}} + - {{.}} +{{/versions}} +{{/condense}} + +You can request info for a specific version with 'bower info {{name}}#' +{{else}}No versions available. +{{/if}} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/lookup.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/lookup.std new file mode 100644 index 0000000..3bab824 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/lookup.std @@ -0,0 +1,7 @@ +{{#condense}} +{{#if url}} +{{#cyan}}{{name}}{{/cyan}} {{url}} +{{else}} +Package not found. +{{/if}} +{{/condense}} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/register.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/register.std new file mode 100644 index 0000000..31b157c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/register.std @@ -0,0 +1,5 @@ +Package {{#cyan}}{{name}}{{/cyan}} registered successfully! +All valid semver tags on {{#cyan}}{{url}}{{/cyan}} will be available as versions. +To publish a new version, just release a valid semver tag. + +Run {{#cyan}}bower info {{name}}{{/cyan}} to list the available versions. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/search-results.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/search-results.std new file mode 100644 index 0000000..c73d3e7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/search-results.std @@ -0,0 +1,9 @@ +{{#if .}}Search results: + +{{#condense}} +{{#.}} + {{#cyan}}{{{name}}}{{/cyan}} {{{url}}} +{{/.}} +{{/condense}} +{{else}}No results. +{{/if}} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/update-notice.std b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/update-notice.std new file mode 100644 index 0000000..2407a55 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/templates/std/update-notice.std @@ -0,0 +1,5 @@ +{{#red}}-----------------------------------------{{/red}} +Update available: {{#yellow}}{{latest}}{{/yellow}} {{#cyan}}(current: {{current}}){{/cyan}} +Run {{#yellow}}npm update -g {{name}}{{/yellow}} to update +{{#red}}-----------------------------------------{{/red}} + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-tar.tar.gz b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-tar.tar.gz new file mode 100644 index 0000000..dda21e0 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-tar.tar.gz differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder-single-file.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder-single-file.zip new file mode 100644 index 0000000..bb1c9ff Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder-single-file.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder.zip new file mode 100644 index 0000000..4bb98a4 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-folder.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-bower-json.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-bower-json.zip new file mode 100644 index 0000000..5a4e539 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-bower-json.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-component-json.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-component-json.zip new file mode 100644 index 0000000..b02fec2 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-component-json.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-file.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-file.zip new file mode 100644 index 0000000..b4145fb Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip-single-file.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip.zip b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip.zip new file mode 100644 index 0000000..5b45083 Binary files /dev/null and b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/package-zip.zip differ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/resolve-cache/list-json-1.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/resolve-cache/list-json-1.json new file mode 100644 index 0000000..8490cdb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/resolve-cache/list-json-1.json @@ -0,0 +1,51 @@ +[ + { + "canonicalDir": "/test/assets/temp-resolve-cache/3668e6529b32a6d3e8931a68474e909d/0.2.0", + "pkgMeta": { + "name": "abc", + "version": "0.2.0" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/77008abea14f06f199c2f481362b48d9/0.0.1", + "pkgMeta": { + "name": "foo", + "version": "0.0.1" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/77008abea14f06f199c2f481362b48d9/0.1.0", + "pkgMeta": { + "name": "foo", + "version": "0.1.0" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/3668e6529b32a6d3e8931a68474e909d/0.2.1", + "pkgMeta": { + "name": "foo", + "version": "0.2.1" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/77008abea14f06f199c2f481362b48d9/aa", + "pkgMeta": { + "name": "foo", + "_target": "aa" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/77008abea14f06f199c2f481362b48d9/bar", + "pkgMeta": { + "name": "foo", + "_target": "bar" + } + }, + { + "canonicalDir": "/test/assets/temp-resolve-cache/77008abea14f06f199c2f481362b48d9/foo", + "pkgMeta": { + "name": "foo", + "_target": "foo" + } + } +] \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test-exception.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test-exception.js new file mode 100644 index 0000000..f97bfc0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test-exception.js @@ -0,0 +1,17 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Logger = require('bower-logger'); +var Resolver = require('../../../lib/core/resolvers/Resolver'); +var defaultConfig = require('../../../lib/config'); + +var resolver = new Resolver({ source: 'foo' }, defaultConfig, new Logger()); +resolver._createTempDir() +.then(function (dir) { + // Need to write something to prevent tmp to automatically + // remove the temp dir (it removes if empty) + fs.writeFileSync(path.join(dir, 'some_file'), 'foo'); + + // Force an error + throw new Error('Some error'); +}) +.done(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test.js new file mode 100644 index 0000000..f9d965a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/assets/test-temp-dir/test.js @@ -0,0 +1,14 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Logger = require('bower-logger'); +var Resolver = require('../../../lib/core/resolvers/Resolver'); +var defaultConfig = require('../../../lib/config'); + +var resolver = new Resolver({ source: 'foo' }, defaultConfig, new Logger()); +resolver._createTempDir() +.then(function (dir) { + // Need to write something to prevent tmp to automatically + // remove the temp dir (it removes if empty) + fs.writeFileSync(path.join(dir, 'some_file'), 'foo'); +}) +.done(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/packageRepository.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/packageRepository.js new file mode 100644 index 0000000..d530e09 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/packageRepository.js @@ -0,0 +1,620 @@ +var expect = require('expect.js'); +var Q = require('q'); +var path = require('path'); +var mout = require('mout'); +var fs = require('graceful-fs'); +var rimraf = require('rimraf'); +var RegistryClient = require('bower-registry-client'); +var Logger = require('bower-logger'); +var proxyquire = require('proxyquire'); +var defaultConfig = require('../../lib/config'); +var ResolveCache = require('../../lib/core/ResolveCache'); +var resolvers = require('../../lib/core/resolvers'); +var copy = require('../../lib/util/copy'); + +describe('PackageRepository', function () { + var packageRepository; + var resolver; + var resolverFactoryHook; + var resolverFactoryClearHook; + var testPackage = path.resolve(__dirname, '../assets/package-a'); + var tempPackage = path.resolve(__dirname, '../assets/temp'); + var packagesCacheDir = path.join(__dirname, '../assets/temp-resolve-cache'); + var registryCacheDir = path.join(__dirname, '../assets/temp-registry-cache'); + var mockSource = 'file://' + testPackage; + + after(function () { + rimraf.sync(registryCacheDir); + rimraf.sync(packagesCacheDir); + }); + + beforeEach(function (next) { + var PackageRepository; + var config; + var logger = new Logger(); + + // Config + config = mout.object.deepMixIn({}, defaultConfig, { + storage: { + packages: packagesCacheDir, + registry: registryCacheDir + } + }); + + // Mock the resolver factory to always return a resolver for the test package + function resolverFactory(decEndpoint, _config, _logger, _registryClient) { + expect(_config).to.eql(config); + expect(_logger).to.be.an(Logger); + expect(_registryClient).to.be.an(RegistryClient); + + decEndpoint = mout.object.deepMixIn({}, decEndpoint); + decEndpoint.source = mockSource; + + resolver = new resolvers.GitRemote(decEndpoint, _config, _logger); + resolverFactoryHook(resolver); + + return Q.resolve(resolver); + } + resolverFactory.getConstructor = function () { + return Q.resolve([resolvers.GitRemote, 'file://' + testPackage, false]); + }; + resolverFactory.clearRuntimeCache = function () { + resolverFactoryClearHook(); + }; + + PackageRepository = proxyquire('../../lib/core/PackageRepository', { + './resolverFactory': resolverFactory + }); + packageRepository = new PackageRepository(config, logger); + + // Reset hooks + resolverFactoryHook = resolverFactoryClearHook = function () {}; + + // Remove temp package + rimraf.sync(tempPackage); + + // Clear the repository + packageRepository.clear() + .then(next.bind(next, null), next); + }); + + describe('.constructor', function () { + it('should pass the config correctly to the registry client, including its cache folder', function () { + expect(packageRepository._registryClient._config.cache).to.equal(registryCacheDir); + }); + }); + + describe('.fetch', function () { + it('should call the resolver factory to get the appropriate resolver', function (next) { + var called; + + resolverFactoryHook = function () { + called = true; + }; + + packageRepository.fetch({ name: '', source: 'foo', target: '~0.1.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.be(true); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('package-a'); + expect(pkgMeta.version).to.be('0.1.1'); + next(); + }) + .done(); + }); + + it('should just call the resolver resolve method if force was specified', function (next) { + var called = []; + + resolverFactoryHook = function (resolver) { + var originalResolve = resolver.resolve; + + resolver.resolve = function () { + called.push('resolve'); + return originalResolve.apply(this, arguments); + }; + + resolver.hasNew = function () { + called.push('hasNew'); + return Q.resolve(false); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + called.push('retrieve'); + return Q.resolve([]); + }; + + packageRepository._config.force = true; + packageRepository.fetch({ name: '', source: 'foo', target: ' ~0.1.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.eql(['resolve']); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('package-a'); + expect(pkgMeta.version).to.be('0.1.1'); + next(); + }) + .done(); + }); + + it('should attempt to retrieve a resolved package from the resolve package', function (next) { + var called; + var originalRetrieve = packageRepository._resolveCache.retrieve; + + packageRepository._resolveCache.retrieve = function (source) { + called = true; + expect(source).to.be(mockSource); + return originalRetrieve.apply(this, arguments); + }; + + packageRepository.fetch({ name: '', source: 'foo', target: '~0.1.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.be(true); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('package-a'); + expect(pkgMeta.version).to.be('0.1.1'); + next(); + }) + .done(); + }); + + it('should just call the resolver resolve method if no appropriate package was found in the resolve cache', function (next) { + var called = []; + + resolverFactoryHook = function (resolver) { + var originalResolve = resolver.resolve; + + resolver.resolve = function () { + called.push('resolve'); + return originalResolve.apply(this, arguments); + }; + + resolver.hasNew = function () { + called.push('hasNew'); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + return Q.resolve([]); + }; + + packageRepository.fetch({ name: '', source: 'foo', target: ' ~0.1.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.eql(['resolve']); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('package-a'); + expect(pkgMeta.version).to.be('0.1.1'); + next(); + }) + .done(); + }); + + it('should call the resolver hasNew method if an appropriate package was found in the resolve cache', function (next) { + var json = { + name: 'a', + version: '0.2.1' + }; + var called; + + resolverFactoryHook = function (resolver) { + var originalHasNew = resolver.hasNew; + + resolver.hasNew = function (canonicalDir, pkgMeta) { + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + called = true; + return originalHasNew.apply(this, arguments); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + return Q.resolve([tempPackage, json]); + }; + + copy.copyDir(testPackage, tempPackage, { ignore: ['.git'] }) + .then(function () { + fs.writeFileSync(path.join(tempPackage, '.bower.json'), JSON.stringify(json)); + + return packageRepository.fetch({ name: '', source: 'foo', target: '~0.1.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.be(true); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('package-a'); + expect(pkgMeta.version).to.be('0.1.1'); + next(); + }); + }) + .done(); + }); + + it('should call the resolver resolve method if hasNew resolved to true', function (next) { + var json = { + name: 'a', + version: '0.2.0' + }; + var called = []; + + resolverFactoryHook = function (resolver) { + var originalResolve = resolver.resolve; + + resolver.resolve = function () { + called.push('resolve'); + return originalResolve.apply(this, arguments); + }; + + resolver.hasNew = function (canonicalDir, pkgMeta) { + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + called.push('hasNew'); + return Q.resolve(true); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + return Q.resolve([tempPackage, json]); + }; + + copy.copyDir(testPackage, tempPackage, { ignore: ['.git'] }) + .then(function () { + fs.writeFileSync(path.join(tempPackage, '.bower.json'), JSON.stringify(json)); + + return packageRepository.fetch({ name: '', source: 'foo', target: '~0.2.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.eql(['hasNew', 'resolve']); + expect(fs.existsSync(canonicalDir)).to.be(true); + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.name).to.be('a'); + expect(pkgMeta.version).to.be('0.2.2'); + next(); + }); + }) + .done(); + }); + + it('should resolve to the cached package if hasNew resolve to false', function (next) { + var json = { + name: 'a', + version: '0.2.0' + }; + var called = []; + + resolverFactoryHook = function (resolver) { + var originalResolve = resolver.resolve; + + resolver.resolve = function () { + called.push('resolve'); + return originalResolve.apply(this, arguments); + }; + + resolver.hasNew = function (canonicalDir, pkgMeta) { + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + called.push('hasNew'); + return Q.resolve(false); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + return Q.resolve([tempPackage, json]); + }; + + copy.copyDir(testPackage, tempPackage, { ignore: ['.git'] }) + .then(function () { + fs.writeFileSync(path.join(tempPackage, '.bower.json'), JSON.stringify(json)); + + return packageRepository.fetch({ name: '', source: 'foo', target: '~0.2.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called).to.eql(['hasNew']); + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + next(); + }); + }) + .done(); + }); + + it('should just use the cached package if offline was specified', function (next) { + var json = { + name: 'a', + version: '0.2.0' + }; + var called = []; + + resolverFactoryHook = function (resolver) { + var originalResolve = resolver.resolve; + + resolver.hasNew = function (canonicalDir, pkgMeta) { + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + called.push('resolve'); + return originalResolve.apply(this, arguments); + }; + + resolver.hasNew = function () { + called.push('hasNew'); + return Q.resolve(false); + }; + }; + + packageRepository._resolveCache.retrieve = function () { + return Q.resolve([tempPackage, json]); + }; + + copy.copyDir(testPackage, tempPackage, { ignore: ['.git'] }) + .then(function () { + fs.writeFileSync(path.join(tempPackage, '.bower.json'), JSON.stringify(json)); + + packageRepository._config.offline = true; + return packageRepository.fetch({ name: '', source: 'foo', target: '~0.2.0' }) + .spread(function (canonicalDir, pkgMeta) { + expect(called.length).to.be(0); + expect(canonicalDir).to.equal(tempPackage); + expect(pkgMeta).to.eql(json); + next(); + }); + }) + .done(); + }); + + it('should error out if there is no appropriate package in the resolve cache and offline was specified', function (next) { + packageRepository._config.offline = true; + packageRepository.fetch({ name: '', source: 'foo', target: '~0.2.0' }) + .then(function () { + throw new Error('Should have failed'); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOCACHE'); + + next(); + }) + .done(); + }); + }); + + describe('.versions', function () { + it('should call the versions method on the concrete resolver', function (next) { + var called = []; + var originalVersions = resolvers.GitRemote.versions; + + resolvers.GitRemote.versions = function (source) { + expect(source).to.equal(mockSource); + called.push('resolver'); + return Q.resolve([]); + }; + + packageRepository._resolveCache.versions = function () { + called.push('resolve-cache'); + return Q.resolve([]); + }; + + packageRepository.versions('foo') + .then(function (versions) { + expect(called).to.eql(['resolver']); + expect(versions).to.be.an('array'); + expect(versions.length).to.be(0); + + next(); + }) + .fin(function () { + resolvers.GitRemote.versions = originalVersions; + }) + .done(); + }); + + it('should call the versions method on the resolve cache if offline was specified', function (next) { + var called = []; + var originalVersions = resolvers.GitRemote.versions; + + resolvers.GitRemote.versions = function () { + called.push('resolver'); + return Q.resolve([]); + }; + + packageRepository._resolveCache.versions = function (source) { + expect(source).to.equal(mockSource); + called.push('resolve-cache'); + return Q.resolve([]); + }; + + packageRepository._config.offline = true; + packageRepository.versions('foo') + .then(function (versions) { + expect(called).to.eql(['resolve-cache']); + expect(versions).to.be.an('array'); + expect(versions.length).to.be(0); + + next(); + }) + .fin(function () { + resolvers.GitRemote.versions = originalVersions; + }) + .done(); + }); + }); + + describe('.eliminate', function () { + it('should call the eliminate method from the resolve cache', function (next) { + var called; + var json = { + name: 'a', + version: '0.2.0', + _source: 'foo' + }; + + packageRepository._resolveCache.eliminate = function (pkgMeta) { + expect(pkgMeta).to.eql(json); + called = true; + return Q.resolve(); + }; + + packageRepository.eliminate(json) + .then(function () { + expect(called).to.be(true); + next(); + }) + .done(); + }); + + it('should call the clearCache method with the name from the registry client', function (next) { + var called; + var json = { + name: 'a', + version: '0.2.0', + _source: 'foo' + }; + + packageRepository._registryClient.clearCache = function (name, callback) { + expect(name).to.eql(json.name); + called = true; + callback(); + }; + + packageRepository.eliminate(json) + .then(function () { + expect(called).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('.list', function () { + it('should proxy to the resolve cache list method', function (next) { + var called; + var originalList = packageRepository._resolveCache.list; + + packageRepository._resolveCache.list = function () { + called = true; + return originalList.apply(this, arguments); + }; + + packageRepository.list() + .then(function (entries) { + expect(called).to.be(true); + expect(entries).to.be.an('array'); + next(); + }) + .done(); + }); + }); + + describe('.clear', function () { + it('should call the clear method from the resolve cache', function (next) { + var called; + + packageRepository._resolveCache.clear = function () { + called = true; + return Q.resolve(); + }; + + packageRepository.clear() + .then(function () { + expect(called).to.be(true); + next(); + }) + .done(); + }); + + it('should call the clearCache method without name from the registry client', function (next) { + var called; + + packageRepository._registryClient.clearCache = function (callback) { + called = true; + callback(); + }; + + packageRepository.clear() + .then(function () { + expect(called).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('.reset', function () { + it('should call the reset method from the resolve cache', function () { + var called; + + packageRepository._resolveCache.reset = function () { + called = true; + return packageRepository._resolveCache; + }; + + packageRepository.reset(); + expect(called).to.be(true); + }); + + it('should call the resetCache method without name from the registry client', function () { + var called; + + packageRepository._registryClient.resetCache = function () { + called = true; + return packageRepository._registryClient; + }; + + packageRepository.reset(); + expect(called).to.be(true); + }); + }); + + describe('.getRegistryClient', function () { + it('should return the underlying registry client', function () { + expect(packageRepository.getRegistryClient()).to.be.an(RegistryClient); + }); + }); + + describe('.getResolveCache', function () { + it('should return the underlying resolve cache', function () { + expect(packageRepository.getResolveCache()).to.be.an(ResolveCache); + }); + }); + + describe('#clearRuntimeCache', function () { + it('should clear the resolve cache runtime cache', function () { + var called; + var originalClearRuntimeCache = ResolveCache.clearRuntimeCache; + + // No need to restore the original method since the constructor + // gets re-assigned every time in beforeEach + ResolveCache.clearRuntimeCache = function () { + called = true; + return originalClearRuntimeCache.apply(ResolveCache, arguments); + }; + + packageRepository.constructor.clearRuntimeCache(); + expect(called).to.be(true); + }); + + it('should clear the resolver factory runtime cache', function () { + var called; + + resolverFactoryClearHook = function () { + called = true; + }; + + packageRepository.constructor.clearRuntimeCache(); + expect(called).to.be(true); + }); + + it('should clear the registry runtime cache', function () { + var called; + var originalClearRuntimeCache = RegistryClient.clearRuntimeCache; + + // No need to restore the original method since the constructor + // gets re-assigned every time in beforeEach + RegistryClient.clearRuntimeCache = function () { + called = true; + return originalClearRuntimeCache.apply(RegistryClient, arguments); + }; + + packageRepository.constructor.clearRuntimeCache(); + expect(called).to.be(true); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolveCache.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolveCache.js new file mode 100644 index 0000000..5ebb82f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolveCache.js @@ -0,0 +1,1045 @@ +var path = require('path'); +var mout = require('mout'); +var rimraf = require('rimraf'); +var fs = require('graceful-fs'); +var Q = require('q'); +var expect = require('expect.js'); +var mkdirp = require('mkdirp'); +var ResolveCache = require('../../lib/core/ResolveCache'); +var defaultConfig = require('../../lib/config'); +var cmd = require('../../lib/util/cmd'); +var copy = require('../../lib/util/copy'); +var md5 = require('../../lib/util/md5'); + +describe('ResolveCache', function () { + var resolveCache; + var testPackage = path.resolve(__dirname, '../assets/package-a'); + var tempPackage = path.resolve(__dirname, '../assets/temp'); + var tempPackage2 = path.resolve(__dirname, '../assets/temp2'); + var cacheDir = path.join(__dirname, '../assets/temp-resolve-cache'); + + before(function (next) { + // Delete cache folder + rimraf.sync(cacheDir); + + // Instantiate resolver cache + resolveCache = new ResolveCache(mout.object.deepMixIn(defaultConfig, { + storage: { + packages: cacheDir + } + })); + + // Checkout test package version 0.2.0 + cmd('git', ['checkout', '0.2.0'], { cwd: testPackage }) + .then(next.bind(next, null), next); + }); + + beforeEach(function () { + // Reset in memory cache for each test + resolveCache.reset(); + }); + + after(function () { + // Remove cache folder afterwards + rimraf.sync(cacheDir); + }); + + describe('.constructor', function () { + beforeEach(function () { + // Delete temp folder + rimraf.sync(tempPackage); + }); + after(function () { + // Delete temp folder + rimraf.sync(tempPackage); + }); + + function initialize(cacheDir) { + return new ResolveCache(mout.object.deepMixIn(defaultConfig, { + storage: { + packages: cacheDir + } + })); + } + + it('should create the cache folder if it doesn\'t exists', function () { + initialize(tempPackage); + expect(fs.existsSync(tempPackage)).to.be(true); + }); + + it('should not error out if the cache folder already exists', function () { + mkdirp.sync(tempPackage); + initialize(tempPackage); + }); + }); + + describe('.store', function () { + var oldFsRename = fs.rename; + + beforeEach(function (next) { + // Restore oldFsRename + fs.rename = oldFsRename; + + // Create a fresh copy of the test package into temp + rimraf.sync(tempPackage); + copy.copyDir(testPackage, tempPackage, { ignore: ['.git'] }) + .then(next.bind(next, null), next); + }); + + it('should move the canonical dir to source-md5/version/ folder if package meta has a version', function (next) { + resolveCache.store(tempPackage, { + name: 'foo', + version: '1.0.0', + _source: 'foo', + _target: '*' + }) + .then(function (dir) { + expect(dir).to.equal(path.join(cacheDir, md5('foo'), '1.0.0')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + + it('should move the canonical dir to source-md5/target/ folder if package meta has no version', function (next) { + resolveCache.store(tempPackage, { + name: 'foo', + _source: 'foo', + _target: 'some-branch' + }) + .then(function (dir) { + expect(dir).to.equal(path.join(cacheDir, md5('foo'), 'some-branch')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + + it('should move the canonical dir to source-md5/_wildcard/ folder if package meta has no version and target is *', function (next) { + resolveCache.store(tempPackage, { + name: 'foo', + _source: 'foo', + _target: '*' + }) + .then(function (dir) { + expect(dir).to.equal(path.join(cacheDir, md5('foo'), '_wildcard')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + + it('should overwrite if the exact same package source/version exists', function (next) { + var cachePkgDir = path.join(cacheDir, md5('foo'), '1.0.0-rc.blehhh'); + + mkdirp.sync(cachePkgDir); + fs.writeFileSync(path.join(cachePkgDir, '_bleh'), 'w00t'); + + resolveCache.store(tempPackage, { + name: 'foo', + version: '1.0.0-rc.blehhh', + _source: 'foo', + _target: '*' + }) + .then(function (dir) { + expect(dir).to.equal(cachePkgDir); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + expect(fs.existsSync(path.join(cachePkgDir, '_bleh'))).to.be(false); + + next(); + }) + .done(); + }); + + it('should read the package meta if not present', function (next) { + var pkgMeta = path.join(tempPackage, '.bower.json'); + + // Copy bower.json to .bower.json and add some props + copy.copyFile(path.join(tempPackage, 'component.json'), pkgMeta) + .then(function () { + return Q.nfcall(fs.readFile, pkgMeta) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + + json._target = '~0.2.0'; + json._source = 'git://github.com/bower/test-package.git'; + + return Q.nfcall(fs.writeFile, pkgMeta, JSON.stringify(json, null, ' ')); + }); + }) + // Store as usual + .then(function () { + return resolveCache.store(tempPackage); + }) + .then(function (dir) { + expect(dir).to.equal(path.join(cacheDir, md5('git://github.com/bower/test-package.git'), '0.2.0')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + + it('should error out when reading the package meta if the file does not exist', function (next) { + resolveCache.store(tempPackage) + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOENT'); + expect(err.message).to.contain(path.join(tempPackage, '.bower.json')); + + next(); + }) + .done(); + }); + + it('should error out when reading an invalid package meta', function (next) { + var pkgMeta = path.join(tempPackage, '.bower.json'); + + return Q.nfcall(fs.writeFile, pkgMeta, 'w00t') + .then(function () { + return resolveCache.store(tempPackage) + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EMALFORMED'); + expect(err.message).to.contain(path.join(tempPackage, '.bower.json')); + + next(); + }); + }) + .done(); + }); + + it('should move the canonical dir, even if it is in a different drive', function (next) { + var hittedMock = false; + + fs.rename = function (src, dest, cb) { + hittedMock = true; + + setTimeout(function () { + var err = new Error(); + err.code = 'EXDEV'; + cb(err); + }, 10); + }; + + resolveCache.store(tempPackage, { + name: 'foo', + _source: 'foo', + _target: 'some-branch' + }) + .then(function (dir) { + // Ensure mock was called + expect(hittedMock).to.be(true); + + expect(dir).to.equal(path.join(cacheDir, md5('foo'), 'some-branch')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + + it('should update the in-memory cache', function (next) { + // Feed the cache + resolveCache.versions('test-in-memory') + // Copy temp package to temp package 2 + .then(function () { + return copy.copyDir(tempPackage, tempPackage2, { ignore: ['.git'] }); + }) + // Store the two packages + .then(function () { + return resolveCache.store(tempPackage, { + name: 'foo', + version: '1.0.0', + _source: 'test-in-memory', + _target: '*' + }); + }) + .then(function () { + return resolveCache.store(tempPackage2, { + name: 'foo', + version: '1.0.1', + _source: 'test-in-memory', + _target: '*' + }); + }) + // Cache should have been updated + .then(function () { + return resolveCache.versions('test-in-memory') + .then(function (versions) { + expect(versions).to.eql(['1.0.1', '1.0.0']); + + next(); + }); + }) + .done(); + }); + + it('should url encode target when storing to the fs', function (next) { + resolveCache.store(tempPackage, { + name: 'foo', + _source: 'foo', + _target: 'foo/bar' + }) + .then(function (dir) { + expect(dir).to.equal(path.join(cacheDir, md5('foo'), 'foo%2Fbar')); + expect(fs.existsSync(dir)).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(tempPackage)).to.be(false); + + next(); + }) + .done(); + }); + }); + + describe('.versions', function () { + it('should resolve to an array', function (next) { + resolveCache.versions(String(Math.random())) + .then(function (versions) { + expect(versions).to.be.an('array'); + next(); + }) + .done(); + }); + + it('should ignore non-semver folders of the source', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.mkdirSync(path.join(sourceDir, 'foo')); + + resolveCache.versions(source) + .then(function (versions) { + expect(versions).to.not.contain('foo'); + expect(versions).to.contain('0.0.1'); + expect(versions).to.contain('0.1.0'); + next(); + }) + .done(); + }); + + it('should order the versions', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.mkdirSync(path.join(sourceDir, '0.1.0-rc.1')); + + resolveCache.versions(source) + .then(function (versions) { + expect(versions).to.eql(['0.1.0', '0.1.0-rc.1', '0.0.1']); + next(); + }) + .done(); + }); + + it('should cache versions to speed-up subsequent calls', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + resolveCache.versions(source) + .then(function () { + // Remove folder + rimraf.sync(sourceDir); + + return resolveCache.versions(source); + }) + .then(function (versions) { + expect(versions).to.eql(['0.0.1']); + next(); + }) + .done(); + }); + }); + + describe('.retrieve', function () { + it('should resolve to empty if there are no packages for the requested source', function (next) { + resolveCache.retrieve(String(Math.random())) + .spread(function () { + expect(arguments.length).to.equal(0); + next(); + }) + .done(); + }); + + it('should resolve to empty if there are no suitable packages for the requested target', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.mkdirSync(path.join(sourceDir, '0.1.9')); + fs.mkdirSync(path.join(sourceDir, '0.2.0')); + + resolveCache.retrieve(source, '~0.3.0') + .spread(function () { + expect(arguments.length).to.equal(0); + + return resolveCache.retrieve(source, 'some-branch'); + }) + .spread(function () { + expect(arguments.length).to.equal(0); + + next(); + }) + .done(); + }); + + it('should remove invalid packages from the cache if their package meta is missing or invalid', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.mkdirSync(path.join(sourceDir, '0.1.9')); + fs.mkdirSync(path.join(sourceDir, '0.2.0')); + + // Create an invalid package meta + fs.writeFileSync(path.join(sourceDir, '0.2.0', '.bower.json'), 'w00t'); + + resolveCache.retrieve(source, '~0.1.0') + .spread(function () { + var dirs = fs.readdirSync(sourceDir); + + expect(arguments.length).to.equal(0); + expect(dirs).to.contain('0.0.1'); + expect(dirs).to.contain('0.2.0'); + next(); + }) + .done(); + }); + + it('should resolve to the highest package that matches a range target, ignoring pre-releases', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { name: 'foo' }; + + // Create some versions + fs.mkdirSync(sourceDir); + + json.version = '0.0.1'; + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.writeFileSync(path.join(sourceDir, '0.0.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0'; + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.writeFileSync(path.join(sourceDir, '0.1.0', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0-rc.1'; + fs.mkdirSync(path.join(sourceDir, '0.1.0-rc.1')); + fs.writeFileSync(path.join(sourceDir, '0.1.0-rc.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.9'; + fs.mkdirSync(path.join(sourceDir, '0.1.9')); + fs.writeFileSync(path.join(sourceDir, '0.1.9', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.2.0'; + fs.mkdirSync(path.join(sourceDir, '0.2.0')); + fs.writeFileSync(path.join(sourceDir, '0.2.0', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.retrieve(source, '~0.1.0') + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.version).to.equal('0.1.9'); + expect(canonicalDir).to.equal(path.join(sourceDir, '0.1.9')); + + return resolveCache.retrieve(source, '*'); + }) + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.version).to.equal('0.2.0'); + expect(canonicalDir).to.equal(path.join(sourceDir, '0.2.0')); + + next(); + }) + .done(); + }); + + it('should resolve to the highest package that matches a range target, not ignoring pre-releases if they are the only versions', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { name: 'foo' }; + + // Create some versions + fs.mkdirSync(sourceDir); + + json.version = '0.1.0-rc.1'; + fs.mkdirSync(path.join(sourceDir, '0.1.0-rc.1')); + fs.writeFileSync(path.join(sourceDir, '0.1.0-rc.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0-rc.2'; + fs.mkdirSync(path.join(sourceDir, '0.1.0-rc.2')); + fs.writeFileSync(path.join(sourceDir, '0.1.0-rc.2', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.retrieve(source, '~0.1.0') + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.version).to.equal('0.1.0-rc.2'); + expect(canonicalDir).to.equal(path.join(sourceDir, '0.1.0-rc.2')); + + next(); + }) + .done(); + }); + + it('should resolve to exact match (including build metadata) if available', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { name: 'foo' }; + + // Create some versions + fs.mkdirSync(sourceDir); + + json.version = '0.1.0'; + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + fs.writeFileSync(path.join(sourceDir, '0.1.0', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0+build.4'; + fs.mkdirSync(path.join(sourceDir, '0.1.0+build.4')); + fs.writeFileSync(path.join(sourceDir, '0.1.0+build.4', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0+build.5'; + fs.mkdirSync(path.join(sourceDir, '0.1.0+build.5')); + fs.writeFileSync(path.join(sourceDir, '0.1.0+build.5', '.bower.json'), JSON.stringify(json, null, ' ')); + + json.version = '0.1.0+build.6'; + fs.mkdirSync(path.join(sourceDir, '0.1.0+build.6')); + fs.writeFileSync(path.join(sourceDir, '0.1.0+build.6', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.retrieve(source, '0.1.0+build.5') + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta.version).to.equal('0.1.0+build.5'); + expect(canonicalDir).to.equal(path.join(sourceDir, '0.1.0+build.5')); + + next(); + }) + .done(); + }); + + it('should resolve to the _wildcard package if target is * and there are no semver versions', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { name: 'foo' }; + + // Create some versions + fs.mkdirSync(sourceDir); + + fs.mkdirSync(path.join(sourceDir, '_wildcard')); + fs.writeFileSync(path.join(sourceDir, '_wildcard', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.retrieve(source, '*') + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(canonicalDir).to.equal(path.join(sourceDir, '_wildcard')); + + next(); + }) + .done(); + }); + + it('should resolve to the exact target it\'s not a semver range', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { name: 'foo' }; + + // Create some versions + fs.mkdirSync(sourceDir); + + fs.mkdirSync(path.join(sourceDir, 'some-branch')); + fs.writeFileSync(path.join(sourceDir, 'some-branch', '.bower.json'), JSON.stringify(json, null, ' ')); + + fs.mkdirSync(path.join(sourceDir, 'other-branch')); + fs.writeFileSync(path.join(sourceDir, 'other-branch', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.retrieve(source, 'some-branch') + .spread(function (canonicalDir, pkgMeta) { + expect(pkgMeta).to.be.an('object'); + expect(pkgMeta).to.not.have.property('version'); + + next(); + }) + .done(); + }); + }); + + describe('.eliminate', function () { + beforeEach(function () { + mkdirp.sync(cacheDir); + }); + + it('should delete the source-md5/version folder', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + + resolveCache.eliminate({ + name: 'foo', + version: '0.0.1', + _source: source, + _target: '*' + }) + .then(function () { + expect(fs.existsSync(path.join(sourceDir, '0.0.1'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, '0.1.0'))).to.be(true); + + next(); + }) + .done(); + }); + + it('should delete the source-md5/target folder', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, 'some-branch')); + + resolveCache.eliminate({ + name: 'foo', + _source: source, + _target: 'some-branch' + }) + .then(function () { + expect(fs.existsSync(path.join(sourceDir, 'some-branch'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, '0.0.1'))).to.be(true); + + next(); + }) + .done(); + }); + + it('should delete the source-md5/_wildcard folder', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '_wildcard')); + + resolveCache.eliminate({ + name: 'foo', + _source: source, + _target: '*' + }) + .then(function () { + expect(fs.existsSync(path.join(sourceDir, '_wildcard'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, '0.0.1'))).to.be(true); + + next(); + }) + .done(); + }); + + it('should delete the source-md5 folder if empty', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + resolveCache.eliminate({ + name: 'foo', + version: '0.0.1', + _source: source, + _target: '*' + }) + .then(function () { + expect(fs.existsSync(path.join(sourceDir, '0.0.1'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir))).to.be(false); + + next(); + }) + .done(); + }); + + it('should remove entry from in memory cache if the source-md5 folder was deleted', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + // Feed up the cache + resolveCache.versions(source) + // Eliminate + .then(function () { + return resolveCache.eliminate({ + name: 'foo', + version: '0.0.1', + _source: source, + _target: '*' + }); + }) + .then(function () { + // At this point the parent folder should be deleted + // To test against the in-memory cache, we create a folder + // manually and request the versions + mkdirp.sync(path.join(sourceDir, '0.0.2')); + + resolveCache.versions(source) + .then(function (versions) { + expect(versions).to.eql(['0.0.2']); + + next(); + }); + }) + .done(); + }); + }); + + describe('.clear', function () { + beforeEach(function () { + mkdirp.sync(cacheDir); + }); + + it('should empty the whole cache folder', function (next) { + resolveCache.clear() + .then(function () { + var files; + + expect(fs.existsSync(cacheDir)).to.be(true); + + files = fs.readdirSync(cacheDir); + expect(files.length).to.be(0); + + next(); + }) + .done(); + }); + + it('should erase the in-memory cache', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + // Feed the in-memory cache + resolveCache.versions(source) + // Clear + .then(function () { + return resolveCache.clear(); + }) + .then(function () { + // To test against the in-memory cache, we create a folder + // manually and request the versions + mkdirp.sync(path.join(sourceDir, '0.0.2')); + + resolveCache.versions(source) + .then(function (versions) { + expect(versions).to.eql(['0.0.2']); + + next(); + }); + }) + .done(); + }); + }); + + describe('.reset', function () { + it('should erase the in-memory cache', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + // Feed the in-memory cache + resolveCache.versions(source) + .then(function () { + // Delete 0.0.1 and create 0.0.2 + fs.rmdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(path.join(sourceDir, '0.0.2')); + + // Reset cache + resolveCache.reset(); + + // Get versions + return resolveCache.versions(source); + }) + .then(function (versions) { + expect(versions).to.eql(['0.0.2']); + + next(); + }) + .done(); + }); + }); + + describe('.list', function () { + beforeEach(function () { + rimraf.sync(cacheDir); + mkdirp.sync(cacheDir); + }); + + it('should resolve to an empty array if the cache is empty', function (next) { + resolveCache.list() + .then(function (entries) { + expect(entries).to.be.an('array'); + expect(entries.length).to.be(0); + + next(); + }) + .done(); + }); + + it('should resolve to an ordered array of entries (name ASC, release ASC)', function (next) { + var source = 'list-package-1'; + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + var source2 = 'list-package-2'; + var sourceId2 = md5(source2); + var sourceDir2 = path.join(cacheDir, sourceId2); + + var json = { + name: 'foo' + }; + + // Create some versions for different sources + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + json.version = '0.0.1'; + fs.writeFileSync(path.join(sourceDir, '0.0.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + fs.mkdirSync(path.join(sourceDir, '0.1.0')); + json.version = '0.1.0'; + fs.writeFileSync(path.join(sourceDir, '0.1.0', '.bower.json'), JSON.stringify(json, null, ' ')); + + delete json.version; + + fs.mkdirSync(path.join(sourceDir, 'foo')); + json._target = 'foo'; + fs.writeFileSync(path.join(sourceDir, 'foo', '.bower.json'), JSON.stringify(json, null, ' ')); + + fs.mkdirSync(path.join(sourceDir, 'bar')); + json._target = 'bar'; + fs.writeFileSync(path.join(sourceDir, 'bar', '.bower.json'), JSON.stringify(json, null, ' ')); + + fs.mkdirSync(path.join(sourceDir, 'aa')); + json._target = 'aa'; + fs.writeFileSync(path.join(sourceDir, 'aa', '.bower.json'), JSON.stringify(json, null, ' ')); + + delete json._target; + + fs.mkdirSync(sourceDir2); + fs.mkdirSync(path.join(sourceDir2, '0.2.1')); + json.version = '0.2.1'; + fs.writeFileSync(path.join(sourceDir2, '0.2.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + fs.mkdirSync(path.join(sourceDir2, '0.2.0')); + json.name = 'abc'; + json.version = '0.2.0'; + fs.writeFileSync(path.join(sourceDir2, '0.2.0', '.bower.json'), JSON.stringify(json, null, ' ')); + + resolveCache.list() + .then(function (entries) { + var expectedJson; + var bowerDir = path.join(__dirname, '../..'); + + expect(entries).to.be.an('array'); + + expectedJson = fs.readFileSync(path.join(__dirname, '../assets/resolve-cache/list-json-1.json')); + expectedJson = expectedJson.toString(); + + mout.object.forOwn(entries, function (entry) { + // Trim absolute bower path from json + entry.canonicalDir = entry.canonicalDir.substr(bowerDir.length); + // Convert windows \ paths to / + entry.canonicalDir = entry.canonicalDir.replace(/\\/g, '/'); + }); + + json = JSON.stringify(entries, null, ' '); + expect(json).to.equal(expectedJson); + + next(); + }) + .done(); + }); + + it('should ignore lurking files where dirs are expected', function (next) { + var source = 'list-package-1'; + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { + name: 'foo' + }; + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + json.version = '0.0.1'; + fs.writeFileSync(path.join(sourceDir, '0.0.1', '.bower.json'), JSON.stringify(json, null, ' ')); + + // Create lurking files + fs.writeFileSync(path.join(cacheDir, 'foo'), 'w00t'); + fs.writeFileSync(path.join(cacheDir, '.DS_Store'), ''); + fs.writeFileSync(path.join(sourceDir, 'foo'), 'w00t'); + fs.writeFileSync(path.join(sourceDir, '.DS_Store'), ''); + + // It should not error out + resolveCache.list() + .then(function (entries) { + expect(entries).to.be.an('array'); + expect(entries.length).to.be(1); + expect(entries[0].pkgMeta).to.eql(json); + + // Lurking file should have been removed + expect(fs.existsSync(path.join(cacheDir, 'foo'))).to.be(false); + expect(fs.existsSync(path.join(cacheDir, '.DS_Store'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, 'foo'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, '.DS_Store'))).to.be(false); + + next(); + }) + .done(); + + }); + + it('should delete entries if failed to read package meta', function (next) { + var source = 'list-package-1'; + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + var json = { + name: 'foo' + }; + + // Create invalid versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + + fs.mkdirSync(path.join(sourceDir, '0.0.2')); + fs.writeFileSync(path.join(sourceDir, '0.0.2', '.bower.json'), 'w00t'); + + // Create valid version + fs.mkdirSync(path.join(sourceDir, '0.0.3')); + json.version = '0.0.3'; + fs.writeFileSync(path.join(sourceDir, '0.0.3', '.bower.json'), JSON.stringify(json, null, ' ')); + + // It should not error out + resolveCache.list() + .then(function (entries) { + expect(entries).to.be.an('array'); + expect(entries.length).to.be(1); + expect(entries[0].pkgMeta).to.eql(json); + + // Packages with invalid metas should have been removed + expect(fs.existsSync(path.join(sourceDir, '0.0.1'))).to.be(false); + expect(fs.existsSync(path.join(sourceDir, '0.0.2'))).to.be(false); + + next(); + }) + .done(); + }); + }); + + describe('#clearRuntimeCache', function () { + it('should clear the in-memory cache for all sources', function (next) { + var source = String(Math.random()); + var sourceId = md5(source); + var sourceDir = path.join(cacheDir, sourceId); + + var source2 = String(Math.random()); + var sourceId2 = md5(source2); + var sourceDir2 = path.join(cacheDir, sourceId2); + + // Create some versions + fs.mkdirSync(sourceDir); + fs.mkdirSync(path.join(sourceDir, '0.0.1')); + fs.mkdirSync(sourceDir2); + fs.mkdirSync(path.join(sourceDir2, '0.0.2')); + + // Feed the cache + resolveCache.versions(source) + .then(function () { + return resolveCache.versions(source2); + }) + .then(function () { + // Create some more + fs.mkdirSync(path.join(sourceDir, '0.0.3')); + fs.mkdirSync(path.join(sourceDir2, '0.0.4')); + + // Reset cache + ResolveCache.clearRuntimeCache(); + }) + .then(function () { + return resolveCache.versions(source) + .then(function (versions) { + expect(versions).to.eql(['0.0.3', '0.0.1']); + + return resolveCache.versions(source2); + }) + .then(function (versions) { + expect(versions).to.eql(['0.0.4', '0.0.2']); + + next(); + }); + }) + .done(); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolverFactory.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolverFactory.js new file mode 100644 index 0000000..0f953fc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolverFactory.js @@ -0,0 +1,615 @@ +var expect = require('expect.js'); +var fs = require('graceful-fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var mout = require('mout'); +var Q = require('q'); +var rimraf = require('rimraf'); +var RegistryClient = require('bower-registry-client'); +var Logger = require('bower-logger'); +var resolverFactory = require('../../lib/core/resolverFactory'); +var resolvers = require('../../lib/core/resolvers'); +var defaultConfig = require('../../lib/config'); + +describe('resolverFactory', function () { + var tempSource; + var logger = new Logger(); + var registryClient = new RegistryClient(mout.object.fillIn({ + cache: defaultConfig._registry + }, defaultConfig)); + + afterEach(function (next) { + logger.removeAllListeners(); + + if (tempSource) { + rimraf(tempSource, next); + tempSource = null; + } else { + next(); + } + }); + + after(function (next) { + rimraf('dejavu', next); + }); + + function callFactory(decEndpoint, config) { + return resolverFactory(decEndpoint, config || defaultConfig, logger, registryClient); + } + + it('should recognize git remote endpoints correctly', function (next) { + var promise = Q.resolve(); + var endpoints; + + endpoints = { + // git: + 'git://hostname.com/user/project': 'git://hostname.com/user/project', + 'git://hostname.com/user/project/': 'git://hostname.com/user/project', + 'git://hostname.com/user/project.git': 'git://hostname.com/user/project.git', + 'git://hostname.com/user/project.git/': 'git://hostname.com/user/project.git', + + // git@: + 'git@hostname.com:user/project': 'git@hostname.com:user/project', + 'git@hostname.com:user/project/': 'git@hostname.com:user/project', + 'git@hostname.com:user/project.git': 'git@hostname.com:user/project.git', + 'git@hostname.com:user/project.git/': 'git@hostname.com:user/project.git', + + // git+ssh: + 'git+ssh://user@hostname.com:project': 'ssh://user@hostname.com:project', + 'git+ssh://user@hostname.com:project/': 'ssh://user@hostname.com:project', + 'git+ssh://user@hostname.com:project.git': 'ssh://user@hostname.com:project.git', + 'git+ssh://user@hostname.com:project.git/': 'ssh://user@hostname.com:project.git', + 'git+ssh://user@hostname.com/project': 'ssh://user@hostname.com/project', + 'git+ssh://user@hostname.com/project/': 'ssh://user@hostname.com/project', + 'git+ssh://user@hostname.com/project.git': 'ssh://user@hostname.com/project.git', + 'git+ssh://user@hostname.com/project.git/': 'ssh://user@hostname.com/project.git', + + // git+http + 'git+http://hostname.com/project/blah': 'http://hostname.com/project/blah', + 'git+http://hostname.com/project/blah/': 'http://hostname.com/project/blah', + 'git+http://hostname.com/project/blah.git': 'http://hostname.com/project/blah.git', + 'git+http://hostname.com/project/blah.git/': 'http://hostname.com/project/blah.git', + 'git+http://user@hostname.com/project/blah': 'http://user@hostname.com/project/blah', + 'git+http://user@hostname.com/project/blah/': 'http://user@hostname.com/project/blah', + 'git+http://user@hostname.com/project/blah.git': 'http://user@hostname.com/project/blah.git', + 'git+http://user@hostname.com/project/blah.git/': 'http://user@hostname.com/project/blah.git', + + // git+https + 'git+https://hostname.com/project/blah': 'https://hostname.com/project/blah', + 'git+https://hostname.com/project/blah/': 'https://hostname.com/project/blah', + 'git+https://hostname.com/project/blah.git': 'https://hostname.com/project/blah.git', + 'git+https://hostname.com/project/blah.git/': 'https://hostname.com/project/blah.git', + 'git+https://user@hostname.com/project/blah': 'https://user@hostname.com/project/blah', + 'git+https://user@hostname.com/project/blah/': 'https://user@hostname.com/project/blah', + 'git+https://user@hostname.com/project/blah.git': 'https://user@hostname.com/project/blah.git', + 'git+https://user@hostname.com/project/blah.git/': 'https://user@hostname.com/project/blah.git', + + // ssh .git$ + 'ssh://user@hostname.com:project.git': 'ssh://user@hostname.com:project.git', + 'ssh://user@hostname.com:project.git/': 'ssh://user@hostname.com:project.git', + 'ssh://user@hostname.com/project.git': 'ssh://user@hostname.com/project.git', + 'ssh://user@hostname.com/project.git/': 'ssh://user@hostname.com/project.git', + + // http .git$ + 'http://hostname.com/project.git': 'http://hostname.com/project.git', + 'http://hostname.com/project.git/': 'http://hostname.com/project.git', + 'http://user@hostname.com/project.git': 'http://user@hostname.com/project.git', + 'http://user@hostname.com/project.git/': 'http://user@hostname.com/project.git', + + // https .git$ + 'https://hostname.com/project.git': 'https://hostname.com/project.git', + 'https://hostname.com/project.git/': 'https://hostname.com/project.git', + 'https://user@hostname.com/project.git': 'https://user@hostname.com/project.git', + 'https://user@hostname.com/project.git/': 'https://user@hostname.com/project.git', + + // shorthand + 'bower/bower': 'git://github.com/bower/bower.git' + }; + + mout.object.forOwn(endpoints, function (value, key) { + // Test without name and target + promise = promise.then(function () { + return callFactory({ source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver).to.not.be(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getTarget()).to.equal('*'); + }); + + // Test with target + promise = promise.then(function () { + return callFactory({ source: key, target: 'commit-ish' }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver).to.not.be(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getTarget()).to.equal('commit-ish'); + }); + + // Test with name + promise = promise.then(function () { + return callFactory({ name: 'foo', source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver).to.not.be(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getTarget()).to.equal('*'); + }); + }); + + promise + .then(next.bind(next, null)) + .done(); + }); + + it('should recognize GitHub endpoints correctly', function (next) { + var promise = Q.resolve(); + var gitHub; + var nonGitHub; + + gitHub = { + // git: + 'git://github.com/user/project': 'git://github.com/user/project.git', + 'git://github.com/user/project/': 'git://github.com/user/project.git', + 'git://github.com/user/project.git': 'git://github.com/user/project.git', + 'git://github.com/user/project.git/': 'git://github.com/user/project.git', + + // git@: + 'git@github.com:user/project': 'git@github.com:user/project.git', + 'git@github.com:user/project/': 'git@github.com:user/project.git', + 'git@github.com:user/project.git': 'git@github.com:user/project.git', + 'git@github.com:user/project.git/': 'git@github.com:user/project.git', + + // git+ssh: + 'git+ssh://git@github.com:project/blah': 'ssh://git@github.com:project/blah.git', + 'git+ssh://git@github.com:project/blah/': 'ssh://git@github.com:project/blah.git', + 'git+ssh://git@github.com:project/blah.git': 'ssh://git@github.com:project/blah.git', + 'git+ssh://git@github.com:project/blah.git/': 'ssh://git@github.com:project/blah.git', + 'git+ssh://git@github.com/project/blah': 'ssh://git@github.com/project/blah.git', + 'git+ssh://git@github.com/project/blah/': 'ssh://git@github.com/project/blah.git', + 'git+ssh://git@github.com/project/blah.git': 'ssh://git@github.com/project/blah.git', + 'git+ssh://git@github.com/project/blah.git/': 'ssh://git@github.com/project/blah.git', + + // git+http + 'git+http://github.com/project/blah': 'http://github.com/project/blah.git', + 'git+http://github.com/project/blah/': 'http://github.com/project/blah.git', + 'git+http://github.com/project/blah.git': 'http://github.com/project/blah.git', + 'git+http://github.com/project/blah.git/': 'http://github.com/project/blah.git', + 'git+http://user@github.com/project/blah': 'http://user@github.com/project/blah.git', + 'git+http://user@github.com/project/blah/': 'http://user@github.com/project/blah.git', + 'git+http://user@github.com/project/blah.git': 'http://user@github.com/project/blah.git', + 'git+http://user@github.com/project/blah.git/': 'http://user@github.com/project/blah.git', + + // git+https + 'git+https://github.com/project/blah': 'https://github.com/project/blah.git', + 'git+https://github.com/project/blah/': 'https://github.com/project/blah.git', + 'git+https://github.com/project/blah.git': 'https://github.com/project/blah.git', + 'git+https://github.com/project/blah.git/': 'https://github.com/project/blah.git', + 'git+https://user@github.com/project/blah': 'https://user@github.com/project/blah.git', + 'git+https://user@github.com/project/blah/': 'https://user@github.com/project/blah.git', + 'git+https://user@github.com/project/blah.git': 'https://user@github.com/project/blah.git', + 'git+https://user@github.com/project/blah.git/': 'https://user@github.com/project/blah.git', + + // ssh .git$ + 'ssh://git@github.com:project/blah.git': 'ssh://git@github.com:project/blah.git', + 'ssh://git@github.com:project/blah.git/': 'ssh://git@github.com:project/blah.git', + 'ssh://git@github.com/project/blah.git': 'ssh://git@github.com/project/blah.git', + 'ssh://git@github.com/project/blah.git/': 'ssh://git@github.com/project/blah.git', + + // http .git$ + 'http://github.com/project/blah.git': 'http://github.com/project/blah.git', + 'http://github.com/project/blah.git/': 'http://github.com/project/blah.git', + 'http://user@github.com/project/blah.git': 'http://user@github.com/project/blah.git', + 'http://user@github.com/project/blah.git/': 'http://user@github.com/project/blah.git', + + // https + 'https://github.com/project/blah.git': 'https://github.com/project/blah.git', + 'https://github.com/project/blah.git/': 'https://github.com/project/blah.git', + 'https://user@github.com/project/blah.git': 'https://user@github.com/project/blah.git', + 'https://user@github.com/project/blah.git/': 'https://user@github.com/project/blah.git', + + // shorthand + 'bower/bower': 'git://github.com/bower/bower.git' + }; + + nonGitHub = [ + 'git://github.com/user/project/bleh.git', + 'git://xxxxgithub.com/user/project.git', + 'git@xxxxgithub.com:user:project.git', + 'git@xxxxgithub.com:user/project.git', + 'git+ssh://git@xxxxgithub.com:user/project', + 'git+ssh://git@xxxxgithub.com/user/project', + 'git+http://user@xxxxgithub.com/user/project', + 'git+https://user@xxxxgithub.com/user/project', + 'ssh://git@xxxxgithub.com:user/project.git', + 'ssh://git@xxxxgithub.com/user/project.git', + 'http://xxxxgithub.com/user/project.git', + 'https://xxxxgithub.com/user/project.git', + 'http://user@xxxxgithub.com/user/project.git', + 'https://user@xxxxgithub.com/user/project.git' + ]; + + // Test GitHub ones + mout.object.forOwn(gitHub, function (value, key) { + // Test without name and target + promise = promise.then(function () { + return callFactory({ source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getTarget()).to.equal('*'); + }); + + // Test with target + promise = promise.then(function () { + return callFactory({ source: key, target: 'commit-ish' }); + }) + .then(function (resolver) { + if (value) { + expect(resolver).to.be.a(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getTarget()).to.equal('commit-ish'); + } else { + expect(resolver).to.not.be.a(resolvers.GitHub); + } + }); + + // Test with name + promise = promise.then(function () { + return callFactory({ name: 'foo', source: key }); + }) + .then(function (resolver) { + if (value) { + expect(resolver).to.be.a(resolvers.GitHub); + expect(resolver.getSource()).to.equal(value); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getTarget()).to.equal('*'); + } else { + expect(resolver).to.not.be.a(resolvers.GitHub); + } + }); + }); + + // Test similar to GitHub but not real GitHub + nonGitHub.forEach(function (value) { + promise = promise.then(function () { + return callFactory({ source: value }); + }) + .then(function (resolver) { + expect(resolver).to.not.be.a(resolvers.GitHub); + expect(resolver).to.be.a(resolvers.GitRemote); + }); + }); + + promise + .then(next.bind(next, null)) + .done(); + }); + + it('should recognize local fs git endpoints correctly', function (next) { + var promise = Q.resolve(); + var endpoints; + var temp; + + endpoints = {}; + + // Absolute path + temp = path.resolve(__dirname, '../assets/package-a'); + endpoints[temp] = temp; + + // Absolute path that ends with a / + // See: https://github.com/bower/bower/issues/898 + temp = path.resolve(__dirname, '../assets/package-a') + '/'; + endpoints[temp] = temp; + + // Relative path + endpoints[__dirname + '/../assets/package-a'] = temp; + + // TODO: test with backslashes on windows and ~/ on unix + + mout.object.forOwn(endpoints, function (value, key) { + // Test without name + promise = promise.then(function () { + return callFactory({ source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitFs); + expect(resolver.getTarget()).to.equal('*'); + }); + + // Test with name + promise = promise.then(function () { + return callFactory({ name: 'foo', source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitFs); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getTarget()).to.equal('*'); + }); + }); + + promise + .then(next.bind(next, null)) + .done(); + }); + + it('should recognize local fs files/folder endpoints correctly', function (next) { + var promise = Q.resolve(); + var endpoints; + var temp; + + tempSource = path.resolve(__dirname, '../assets/tmp'); + mkdirp.sync(tempSource); + fs.writeFileSync(path.join(tempSource, '.git'), 'foo'); + fs.writeFileSync(path.join(tempSource, 'file.with.multiple.dots'), 'foo'); + + endpoints = {}; + + // Absolute path to folder with .git file + endpoints[tempSource] = tempSource; + // Relative path to folder with .git file + endpoints[__dirname + '/../assets/tmp'] = tempSource; + + // Absolute path to folder + temp = path.resolve(__dirname, '../assets/test-temp-dir'); + endpoints[temp] = temp; + // Absolute + relative path to folder + endpoints[__dirname + '/../assets/test-temp-dir'] = temp; + + // Absolute path to file + temp = path.resolve(__dirname, '../assets/package-zip.zip'); + endpoints[temp] = temp; + // Absolute + relative path to file + endpoints[__dirname + '/../assets/package-zip.zip'] = temp; + + // Relative ../ + endpoints['../'] = path.normalize(__dirname + '/../../..'); + + // Relative ./ + endpoints['./test/assets'] = path.join(__dirname, '../assets'); + + // Relative with just one slash, to test fs resolution + // priority against shorthands + endpoints['./test'] = path.join(__dirname, '..'); + + // Test files with multiple dots (PR #474) + temp = path.join(tempSource, 'file.with.multiple.dots'); + endpoints[temp] = temp; + + mout.object.forOwn(endpoints, function (value, key) { + // Test without name + promise = promise.then(function () { + return callFactory({ source: key }); + }) + .then(function (resolver) { + expect(resolver.getSource()).to.equal(value); + expect(resolver).to.be.a(resolvers.Fs); + expect(resolver.getTarget()).to.equal('*'); + }); + + // Test with name + promise = promise.then(function () { + return callFactory({ name: 'foo', source: key }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.Fs); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getTarget()).to.equal('*'); + expect(resolver.getSource()).to.equal(value); + }); + }); + + + promise + .then(next.bind(next, null)) + .done(); + }); + + it('should recognize URL endpoints correctly', function (next) { + var promise = Q.resolve(); + var endpoints; + + endpoints = [ + 'http://bower.io/foo.js', + 'https://bower.io/foo.js' + ]; + + endpoints.forEach(function (source) { + // Test without name + promise = promise.then(function () { + return callFactory({ source: source }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.Url); + expect(resolver.getSource()).to.equal(source); + }); + + // Test with name + promise = promise.then(function () { + return callFactory({ name: 'foo', source: source }); + }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.Url); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getSource()).to.equal(source); + }); + }); + + promise + .then(next.bind(next, null)) + .done(); + }); + + it('should recognize registry endpoints correctly', function (next) { + // Create a 'dejavu' file at the root to prevent regressions of #666 + fs.writeFileSync('dejavu', 'foo'); + + callFactory({ source: 'dejavu' }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver.getSource()).to.equal('git://github.com/IndigoUnited/dejavu.git'); + expect(resolver.getTarget()).to.equal('*'); + }) + .then(function () { + // Test with name + return callFactory({ source: 'dejavu', name: 'foo' }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver.getSource()).to.equal('git://github.com/IndigoUnited/dejavu.git'); + expect(resolver.getName()).to.equal('foo'); + expect(resolver.getTarget()).to.equal('*'); + }); + }) + .then(function () { + // Test with target + return callFactory({ source: 'dejavu', target: '~2.0.0' }) + .then(function (resolver) { + expect(resolver).to.be.a(resolvers.GitRemote); + expect(resolver.getTarget()).to.equal('~2.0.0'); + + next(); + }); + }) + .done(); + }); + + it('should error out if the package was not found in the registry', function (next) { + callFactory({ source: 'some-package-that-will-never-exist' }) + .then(function () { + throw new Error('Should have failed'); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOTFOUND'); + expect(err.message).to.contain('some-package-that-will-never-exist'); + + next(); + }) + .done(); + }); + + it('should set registry to true on the decomposed endpoint if fetched from the registry', function (next) { + var decEndpoint = { source: 'dejavu' }; + + callFactory(decEndpoint) + .then(function () { + expect(decEndpoint.registry).to.be(true); + next(); + }) + .done(); + }); + + it('should use the configured shorthand resolver', function (next) { + callFactory({ source: 'bower/bower' }) + .then(function (resolver) { + var config; + + expect(resolver.getSource()).to.equal('git://github.com/bower/bower.git'); + + config = mout.object.fillIn({ + shorthandResolver: 'git://bower.io/{{owner}}/{{package}}/{{shorthand}}' + }, defaultConfig); + + return callFactory({ source: 'IndigoUnited/promptly' }, config); + }) + .then(function (resolver) { + expect(resolver.getSource()).to.equal('git://bower.io/IndigoUnited/promptly/IndigoUnited/promptly'); + next(); + }) + .done(); + }); + + it('should not expand using the shorthand resolver if it looks like a SSH URL', function (next) { + callFactory({ source: 'bleh@xxx.com:foo/bar' }) + .then(function (resolver) { + throw new Error('Should have failed'); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('ENOTFOUND'); + expect(err.message).to.contain('bleh@xxx.com:foo/bar'); + next(); + }) + .done(); + }); + + + it('should error out if there\'s no suitable resolver for a given source', function (next) { + resolverFactory({ source: 'some-package-that-will-never-exist' }, defaultConfig, logger) + .then(function () { + throw new Error('Should have failed'); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.be('ENORESOLVER'); + expect(err.message).to.contain('appropriate resolver'); + next(); + }) + .done(); + }); + + it.skip('should use config.cwd when resolving relative paths'); + + it('should not swallow constructor errors when instantiating resolvers', function (next) { + var promise = Q.resolve(); + var endpoints; + + // TODO: test with others + endpoints = [ + 'http://bower.io/foo.js', + path.resolve(__dirname, '../assets/test-temp-dir') + ]; + + endpoints.forEach(function (source) { + promise = promise.then(function () { + return callFactory({ source: source, target: 'bleh' }); + }) + .then(function () { + throw new Error('Should have failed'); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/can't resolve targets/i); + expect(err.code).to.equal('ENORESTARGET'); + }); + }); + + promise + .then(next.bind(next, null)) + .done(); + }); + + describe('.clearRuntimeCache', function () { + it('should call every resolver static method that clears the runtime cache', function () { + var originalMethods = {}; + var called = []; + var error; + + mout.object.forOwn(resolvers, function (ConcreteResolver, key) { + originalMethods[key] = ConcreteResolver.clearRuntimeCache; + ConcreteResolver.clearRuntimeCache = function () { + called.push(key); + return originalMethods[key].apply(this, arguments); + }; + }); + + try { + resolverFactory.clearRuntimeCache(); + } catch (e) { + error = e; + } finally { + mout.object.forOwn(resolvers, function (ConcreteResolver, key) { + ConcreteResolver.clearRuntimeCache = originalMethods[key]; + }); + } + + if (error) { + throw error; + } + + expect(called.sort()).to.eql(Object.keys(resolvers).sort()); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/fsResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/fsResolver.js new file mode 100644 index 0000000..521fc04 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/fsResolver.js @@ -0,0 +1,342 @@ +var expect = require('expect.js'); +var path = require('path'); +var fs = require('graceful-fs'); +var path = require('path'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var Q = require('q'); +var Logger = require('bower-logger'); +var cmd = require('../../../lib/util/cmd'); +var copy = require('../../../lib/util/copy'); +var FsResolver = require('../../../lib/core/resolvers/FsResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('FsResolver', function () { + var tempSource; + var logger; + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + + before(function (next) { + logger = new Logger(); + // Checkout test package version 0.2.1 which has a bower.json + // with ignores + cmd('git', ['checkout', '0.2.1'], { cwd: testPackage }) + .then(next.bind(next, null), next); + }); + + afterEach(function (next) { + logger.removeAllListeners(); + + if (tempSource) { + rimraf(tempSource, next); + tempSource = null; + } else { + next(); + } + }); + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new FsResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.constructor', function () { + it('should guess the name from the path', function () { + var resolver = create(path.resolve('../../assets/package-zip.zip')); + + expect(resolver.getName()).to.equal('package-zip'); + }); + + it('should make paths absolute and normalized', function () { + var resolver; + + resolver = create(path.relative(process.cwd(), testPackage)); + expect(resolver.getSource()).to.equal(testPackage); + + resolver = create(testPackage + '/something/..'); + expect(resolver.getSource()).to.equal(testPackage); + }); + + it.skip('should use config.cwd for resolving relative paths'); + + it('should error out if a target was specified', function (next) { + var resolver; + + try { + resolver = create({ source: testPackage, target: '0.0.1' }); + } catch (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/can\'t resolve targets/i); + expect(err.code).to.equal('ENORESTARGET'); + return next(); + } + + next(new Error('Should have thrown')); + }); + }); + + describe('.hasNew', function () { + it('should resolve always to true (for now..)', function (next) { + var resolver = create(testPackage); + + tempSource = path.resolve(__dirname, '../../assets/tmp'); + mkdirp.sync(tempSource); + fs.writeFileSync(path.join(tempSource, '.bower.json'), JSON.stringify({ + name: 'test' + })); + + resolver.hasNew(tempSource) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + //it.skip('should be false if the file mtime hasn\'t changed'); + //it.skip('should be false if the directory mtime hasn\'t changed'); + //it.skip('should be true if the file mtime has changed'); + //it.skip('should be true if the directory mtime has changed'); + //it.skip('should ignore files specified to be ignored'); + }); + + describe('.resolve', function () { + // Function to assert that the main property of the + // package meta of a canonical dir is set to the + // expected value + function assertMain(dir, singleFile) { + return Q.nfcall(fs.readFile, path.join(dir, '.bower.json')) + .then(function (contents) { + var pkgMeta = JSON.parse(contents.toString()); + + expect(pkgMeta.main).to.equal(singleFile); + + return pkgMeta; + }); + } + + it('should copy the source directory contents', function (next) { + var resolver = create(testPackage); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'README.md'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'more'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'more', 'more-foo'))).to.be(true); + next(); + }) + .done(); + }); + + it('should copy the source file, renaming it to index', function (next) { + var resolver = create(path.join(testPackage, 'foo')); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'bar'))).to.be(false); + }) + .then(function () { + // Test with extension + var resolver = create(path.join(testPackage, 'README.md')); + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index.md'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'README.md'))).to.be(false); + + return assertMain(dir, 'index.md') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should rename to index if source is a folder with just one file in it', function (next) { + var resolver; + + tempSource = path.resolve(__dirname, '../../assets/tmp'); + + mkdirp.sync(tempSource); + resolver = create(tempSource); + + copy.copyFile(path.join(testPackage, 'foo'), path.join(tempSource, 'foo')) + .then(resolver.resolve.bind(resolver)) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(false); + + return assertMain(dir, 'index') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should not rename to index if source is a folder with just bower.json/component.json file in it', function (next) { + var resolver; + + tempSource = path.resolve(__dirname, '../../assets/tmp'); + + mkdirp.sync(tempSource); + resolver = create(tempSource); + + copy.copyFile(path.join(testPackage, 'bower.json'), path.join(tempSource, 'bower.json')) + .then(resolver.resolve.bind(resolver)) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'bower.json'))).to.be(true); + + rimraf.sync(tempSource); + mkdirp.sync(tempSource); + + resolver = create(tempSource); + }) + .then(copy.copyFile.bind(copy, path.join(testPackage, 'bower.json'), path.join(tempSource, 'component.json'))) + .then(function () { + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'component.json'))).to.be(true); + next(); + }) + .done(); + }); + + it('should copy the source directory permissions', function (next) { + var mode0777; + var resolver; + + tempSource = path.resolve(__dirname, '../../assets/package-a-copy'); + resolver = create(tempSource); + + copy.copyDir(testPackage, tempSource) + .then(function () { + // Change tempSource dir to 0777 + fs.chmodSync(tempSource, 0777); + // Get the mode to a variable + mode0777 = fs.statSync(tempSource).mode; + }) + .then(resolver.resolve.bind(resolver)) + .then(function (dir) { + // Check if temporary dir is 0777 instead of default 0777 & ~process.umask() + var stat = fs.statSync(dir); + expect(stat.mode).to.equal(mode0777); + next(); + }) + .done(); + }); + + it('should copy the source file permissions', function (next) { + var mode0777; + var resolver; + + tempSource = path.resolve(__dirname, '../../assets/temp'); + resolver = create(tempSource); + + copy.copyFile(path.join(testPackage, 'foo'), tempSource) + .then(function () { + // Change tempSource dir to 0777 + fs.chmodSync(tempSource, 0777); + // Get the mode to a variable + mode0777 = fs.statSync(tempSource).mode; + }) + .then(resolver.resolve.bind(resolver)) + .then(function (dir) { + // Check if file is 0777 + var stat = fs.statSync(path.join(dir, 'index')); + expect(stat.mode).to.equal(mode0777); + next(); + }) + .done(); + }); + + it('should not copy ignored paths (to speed up copying)', function (next) { + var resolver = create(testPackage); + + // Override the _applyPkgMeta function to prevent it from deleting ignored files + resolver._applyPkgMeta = function () { + return Q.resolve(); + }; + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'test'))).to.be(false); + next(); + }) + .done(); + }); + + it('should extract if source is an archive', function (next) { + var resolver = create(path.resolve(__dirname, '../../assets/package-zip.zip')); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip.zip'))).to.be(false); + next(); + }) + .done(); + }); + + it('should copy extracted folder contents if archive contains only a folder inside', function (next) { + var resolver = create(path.resolve(__dirname, '../../assets/package-zip-folder.zip')); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder.zip'))).to.be(false); + next(); + }) + .done(); + }); + + + it('should extract if source is an archive and rename to index if it\'s only one file inside', function (next) { + var resolver = create(path.resolve(__dirname, '../../assets/package-zip-single-file.zip')); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-single-file'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-single-file.zip'))).to.be(false); + + return assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should rename single file from a single folder to index when source is an archive', function (next) { + var resolver = create(path.resolve(__dirname, '../../assets/package-zip-folder-single-file.zip')); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder-single-file'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder-single-file.zip'))).to.be(false); + + return assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + }); + + describe('#isTargetable', function () { + it('should return false', function () { + expect(FsResolver.isTargetable()).to.be(false); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitFsResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitFsResolver.js new file mode 100644 index 0000000..262d86a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitFsResolver.js @@ -0,0 +1,264 @@ +var expect = require('expect.js'); +var path = require('path'); +var fs = require('graceful-fs'); +var path = require('path'); +var rimraf = require('rimraf'); +var Logger = require('bower-logger'); +var cmd = require('../../../lib/util/cmd'); +var copy = require('../../../lib/util/copy'); +var GitFsResolver = require('../../../lib/core/resolvers/GitFsResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('GitFsResolver', function () { + var tempSource; + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + var logger; + + before(function () { + logger = new Logger(); + }); + + afterEach(function (next) { + logger.removeAllListeners(); + + if (tempSource) { + rimraf(tempSource, next); + tempSource = null; + } else { + next(); + } + }); + + function clearResolverRuntimeCache() { + GitFsResolver.clearRuntimeCache(); + } + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new GitFsResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.constructor', function () { + it('should guess the name from the path', function () { + var resolver = create(testPackage); + + expect(resolver.getName()).to.equal('package-a'); + }); + + it('should not guess the name from the path if the name was specified', function () { + var resolver = create({ source: testPackage, name: 'foo' }); + + expect(resolver.getName()).to.equal('foo'); + }); + + it('should make paths absolute and normalized', function () { + var resolver; + + resolver = create(path.relative(process.cwd(), testPackage)); + expect(resolver.getSource()).to.equal(testPackage); + + resolver = create(testPackage + '/something/..'); + expect(resolver.getSource()).to.equal(testPackage); + }); + + it.skip('should use config.cwd for resolving relative paths'); + }); + + describe('.resolve', function () { + it('should checkout correctly if resolution is a branch', function (next) { + var resolver = create({ source: testPackage, target: 'some-branch' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + var fooContents; + + expect(files).to.contain('foo'); + expect(files).to.contain('baz'); + expect(files).to.contain('baz'); + + fooContents = fs.readFileSync(path.join(dir, 'foo')).toString(); + expect(fooContents).to.equal('foo foo'); + + next(); + }) + .done(); + }); + + it('should checkout correctly if resolution is a tag', function (next) { + var resolver = create({ source: testPackage, target: '~0.0.1' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + + expect(files).to.contain('foo'); + expect(files).to.contain('bar'); + expect(files).to.not.contain('baz'); + + next(); + }) + .done(); + }); + + it('should checkout correctly if resolution is a commit', function (next) { + var resolver = create({ source: testPackage, target: 'bdf51ece75e20cf404e49286727b7e92d33e9ad0' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + + expect(files).to.not.contain('foo'); + expect(files).to.not.contain('bar'); + expect(files).to.not.contain('baz'); + expect(files).to.contain('.master'); + next(); + }) + .done(); + }); + + it('should remove any untracked files and directories', function (next) { + var resolver = create({ source: testPackage, target: 'bdf51ece75e20cf404e49286727b7e92d33e9ad0' }); + var file = path.join(testPackage, 'new-file'); + var dir = path.join(testPackage, 'new-dir'); + + fs.writeFileSync(file, 'foo'); + fs.mkdir(dir); + + function cleanup(err) { + fs.unlinkSync(file); + fs.rmdirSync(dir); + + if (err) { + throw err; + } + } + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + + expect(files).to.not.contain('new-file'); + expect(files).to.not.contain('new-dir'); + + cleanup(); + next(); + }) + .fail(cleanup) + .done(); + }); + + it('should leave the original repository untouched', function (next) { + // Switch to master + cmd('git', ['checkout', 'master'], { cwd: testPackage }) + // Resolve to some-branch + .then(function () { + var resolver = create({ source: testPackage, target: 'some-branch' }); + return resolver.resolve(); + }) + // Check if the original branch is still the master one + .then(function () { + return cmd('git', ['branch', '--color=never'], { cwd: testPackage }) + .spread(function (stdout) { + expect(stdout).to.contain('* master'); + }); + }) + // Check if git status is empty + .then(function () { + return cmd('git', ['status', '--porcelain'], { cwd: testPackage }) + .spread(function (stdout) { + stdout = stdout.trim(); + expect(stdout).to.equal(''); + next(); + }); + }) + .done(); + }); + + it('should copy source folder permissions', function (next) { + var mode0777; + var resolver; + + tempSource = path.resolve(__dirname, '../../assets/package-a-copy'); + resolver = create({ source: tempSource, target: 'some-branch' }); + + copy.copyDir(testPackage, tempSource) + .then(function () { + // Change tempSource dir to 0777 + fs.chmodSync(tempSource, 0777); + // Get the mode to a variable + mode0777 = fs.statSync(tempSource).mode; + }) + .then(resolver.resolve.bind(resolver)) + .then(function (dir) { + // Check if temporary dir is 0777 instead of default 0777 & ~process.umask() + var stat = fs.statSync(dir); + expect(stat.mode).to.equal(mode0777); + next(); + }) + .done(); + }); + }); + + describe('#refs', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to the references of the local repository', function (next) { + GitFsResolver.refs(testPackage) + .then(function (refs) { + // Remove master and test only for the first 7 refs + refs = refs.slice(1, 8); + + expect(refs).to.eql([ + 'e4655d250f2a3f64ef2d712f25dafa60652bb93e refs/heads/some-branch', + '0a7daf646d4fd743b6ef701d63bdbe20eee422de refs/tags/0.0.1', + '0791865e6f4b88f69fc35167a09a6f0626627765 refs/tags/0.0.2', + '2af02ac6ddeaac1c2f4bead8d6287ce54269c039 refs/tags/0.1.0', + '6ab264f1ba5bafa80fb0198183493e4d5b20804a refs/tags/0.1.1', + 'c91ed7facbb695510e3e1ab86bac8b5ac159f4f3 refs/tags/0.2.0', + '8556e55c65722a351ca5fdce4f1ebe83ec3f2365 refs/tags/0.2.1' + ]); + next(); + }) + .done(); + }); + + it('should cache the results', function (next) { + GitFsResolver.refs(testPackage) + .then(function () { + // Manipulate the cache and check if it resolves for the cached ones + GitFsResolver._cache.refs.get(testPackage).splice(0, 1); + + // Check if it resolver to the same array + return GitFsResolver.refs(testPackage); + }) + .then(function (refs) { + // Test only for the first 6 refs + refs = refs.slice(0, 7); + + expect(refs).to.eql([ + 'e4655d250f2a3f64ef2d712f25dafa60652bb93e refs/heads/some-branch', + '0a7daf646d4fd743b6ef701d63bdbe20eee422de refs/tags/0.0.1', + '0791865e6f4b88f69fc35167a09a6f0626627765 refs/tags/0.0.2', + '2af02ac6ddeaac1c2f4bead8d6287ce54269c039 refs/tags/0.1.0', + '6ab264f1ba5bafa80fb0198183493e4d5b20804a refs/tags/0.1.1', + 'c91ed7facbb695510e3e1ab86bac8b5ac159f4f3 refs/tags/0.2.0', + '8556e55c65722a351ca5fdce4f1ebe83ec3f2365 refs/tags/0.2.1' + ]); + next(); + }) + .done(); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitHubResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitHubResolver.js new file mode 100644 index 0000000..4b7c0d7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitHubResolver.js @@ -0,0 +1,175 @@ +var path = require('path'); +var nock = require('nock'); +var fs = require('graceful-fs'); +var expect = require('expect.js'); +var Logger = require('bower-logger'); +var GitRemoteResolver = require('../../../lib/core/resolvers/GitRemoteResolver'); +var GitHubResolver = require('../../../lib/core/resolvers/GitHubResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('GitHub', function () { + var logger; + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + + before(function () { + logger = new Logger(); + }); + + beforeEach(function () { + // Turn off strict ssl because it gives problems with nock + defaultConfig.strictSsl = false; + }); + + afterEach(function () { + // Clean nocks + nock.cleanAll(); + + logger.removeAllListeners(); + + // Enable strict ssl back again + defaultConfig.strictSsl = true; + }); + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new GitHubResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.constructor', function () { + it.skip('should throw an error on invalid GitHub URLs'); + + it('should ensure .git in the source', function () { + var resolver; + + resolver = create('git://github.com/twitter/bower'); + expect(resolver.getSource()).to.equal('git://github.com/twitter/bower.git'); + + resolver = create('git://github.com/twitter/bower.git'); + expect(resolver.getSource()).to.equal('git://github.com/twitter/bower.git'); + + resolver = create('git://github.com/twitter/bower.git/'); + expect(resolver.getSource()).to.equal('git://github.com/twitter/bower.git'); + }); + }); + + describe('.resolve', function () { + it('should download and extract the .tar.gz archive from GitHub.com', function (next) { + var resolver; + + nock('https://github.com') + .get('/IndigoUnited/events-emitter/archive/0.1.0.tar.gz') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-tar.tar.gz')); + + resolver = create({ source: 'git://github.com/IndigoUnited/events-emitter.git', target: '0.1.0' }); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, '.bower.json'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-tar.tar.gz'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-tar.tar'))).to.be(false); + next(); + }) + .done(); + }); + + it('should retry using the GitRemoteResolver mechanism if download failed', function (next) { + var resolver; + var retried; + + nock('https://github.com') + .get('/IndigoUnited/events-emitter/archive/0.1.0.tar.gz') + .reply(200, 'this is not a valid tar'); + + logger.on('log', function (entry) { + if (entry.level === 'warn' && entry.id === 'retry') { + retried = true; + } + }); + + resolver = create({ source: 'git://github.com/IndigoUnited/events-emitter.git', target: '0.1.0' }); + + // Monkey patch source to file:// + resolver._source = 'file://' + testPackage; + + resolver.resolve() + .then(function (dir) { + expect(retried).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + next(); + }) + .done(); + }); + + it('should retry using the GitRemoteResolver mechanism if extraction failed', function (next) { + var resolver; + var retried; + + nock('https://github.com') + .get('/IndigoUnited/events-emitter/archive/0.1.0.tar.gz') + .reply(500); + + logger.on('log', function (entry) { + if (entry.level === 'warn' && entry.id === 'retry') { + retried = true; + } + }); + + resolver = create({ source: 'git://github.com/IndigoUnited/events-emitter.git', target: '0.1.0' }); + + // Monkey patch source to file:// + resolver._source = 'file://' + testPackage; + + resolver.resolve() + .then(function (dir) { + expect(retried).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + next(); + }) + .done(); + }); + + it('should fallback to the GitRemoteResolver mechanism if resolution is not a tag', function (next) { + var resolver = create({ source: 'git://github.com/foo/bar.git', target: '2af02ac6ddeaac1c2f4bead8d6287ce54269c039' }); + var originalCheckout = GitRemoteResolver.prototype._checkout; + var called; + + GitRemoteResolver.prototype._checkout = function () { + called = true; + return originalCheckout.apply(this, arguments); + }; + + // Monkey patch source to file:// + resolver._source = 'file://' + testPackage; + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'baz'))).to.be(true); + expect(called).to.be(true); + next(); + }) + .fin(function () { + GitRemoteResolver.prototype._checkout = originalCheckout; + }) + .done(); + }); + + it.skip('it should error out if the status code is not within 200-299'); + + it.skip('should report progress if it takes too long to download'); + }); + + describe('._savePkgMeta', function () { + it.skip('should guess the homepage if not already set'); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitRemoteResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitRemoteResolver.js new file mode 100644 index 0000000..f52d21b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitRemoteResolver.js @@ -0,0 +1,165 @@ +var expect = require('expect.js'); +var path = require('path'); +var fs = require('graceful-fs'); +var Logger = require('bower-logger'); +var GitRemoteResolver = require('../../../lib/core/resolvers/GitRemoteResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('GitRemoteResolver', function () { + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + var logger; + + before(function () { + logger = new Logger(); + }); + + afterEach(function () { + logger.removeAllListeners(); + }); + + function clearResolverRuntimeCache() { + GitRemoteResolver.clearRuntimeCache(); + } + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new GitRemoteResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.constructor', function () { + it('should guess the name from the path', function () { + var resolver; + + resolver = create('file://' + testPackage); + expect(resolver.getName()).to.equal('package-a'); + + resolver = create('git://github.com/twitter/bower.git'); + expect(resolver.getName()).to.equal('bower'); + + resolver = create('git://github.com/twitter/bower'); + expect(resolver.getName()).to.equal('bower'); + + resolver = create('git://github.com'); + expect(resolver.getName()).to.equal('github.com'); + }); + }); + + describe('.resolve', function () { + it('should checkout correctly if resolution is a branch', function (next) { + var resolver = create({ source: 'file://' + testPackage, target: 'some-branch' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + var fooContents; + + expect(files).to.contain('foo'); + expect(files).to.contain('baz'); + expect(files).to.contain('baz'); + + fooContents = fs.readFileSync(path.join(dir, 'foo')).toString(); + expect(fooContents).to.equal('foo foo'); + + next(); + }) + .done(); + }); + + it('should checkout correctly if resolution is a tag', function (next) { + var resolver = create({ source: 'file://' + testPackage, target: '~0.0.1' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + + expect(files).to.contain('foo'); + expect(files).to.contain('bar'); + expect(files).to.not.contain('baz'); + + next(); + }) + .done(); + }); + + it('should checkout correctly if resolution is a commit', function (next) { + var resolver = create({ source: 'file://' + testPackage, target: 'bdf51ece75e20cf404e49286727b7e92d33e9ad0' }); + + resolver.resolve() + .then(function (dir) { + expect(dir).to.be.a('string'); + + var files = fs.readdirSync(dir); + + expect(files).to.not.contain('foo'); + expect(files).to.not.contain('bar'); + expect(files).to.not.contain('baz'); + expect(files).to.contain('.master'); + next(); + }) + .done(); + }); + + it.skip('should handle gracefully servers that do not support --depth=1'); + it.skip('should report progress when it takes too long to clone'); + }); + + describe('#refs', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to the references of the remote repository', function (next) { + GitRemoteResolver.refs('file://' + testPackage) + .then(function (refs) { + // Remove master and test only for the first 7 refs + refs = refs.slice(1, 8); + + expect(refs).to.eql([ + 'e4655d250f2a3f64ef2d712f25dafa60652bb93e refs/heads/some-branch', + '0a7daf646d4fd743b6ef701d63bdbe20eee422de refs/tags/0.0.1', + '0791865e6f4b88f69fc35167a09a6f0626627765 refs/tags/0.0.2', + '2af02ac6ddeaac1c2f4bead8d6287ce54269c039 refs/tags/0.1.0', + '6ab264f1ba5bafa80fb0198183493e4d5b20804a refs/tags/0.1.1', + 'c91ed7facbb695510e3e1ab86bac8b5ac159f4f3 refs/tags/0.2.0', + '8556e55c65722a351ca5fdce4f1ebe83ec3f2365 refs/tags/0.2.1' + ]); + next(); + }) + .done(); + }); + + it('should cache the results', function (next) { + var source = 'file://' + testPackage; + + GitRemoteResolver.refs(source) + .then(function () { + // Manipulate the cache and check if it resolves for the cached ones + GitRemoteResolver._cache.refs.get(source).splice(0, 1); + + // Check if it resolver to the same array + return GitRemoteResolver.refs('file://' + testPackage); + }) + .then(function (refs) { + // Test only for the first 7 refs + refs = refs.slice(0, 7); + + expect(refs).to.eql([ + 'e4655d250f2a3f64ef2d712f25dafa60652bb93e refs/heads/some-branch', + '0a7daf646d4fd743b6ef701d63bdbe20eee422de refs/tags/0.0.1', + '0791865e6f4b88f69fc35167a09a6f0626627765 refs/tags/0.0.2', + '2af02ac6ddeaac1c2f4bead8d6287ce54269c039 refs/tags/0.1.0', + '6ab264f1ba5bafa80fb0198183493e4d5b20804a refs/tags/0.1.1', + 'c91ed7facbb695510e3e1ab86bac8b5ac159f4f3 refs/tags/0.2.0', + '8556e55c65722a351ca5fdce4f1ebe83ec3f2365 refs/tags/0.2.1' + ]); + next(); + }) + .done(); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitResolver.js new file mode 100644 index 0000000..b2ddcc3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/gitResolver.js @@ -0,0 +1,1483 @@ +var expect = require('expect.js'); +var util = require('util'); +var path = require('path'); +var fs = require('graceful-fs'); +var chmodr = require('chmodr'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var Q = require('q'); +var mout = require('mout'); +var Logger = require('bower-logger'); +var copy = require('../../../lib/util/copy'); +var GitResolver = require('../../../lib/core/resolvers/GitResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('GitResolver', function () { + var tempDir = path.resolve(__dirname, '../../assets/tmp'); + var originalrefs = GitResolver.refs; + var logger; + + before(function () { + logger = new Logger(); + }); + + afterEach(function () { + logger.removeAllListeners(); + }); + + function clearResolverRuntimeCache() { + GitResolver.refs = originalrefs; + GitResolver.clearRuntimeCache(); + } + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new GitResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('misc', function () { + it.skip('should error out if git is not installed'); + it.skip('should setup git template dir to an empty folder'); + }); + + describe('.hasNew', function () { + before(function () { + mkdirp.sync(tempDir); + }); + + afterEach(function (next) { + clearResolverRuntimeCache(); + rimraf(path.join(tempDir, '.bower.json'), next); + }); + + after(function (next) { + rimraf(tempDir, next); + }); + + + it('should be true when the resolution type is different', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0', + _resolution: { + type: 'version', + tag: '0.0.0', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/master' // same commit hash on purpose + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should be true when a higher version for a range is available', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '1.0.0', + _resolution: { + type: 'version', + tag: '1.0.0', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0.0', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0.1' // same commit hash on purpose + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should be true when a resolved to a lower version of a range', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '1.0.1', + _resolution: { + type: 'version', + tag: '1.0.1', + commit: 'cccccccccccccccccccccccccccccccccccccccc' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0.0' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should be false when resolved to the same tag (with same commit hash) for a given range', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '1.0.1', + _resolution: { + type: 'version', + tag: '1.0.1', + commit: 'cccccccccccccccccccccccccccccccccccccccc' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0.0', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/1.0.1' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(false); + next(); + }) + .done(); + }); + + it('should be true when resolved to the same tag (with different commit hash) for a given range', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '1.0.1', + _resolution: { + type: 'version', + tag: '1.0.1', + commit: 'cccccccccccccccccccccccccccccccccccccccc' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0.0', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/1.0.1' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should be true when a different commit hash for a given branch is available', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + _resolution: { + type: 'branch', + branch: 'master', + commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/master' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should be false when resolved to the the same commit hash for a given branch', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + _resolution: { + type: 'branch', + branch: 'master', + commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(false); + next(); + }) + .done(); + }); + + it('should be false when targeting commit hashes', function (next) { + var resolver; + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + _resolution: { + type: 'commit', + commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + })); + GitResolver.refs = function () { + return Q.resolve([ + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/master' + ]); + }; + + resolver = create('foo'); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('._resolve', function () { + afterEach(clearResolverRuntimeCache); + + it('should call the necessary functions by the correct order', function (next) { + var resolver; + + function DummyResolver() { + GitResolver.apply(this, arguments); + this._stack = []; + } + + util.inherits(DummyResolver, GitResolver); + mout.object.mixIn(DummyResolver, GitResolver); + + DummyResolver.prototype.getStack = function () { + return this._stack; + }; + + DummyResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + DummyResolver.prototype.resolve = function () { + this._stack = []; + return GitResolver.prototype.resolve.apply(this, arguments); + }; + + DummyResolver.prototype._findResolution = function () { + this._stack.push('before _findResolution'); + return GitResolver.prototype._findResolution.apply(this, arguments) + .then(function (val) { + this._stack.push('after _findResolution'); + return val; + }.bind(this)); + }; + + DummyResolver.prototype._checkout = function () { + this._stack.push('before _checkout'); + return Q.resolve() + .then(function (val) { + this._stack.push('after _checkout'); + return val; + }.bind(this)); + }; + + DummyResolver.prototype._cleanup = function () { + this._stack.push('before _cleanup'); + return GitResolver.prototype._cleanup.apply(this, arguments) + .then(function (val) { + this._stack.push('after _cleanup'); + return val; + }.bind(this)); + }; + + resolver = new DummyResolver({ source: 'foo', target: 'master' }, defaultConfig, logger); + + resolver.resolve() + .then(function () { + expect(resolver.getStack()).to.eql([ + 'before _findResolution', + 'after _findResolution', + 'before _checkout', + 'after _checkout', + 'before _cleanup', + 'after _cleanup' + ]); + next(); + }) + .done(); + }); + + it('should reject the promise if _checkout is not implemented', function (next) { + var resolver = create('foo'); + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver.resolve() + .then(function () { + next(new Error('Should have rejected the promise')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.contain('_checkout not implemented'); + next(); + }) + .done(); + }); + + it('should reject the promise if #refs is not implemented', function (next) { + var resolver = create('foo'); + + resolver._checkout = function () { + return Q.resolve(); + }; + + resolver.resolve() + .then(function () { + next(new Error('Should have rejected the promise')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.contain('refs not implemented'); + next(); + }) + .done(); + }); + }); + + describe('._findResolution', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to an object', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('*') + .then(function (resolution) { + expect(resolution).to.be.an('object'); + next(); + }) + .done(); + }); + + it('should fail to resolve * if no tags/heads are found', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([]); + }; + + resolver = create('foo'); + resolver._findResolution('*') + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/branch master does not exist/i); + expect(err.details).to.match(/no branches found/i); + expect(err.code).to.equal('ENORESTARGET'); + next(); + }) + .done(); + }); + + it('should resolve "*" to the latest commit on master if a repository has no valid semver tags', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/some-tag' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('*') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'branch', + branch: 'master', + commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + next(); + }) + .done(); + }); + + it('should resolve "*" to the latest version if a repository has valid semver tags, ignoring pre-releases', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/v0.1.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.2.0-rc.1' // Should ignore release candidates + ]); + }; + + resolver = create('foo'); + resolver._findResolution('*') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'version', + tag: 'v0.1.1', + commit: 'cccccccccccccccccccccccccccccccccccccccc' + }); + next(); + }) + .done(); + }); + + it('should resolve "*" to the latest version if a repository has valid semver tags, not ignoring pre-releases if they are the only versions', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0-rc.1', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.1.0-rc.2' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('*') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'version', + tag: '0.1.0-rc.2', + commit: 'cccccccccccccccccccccccccccccccccccccccc' + }); + next(); + }) + .done(); + }); + + it('should resolve to the latest version that matches a range/version', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/v0.1.1', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/0.2.0', + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/v0.2.1' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('~0.2.0') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'version', + tag: 'v0.2.1', + commit: 'ffffffffffffffffffffffffffffffffffffffff' + }); + next(); + }) + .done(); + }); + + it('should resolve to a branch even if target is a range/version that does not exist', function (next) { + var resolver; + + // See #771 + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/3.0.0-wip', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/v0.1.1' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('3.0.0-wip') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'branch', + branch: '3.0.0-wip', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should resolve to a tag even if target is a range that does not exist', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/1.0' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('1.0') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'tag', + tag: '1.0', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should resolve to the latest pre-release version that matches a range/version', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/v0.1.1', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/0.2.0', + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/v0.2.1-rc.1' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('~0.2.1') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'version', + tag: 'v0.2.1-rc.1', + commit: 'ffffffffffffffffffffffffffffffffffffffff' + }); + next(); + }) + .done(); + }); + + it('should resolve to the exact version if exists', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.8.1', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.8.1+build.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.8.1+build.2', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/0.8.1+build.3' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('0.8.1+build.2') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'version', + tag: '0.8.1+build.2', + commit: 'dddddddddddddddddddddddddddddddddddddddd' + }); + next(); + }) + .done(); + }); + + it('should fail to resolve if none of the versions matched a range/version', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/v0.1.1' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('~0.2.0') + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/was able to satisfy ~0.2.0/i); + expect(err.details).to.match(/available versions: 0\.1\.1, 0\.1\.0/i); + expect(err.code).to.equal('ENORESTARGET'); + next(); + }) + .done(); + }); + + it('should fail to resolve if there are no versions to match a range/version', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver = create('foo'); + + resolver._findResolution('~0.2.0') + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/was able to satisfy ~0.2.0/i); + expect(err.details).to.match(/no versions found in foo/i); + expect(err.code).to.equal('ENORESTARGET'); + next(); + }) + .done(); + }); + + it('should resolve to the specified commit', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'commit', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should resolve to the specified tag if it exists', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/some-tag' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('some-tag') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'tag', + tag: 'some-tag', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should resolve to the specified branch if it exists', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('some-branch') + .then(function (resolution) { + expect(resolution).to.eql({ + type: 'branch', + branch: 'some-branch', + commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should fail to resolve to the specified tag/branch if it doesn\'t exists', function (next) { + var resolver; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/some-tag' + ]); + }; + + resolver = create('foo'); + resolver._findResolution('some-branch') + .then(function () { + next(new Error('Should have failed')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/tag\/branch some-branch does not exist/i); + expect(err.details).to.match(/available branches: master/i); + expect(err.details).to.match(/available tags: some-tag/i); + expect(err.code).to.equal('ENORESTARGET'); + next(); + }) + .done(); + }); + }); + + describe('._cleanup', function () { + beforeEach(function () { + mkdirp.sync(tempDir); + }); + + afterEach(function (next) { + clearResolverRuntimeCache(); + // Need to chmodr before removing..at least on windows + // because .git has some read only files + chmodr(tempDir, 0777, function () { + rimraf(tempDir, next); + }); + }); + + it('should remove the .git folder from the temp dir', function (next) { + var resolver = create('foo'); + var dst = path.join(tempDir, '.git'); + + this.timeout(30000); // Give some time to copy + + // Copy .git folder to the tempDir + copy.copyDir(path.resolve(__dirname, '../../../.git'), dst, { + mode: 0777 + }) + .then(function () { + resolver._tempDir = tempDir; + + return resolver._cleanup() + .then(function () { + expect(fs.existsSync(dst)).to.be(false); + next(); + }); + }) + .done(); + }); + + it('should not fail if .git does not exist for some reason', function (next) { + var resolver = create('foo'); + var dst = path.join(tempDir, '.git'); + + resolver._tempDir = tempDir; + + resolver._cleanup() + .then(function () { + expect(fs.existsSync(dst)).to.be(false); + next(); + }) + .done(); + }); + + it('should sill run even if _checkout fails for some reason', function (next) { + var resolver = create('foo'); + var called = false; + + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master' + ]); + }; + + resolver._tempDir = tempDir; + resolver._checkout = function () { + return Q.reject(new Error('Some error')); + }; + + resolver._cleanup = function () { + called = true; + return GitResolver.prototype._cleanup.apply(this, arguments); + }; + + resolver.resolve() + .then(function () { + next(new Error('Should have failed')); + }, function () { + expect(called).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('._savePkgMeta', function () { + before(function () { + mkdirp.sync(tempDir); + }); + + afterEach(function (next) { + rimraf(path.join(tempDir, '.bower.json'), next); + }); + + after(function (next) { + rimraf(tempDir, next); + }); + + it('should save the resolution to the .bower.json to be used later by .hasNew', function (next) { + var resolver = create('foo'); + + resolver._resolution = { type: 'version', tag: '0.0.1' }; + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'foo', version: '0.0.1' }) + .then(function () { + return Q.nfcall(fs.readFile, path.join(tempDir, '.bower.json')); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + + expect(json._resolution).to.eql(resolver._resolution); + next(); + }) + .done(); + }); + + it('should save the release in the package meta', function (next) { + var resolver = create('foo'); + var metaFile = path.join(tempDir, '.bower.json'); + + // Test with type 'version' + resolver._resolution = { type: 'version', tag: '0.0.1', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'foo', version: '0.0.1' }) + .then(function () { + return Q.nfcall(fs.readFile, metaFile); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json._release).to.equal('0.0.1'); + }) + // Test with type 'version' + build metadata + .then(function () { + resolver._resolution = { type: 'version', tag: '0.0.1+build.5', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + return resolver._savePkgMeta({ name: 'foo' }); + }) + .then(function () { + return Q.nfcall(fs.readFile, metaFile); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json._release).to.equal('0.0.1+build.5'); + }) + // Test with type 'tag' + .then(function () { + resolver._resolution = { type: 'tag', tag: '0.0.1', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + return resolver._savePkgMeta({ name: 'foo' }); + }) + .then(function () { + return Q.nfcall(fs.readFile, metaFile); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json._release).to.equal('0.0.1'); + }) + // Test with type 'branch' + // In this case, it should be the commit + .then(function () { + resolver._resolution = { type: 'branch', branch: 'foo', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + return resolver._savePkgMeta({ name: 'foo' }); + }) + .then(function () { + return Q.nfcall(fs.readFile, metaFile); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json._release).to.equal('aaaaaaaaaa'); + }) + // Test with type 'commit' + .then(function () { + resolver._resolution = { type: 'commit', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + return resolver._savePkgMeta({ name: 'foo' }); + }) + .then(function () { + return Q.nfcall(fs.readFile, metaFile); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json._release).to.equal('aaaaaaaaaa'); + next(); + }) + .done(); + }); + + it('should add the version to the package meta if not present and resolution is a version', function (next) { + var resolver = create('foo'); + + resolver._resolution = { type: 'version', tag: 'v0.0.1' }; + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'foo' }) + .then(function () { + return Q.nfcall(fs.readFile, path.join(tempDir, '.bower.json')); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json.version).to.equal('0.0.1'); + + next(); + }) + .done(); + }); + + it('should remove the version from the package meta if resolution is not a version', function (next) { + var resolver = create('foo'); + + resolver._resolution = { type: 'commit', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }; + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'foo', version: '0.0.1' }) + .then(function () { + return Q.nfcall(fs.readFile, path.join(tempDir, '.bower.json')); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json).to.not.have.property('version'); + + next(); + }) + .done(); + }); + + it('should warn if the resolution version is different than the package meta version', function (next) { + var resolver = create('foo'); + var notified = false; + + resolver._resolution = { type: 'version', tag: '0.0.1' }; + resolver._tempDir = tempDir; + + logger.on('log', function (log) { + expect(log).to.be.an('object'); + + if (log.level === 'warn' && log.id === 'mismatch') { + expect(log.message).to.match(/\(0\.0\.0\).*different.*\(0\.0\.1\)/); + notified = true; + } + }); + + resolver._savePkgMeta({ name: 'foo', version: '0.0.0' }) + .then(function () { + return Q.nfcall(fs.readFile, path.join(tempDir, '.bower.json')); + }) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json.version).to.equal('0.0.1'); + expect(notified).to.be(true); + + next(); + }) + .done(); + }); + + it('should not warn if the resolution version and the package meta version are the same', function (next) { + var resolver = create('foo'); + var notified = false; + + resolver._resolution = { type: 'version', tag: 'v0.0.1' }; + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'foo', version: '0.0.1' }) + .then(function () { + return Q.nfcall(fs.readFile, path.join(tempDir, '.bower.json')); + }, null) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + expect(json.version).to.equal('0.0.1'); + expect(notified).to.be(false); + + next(); + }) + .done(); + }); + }); + + describe('#branches', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to an empty object if no heads are found', function (next) { + GitResolver.refs = function () { + return Q.resolve([]); + }; + + GitResolver.branches('foo') + .then(function (branches) { + expect(branches).to.be.an('object'); + expect(branches).to.eql({}); + next(); + }) + .done(); + }); + + it('should resolve to an object where keys are branches and values their commit hashes', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch', + 'foo refs/heads/invalid', // invalid + 'cccccccccccccccccccccccccccccccccccccccc refs/heads/', // invalid + 'dddddddddddddddddddddddddddddddddddddddd refs/heads', // invalid + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/some-tag', + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/0.1.1' + ]); + }; + + GitResolver.branches('foo') + .then(function (branches) { + expect(branches).to.eql({ + 'master': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'some-branch': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should cache the result for each source', function (next) { + GitResolver.refs = function (source) { + if (source === 'foo') { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch' + ]); + } + + return Q.resolve([ + 'cccccccccccccccccccccccccccccccccccccccc refs/heads/master', + 'dddddddddddddddddddddddddddddddddddddddd refs/heads/other-branch' + ]); + }; + + GitResolver.branches('foo') + .then(function (branches) { + expect(branches).to.eql({ + 'master': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'some-branch': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + + return GitResolver.branches('bar'); + }) + .then(function (branches) { + expect(branches).to.eql({ + 'master': 'cccccccccccccccccccccccccccccccccccccccc', + 'other-branch': 'dddddddddddddddddddddddddddddddddddddddd' + }); + + // Manipulate the cache and check if it resolves for the cached ones + delete GitResolver._cache.branches.get('foo').master; + delete GitResolver._cache.branches.get('bar').master; + + return GitResolver.branches('foo'); + }) + .then(function (branches) { + expect(branches).to.eql({ + 'some-branch': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + + return GitResolver.branches('bar'); + }) + .then(function (branches) { + expect(branches).to.eql({ + 'other-branch': 'dddddddddddddddddddddddddddddddddddddddd' + }); + + next(); + }) + .done(); + }); + + it('should work if requested in parallel for the same source', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch' + ]); + }; + + Q.all([ + GitResolver.branches('foo'), + GitResolver.branches('foo') + ]) + .spread(function (branches1, branches2) { + expect(branches1).to.eql({ + 'master': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'some-branch': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + expect(branches1).to.eql(branches2); + + next(); + }) + .done(); + }); + }); + + describe('#tags', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to an empty array if no tags are found', function (next) { + GitResolver.refs = function () { + return Q.resolve([]); + }; + + GitResolver.tags('foo') + .then(function (tags) { + expect(tags).to.be.an('array'); + expect(tags).to.eql([]); + next(); + }) + .done(); + }); + + it('should resolve to an array of tags', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.2.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.1.0', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/v0.1.1', + 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/some-tag', + 'foo refs/tags/invalid', // invalid + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/', // invalid + 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags' // invalid + ]); + }; + + GitResolver.tags('foo') + .then(function (tags) { + expect(tags).to.eql({ + '0.2.1': 'cccccccccccccccccccccccccccccccccccccccc', + '0.1.0': 'dddddddddddddddddddddddddddddddddddddddd', + 'v0.1.1': 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', + 'some-tag': 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + next(); + }) + .done(); + }); + + it('should cache the result for each source', function (next) { + GitResolver.refs = function (source) { + if (source === 'foo') { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/tags/0.2.1', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/some-tag' + ]); + } + + return Q.resolve([ + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.3.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/some-tag' + ]); + }; + + GitResolver.tags('foo') + .then(function (versions) { + expect(versions).to.eql({ + '0.2.1': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'some-tag': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + + return GitResolver.tags('bar'); + }) + .then(function (versions) { + expect(versions).to.eql({ + '0.3.1': 'cccccccccccccccccccccccccccccccccccccccc', + 'some-tag': 'dddddddddddddddddddddddddddddddddddddddd' + }); + + + // Manipulate the cache and check if it resolves for the cached ones + delete GitResolver._cache.tags.get('foo')['0.2.1']; + delete GitResolver._cache.tags.get('bar')['0.3.1']; + + return GitResolver.tags('foo'); + }) + .then(function (tags) { + expect(tags).to.eql({ + 'some-tag': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + }); + + return GitResolver.tags('bar'); + }) + .then(function (tags) { + expect(tags).to.eql({ + 'some-tag': 'dddddddddddddddddddddddddddddddddddddddd' + }); + + next(); + }) + .done(); + }); + + it('should work if requested in parallel for the same source', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.3.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/some-tag' + ]); + }; + + Q.all([ + GitResolver.tags('foo'), + GitResolver.tags('foo') + ]) + .spread(function (tags1, tags2) { + expect(tags1).to.eql({ + '0.3.1': 'cccccccccccccccccccccccccccccccccccccccc', + 'some-tag': 'dddddddddddddddddddddddddddddddddddddddd' + }); + expect(tags2).to.eql(tags1); + + next(); + }) + .done(); + }); + }); + + describe('#clearRuntimeCache', function () { + // Use a class that inherit the GitResolver to see if it uses + // late binding when clearing the cache + function CustomGitResolver() {} + util.inherits(CustomGitResolver, GitResolver); + mout.object.mixIn(CustomGitResolver, GitResolver); + + it('should clear refs cache', function () { + CustomGitResolver._cache.refs.set('foo', {}); + CustomGitResolver.clearRuntimeCache(); + expect(CustomGitResolver._cache.refs.has('foo')).to.be(false); + }); + + it('should clear branches cache', function () { + CustomGitResolver._cache.branches.set('foo', {}); + CustomGitResolver.clearRuntimeCache(); + expect(CustomGitResolver._cache.branches.has('foo')).to.be(false); + }); + + it('should clear tags cache', function () { + CustomGitResolver._cache.tags.set('foo', {}); + CustomGitResolver.clearRuntimeCache(); + expect(CustomGitResolver._cache.tags.has('foo')).to.be(false); + }); + + it('should clear versions cache', function () { + CustomGitResolver._cache.versions.set('foo', {}); + CustomGitResolver.clearRuntimeCache(); + expect(CustomGitResolver._cache.versions.has('foo')).to.be(false); + }); + }); + + describe('#versions', function () { + afterEach(clearResolverRuntimeCache); + + it('should resolve to an empty array if no tags are found', function (next) { + GitResolver.refs = function () { + return Q.resolve([]); + }; + + GitResolver.versions('foo') + .then(function (versions) { + expect(versions).to.be.an('array'); + expect(versions).to.eql([]); + next(); + }) + .done(); + }); + + it('should resolve to an empty array if no valid semver tags', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/some-tag' + ]); + }; + + GitResolver.versions('foo') + .then(function (versions) { + expect(versions).to.be.an('array'); + expect(versions).to.eql([]); + next(); + }) + .done(); + }); + + it('should resolve to an array of versions, ignoring invalid semver tags', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/some-branch', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.2.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.1.0', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/v0.1.1', + 'foo refs/tags/invalid', // invalid + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/', // invalid + 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags' // invalid + ]); + }; + + GitResolver.versions('foo', true) + .then(function (versions) { + expect(versions).to.eql([ + { version: '0.2.1', tag: '0.2.1', commit: 'cccccccccccccccccccccccccccccccccccccccc' }, + { version: '0.1.1', tag: 'v0.1.1', commit: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' }, + { version: '0.1.0', tag: '0.1.0', commit: 'dddddddddddddddddddddddddddddddddddddddd' } + ]); + }) + .then(function () { + return GitResolver.versions('foo'); + }) + .then(function (versions) { + expect(versions).to.eql(['0.2.1', '0.1.1', '0.1.0']); + next(); + }) + .done(); + }); + + it('should order the versions according to the semver spec', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/tags/0.1.0', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.1+build.11', + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.1.1+build.100', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.1.1-rc.22', + 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee refs/tags/0.1.1-rc.200', + 'ffffffffffffffffffffffffffffffffffffffff refs/tags/0.1.1', + 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/v0.2.1' + ]); + }; + + GitResolver.versions('foo', true) + .then(function (versions) { + expect(versions).to.eql([ + { version: '0.2.1', tag: 'v0.2.1', commit: 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' }, + { version: '0.1.1+build.11', tag: '0.1.1+build.11', commit: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' }, + { version: '0.1.1+build.100', tag: '0.1.1+build.100', commit: 'cccccccccccccccccccccccccccccccccccccccc' }, + { version: '0.1.1', tag: '0.1.1', commit: 'ffffffffffffffffffffffffffffffffffffffff' }, + { version: '0.1.1-rc.200', tag: '0.1.1-rc.200', commit: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' }, + { version: '0.1.1-rc.22', tag: '0.1.1-rc.22', commit: 'dddddddddddddddddddddddddddddddddddddddd' }, + { version: '0.1.0', tag: '0.1.0', commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } + ]); + next(); + }) + .done(); + }); + + it('should cache the result for each source', function (next) { + GitResolver.refs = function (source) { + if (source === 'foo') { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/tags/0.2.1', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0' + ]); + } + + return Q.resolve([ + 'cccccccccccccccccccccccccccccccccccccccc refs/tags/0.3.1', + 'dddddddddddddddddddddddddddddddddddddddd refs/tags/0.3.0' + ]); + }; + + GitResolver.versions('foo') + .then(function (versions) { + expect(versions).to.eql(['0.2.1', '0.1.0']); + + return GitResolver.versions('bar'); + }) + .then(function (versions) { + expect(versions).to.eql(['0.3.1', '0.3.0']); + + + // Manipulate the cache and check if it resolves for the cached ones + GitResolver._cache.versions.get('foo').splice(1, 1); + GitResolver._cache.versions.get('bar').splice(1, 1); + + return GitResolver.versions('foo'); + }) + .then(function (versions) { + expect(versions).to.eql(['0.2.1']); + + return GitResolver.versions('bar'); + }) + .then(function (versions) { + expect(versions).to.eql(['0.3.1']); + next(); + }) + .done(); + }); + + it('should work if requested in parallel for the same source', function (next) { + GitResolver.refs = function () { + return Q.resolve([ + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/tags/0.2.1', + 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/tags/0.1.0' + ]); + }; + + Q.all([ + GitResolver.versions('foo'), + GitResolver.versions('foo') + ]) + .spread(function (versions1, versions2) { + expect(versions1).to.eql(['0.2.1', '0.1.0']); + expect(versions2).to.eql(versions1); + + next(); + }) + .done(); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/resolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/resolver.js new file mode 100644 index 0000000..7357f7a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/resolver.js @@ -0,0 +1,807 @@ +var expect = require('expect.js'); +var fs = require('graceful-fs'); +var path = require('path'); +var util = require('util'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var tmp = require('tmp'); +var Q = require('q'); +var Logger = require('bower-logger'); +var cmd = require('../../../lib/util/cmd'); +var copy = require('../../../lib/util/copy'); +var Resolver = require('../../../lib/core/resolvers/Resolver'); +var defaultConfig = require('../../../lib/config'); + +describe('Resolver', function () { + var tempDir = path.resolve(__dirname, '../../assets/tmp'); + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + var logger; + var dirMode0777; + + before(function () { + var stat; + + mkdirp.sync(tempDir); + stat = fs.statSync(tempDir); + dirMode0777 = stat.mode; + rimraf.sync(tempDir); + + logger = new Logger(); + }); + + afterEach(function () { + logger.removeAllListeners(); + }); + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new Resolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.getSource', function () { + it('should return the resolver source', function () { + var resolver = create('foo'); + + expect(resolver.getSource()).to.equal('foo'); + }); + }); + + describe('.getName', function () { + it('should return the resolver name', function () { + var resolver = create({ source: 'foo', name: 'bar' }); + + expect(resolver.getName()).to.equal('bar'); + }); + + it('should return the resolver source if none is specified (default guess mechanism)', function () { + var resolver = create('foo'); + + expect(resolver.getName()).to.equal('foo'); + }); + }); + + describe('.getTarget', function () { + it('should return the resolver target', function () { + var resolver = create({ source: 'foo', target: '~2.1.0' }); + + expect(resolver.getTarget()).to.equal('~2.1.0'); + }); + + it('should return * if none was configured', function () { + var resolver = create('foo'); + + expect(resolver.getTarget()).to.equal('*'); + }); + + it('should return * if latest was configured (for backwards compatibility)', function () { + var resolver = create('foo'); + + expect(resolver.getTarget()).to.equal('*'); + }); + }); + + describe('.hasNew', function () { + before(function () { + mkdirp.sync(tempDir); + }); + + beforeEach(function () { + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'test' + })); + }); + + after(function (next) { + rimraf(tempDir, next); + }); + + it('should throw an error if already working (resolving)', function (next) { + var resolver = create('foo'); + var succeeded; + + resolver._resolve = function () {}; + + resolver.resolve() + .then(function () { + // Test if resolve can be called again when done + resolver.resolve() + .then(function () { + next(succeeded ? new Error('Should have failed') : null); + }); + }) + .done(); + + resolver.hasNew(tempDir) + .then(function () { + succeeded = true; + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EWORKING'); + expect(err.message).to.match(/already working/i); + }); + }); + + it('should throw an error if already working (checking for newer version)', function (next) { + var resolver = create('foo'); + var succeeded; + + resolver.hasNew(tempDir) + .then(function () { + // Test if hasNew can be called again when done + resolver.hasNew(tempDir) + .then(function () { + next(succeeded ? new Error('Should have failed') : null); + }); + }) + .done(); + + resolver.hasNew(tempDir) + .then(function () { + succeeded = true; + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EWORKING'); + expect(err.message).to.match(/already working/i); + }); + }); + + it('should resolve to true by default', function (next) { + var resolver = create('foo'); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.equal(true); + next(); + }) + .done(); + }); + + it('should resolve to true if the there\'s an error reading the package meta', function (next) { + var resolver = create('foo'); + + rimraf.sync(path.join(tempDir, '.bower.json')); + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.equal(true); + next(); + }) + .done(); + }); + + it('should call _hasNew with the canonical dir and the package meta', function (next) { + var resolver = create('foo'); + var canonical; + var meta; + + resolver._hasNew = function (canonicalDir, pkgMeta) { + canonical = canonicalDir; + meta = pkgMeta; + return Q.resolve(true); + }; + + resolver.hasNew(tempDir) + .then(function () { + expect(canonical).to.equal(tempDir); + expect(meta).to.be.an('object'); + expect(meta.name).to.equal('test'); + next(); + }) + .done(); + }); + + it('should not read the package meta if already passed', function (next) { + var resolver = create('foo'); + var meta; + + resolver._hasNew = function (canonicalDir, pkgMeta) { + meta = pkgMeta; + return Q.resolve(true); + }; + + resolver.hasNew(tempDir, { + name: 'foo' + }) + .then(function () { + expect(meta).to.be.an('object'); + expect(meta.name).to.equal('foo'); + next(); + }) + .done(); + }); + }); + + describe('.resolve', function () { + it('should reject the promise if _resolve is not implemented', function (next) { + var resolver = create('foo'); + + resolver.resolve() + .then(function () { + next(new Error('Should have rejected the promise')); + }, function (err) { + expect(err).to.be.an(Error); + expect(err.message).to.contain('_resolve not implemented'); + next(); + }) + .done(); + }); + + it('should throw an error if already working (resolving)', function (next) { + var resolver = create('foo'); + var succeeded; + + resolver._resolve = function () {}; + + resolver.resolve() + .then(function () { + // Test if resolve can be called again when done + resolver.resolve() + .then(function () { + next(succeeded ? new Error('Should have failed') : null); + }); + }) + .done(); + + resolver.resolve() + .then(function () { + succeeded = true; + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EWORKING'); + expect(err.message).to.match(/already working/i); + }); + }); + + it('should throw an error if already working (checking newer version)', function (next) { + var resolver = create('foo'); + var succeeded; + + resolver._resolve = function () {}; + + resolver.hasNew(tempDir) + .then(function () { + // Test if hasNew can be called again when done + resolver.hasNew(tempDir) + .then(function () { + next(succeeded ? new Error('Should have failed') : null); + }); + }) + .done(); + + resolver.resolve() + .then(function () { + succeeded = true; + }, function (err) { + expect(err).to.be.an(Error); + expect(err.code).to.equal('EWORKING'); + expect(err.message).to.match(/already working/i); + }); + }); + + it('should call all the functions necessary to resolve by the correct order', function (next) { + var resolver; + + function DummyResolver() { + Resolver.apply(this, arguments); + this._stack = []; + } + + util.inherits(DummyResolver, Resolver); + + DummyResolver.prototype.getStack = function () { + return this._stack; + }; + + DummyResolver.prototype.resolve = function () { + this._stack = []; + return Resolver.prototype.resolve.apply(this, arguments); + }; + + DummyResolver.prototype._createTempDir = function () { + this._stack.push('before _createTempDir'); + return Resolver.prototype._createTempDir.apply(this, arguments) + .then(function (val) { + this._stack.push('after _createTempDir'); + return val; + }.bind(this)); + }; + DummyResolver.prototype._resolve = function () {}; + DummyResolver.prototype._readJson = function () { + this._stack.push('before _readJson'); + return Resolver.prototype._readJson.apply(this, arguments) + .then(function (val) { + this._stack.push('after _readJson'); + return val; + }.bind(this)); + }; + DummyResolver.prototype._applyPkgMeta = function () { + this._stack.push('before _applyPkgMeta'); + return Resolver.prototype._applyPkgMeta.apply(this, arguments) + .then(function (val) { + this._stack.push('after _applyPkgMeta'); + return val; + }.bind(this)); + }; + DummyResolver.prototype._savePkgMeta = function () { + this._stack.push('before _savePkgMeta'); + return Resolver.prototype._savePkgMeta.apply(this, arguments) + .then(function (val) { + this._stack.push('after _savePkgMeta'); + return val; + }.bind(this)); + }; + + resolver = new DummyResolver({ source: 'foo'}, defaultConfig, logger); + + resolver.resolve() + .then(function () { + expect(resolver.getStack()).to.eql([ + 'before _createTempDir', + 'after _createTempDir', + 'before _readJson', + 'after _readJson', + // Both below are called in parallel + 'before _applyPkgMeta', + 'after _applyPkgMeta', + 'before _savePkgMeta', + 'after _savePkgMeta' + ]); + next(); + }) + .done(); + }); + + it('should resolve with the canonical dir (folder)', function (next) { + var resolver = create('foo'); + + resolver._resolve = function () {}; + + resolver.resolve() + .then(function (folder) { + expect(folder).to.be.a('string'); + expect(fs.existsSync(folder)).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('.getTempDir', function () { + it('should return null if resolver is not yet resolved', function () { + var resolver = create('foo'); + + expect(resolver.getTempDir() == null).to.be(true); + }); + + it('should still return null if resolve failed', function () { + it('should still return null', function (next) { + var resolver = create('foo'); + + resolver._resolve = function () { + throw new Error('I\'ve failed to resolve'); + }; + + resolver.resolve() + .fail(function () { + expect(resolver.getTempDir() == null).to.be(true); + next(); + }); + }); + }); + + it('should return the canonical dir (folder) if resolve succeeded', function (next) { + var resolver = create('foo'); + + resolver._resolve = function () {}; + + resolver.resolve() + .then(function () { + var dir = resolver.getTempDir(); + + expect(dir).to.be.a('string'); + expect(fs.existsSync(dir)).to.be(true); + next(); + }) + .done(); + }); + }); + + describe('.getPkgMeta', function () { + it('should return null if resolver is not yet resolved', function () { + var resolver = create('foo'); + + expect(resolver.getPkgMeta() == null).to.be(true); + }); + + it('should still return null if resolve failed', function () { + it('should still return null', function (next) { + var resolver = create('foo'); + + resolver._resolve = function () { + throw new Error('I\'ve failed to resolve'); + }; + + resolver.resolve() + .fail(function () { + expect(resolver.getPkgMeta() == null).to.be(true); + next(); + }); + }); + }); + + it('should return the package meta if resolve succeeded', function (next) { + var resolver = create('foo'); + + resolver._resolve = function () {}; + + resolver.resolve() + .then(function () { + expect(resolver.getPkgMeta()).to.be.an('object'); + next(); + }) + .done(); + }); + }); + + describe('._createTempDir', function () { + it('should create a directory inside a "username/bower" folder, located within the OS temp folder', function (next) { + var resolver = create('foo'); + + resolver._createTempDir() + .then(function (dir) { + var dirname; + var osTempDir; + + expect(dir).to.be.a('string'); + expect(fs.existsSync(dir)).to.be(true); + + dirname = path.dirname(dir); + osTempDir = path.resolve(tmp.tmpdir); + + expect(dir.indexOf(osTempDir)).to.be(0); + expect(dir.indexOf(defaultConfig.tmp)).to.be(0); + + expect(path.basename(dirname)).to.equal('bower'); + expect(path.dirname(path.dirname(dirname))).to.equal(osTempDir); + next(); + }) + .done(); + }); + + it('should set the dir mode the same as the process', function (next) { + var resolver = create('foo'); + + resolver._createTempDir() + .then(function (dir) { + var stat = fs.statSync(dir); + var expectedMode = dirMode0777 & ~process.umask(); + + expect(stat.mode).to.equal(expectedMode); + next(); + }) + .done(); + }); + + it('should remove the folder after execution', function (next) { + this.timeout(15000); // Give some time to execute + + rimraf(defaultConfig.tmp, function (err) { + if (err) return next(err); + + cmd('node', ['test/assets/test-temp-dir/test.js'], { cwd: path.resolve(__dirname, '../../..') }) + .then(function () { + expect(fs.existsSync(defaultConfig.tmp)).to.be(true); + expect(fs.readdirSync(defaultConfig.tmp)).to.eql([]); + next(); + }, function (err) { + next(new Error(err.details)); + }) + .done(); + }); + }); + + it('should remove the folder on an uncaught exception', function (next) { + rimraf(defaultConfig.tmp, function (err) { + if (err) return next(err); + + cmd('node', ['test/assets/test-temp-dir/test-exception.js'], { cwd: path.resolve(__dirname, '../../..') }) + .then(function () { + next(new Error('The command should have failed')); + }, function () { + expect(fs.existsSync(defaultConfig.tmp)).to.be(true); + expect(fs.readdirSync(defaultConfig.tmp)).to.eql([]); + next(); + }) + .done(); + }); + }); + + it('should set _tempDir with the created directory', function (next) { + var resolver = create('foo'); + + resolver._createTempDir() + .then(function (dir) { + expect(resolver._tempDir).to.be.ok(); + expect(resolver._tempDir).to.equal(dir); + next(); + }) + .done(); + }); + }); + + describe('._cleanTempDir', function () { + it('should not error out if temporary dir is not yet created', function (next) { + var resolver = create('foo'); + + resolver._cleanTempDir() + .then(next.bind(null)) + .done(); + }); + + it('should delete the temporary folder contents', function (next) { + var resolver = create('foo'); + + resolver._createTempDir() + .then(resolver._cleanTempDir.bind(resolver)) + .then(function (dir) { + expect(dir).to.equal(resolver.getTempDir()); + expect(fs.readdirSync(dir).length).to.be(0); + next(); + }) + .done(); + }); + + it('should keep the mode', function (next) { + var resolver = create('foo'); + + resolver._createTempDir() + .then(resolver._cleanTempDir.bind(resolver)) + .then(function (dir) { + var stat = fs.statSync(dir); + var expectedMode = dirMode0777 & ~process.umask(); + + expect(stat.mode).to.equal(expectedMode); + next(); + }) + .done(); + }); + + it('should keep the dir path', function (next) { + var resolver = create('foo'); + var tempDir; + + resolver._createTempDir() + .then(function (dir) { + tempDir = dir; + return resolver._cleanTempDir(); + }) + .then(function (dir) { + expect(dir).to.equal(tempDir); + next(); + }) + .done(); + }); + }); + + describe('._readJson', function () { + afterEach(function (next) { + rimraf(tempDir, next); + }); + + it('should read the bower.json file', function (next) { + var resolver = create('foo'); + + mkdirp.sync(tempDir); + fs.writeFileSync(path.join(tempDir, 'bower.json'), JSON.stringify({ name: 'foo', version: '0.0.0' })); + fs.writeFileSync(path.join(tempDir, 'component.json'), JSON.stringify({ name: 'bar', version: '0.0.0' })); + + resolver._readJson(tempDir) + .then(function (meta) { + expect(meta).to.be.an('object'); + expect(meta.name).to.equal('foo'); + expect(meta.version).to.equal('0.0.0'); + next(); + }) + .done(); + }); + + it('should fallback to component.json (notifying a warn)', function (next) { + var resolver = create('foo'); + var notified = false; + + mkdirp.sync(tempDir); + fs.writeFileSync(path.join(tempDir, 'component.json'), JSON.stringify({ name: 'bar', version: '0.0.0' })); + + logger.on('log', function (log) { + expect(log).to.be.an('object'); + if (log.level === 'warn' && /deprecated/i.test(log.id)) { + expect(log.message).to.contain('component.json'); + notified = true; + } + }); + + resolver._readJson(tempDir) + .then(function (meta) { + expect(meta).to.be.an('object'); + expect(meta.name).to.equal('bar'); + expect(meta.version).to.equal('0.0.0'); + expect(notified).to.be(true); + next(); + }) + .done(); + }); + + it('should resolve to an inferred json if no json file was found', function (next) { + var resolver = create('foo'); + + resolver._readJson(tempDir) + .then(function (meta) { + expect(meta).to.be.an('object'); + expect(meta.name).to.equal('foo'); + next(); + }) + .done(); + }); + + it.skip('should apply normalisation, defaults and validation to the json object'); + }); + + describe('._applyPkgMeta', function () { + afterEach(function (next) { + rimraf(tempDir, next); + }); + + it('should resolve with the same package meta', function (next) { + var resolver = create('foo'); + var meta = { name: 'foo' }; + + mkdirp.sync(tempDir); + resolver._tempDir = tempDir; + + resolver._applyPkgMeta(meta) + .then(function (retMeta) { + expect(retMeta).to.equal(meta); + + // Test also with the ignore property because the code is different + meta = { name: 'foo', ignore: ['somefile'] }; + + return resolver._applyPkgMeta(meta) + .then(function (retMeta) { + expect(retMeta).to.equal(meta); + next(); + }); + }) + .done(); + }); + + it('should remove files that match the ignore patterns', function (next) { + var resolver = create({ source: 'foo', name: 'foo' }); + + mkdirp.sync(tempDir); + + // Checkout test package version 0.2.1 which has a bower.json + // with ignores + cmd('git', ['checkout', '0.2.2'], { cwd: testPackage }) + // Copy its contents to the temporary dir + .then(function () { + return copy.copyDir(testPackage, tempDir); + }) + .then(function () { + var json; + + // This is a very rudimentary check + // Complete checks are made in the 'describe' below + resolver._tempDir = tempDir; + json = JSON.parse(fs.readFileSync(path.join(tempDir, 'bower.json')).toString()); + + return resolver._applyPkgMeta(json) + .then(function () { + expect(fs.existsSync(path.join(tempDir, 'foo'))).to.be(true); + expect(fs.existsSync(path.join(tempDir, 'baz'))).to.be(true); + expect(fs.existsSync(path.join(tempDir, 'test'))).to.be(false); + expect(fs.existsSync(path.join(tempDir, 'more/docs'))).to.be(false); + expect(fs.existsSync(path.join(tempDir, 'more/assets'))).to.be(false); + next(); + }); + }) + .done(); + }); + + describe('handling of ignore property according to the .gitignore spec', function () { + it.skip('A blank line matches no files, so it can serve as a separator for readability.'); + it.skip('A line starting with # serves as a comment.'); + it.skip('An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again...', function () { + // If a negated pattern matches, this will override lower precedence patterns sources. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "\!important!.txt". + }); + it.skip('If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find a match with a directory...', function () { + // In other words, foo/ will match a directory foo and paths underneath it, but will not match a regular file or a symbolic link foo (this is consistent with the way how pathspec works in general in git). + }); + it.skip('If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname without leading directories.'); + it.skip('Otherwise, git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag..', function () { + // wildcards in the pattern will not match a / in the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html". + }); + }); + }); + + describe('._savePkgMeta', function () { + before(function () { + mkdirp.sync(tempDir); + }); + + afterEach(function (next) { + rimraf(path.join(tempDir, '.bower.json'), next); + }); + + after(function (next) { + rimraf(tempDir, next); + }); + + it('should resolve with the same package meta', function (next) { + var resolver = create('foo'); + var meta = { name: 'foo' }; + + resolver._tempDir = tempDir; + + resolver._savePkgMeta(meta) + .then(function (retMeta) { + expect(retMeta).to.equal(meta); + next(); + }) + .done(); + }); + + it('should set the original source and target in package meta file', function (next) { + var resolver = create({ source: 'bar', target: '~2.0.0' }); + var meta = { name: 'foo' }; + + resolver._tempDir = tempDir; + + resolver._savePkgMeta(meta) + .then(function (retMeta) { + expect(retMeta._source).to.equal('bar'); + expect(retMeta._target).to.equal('~2.0.0'); + next(); + }) + .done(); + }); + + it('should save the package meta to the package meta file (.bower.json)', function (next) { + var resolver = create('foo'); + + resolver._tempDir = tempDir; + + resolver._savePkgMeta({ name: 'bar' }) + .then(function (retMeta) { + fs.readFile(path.join(tempDir, '.bower.json'), function (err, contents) { + if (err) return next(err); + + contents = contents.toString(); + expect(JSON.parse(contents)).to.eql(retMeta); + next(); + }); + }) + .done(); + }); + }); + + describe('#isTargetable', function () { + it('should return true by default', function () { + expect(Resolver.isTargetable()).to.be(true); + }); + }); + + describe('#versions', function () { + it('should resolve to an array by default', function (next) { + Resolver.versions() + .then(function (versions) { + expect(versions).to.be.an('array'); + expect(versions.length).to.be(0); + + next(); + }) + .done(); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/urlResolver.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/urlResolver.js new file mode 100644 index 0000000..d63ede7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/core/resolvers/urlResolver.js @@ -0,0 +1,772 @@ +var expect = require('expect.js'); +var path = require('path'); +var fs = require('graceful-fs'); +var path = require('path'); +var nock = require('nock'); +var Q = require('q'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var Logger = require('bower-logger'); +var cmd = require('../../../lib/util/cmd'); +var UrlResolver = require('../../../lib/core/resolvers/UrlResolver'); +var defaultConfig = require('../../../lib/config'); + +describe('UrlResolver', function () { + var testPackage = path.resolve(__dirname, '../../assets/package-a'); + var tempDir = path.resolve(__dirname, '../../assets/tmp'); + var logger; + + before(function (next) { + logger = new Logger(); + + // Checkout test package version 0.2.1 + cmd('git', ['checkout', '0.2.1'], { cwd: testPackage }) + .then(next.bind(next, null), next); + }); + + afterEach(function () { + logger.removeAllListeners(); + + // Clean nocks + nock.cleanAll(); + }); + + function create(decEndpoint, config) { + if (typeof decEndpoint === 'string') { + decEndpoint = { source: decEndpoint }; + } + + return new UrlResolver(decEndpoint, config || defaultConfig, logger); + } + + describe('.constructor', function () { + it('should guess the name from the URL', function () { + var resolver = create('http://bower.io/foo.txt'); + + expect(resolver.getName()).to.equal('foo'); + }); + + it('should remove ?part from the URL when guessing the name', function () { + var resolver = create('http://bower.io/foo.txt?bar'); + + expect(resolver.getName()).to.equal('foo'); + }); + + it('should not guess the name or remove ?part from the URL if not guessing', function () { + var resolver = create({ source: 'http://bower.io/foo.txt?bar', name: 'baz' }); + + expect(resolver.getName()).to.equal('baz'); + }); + + it('should error out if a target was specified', function (next) { + var resolver; + + try { + resolver = create({ source: testPackage, target: '0.0.1' }); + } catch (err) { + expect(err).to.be.an(Error); + expect(err.message).to.match(/can\'t resolve targets/i); + expect(err.code).to.equal('ENORESTARGET'); + return next(); + } + + next(new Error('Should have thrown')); + }); + }); + + describe('.hasNew', function () { + before(function () { + mkdirp.sync(tempDir); + }); + + afterEach(function (next) { + rimraf(path.join(tempDir, '.bower.json'), next); + }); + + after(function (next) { + rimraf(tempDir, next); + }); + + it('should resolve to true if the response is not in the 2xx range', function (next) { + var resolver = create('http://bower.io/foo.js'); + + nock('http://bower.io') + .head('/foo.js') + .reply(500); + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0' + })); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should resolve to true if cache headers changed', function (next) { + var resolver = create('http://bower.io/foo.js'); + + nock('http://bower.io') + .head('/foo.js') + .reply(200, '', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0', + _cacheHeaders: { + 'ETag': 'fk3454fdmmlw20i9nf', + 'Last-Modified': 'Tue, 16 Nov 2012 13:35:29 GMT' + } + })); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(true); + next(); + }) + .done(); + }); + + it('should resolve to false if cache headers haven\'t changed', function (next) { + var resolver = create('http://bower.io/foo.js'); + + nock('http://bower.io') + .head('/foo.js') + .reply(200, '', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0', + _cacheHeaders: { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + } + })); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(false); + next(); + }) + .done(); + }); + + it('should resolve to true if server responds with 304 (ETag mechanism)', function (next) { + var resolver = create('http://bower.io/foo.js'); + + nock('http://bower.io') + .head('/foo.js') + .matchHeader('If-None-Match', '686897696a7c876b7e') + .reply(304, '', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0', + _cacheHeaders: { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + } + })); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(false); + next(); + }) + .done(); + }); + + it('should work with redirects', function (next) { + var redirectingUrl = 'http://redirecting-url.com'; + var redirectingToUrl = 'http://bower.io'; + var resolver; + + nock(redirectingUrl) + .head('/foo.js') + .reply(302, '', { location: redirectingToUrl + '/foo.js' }); + + nock(redirectingToUrl) + .head('/foo.js') + .reply(200, 'foo contents', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + + fs.writeFileSync(path.join(tempDir, '.bower.json'), JSON.stringify({ + name: 'foo', + version: '0.0.0', + _cacheHeaders: { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + } + })); + + resolver = create(redirectingUrl + '/foo.js'); + + resolver.hasNew(tempDir) + .then(function (hasNew) { + expect(hasNew).to.be(false); + next(); + }) + .done(); + }); + }); + + describe('.resolve', function () { + // Function to assert that the main property of the + // package meta of a canonical dir is set to the + // expected value + function assertMain(dir, singleFile) { + return Q.nfcall(fs.readFile, path.join(dir, '.bower.json')) + .then(function (contents) { + var pkgMeta = JSON.parse(contents.toString()); + + expect(pkgMeta.main).to.equal(singleFile); + + return pkgMeta; + }); + } + + it('should download file, renaming it to index', function (next) { + var resolver; + + nock('http://bower.io') + .get('/foo.js') + .reply(200, 'foo contents'); + + resolver = create('http://bower.io/foo.js'); + + resolver.resolve() + .then(function (dir) { + var contents; + + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(false); + + contents = fs.readFileSync(path.join(dir, 'index.js')).toString(); + expect(contents).to.equal('foo contents'); + + assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should extract if source is an archive', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip')); + + resolver = create('http://bower.io/package-zip.zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip.zip'))).to.be(false); + next(); + }) + .done(); + }); + + it('should extract if source is an archive (case insensitive)', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip.ZIP') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip')); + + resolver = create('http://bower.io/package-zip.ZIP'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip.ZIP'))).to.be(false); + next(); + }) + .done(); + }); + + it('should copy extracted folder contents if archive contains only a folder inside', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip-folder.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-folder.zip')); + + nock('http://bower.io') + .get('/package-zip.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-folder.zip')); + + resolver = create('http://bower.io/package-zip-folder.zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder.zip'))).to.be(false); + + resolver = create({ source: 'http://bower.io/package-zip.zip', name: 'package-zip' }); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip.zip'))).to.be(false); + + next(); + }) + .done(); + }); + + it('should extract if source is an archive and rename to index if it\'s only one file inside', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip-single-file.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-single-file.zip')); + + resolver = create('http://bower.io/package-zip-single-file.zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-single-file'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-single-file.zip'))).to.be(false); + + return assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should extract if source is an archive and not rename to index if inside it\'s just a just bower.json/component.json file in it', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip-single-bower-json.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-single-bower-json.zip')) + .get('/package-zip-single-component-json.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-single-component-json.zip')); + + resolver = create('http://bower.io/package-zip-single-bower-json.zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'bower.json'))).to.be(true); + + resolver = create('http://bower.io/package-zip-single-component-json.zip'); + }) + .then(function () { + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'component.json'))).to.be(true); + next(); + }) + .done(); + }); + + it('should rename single file from a single folder to index when source is an archive', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip-folder-single-file.zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip-folder-single-file.zip')); + + resolver = create('http://bower.io/package-zip-folder-single-file.zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder-single-file'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip-folder-single-file.zip'))).to.be(false); + + return assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should extract if response content-type is an archive', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Type': 'application/zip' + }) + + .get('/package-zip2') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Type': 'application/zip; charset=UTF-8' + }) + + .get('/package-zip3') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Type': ' application/zip ; charset=UTF-8' + }) + + .get('/package-zip4') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Type': '"application/x-zip"' // Test with quotes + }) + + .get('/package-tar') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-tar.tar.gz'), { + 'Content-Type': ' application/x-tgz ; charset=UTF-8' + }) + + .get('/package-tar.tar.gz') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-tar.tar.gz'), { + 'Content-Type': ' application/x-tgz ; charset=UTF-8' + }) + + .get('/package-tar2.tar.gz') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-tar.tar.gz'), { + 'Content-Type': ' application/octet-stream ; charset=UTF-8' + }); + + resolver = create('http://bower.io/package-zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip.zip'))).to.be(false); + + resolver = create('http://bower.io/package-zip2'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip3.zip'))).to.be(false); + + resolver = create('http://bower.io/package-zip3'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip4.zip'))).to.be(false); + + resolver = create('http://bower.io/package-zip4'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-tar'))).to.be(false); + + resolver = create('http://bower.io/package-tar'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-tar'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-tar.tar.gz'))).to.be(false); + + resolver = create('http://bower.io/package-tar.tar.gz'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-tar'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-tar.tar.gz'))).to.be(false); + + resolver = create('http://bower.io/package-tar2.tar.gz'); + + return resolver.resolve(); + }) + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-tar'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-tar.tar.gz'))).to.be(false); + + next(); + }) + .done(); + }); + + it('should extract if response content-disposition filename is an archive', function (next) { + var resolver; + + nock('http://bower.io') + .get('/package-zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Disposition': 'attachment; filename="package-zip.zip"' + }); + + resolver = create('http://bower.io/package-zip'); + + resolver.resolve() + .then(function (dir) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip.zip'))).to.be(false); + next(); + }) + .done(); + }); + + it('should save the release if there\'s a E-Tag', function (next) { + var resolver; + + nock('http://bower.io') + .get('/foo.js') + .reply(200, 'foo contents', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + resolver = create('http://bower.io/foo.js'); + + resolver.resolve() + .then(function (dir) { + assertMain(dir, 'index.js') + .then(function (pkgMeta) { + expect(pkgMeta._release).to.equal('e-tag:686897696a'); + next(); + }); + }) + .done(); + }); + + it('should allow for query strings in URL', function (next) { + var resolver; + + nock('http://bower.io') + .get('/foo.js?bar=baz') + .reply(200, 'foo contents'); + + resolver = create('http://bower.io/foo.js?bar=baz'); + + resolver.resolve() + .then(function (dir) { + var contents; + + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'foo.js?bar=baz'))).to.be(false); + + contents = fs.readFileSync(path.join(dir, 'index.js')).toString(); + expect(contents).to.equal('foo contents'); + + assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it('should save cache headers', function (next) { + var resolver; + + nock('http://bower.io') + .get('/foo.js') + .reply(200, 'foo contents', { + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + + resolver = create('http://bower.io/foo.js'); + + resolver.resolve() + .then(function (dir) { + assertMain(dir, 'index.js') + .then(function (pkgMeta) { + expect(pkgMeta._cacheHeaders).to.eql({ + 'ETag': '686897696a7c876b7e', + 'Last-Modified': 'Tue, 15 Nov 2012 12:45:26 GMT' + }); + next(); + }); + }) + .done(); + }); + + it('should work with redirects', function (next) { + var redirectingUrl = 'http://redirecting-url.com'; + var redirectingToUrl = 'http://bower.io'; + var resolver; + + nock(redirectingUrl) + .get('/foo.js') + .reply(302, '', { + location: redirectingToUrl + '/foo.js' + }); + + nock(redirectingToUrl) + .get('/foo.js') + .reply(200, 'foo contents'); + + resolver = create(redirectingUrl + '/foo.js'); + + resolver.resolve() + .then(function (dir) { + var contents; + + expect(fs.existsSync(path.join(dir, 'index.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(false); + + contents = fs.readFileSync(path.join(dir, 'index.js')).toString(); + expect(contents).to.equal('foo contents'); + + assertMain(dir, 'index.js') + .then(next.bind(next, null)); + }) + .done(); + }); + + it.skip('it should error out if the status code is not within 200-299'); + + it.skip('should report progress when it takes too long to download'); + + describe('content-disposition validation', function () { + function performTest(header, extraction) { + var resolver; + + nock('http://bower.io') + .get('/package-zip') + .replyWithFile(200, path.resolve(__dirname, '../../assets/package-zip.zip'), { + 'Content-Disposition': header + }); + + resolver = create('http://bower.io/package-zip'); + + return resolver.resolve() + .then(function (dir) { + if (extraction) { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(true); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + } else { + expect(fs.existsSync(path.join(dir, 'foo.js'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'bar.js'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'package-zip'))).to.be(false); + expect(fs.existsSync(path.join(dir, 'index'))).to.be(true); + } + }); + } + + it('should work with and without quotes', function (next) { + performTest('attachment; filename="package-zip.zip"', true) + .then(function () { + return performTest('attachment; filename=package-zip.zip', true); + }) + .then(next.bind(next, null)) + .done(); + }); + + it('should not work with partial quotes', function (next) { + performTest('attachment; filename="package-zip.zip', false) + .then(function () { + // This one works, and the last quote is simply ignored + return performTest('attachment; filename=package-zip.zip"', true); + }) + .then(next.bind(next, null)) + .done(); + }); + + it('should not work if the filename contain chars other than alphanumerical, dashes, spaces and dots', function (next) { + performTest('attachment; filename="1package01 _-zip.zip"', true) + .then(function () { + return performTest('attachment; filename="package$%"', false); + }) + .then(function () { + return performTest('attachment; filename=packagé', false); + }) + .then(function () { + // This one works, but since the filename is truncated once a space is found + // the extraction will not happen because the file has no .zip extension + return performTest('attachment; filename=1package01 _-zip.zip"', false); + }) + .then(function () { + return performTest('attachment; filename=1package01.zip _-zip.zip"', true); + }) + .then(next.bind(next, null)) + .done(); + }); + + it('should trim leading and trailing spaces', function (next) { + performTest('attachment; filename=" package.zip "', true) + .then(next.bind(next, null)) + .done(); + }); + + it('should not work if the filename ends with a dot', function (next) { + performTest('attachment; filename="package.zip."', false) + .then(function () { + return performTest('attachment; filename="package.zip. "', false); + }) + .then(function () { + return performTest('attachment; filename=package.zip.', false); + }) + .then(function () { + return performTest('attachment; filename="package.zip ."', false); + }) + .then(function () { + return performTest('attachment; filename="package.zip. "', false); + }) + .then(next.bind(next, null)) + .done(); + }); + + it('should be case insensitive', function (next) { + performTest('attachment; FILENAME="package.zip"', true) + .then(function () { + return performTest('attachment; filename="package.ZIP"', true); + }) + .then(function () { + return performTest('attachment; FILENAME=package.zip', true); + }) + .then(function () { + return performTest('attachment; filename=package.ZIP', true); + }) + .then(next.bind(next, null)) + .done(); + }); + }); + }); + + describe('#isTargetable', function () { + it('should return false', function () { + expect(UrlResolver.isTargetable()).to.be(false); + }); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.js new file mode 100644 index 0000000..8c33419 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.js @@ -0,0 +1,204 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var semver = require('semver'); +var mout = require('mout'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var chalk = require('chalk'); +var cmd = require('../lib/util/cmd'); +var packages = require('./packages.json'); +var nopt = require('nopt'); + +var options = nopt({ + 'force': Boolean +}, { + 'f': '--force' +}); + +var env = { + 'GIT_AUTHOR_DATE': 'Sun Apr 7 22:13:13 2013 +0000', + 'GIT_AUTHOR_NAME': 'André Cruz', + 'GIT_AUTHOR_EMAIL': 'amdfcruz@gmail.com', + 'GIT_COMMITTER_DATE': 'Sun Apr 7 22:13:13 2013 +0000', + 'GIT_COMMITTER_NAME': 'André Cruz', + 'GIT_COMMITTER_EMAIL': 'amdfcruz@gmail.com' +}; + +// Preserve the original environment +mout.object.mixIn(env, process.env); + +function ensurePackage(dir) { + var promise; + + // If force is specified, delete folder + if (options.force) { + promise = Q.nfcall(rimraf, dir) + .then(function () { + throw new Error(); + }); + // Otherwise check if .git is already created + } else { + promise = Q.nfcall(fs.stat, path.join(dir, '.git')); + } + + // Only create if stat failed + return promise.fail(function () { + // Create dir + return Q.nfcall(mkdirp, dir) + // Init git repo + .then(cmd.bind(null, 'git', ['init'], { cwd: dir })) + // Create dummy file + .then(function () { + return Q.nfcall(fs.writeFile, path.join(dir, '.master'), 'based on master'); + }) + // Stage files + .then(cmd.bind(null, 'git', ['add', '-A'], { cwd: dir })) + // Commit + // Note that we force a specific date and author so that the same + // commit-sha's are always equal + // These commit-sha's are used internally in tests! + .then(function () { + return cmd('git', ['commit', '-m"Initial commit."'], { + cwd: dir, + env: env + }); + }) + .then(function () { + return dir; + }); + }); +} + +function checkRelease(dir, release) { + if (semver.valid(release)) { + return cmd('git', ['tag', '-l'], { cwd: dir }) + .spread(function (stdout) { + return stdout.split(/\s*\r*\n\s*/).some(function (tag) { + return semver.clean(tag) === release; + }); + }); + } + + return cmd('git', ['branch', '--list'], { cwd: dir }) + .spread(function (stdout) { + return stdout.split(/\s*\r*\n\s*/).some(function (branch) { + branch = branch.trim().replace(/^\*?\s*/, ''); + return branch === release; + }); + }); +} + +function createRelease(dir, release, files) { + var branch = semver.valid(release) ? 'branch-' + release : release; + + // Checkout master + return cmd('git', ['checkout', 'master', '-f'], { cwd: dir }) + // Attempt to delete branch, ignoring the error + .then(function () { + return cmd('git', ['branch', '-D', branch], { cwd: dir }) + .fail(function () {}); + }) + // Checkout based on master + .then(cmd.bind(null, 'git', ['checkout', '-b', branch, 'master'], { cwd: dir })) + // Create files + .then(function () { + var promise; + var promises = []; + + mout.object.forOwn(files, function (contents, name) { + name = path.join(dir, name); + + // Convert contents to JSON if they are not a string + if (typeof contents !== 'string') { + contents = JSON.stringify(contents, null, ' '); + } + + promise = Q.nfcall(mkdirp, path.dirname(name)) + .then(function () { + return Q.nfcall(fs.writeFile, name, contents); + }); + + promises.push(promise); + }); + + // Delete dummy .master file that is present on the master branch + promise = Q.nfcall(fs.unlink, path.join(dir, '.master')); + promises.push(promise); + + return Q.all(promises); + }) + // Stage files + .then(cmd.bind(null, 'git', ['add', '-A'], { cwd: dir })) + // Commit + // Note that we force a specific date and author so that the same + // commit-sha's are always equal + // These commit-sha's are used internally in tests! + .then(function () { + return cmd('git', ['commit', '-m"Commit for ' + branch + '."'], { + cwd: dir, + env: env + }); + }) + // Tag + .then(function () { + if (!semver.valid(release)) { + return; + } + + return cmd('git', ['tag', '-f', release], { cwd: dir }) + // Delete branch (not necessary anymore) + .then(cmd.bind(null, 'git', ['checkout', 'master', '-f'], { cwd: dir })) + .then(cmd.bind(null, 'git', ['branch', '-D', branch], { cwd: dir })); + }); +} + +var promises = []; + +// Process packages.json +mout.object.forOwn(packages, function (pkg, name) { + var promise; + var dir = path.join(__dirname, 'assets', name); + + // Ensure package is created + promise = ensurePackage(dir); + promise = promise.fail(function (err) { + console.log('Failed to create ' + name); + console.log(err.message); + }); + + mout.object.forOwn(pkg, function (files, release) { + // Check if the release already exists + promise = promise.then(checkRelease.bind(null, dir, release)) + .then(function (exists) { + // Skip it if already created + if (exists) { + return console.log(chalk.cyan('> ') + 'Package ' + name + '#' + release + ' already created'); + } + + // Create it based on the metadata + return createRelease(dir, release, files) + .then(function () { + console.log(chalk.green('> ') + 'Package ' + name + '#' + release + ' successfully created'); + }); + }) + .fail(function (err) { + console.log(chalk.red('> ') + 'Failed to create ' + name + '#' + release); + console.log(err.message.trim()); + if (err.details) { + console.log(err.details.trim()); + } + console.log(err.stack); + }); + }); + + promises.push(promise); +}); + +Q.allSettled(promises, function (results) { + results.forEach(function (result) { + if (result.state !== 'fulfilled') { + process.exit(1); + } + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.json new file mode 100644 index 0000000..fe2a69f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/packages.json @@ -0,0 +1,85 @@ +{ + "package-a": { + "0.0.1": { + "README.md": "", + "foo": "foo" + }, + "0.0.1": { + "README.md": "", + "foo": "foo" + }, + "0.0.2": { + "README.md": "", + "foo": "foo", + "bar": "bar" + }, + "0.1.0": { + "README.md": "", + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "0.1.1": { + "README.md": "", + "foo": "foo", + "bar": "bar", + "baz": "baz", + "more/more-foo": "more-foo" + }, + "0.2.0": { + "README.md": "", + "foo": "foo", + "bar": "bar", + "baz": "baz", + "more/more-foo": "more-foo", + "test/test.js": "some tests", + "component.json": { + "name": "a", + "version": "0.2.0", + "ignore": [ + "test/" + ] + } + }, + "0.2.1": { + "README.md": "", + "foo": "foo", + "bar": "bar", + "baz": "baz", + "more/more-foo": "more-foo", + "test/test.js": "some tests", + "bower.json": { + "name": "a", + "version": "0.2.0", + "ignore": [ + "test/" + ] + } + }, + "0.2.2": { + "README.md": "", + "foo": "foo", + "bar": "bar", + "baz": "baz", + "more/more-foo": "more-foo", + "more/docs/doc.html": "doc", + "more/assets/styles.css": "css", + "bower.json": { + "name": "a", + "version": "0.2.2", + "ignore": [ + "test/", + "more/docs", + "more/assets/", + "baz/" + ] + } + }, + "some-branch": { + "README.md": "", + "foo": "foo foo", + "bar": "bar bar", + "baz": "baz baz" + } + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/test.js new file mode 100644 index 0000000..f020f64 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/bower/test/test.js @@ -0,0 +1,17 @@ +// Cleanup the uncaughtException added by the tmp module +// It messes with the mocha uncaughtException event to caught errors +// Please note that is the Resolver that calls tmp.setGracefulCleanup() +// so we need to require that before +require('../lib/core/resolvers/Resolver'); +process.removeAllListeners('uncaughtException'); + +require('./core/resolvers/resolver'); +require('./core/resolvers/urlResolver'); +require('./core/resolvers/fsResolver'); +require('./core/resolvers/gitResolver'); +require('./core/resolvers/gitFsResolver'); +require('./core/resolvers/gitRemoteResolver'); +require('./core/resolvers/gitHubResolver'); +require('./core/resolverFactory'); +require('./core/resolveCache'); +require('./core/packageRepository'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.npmignore new file mode 100644 index 0000000..2af4b71 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.npmignore @@ -0,0 +1,2 @@ +.*.swp +test/a/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.travis.yml new file mode 100644 index 0000000..baa0031 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/README.md new file mode 100644 index 0000000..cc69164 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/README.md @@ -0,0 +1,250 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +## Attention: node-glob users! + +The API has changed dramatically between 2.x and 3.x. This library is +now 100% JavaScript, and the integer flags have been replaced with an +options object. + +Also, there's an event emitter class, proper tests, and all the other +things you've come to expect from node modules. + +And best of all, no compilation! + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Features + +Please see the [minimatch +documentation](https://github.com/isaacs/minimatch) for more details. + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instanting the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `error` The error encountered. When an error is encountered, the + glob object is in an undefined state, and should be discarded. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `statCache` Collection of all the stat results the glob search + performed. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `1` - Path exists, and is not a directory + * `2` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `abort` Stop the search. + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the glob object, as well. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. It will cause + ELOOP to be triggered one level sooner in the case of cyclical + symbolic links. +* `silent` When an unusual error is encountered + when attempting to read a directory, a warning will be printed to + stderr. Set the `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered + when attempting to read a directory, the process will just continue on + in search of other matches. Set the `strict` option to raise an error + in these cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary to + set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. + Set this flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `nocase` Perform a case-insensitive match. Note that case-insensitive + filesystems will sometimes result in glob returning results that are + case-insensitively matched anyway, since readdir and stat will not + raise an error. +* `debug` Set to enable debug logging in minimatch and glob. +* `globDebug` Set to enable debug logging in glob, but not minimatch. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/g.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/g.js new file mode 100644 index 0000000..be122df --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/g.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "test/a/**/[cg]/../[cg]" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/usr-local.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/usr-local.js new file mode 100644 index 0000000..327a425 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/examples/usr-local.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "{./*/*,/*,/usr/local/*}" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/glob.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/glob.js new file mode 100644 index 0000000..f4c69e9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/glob.js @@ -0,0 +1,690 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// readdir(PREFIX) as ENTRIES +// If fails, END +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + + + +module.exports = glob + +var fs = require("fs") +, minimatch = require("minimatch") +, Minimatch = minimatch.Minimatch +, inherits = require("inherits") +, EE = require("events").EventEmitter +, path = require("path") +, isDir = {} +, assert = require("assert").ok + +function glob (pattern, options, cb) { + if (typeof options === "function") cb = options, options = {} + if (!options) options = {} + + if (typeof options === "number") { + deprecated() + return + } + + var g = new Glob(pattern, options, cb) + return g.sync ? g.found : g +} + +glob.fnmatch = deprecated + +function deprecated () { + throw new Error("glob's interface has changed. Please see the docs.") +} + +glob.sync = globSync +function globSync (pattern, options) { + if (typeof options === "number") { + deprecated() + return + } + + options = options || {} + options.sync = true + return glob(pattern, options) +} + + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options, cb) + } + + if (typeof options === "function") { + cb = options + options = null + } + + if (typeof cb === "function") { + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) + }) + } + + options = options || {} + + this.EOF = {} + this._emitQueue = [] + + this.maxDepth = options.maxDepth || 1000 + this.maxLength = options.maxLength || Infinity + this.cache = options.cache || {} + this.statCache = options.statCache || {} + + this.changedCwd = false + var cwd = process.cwd() + if (!options.hasOwnProperty("cwd")) this.cwd = cwd + else { + this.cwd = options.cwd + this.changedCwd = path.resolve(options.cwd) !== cwd + } + + this.root = options.root || path.resolve(this.cwd, "/") + this.root = path.resolve(this.root) + if (process.platform === "win32") + this.root = this.root.replace(/\\/g, "/") + + this.nomount = !!options.nomount + + if (!pattern) { + throw new Error("must provide pattern") + } + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + this.strict = options.strict !== false + this.dot = !!options.dot + this.mark = !!options.mark + this.sync = !!options.sync + this.nounique = !!options.nounique + this.nonull = !!options.nonull + this.nosort = !!options.nosort + this.nocase = !!options.nocase + this.stat = !!options.stat + + this.debug = !!options.debug || !!options.globDebug + if (this.debug) + this.log = console.error + + this.silent = !!options.silent + + var mm = this.minimatch = new Minimatch(pattern, options) + this.options = mm.options + pattern = this.pattern = mm.pattern + + this.error = null + this.aborted = false + + // list of all the patterns that ** has resolved do, so + // we can avoid visiting multiple times. + this._globstars = {} + + EE.call(this) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + this.minimatch.set.forEach(iterator.bind(this)) + function iterator (pattern, i, set) { + this._process(pattern, 0, i, function (er) { + if (er) this.emit("error", er) + if (-- n <= 0) this._finish() + }) + } +} + +Glob.prototype.log = function () {} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + + var nou = this.nounique + , all = nou ? [] : {} + + for (var i = 0, l = this.matches.length; i < l; i ++) { + var matches = this.matches[i] + this.log("matches[%d] =", i, matches) + // do like the shell, and spit out the literal glob + if (!matches) { + if (this.nonull) { + var literal = this.minimatch.globSet[i] + if (nou) all.push(literal) + else all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) all.push.apply(all, m) + else m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) all = Object.keys(all) + + if (!this.nosort) { + all = all.sort(this.nocase ? alphasorti : alphasort) + } + + this.log("emitting end", all) + + this.EOF = this.found = all + this.emitMatch(this.EOF, -1) +} + +function alphasorti (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return alphasort(a, b) +} + +function alphasort (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit("abort") +} + +Glob.prototype.pause = function () { + if (this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = true + this.emit("pause") +} + +Glob.prototype.resume = function () { + if (!this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = false + this.emit("resume") + this._processEmitQueue() + //process.nextTick(this.emit.bind(this, "resume")) +} + +Glob.prototype._mark = function (p) { + var c = this.cache[p] + var m = p + if (c) { + var isDir = c === 2 || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + this.statCache[m] = this.statCache[p] + this.cache[m] = this.cache[p] + } + } + + return m +} + +Glob.prototype._pushMatch = function(m, index) { + if (this.mark && m !== this.EOF) + m = this._mark(m) + + if (m !== this.EOF) { + this.matches[index] = this.matches[index] || {} + this.matches[index][m] = true + } + + this._emitQueue.push(m) + this._processEmitQueue() +} + +Glob.prototype.emitMatch = function (m, index) { + if ((!this.stat && !this.mark) || this.statCache[m] || m === this.EOF) { + this._pushMatch(m, index) + } else { + this._stat(m, function(exists, isDir) { + if (exists) + this._pushMatch(m, index) + }) + } +} + +Glob.prototype._processEmitQueue = function (m) { + while (!this._processingEmitQueue && + !this.paused) { + this._processingEmitQueue = true + var m = this._emitQueue.shift() + if (!m) { + this._processingEmitQueue = false + break + } + + this.log('emit!', m === this.EOF ? "end" : "match") + + this.emit(m === this.EOF ? "end" : "match", m) + this._processingEmitQueue = false + } +} + +Glob.prototype._process = function (pattern, depth, index, cb_) { + assert(this instanceof Glob) + + var cb = function cb (er, res) { + assert(this instanceof Glob) + if (this.paused) { + if (!this._processQueue) { + this._processQueue = [] + this.once("resume", function () { + var q = this._processQueue + this._processQueue = null + q.forEach(function (cb) { cb() }) + }) + } + this._processQueue.push(cb_.bind(this, er, res)) + } else { + cb_.call(this, er, res) + } + }.bind(this) + + if (this.aborted) return cb() + + if (depth > this.maxDepth) return cb() + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === "string") { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + prefix = pattern.join("/") + this._stat(prefix, function (exists, isDir) { + // either it's there, or it isn't. + // nothing more to do, either way. + if (exists) { + if (prefix && isAbsolute(prefix) && !this.nomount) { + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + this.emitMatch(prefix, index) + } + return cb() + }) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's "absolute" like /foo/bar, + // or "relative" like "../baz" + prefix = pattern.slice(0, n) + prefix = prefix.join("/") + break + } + + // get the list of entries. + var read + if (prefix === null) read = "." + else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + if (!prefix || !isAbsolute(prefix)) { + prefix = path.join("/", prefix) + } + read = prefix = path.resolve(prefix) + + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } + + this.log('readdir(%j)', read, this.cwd, this.root) + + return this._readdir(read, function (er, entries) { + if (er) { + // not a directory! + // this means that, whatever else comes after this, it can never match + return cb() + } + + // globstar is special + if (pattern[n] === minimatch.GLOBSTAR) { + // test without the globstar, and with every child both below + // and replacing the globstar. + var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] + entries.forEach(function (e) { + if (e.charAt(0) === "." && !this.dot) return + // instead of the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) + // below the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) + }, this) + + s = s.filter(function (pattern) { + var key = gsKey(pattern) + var seen = !this._globstars[key] + this._globstars[key] = true + return seen + }, this) + + if (!s.length) + return cb() + + // now asyncForEach over this + var l = s.length + , errState = null + s.forEach(function (gsPattern) { + this._process(gsPattern, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l <= 0) return cb() + }) + }, this) + + return + } + + // not a globstar + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = pattern[n] + var rawGlob = pattern[n]._glob + , dotOk = this.dot || rawGlob.charAt(0) === "." + + entries = entries.filter(function (e) { + return (e.charAt(0) !== "." || dotOk) && + e.match(pattern[n]) + }) + + // If n === pattern.length - 1, then there's no need for the extra stat + // *unless* the user has specified "mark" or "stat" explicitly. + // We know that they exist, since the readdir returned them. + if (n === pattern.length - 1 && + !this.mark && + !this.stat) { + entries.forEach(function (e) { + if (prefix) { + if (prefix !== "/") e = prefix + "/" + e + else e = prefix + e + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + + if (process.platform === "win32") + e = e.replace(/\\/g, "/") + + this.emitMatch(e, index) + }, this) + return cb.call(this) + } + + + // now test all the remaining entries as stand-ins for that part + // of the pattern. + var l = entries.length + , errState = null + if (l === 0) return cb() // no matches possible + entries.forEach(function (e) { + var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) + this._process(p, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l === 0) return cb.call(this) + }) + }, this) + }) + +} + +function gsKey (pattern) { + return '**' + pattern.map(function (p) { + return (p === minimatch.GLOBSTAR) ? '**' : (''+p) + }).join('/') +} + +Glob.prototype._stat = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterStat(f, abs, cb, er) + } + + this.log('stat', [this.cwd, f, '=', abs]) + + if (!this.stat && this.cache.hasOwnProperty(f)) { + var exists = this.cache[f] + , isDir = exists && (Array.isArray(exists) || exists === 2) + if (this.sync) return cb.call(this, !!exists, isDir) + return process.nextTick(cb.bind(this, !!exists, isDir)) + } + + var stat = this.statCache[abs] + if (this.sync || stat) { + var er + try { + stat = fs.statSync(abs) + } catch (e) { + er = e + } + this._afterStat(f, abs, cb, er, stat) + } else { + fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + } +} + +Glob.prototype._afterStat = function (f, abs, cb, er, stat) { + var exists + assert(this instanceof Glob) + + if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { + this.log("should be ENOTDIR, fake it") + + er = new Error("ENOTDIR, not a directory '" + abs + "'") + er.path = abs + er.code = "ENOTDIR" + stat = null + } + + var emit = !this.statCache[abs] + this.statCache[abs] = stat + + if (er || !stat) { + exists = false + } else { + exists = stat.isDirectory() ? 2 : 1 + if (emit) + this.emit('stat', f, stat) + } + this.cache[f] = this.cache[f] || exists + cb.call(this, !!exists, exists === 2) +} + +Glob.prototype._readdir = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (isAbsolute(f)) { + abs = f + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterReaddir(f, abs, cb, er) + } + + this.log('readdir', [this.cwd, f, abs]) + if (this.cache.hasOwnProperty(f)) { + var c = this.cache[f] + if (Array.isArray(c)) { + if (this.sync) return cb.call(this, null, c) + return process.nextTick(cb.bind(this, null, c)) + } + + if (!c || c === 1) { + // either ENOENT or ENOTDIR + var code = c ? "ENOTDIR" : "ENOENT" + , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) + er.path = f + er.code = code + this.log(f, er) + if (this.sync) return cb.call(this, er) + return process.nextTick(cb.bind(this, er)) + } + + // at this point, c === 2, meaning it's a dir, but we haven't + // had to read it yet, or c === true, meaning it's *something* + // but we don't have any idea what. Need to read it, either way. + } + + if (this.sync) { + var er, entries + try { + entries = fs.readdirSync(abs) + } catch (e) { + er = e + } + return this._afterReaddir(f, abs, cb, er, entries) + } + + fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) +} + +Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { + assert(this instanceof Glob) + if (entries && !er) { + this.cache[f] = entries + // if we haven't asked to stat everything for suresies, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. This also gets us one step + // further into ELOOP territory. + if (!this.mark && !this.stat) { + entries.forEach(function (e) { + if (f === "/") e = f + e + else e = f + "/" + e + this.cache[e] = true + }, this) + } + + return cb.call(this, er, entries) + } + + // now handle errors, and cache the information + if (er) switch (er.code) { + case "ENOTDIR": // totally normal. means it *does* exist. + this.cache[f] = 1 + return cb.call(this, er) + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[f] = false + return cb.call(this, er) + default: // some unusual error. Treat as failure. + this.cache[f] = false + if (this.strict) this.emit("error", er) + if (!this.silent) console.error("glob error", er) + return cb.call(this, er) + } +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits_browser.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/package.json new file mode 100644 index 0000000..5bf0db5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/package.json @@ -0,0 +1,33 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits", + "_id": "inherits@2.0.1", + "_from": "inherits@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 0000000..978268e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,218 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +Eventually, it will replace the C binding in node-glob. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself. When set, an empty list is returned if there are +no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/minimatch.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..c633f89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,1055 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + var splitFile = path.basename(f.join("/")).split("/") + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = splitFile + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore new file mode 100644 index 0000000..07e6e47 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS new file mode 100644 index 0000000..4a0bc50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS @@ -0,0 +1,14 @@ +# Authors, sorted by whether or not they are me +Isaac Z. Schlueter +Brian Cottingham +Carlos Brito Lage +Jesse Dailey +Kevin O'Hara +Marco Rogers +Mark Cavage +Marko Mikulicic +Nathan Rajlich +Satheesh Natesan +Trent Mick +ashleybrener +n4kz diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md new file mode 100644 index 0000000..03ee0f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md @@ -0,0 +1,97 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `n` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 0000000..d1d1381 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,252 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0; + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +// Provided for debugging/dev purposes only. No promises whatsoever that +// this API stays stable. +LRUCache.prototype.dump = function () { + return this._cache +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value) { + if (hOP(this._cache, key)) { + // dispose of the old one before overwriting + if (this._dispose) this._dispose(key, this._cache[key].value) + if (this._maxAge) this._cache[key].now = Date.now() + this._cache[key].value = value + this.get(key) + return true + } + + var len = this._lengthCalculator(value) + var age = this._maxAge ? Date.now() : 0 + var hit = new Entry(key, value, this._mru++, len, age) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + del(this, this._cache[key]) +} + +function get (self, key, doUse) { + var hit = self._cache[key] + if (hit) { + if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now +} + +})() diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json new file mode 100644 index 0000000..4472725 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,33 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.5.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "", + "weak": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" + }, + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache", + "_id": "lru-cache@2.5.0", + "_from": "lru-cache@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js new file mode 100644 index 0000000..f72697c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js @@ -0,0 +1,369 @@ +var test = require("tap").test + , LRU = require("../") + +test("basic", function (t) { + var cache = new LRU({max: 10}) + cache.set("key", "value") + t.equal(cache.get("key"), "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.length, 1) + t.equal(cache.max, 10) + t.end() +}) + +test("least recently set", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.get("a") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), "A") + t.end() +}) + +test("del", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.del("a") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("max", function (t) { + var cache = new LRU(3) + + // test changing the max, verify that the LRU items get dropped. + cache.max = 100 + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + + // now remove the max restriction, and try again. + cache.max = "hello" + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + // should trigger an immediate resize + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + t.end() +}) + +test("reset", function (t) { + var cache = new LRU(10) + cache.set("a", "A") + cache.set("b", "B") + cache.reset() + t.equal(cache.length, 0) + t.equal(cache.max, 10) + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.end() +}) + + +// Note: `.dump()` is a debugging tool only. No guarantees are made +// about the format/layout of the response. +test("dump", function (t) { + var cache = new LRU(10) + var d = cache.dump(); + t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") + cache.set("a", "A") + var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } + t.ok(d.a) + t.equal(d.a.key, "a") + t.equal(d.a.value, "A") + t.equal(d.a.lu, 0) + + cache.set("b", "B") + cache.get("b") + d = cache.dump() + t.ok(d.b) + t.equal(d.b.key, "b") + t.equal(d.b.value, "B") + t.equal(d.b.lu, 2) + + t.end() +}) + + +test("basic with weighed length", function (t) { + var cache = new LRU({ + max: 100, + length: function (item) { return item.size } + }) + cache.set("key", {val: "value", size: 50}) + t.equal(cache.get("key").val, "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.lengthCalculator(cache.get("key")), 50) + t.equal(cache.length, 50) + t.equal(cache.max, 100) + t.end() +}) + + +test("weighed length item too large", function (t) { + var cache = new LRU({ + max: 10, + length: function (item) { return item.size } + }) + t.equal(cache.max, 10) + + // should fall out immediately + cache.set("key", {val: "value", size: 50}) + + t.equal(cache.length, 0) + t.equal(cache.get("key"), undefined) + t.end() +}) + +test("least recently set with weighed length", function (t) { + var cache = new LRU({ + max:8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.set("d", "DDDD") + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("c"), "CCC") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.get("a") + cache.get("b") + cache.set("d", "DDDD") + t.equal(cache.get("c"), undefined) + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("b"), "BB") + t.equal(cache.get("a"), "A") + t.end() +}) + +test("set returns proper booleans", function(t) { + var cache = new LRU({ + max: 5, + length: function (item) { return item.length } + }) + + t.equal(cache.set("a", "A"), true) + + // should return false for max exceeded + t.equal(cache.set("b", "donuts"), false) + + t.equal(cache.set("b", "B"), true) + t.equal(cache.set("c", "CCCC"), true) + t.end() +}) + +test("drop the old items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A") + + setTimeout(function () { + cache.set("b", "b") + t.equal(cache.get("a"), "A") + }, 25) + + setTimeout(function () { + cache.set("c", "C") + // timed out + t.notOk(cache.get("a")) + }, 60) + + setTimeout(function () { + t.notOk(cache.get("b")) + t.equal(cache.get("c"), "C") + }, 90) + + setTimeout(function () { + t.notOk(cache.get("c")) + t.end() + }, 155) +}) + +test("disposal function", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + dispose: function (k, n) { + disposed = n + } + }) + + cache.set(1, 1) + cache.set(2, 2) + t.equal(disposed, 1) + cache.set(3, 3) + t.equal(disposed, 2) + cache.reset() + t.equal(disposed, 3) + t.end() +}) + +test("disposal function on too big of item", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + length: function (k) { + return k.length + }, + dispose: function (k, n) { + disposed = n + } + }) + var obj = [ 1, 2 ] + + t.equal(disposed, false) + cache.set("obj", obj) + t.equal(disposed, obj) + t.end() +}) + +test("has()", function(t) { + var cache = new LRU({ + max: 1, + maxAge: 10 + }) + + cache.set('foo', 'bar') + t.equal(cache.has('foo'), true) + cache.set('blu', 'baz') + t.equal(cache.has('foo'), false) + t.equal(cache.has('blu'), true) + setTimeout(function() { + t.equal(cache.has('blu'), false) + t.end() + }, 15) +}) + +test("stale", function(t) { + var cache = new LRU({ + maxAge: 10, + stale: true + }) + + cache.set('foo', 'bar') + t.equal(cache.get('foo'), 'bar') + t.equal(cache.has('foo'), true) + setTimeout(function() { + t.equal(cache.has('foo'), false) + t.equal(cache.get('foo'), 'bar') + t.equal(cache.get('foo'), undefined) + t.end() + }, 15) +}) + +test("lru update via set", function(t) { + var cache = LRU({ max: 2 }); + + cache.set('foo', 1); + cache.set('bar', 2); + cache.del('bar'); + cache.set('baz', 3); + cache.set('qux', 4); + + t.equal(cache.get('foo'), undefined) + t.equal(cache.get('bar'), undefined) + t.equal(cache.get('baz'), 3) + t.equal(cache.get('qux'), 4) + t.end() +}) + +test("least recently set w/ peek", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + t.equal(cache.peek("a"), "A") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("pop the least used item", function (t) { + var cache = new LRU(3) + , last + + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + + t.equal(cache.length, 3) + t.equal(cache.max, 3) + + // Ensure we pop a, c, b + cache.get("b", "B") + + last = cache.pop() + t.equal(last.key, "a") + t.equal(last.value, "A") + t.equal(cache.length, 2) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "c") + t.equal(last.value, "C") + t.equal(cache.length, 1) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "b") + t.equal(last.value, "B") + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last, null) + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js new file mode 100644 index 0000000..eefb80d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js @@ -0,0 +1,52 @@ +var test = require('tap').test +var LRU = require('../') + +test('forEach', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 9 + l.forEach(function (val, key, cache) { + t.equal(cache, l) + t.equal(key, i.toString()) + t.equal(val, i.toString(2)) + i -= 1 + }) + + // get in order of most recently used + l.get(6) + l.get(8) + + var order = [ 8, 6, 9, 7, 5 ] + var i = 0 + + l.forEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + + t.end() +}) + +test('keys() and values()', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + t.similar(l.keys(), ['9', '8', '7', '6', '5']) + t.similar(l.values(), ['1001', '1000', '111', '110', '101']) + + // get in order of most recently used + l.get(6) + l.get(8) + + t.similar(l.keys(), ['8', '6', '9', '7', '5']) + t.similar(l.values(), ['1000', '110', '1001', '111', '101']) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js new file mode 100644 index 0000000..7af45b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node --expose_gc + +var weak = require('weak'); +var test = require('tap').test +var LRU = require('../') +var l = new LRU({ max: 10 }) +var refs = 0 +function X() { + refs ++ + weak(this, deref) +} + +function deref() { + refs -- +} + +test('no leaks', function (t) { + // fill up the cache + for (var i = 0; i < 100; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var start = process.memoryUsage() + + // capture the memory + var startRefs = refs + + // do it again, but more + for (var i = 0; i < 10000; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var end = process.memoryUsage() + t.equal(refs, startRefs, 'no leaky refs') + + console.error('start: %j\n' + + 'end: %j', start, end); + t.pass(); + t.end(); +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md new file mode 100644 index 0000000..7e36512 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md @@ -0,0 +1,53 @@ +# sigmund + +Quick and dirty signatures for Objects. + +This is like a much faster `deepEquals` comparison, which returns a +string key suitable for caches and the like. + +## Usage + +```javascript +function doSomething (someObj) { + var key = sigmund(someObj, maxDepth) // max depth defaults to 10 + var cached = cache.get(key) + if (cached) return cached) + + var result = expensiveCalculation(someObj) + cache.set(key, result) + return result +} +``` + +The resulting key will be as unique and reproducible as calling +`JSON.stringify` or `util.inspect` on the object, but is much faster. +In order to achieve this speed, some differences are glossed over. +For example, the object `{0:'foo'}` will be treated identically to the +array `['foo']`. + +Also, just as there is no way to summon the soul from the scribblings +of a cocain-addled psychoanalyst, there is no way to revive the object +from the signature string that sigmund gives you. In fact, it's +barely even readable. + +As with `sys.inspect` and `JSON.stringify`, larger objects will +produce larger signature strings. + +Because sigmund is a bit less strict than the more thorough +alternatives, the strings will be shorter, and also there is a +slightly higher chance for collisions. For example, these objects +have the same signature: + + var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} + var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +Like a good Freudian, sigmund is most effective when you already have +some understanding of what you're looking for. It can help you help +yourself, but you must be willing to do some work as well. + +Cycles are handled, and cyclical objects are silently omitted (though +the key is included in the signature output.) + +The second argument is the maximum depth, which defaults to 10, +because that is the maximum object traversal depth covered by most +insurance carriers. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js new file mode 100644 index 0000000..5acfd6d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js @@ -0,0 +1,283 @@ +// different ways to id objects +// use a req/res pair, since it's crazy deep and cyclical + +// sparseFE10 and sigmund are usually pretty close, which is to be expected, +// since they are essentially the same algorithm, except that sigmund handles +// regular expression objects properly. + + +var http = require('http') +var util = require('util') +var sigmund = require('./sigmund.js') +var sreq, sres, creq, cres, test + +http.createServer(function (q, s) { + sreq = q + sres = s + sres.end('ok') + this.close(function () { setTimeout(function () { + start() + }, 200) }) +}).listen(1337, function () { + creq = http.get({ port: 1337 }) + creq.on('response', function (s) { cres = s }) +}) + +function start () { + test = [sreq, sres, creq, cres] + // test = sreq + // sreq.sres = sres + // sreq.creq = creq + // sreq.cres = cres + + for (var i in exports.compare) { + console.log(i) + var hash = exports.compare[i]() + console.log(hash) + console.log(hash.length) + console.log('') + } + + require('bench').runMain() +} + +function customWs (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return customWs(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + customWs(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function custom (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return '' + obj + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return custom(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + custom(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function sparseFE2 (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ':' + ch(v[k], depth + 1) + }) + soFar += '}' + } + ch(obj, 0) + return soFar +} + +function sparseFE (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ch(v[k], depth + 1) + }) + } + ch(obj, 0) + return soFar +} + +function sparse (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ch(v[k], depth + 1) + } + } + ch(obj, 0) + return soFar +} + +function noCommas (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + + +function flatten (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + soFar += ',' + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + +exports.compare = +{ + // 'custom 2': function () { + // return custom(test, 2, 0) + // }, + // 'customWs 2': function () { + // return customWs(test, 2, 0) + // }, + 'JSON.stringify (guarded)': function () { + var seen = [] + return JSON.stringify(test, function (k, v) { + if (typeof v !== 'object' || !v) return v + if (seen.indexOf(v) !== -1) return undefined + seen.push(v) + return v + }) + }, + + 'flatten 10': function () { + return flatten(test, 10) + }, + + // 'flattenFE 10': function () { + // return flattenFE(test, 10) + // }, + + 'noCommas 10': function () { + return noCommas(test, 10) + }, + + 'sparse 10': function () { + return sparse(test, 10) + }, + + 'sparseFE 10': function () { + return sparseFE(test, 10) + }, + + 'sparseFE2 10': function () { + return sparseFE2(test, 10) + }, + + sigmund: function() { + return sigmund(test, 10) + }, + + + // 'util.inspect 1': function () { + // return util.inspect(test, false, 1, false) + // }, + // 'util.inspect undefined': function () { + // util.inspect(test) + // }, + // 'util.inspect 2': function () { + // util.inspect(test, false, 2, false) + // }, + // 'util.inspect 3': function () { + // util.inspect(test, false, 3, false) + // }, + // 'util.inspect 4': function () { + // util.inspect(test, false, 4, false) + // }, + // 'util.inspect Infinity': function () { + // util.inspect(test, false, Infinity, false) + // } +} + +/** results +**/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json new file mode 100644 index 0000000..cb7e2bd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json @@ -0,0 +1,42 @@ +{ + "name": "sigmund", + "version": "1.0.0", + "description": "Quick and dirty signatures for Objects.", + "main": "sigmund.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.3.0" + }, + "scripts": { + "test": "tap test/*.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/sigmund" + }, + "keywords": [ + "object", + "signature", + "key", + "data", + "psychoanalysis" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/sigmund/issues" + }, + "homepage": "https://github.com/isaacs/sigmund", + "_id": "sigmund@1.0.0", + "_from": "sigmund@~1.0.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js new file mode 100644 index 0000000..82c7ab8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js @@ -0,0 +1,39 @@ +module.exports = sigmund +function sigmund (subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ''; + var RE = RegExp; + + function psychoAnalyze (subject, session) { + if (session > maxSessions) return; + + if (typeof subject === 'function' || + typeof subject === 'undefined') { + return; + } + + if (typeof subject !== 'object' || !subject || + (subject instanceof RE)) { + analysis += subject; + return; + } + + if (notes.indexOf(subject) !== -1 || session === maxSessions) return; + + notes.push(subject); + analysis += '{'; + Object.keys(subject).forEach(function (issue, _, __) { + // pseudo-private values. skip those. + if (issue.charAt(0) === '_') return; + var to = typeof subject[issue]; + if (to === 'function' || to === 'undefined') return; + analysis += issue; + psychoAnalyze(subject[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; +} + +// vim: set softtabstop=4 shiftwidth=4: diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js new file mode 100644 index 0000000..50c53a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -0,0 +1,24 @@ +var test = require('tap').test +var sigmund = require('../sigmund.js') + + +// occasionally there are duplicates +// that's an acceptable edge-case. JSON.stringify and util.inspect +// have some collision potential as well, though less, and collision +// detection is expensive. +var hash = '{abc/def/g{0h1i2{jkl' +var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} +var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +var obj3 = JSON.parse(JSON.stringify(obj1)) +obj3.c = /def/ +obj3.g[2].cycle = obj3 +var cycleHash = '{abc/def/g{0h1i2{jklcycle' + +test('basic', function (t) { + t.equal(sigmund(obj1), hash) + t.equal(sigmund(obj2), hash) + t.equal(sigmund(obj3), cycleHash) + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 0000000..f8f545a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.2.14", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@0.2.14", + "_from": "minimatch@~0.2.11" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/basic.js new file mode 100644 index 0000000..ae7ac73 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/basic.js @@ -0,0 +1,399 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + + +var patterns = + [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + // https://github.com/isaacs/minimatch/issues/5 + , function () { + files = [ 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' + , 'a/b/.x' + , 'a/b/.x/' + , 'a/.x/b' + , '.x' + , '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b/.x/c' + , '.x/.x' ] + } + , ["**/.x/**", [ '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b' + , 'a/b/.x/' + , 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' ] ] + + ] + +var regexps = + [ '/^(?:(?=.)a[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:\\*)$/', + '/^(?:(?=.)\\*[^/]*?)$/', + '/^(?:\\*\\*)$/', + '/^(?:(?=.)b[^/]*?\\/)$/', + '/^(?:(?=.)c[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', + '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', + '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', + '/^(?:(?=.)a[^/]*?[^c])$/', + '/^(?:(?=.)a[X-]b)$/', + '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', + '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[^/]c)$/', + '/^(?:a\\*c)$/', + 'false', + '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', + '/^(?:man\\/man1\\/bash\\.1)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[-abc])$/', + '/^(?:(?!\\.)(?=.)[abc-])$/', + '/^(?:\\\\)$/', + '/^(?:(?!\\.)(?=.)[\\\\])$/', + '/^(?:(?!\\.)(?=.)[\\[])$/', + '/^(?:\\[)$/', + '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[\\]])$/', + '/^(?:(?!\\.)(?=.)[\\]-])$/', + '/^(?:(?!\\.)(?=.)[a-z])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:\\[\\])$/', + '/^(?:\\[abc)$/', + '/^(?:(?=.)XYZ)$/i', + '/^(?:(?=.)ab[^/]*?)$/i', + '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', + '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', + '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', + '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', + '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', + '/^(?:(?=.)a[^/]b)$/', + '/^(?:(?=.)#[^/]*?)$/', + '/^(?!^(?:(?=.)a[^/]*?)$).*$/', + '/^(?:(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)a[^/]*?)$/', + '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] +var re = 0; + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + patterns.forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var m = new mm.Minimatch(pattern, options) + var r = m.makeRe() + var expectRe = regexps[re++] + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + + t.equal(tapOpts.re, expectRe, tapOpts) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/brace-expand.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/brace-expand.js new file mode 100644 index 0000000..7ee278a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/brace-expand.js @@ -0,0 +1,33 @@ +var tap = require("tap") + , minimatch = require("../") + +tap.test("brace expansion", function (t) { + // [ pattern, [expanded] ] + ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" + , [ "abxy" + , "abxz" + , "acdxy" + , "acdxz" + , "acexy" + , "acexz" + , "afhxy" + , "afhxz" + , "aghxy" + , "aghxz" ] ] + , [ "a{1..5}b" + , [ "a1b" + , "a2b" + , "a3b" + , "a4b" + , "a5b" ] ] + , [ "a{b}c", ["a{b}c"] ] + ].forEach(function (tc) { + var p = tc[0] + , expect = tc[1] + t.equivalent(minimatch.braceExpand(p), expect, p) + }) + console.error("ending") + t.end() +}) + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/caching.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/caching.js new file mode 100644 index 0000000..0fec4b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/caching.js @@ -0,0 +1,14 @@ +var Minimatch = require("../minimatch.js").Minimatch +var tap = require("tap") +tap.test("cache test", function (t) { + var mm1 = new Minimatch("a?b") + var mm2 = new Minimatch("a?b") + t.equal(mm1, mm2, "should get the same object") + // the lru should drop it after 100 entries + for (var i = 0; i < 100; i ++) { + new Minimatch("a"+i) + } + mm2 = new Minimatch("a?b") + t.notEqual(mm1, mm2, "cache should have dropped") + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/defaults.js new file mode 100644 index 0000000..25f1f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/defaults.js @@ -0,0 +1,274 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + ; [ "http://www.bashcookbook.com/bashinfo" + + "/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + ].forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var Class = mm.defaults(options).Minimatch + var m = new Class(pattern, {}) + var r = m.makeRe() + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js new file mode 100644 index 0000000..6676e26 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js @@ -0,0 +1,8 @@ +var test = require('tap').test +var minimatch = require('../') + +test('extglob ending with statechar', function(t) { + t.notOk(minimatch('ax', 'a?(b*)')) + t.ok(minimatch('ax', '?(a*|b)')) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/package.json new file mode 100644 index 0000000..2c7a1be --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/package.json @@ -0,0 +1,43 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "3.2.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "engines": { + "node": "*" + }, + "dependencies": { + "minimatch": "~0.2.11", + "inherits": "2" + }, + "devDependencies": { + "tap": "~0.4.0", + "mkdirp": "0", + "rimraf": "1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "BSD", + "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `1` - Path exists, and is not a directory\n * `2` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob", + "_id": "glob@3.2.8", + "dist": { + "shasum": "faed42352b23fd9688f67e91dfd4a6b3f58f0784" + }, + "_from": "glob@~3.2.6", + "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/00-setup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/00-setup.js new file mode 100644 index 0000000..245afaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/00-setup.js @@ -0,0 +1,176 @@ +// just a little pre-run script to set up the fixtures. +// zz-finish cleans it up + +var mkdirp = require("mkdirp") +var path = require("path") +var i = 0 +var tap = require("tap") +var fs = require("fs") +var rimraf = require("rimraf") + +var files = +[ "a/.abcdef/x/y/z/a" +, "a/abcdef/g/h" +, "a/abcfed/g/h" +, "a/b/c/d" +, "a/bc/e/f" +, "a/c/d/c/b" +, "a/cb/e/f" +] + +var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") +var symlinkFrom = "../.." + +files = files.map(function (f) { + return path.resolve(__dirname, f) +}) + +tap.test("remove fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "remove fixtures") + t.end() + }) +}) + +files.forEach(function (f) { + tap.test(f, function (t) { + var d = path.dirname(f) + mkdirp(d, 0755, function (er) { + if (er) { + t.fail(er) + return t.bailout() + } + fs.writeFile(f, "i like tests", function (er) { + t.ifError(er, "make file") + t.end() + }) + }) + }) +}) + +if (process.platform !== "win32") { + tap.test("symlinky", function (t) { + var d = path.dirname(symlinkTo) + console.error("mkdirp", d) + mkdirp(d, 0755, function (er) { + t.ifError(er) + fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { + t.ifError(er, "make symlink") + t.end() + }) + }) + }) +} + +;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { + w = "/tmp/glob-test/" + w + tap.test("create " + w, function (t) { + mkdirp(w, function (er) { + if (er) + throw er + t.pass(w) + t.end() + }) + }) +}) + + +// generate the bash pattern test-fixtures if possible +if (process.platform === "win32" || !process.env.TEST_REGEN) { + console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") + return +} + +var spawn = require("child_process").spawn; +var globs = + // put more patterns here. + // anything that would be directly in / should be in /tmp/glob-test + ["test/a/*/+(c|g)/./d" + ,"test/a/**/[cg]/../[cg]" + ,"test/a/{b,c,d,e,f}/**/g" + ,"test/a/b/**" + ,"test/**/g" + ,"test/a/abc{fed,def}/g/h" + ,"test/a/abc{fed/g,def}/**/" + ,"test/a/abc{fed/g,def}/**///**/" + ,"test/**/a/**/" + ,"test/+(a|b|c)/a{/,bc*}/**" + ,"test/*/*/*/f" + ,"test/**/f" + ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" + ,"{./*/*,/tmp/glob-test/*}" + ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! + ,"test/a/!(symlink)/**" + ] +var bashOutput = {} +var fs = require("fs") + +globs.forEach(function (pattern) { + tap.test("generate fixture " + pattern, function (t) { + var cmd = "shopt -s globstar && " + + "shopt -s extglob && " + + "shopt -s nullglob && " + + // "shopt >&2; " + + "eval \'for i in " + pattern + "; do echo $i; done\'" + var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) + var out = [] + cp.stdout.on("data", function (c) { + out.push(c) + }) + cp.stderr.pipe(process.stderr) + cp.on("close", function (code) { + out = flatten(out) + if (!out) + out = [] + else + out = cleanResults(out.split(/\r*\n/)) + + bashOutput[pattern] = out + t.notOk(code, "bash test should finish nicely") + t.end() + }) + }) +}) + +tap.test("save fixtures", function (t) { + var fname = path.resolve(__dirname, "bash-results.json") + var data = JSON.stringify(bashOutput, null, 2) + "\n" + fs.writeFile(fname, data, function (er) { + t.ifError(er) + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +function flatten (chunks) { + var s = 0 + chunks.forEach(function (c) { s += c.length }) + var out = new Buffer(s) + s = 0 + chunks.forEach(function (c) { + c.copy(out, s) + s += c.length + }) + + return out.toString().trim() +} + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-comparison.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-comparison.js new file mode 100644 index 0000000..239ed1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-comparison.js @@ -0,0 +1,63 @@ +// basic test +// show that it does the same thing by default as the shell. +var tap = require("tap") +, child_process = require("child_process") +, bashResults = require("./bash-results.json") +, globs = Object.keys(bashResults) +, glob = require("../") +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +globs.forEach(function (pattern) { + var expect = bashResults[pattern] + // anything regarding the symlink thing will fail on windows, so just skip it + if (process.platform === "win32" && + expect.some(function (m) { + return /\/symlink\//.test(m) + })) + return + + tap.test(pattern, function (t) { + glob(pattern, function (er, matches) { + if (er) + throw er + + // sort and unmark, just to match the shell results + matches = cleanResults(matches) + + t.deepEqual(matches, expect, pattern) + t.end() + }) + }) + + tap.test(pattern + " sync", function (t) { + var matches = cleanResults(glob.sync(pattern)) + + t.deepEqual(matches, expect, "should match shell") + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-results.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-results.json new file mode 100644 index 0000000..593215c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/bash-results.json @@ -0,0 +1,350 @@ +{ + "test/a/*/+(c|g)/./d": [ + "test/a/b/c/./d" + ], + "test/a/**/[cg]/../[cg]": [ + "test/a/abcdef/g/../g", + "test/a/abcfed/g/../g", + "test/a/b/c/../c", + "test/a/c/../c", + "test/a/c/d/c/../c", + "test/a/symlink/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" + ], + "test/a/{b,c,d,e,f}/**/g": [], + "test/a/b/**": [ + "test/a/b", + "test/a/b/c", + "test/a/b/c/d" + ], + "test/**/g": [ + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed,def}/g/h": [ + "test/a/abcdef/g/h", + "test/a/abcfed/g/h" + ], + "test/a/abc{fed/g,def}/**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed/g,def}/**///**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/**/a/**/": [ + "test/a", + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/b", + "test/a/b/c", + "test/a/bc", + "test/a/bc/e", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/cb", + "test/a/cb/e", + "test/a/symlink", + "test/a/symlink/a", + "test/a/symlink/a/b", + "test/a/symlink/a/b/c", + "test/a/symlink/a/b/c/a", + "test/a/symlink/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" + ], + "test/+(a|b|c)/a{/,bc*}/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h" + ], + "test/*/*/*/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/**/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" + ], + "{./*/*,/tmp/glob-test/*}": [ + "./examples/g.js", + "./examples/usr-local.js", + "./node_modules/inherits", + "./node_modules/minimatch", + "./node_modules/mkdirp", + "./node_modules/rimraf", + "./node_modules/tap", + "./test/00-setup.js", + "./test/a", + "./test/bash-comparison.js", + "./test/bash-results.json", + "./test/cwd-test.js", + "./test/globstar-match.js", + "./test/mark.js", + "./test/new-glob-optional-options.js", + "./test/nocase-nomagic.js", + "./test/pause-resume.js", + "./test/root-nomount.js", + "./test/root.js", + "./test/stat.js", + "./test/zz-cleanup.js", + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq" + ], + "{/tmp/glob-test/*,*}": [ + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq", + "examples", + "glob.js", + "LICENSE", + "node_modules", + "package.json", + "README.md", + "test" + ], + "test/a/!(symlink)/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h", + "test/a/b", + "test/a/b/c", + "test/a/b/c/d", + "test/a/bc", + "test/a/bc/e", + "test/a/bc/e/f", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/c/d/c/b", + "test/a/cb", + "test/a/cb/e", + "test/a/cb/e/f" + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/cwd-test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/cwd-test.js new file mode 100644 index 0000000..352c27e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/cwd-test.js @@ -0,0 +1,55 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing cwd and searching for **/d", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('**/d', function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('a', function (t) { + glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'b/c/d', 'c/d' ]) + t.end() + }) + }) + + t.test('a/b', function (t) { + glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('a/b/', function (t) { + glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('.', function (t) { + glob('**/d', {cwd: process.cwd()}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/globstar-match.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/globstar-match.js new file mode 100644 index 0000000..9b234fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/globstar-match.js @@ -0,0 +1,19 @@ +var Glob = require("../glob.js").Glob +var test = require('tap').test + +test('globstar should not have dupe matches', function(t) { + var pattern = 'a/**/[gh]' + var g = new Glob(pattern, { cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + console.error('match %j', m) + matches.push(m) + }) + g.on('end', function(set) { + console.error('set', set) + matches = matches.sort() + set = set.sort() + t.same(matches, set, 'should have same set of matches') + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/mark.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/mark.js new file mode 100644 index 0000000..e742820 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/mark.js @@ -0,0 +1,82 @@ +var test = require("tap").test +var glob = require('../') +process.chdir(__dirname) + +test("mark, no / on pattern", function (t) { + glob("a/*", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + + if (process.platform !== "win32") + expect.push('a/symlink/') + + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, no / on pattern", function (t) { + glob("a/*", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef', + 'a/abcfed', + 'a/b', + 'a/bc', + 'a/c', + 'a/cb' ] + + if (process.platform !== "win32") + expect.push('a/symlink') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /[^\/]$/) + }) +}) + +test("mark=true, / on pattern", function (t) { + glob("a/*/", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, / on pattern", function (t) { + glob("a/*/", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/new-glob-optional-options.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/new-glob-optional-options.js new file mode 100644 index 0000000..3e7dc5a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/new-glob-optional-options.js @@ -0,0 +1,10 @@ +var Glob = require('../glob.js').Glob; +var test = require('tap').test; + +test('new glob, with cb, and no options', function (t) { + new Glob(__filename, function(er, results) { + if (er) throw er; + t.same(results, [__filename]); + t.end(); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/nocase-nomagic.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/nocase-nomagic.js new file mode 100644 index 0000000..2503f23 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/nocase-nomagic.js @@ -0,0 +1,113 @@ +var fs = require('fs'); +var test = require('tap').test; +var glob = require('../'); + +test('mock fs', function(t) { + var stat = fs.stat + var statSync = fs.statSync + var readdir = fs.readdir + var readdirSync = fs.readdirSync + + function fakeStat(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = { isDirectory: function() { return true } } + break + case '/tmp/a': + ret = { isDirectory: function() { return false } } + break + } + return ret + } + + fs.stat = function(path, cb) { + var f = fakeStat(path); + if (f) { + process.nextTick(function() { + cb(null, f) + }) + } else { + stat.call(fs, path, cb) + } + } + + fs.statSync = function(path) { + return fakeStat(path) || statSync.call(fs, path) + } + + function fakeReaddir(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = [ 'a', 'A' ] + break + case '/': + ret = ['tmp', 'tMp', 'tMP', 'TMP'] + } + return ret + } + + fs.readdir = function(path, cb) { + var f = fakeReaddir(path) + if (f) + process.nextTick(function() { + cb(null, f) + }) + else + readdir.call(fs, path, cb) + } + + fs.readdirSync = function(path) { + return fakeReaddir(path) || readdirSync.call(fs, path) + } + + t.pass('mocked') + t.end() +}) + +test('nocase, nomagic', function(t) { + var n = 2 + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/a', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) + glob('/tmp/A', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) +}) + +test('nocase, with some magic', function(t) { + t.plan(2) + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/pause-resume.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/pause-resume.js new file mode 100644 index 0000000..e1ffbab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/pause-resume.js @@ -0,0 +1,73 @@ +// show that no match events happen while paused. +var tap = require("tap") +, child_process = require("child_process") +// just some gnarly pattern with lots of matches +, pattern = "test/a/!(symlink)/**" +, bashResults = require("./bash-results.json") +, patterns = Object.keys(bashResults) +, glob = require("../") +, Glob = glob.Glob +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +var globResults = [] +tap.test("use a Glob object, and pause/resume it", function (t) { + var g = new Glob(pattern) + , paused = false + , res = [] + , expect = bashResults[pattern] + + g.on("pause", function () { + console.error("pause") + }) + + g.on("resume", function () { + console.error("resume") + }) + + g.on("match", function (m) { + t.notOk(g.paused, "must not be paused") + globResults.push(m) + g.pause() + t.ok(g.paused, "must be paused") + setTimeout(g.resume.bind(g), 10) + }) + + g.on("end", function (matches) { + t.pass("reached glob end") + globResults = cleanResults(globResults) + matches = cleanResults(matches) + t.deepEqual(matches, globResults, + "end event matches should be the same as match events") + + t.deepEqual(matches, expect, + "glob matches should be the same as bash results") + + t.end() + }) +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root-nomount.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root-nomount.js new file mode 100644 index 0000000..3ac5979 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root-nomount.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing root and searching for /b*/**", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) + }) + + t.test('a', function (t) { + glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root.js new file mode 100644 index 0000000..95c23f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/root.js @@ -0,0 +1,46 @@ +var t = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +var glob = require('../') +var path = require('path') + +t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) +}) + + +t.test('a', function (t) { + console.error("root=" + path.resolve('a')) + glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { + t.ifError(er) + var wanted = [ + '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' + ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + }) + + t.like(matches, wanted) + t.end() + }) +}) + +t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + })) + t.end() + }) +}) + +t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/stat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/stat.js new file mode 100644 index 0000000..6291711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/stat.js @@ -0,0 +1,32 @@ +var glob = require('../') +var test = require('tap').test +var path = require('path') + +test('stat all the things', function(t) { + var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + matches.push(m) + }) + var stats = [] + g.on('stat', function(m) { + stats.push(m) + }) + g.on('end', function(eof) { + stats = stats.sort() + matches = matches.sort() + eof = eof.sort() + t.same(stats, matches) + t.same(eof, matches) + var cache = Object.keys(this.statCache) + t.same(cache.map(function (f) { + return path.relative(__dirname, f) + }).sort(), matches) + + cache.forEach(function(c) { + t.equal(typeof this.statCache[c], 'object') + }, this) + + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/zz-cleanup.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/zz-cleanup.js new file mode 100644 index 0000000..e085f0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/glob/test/zz-cleanup.js @@ -0,0 +1,11 @@ +// remove the fixtures +var tap = require("tap") +, rimraf = require("rimraf") +, path = require("path") + +tap.test("cleanup fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "removed") + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/LICENSE.txt b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/LICENSE.txt new file mode 100644 index 0000000..49869bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/README.md b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/README.md new file mode 100644 index 0000000..6f9598e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/README.md @@ -0,0 +1,163 @@ +# Lo-Dash v2.4.1 +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + +Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds. + +* Modern builds perfect for newer browsers/environments:
        +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js) + +* Compatibility builds for older environment support too:
        +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.min.js) + +* Underscore builds to use as a drop-in replacement:
        +[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.js) & +[Production](https://raw.github.com/lodash/lodash/2.4.1/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](http://lodash.com/custom-builds) with only the features needed. + +Love modules? We’ve 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 + +There’s plenty of **[documentation](http://lodash.com/docs)**, [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).
        +Check out DevDocs as a fast, organized, & searchable interface for our documentation. + +The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).
        +A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). + +## Features *not* in Underscore + + * AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.) + * [_(…)](http://lodash.com/docs#_) supports intuitive chaining + * [_.at](http://lodash.com/docs#at) for cherry-picking collection values + * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods + * [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects + * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects + * [_.constant](http://lodash.com/docs#constant) & [_.property](http://lodash.com/docs#property) function generators for composing functions + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` + * [_.create](http://lodash.com/docs#create) for easier object inheritance + * [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins + * [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions + * [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control + * [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys + * [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early + * [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object` + * [_.mapValues](http://lodash.com/docs#mapValues) for [mapping](http://lodash.com/docs#map) values to an object + * [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions + * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) + * [_.noop](http://lodash.com/docs#noop) for function placeholders + * [_.now](http://lodash.com/docs#now) as a cross-browser `Date.now` alternative + * [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior + * [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays + * [_.random](http://lodash.com/docs#random) supports returning floating-point numbers + * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking + * [_.sortBy](http://lodash.com/docs#sortBy) supports sorting by multiple properties + * [_.support](http://lodash.com/docs#support) for flagging environment features + * [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals) + * [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects + * [_.where](http://lodash.com/docs#where) supports deep object comparisons + * [_.xor](http://lodash.com/docs#xor) as a companion to [_.difference](http://lodash.com/docs#difference), [_.intersection](http://lodash.com/docs#intersection), & [_.union](http://lodash.com/docs#union) + * [_.zip](http://lodash.com/docs#zip) is capable of unzipping values + * [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), & + [more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks + * [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), & + [more](http://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](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), & + [more](http://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](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), & + [more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods + +## Resources + + * Podcasts + - [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/) + + * 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/) + + * 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) + + A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources). + +## Support + +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.
        +Automated browser test results [are available](https://saucelabs.com/u/lodash) as well as [Travis CI](https://travis-ci.org/) builds for [lodash](https://travis-ci.org/lodash/lodash/), [lodash-cli](https://travis-ci.org/lodash/lodash-cli/), [lodash-amd](https://travis-ci.org/lodash/lodash-amd/), [lodash-node](https://travis-ci.org/lodash/lodash-node/), & [grunt-lodash](https://travis-ci.org/lodash/grunt-lodash). + +Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
        +[![Sauce Labs](http://lodash.com/_img/sauce.png)](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More") + +## Installation & usage + +In browsers: + +```html + +``` + +Using [`npm`](http://npmjs.org/): + +```bash +npm i --save lodash + +{sudo} npm i -g lodash +npm ln lodash +``` + +In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/): + +```js +var _ = require('lodash'); +// or as Underscore +var _ = require('lodash/dist/lodash.underscore'); +``` + +**Notes:** + * Don’t 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 project’s root directory *before* requiring it + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader: + +```js +require({ + 'packages': [ + { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' } + ] +}, +['lodash'], function(_) { + console.log(_.VERSION); +}); +``` + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/dist/lodash.compat.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/dist/lodash.compat.js new file mode 100644 index 0000000..23798ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/node_modules/lodash/dist/lodash.compat.js @@ -0,0 +1,7157 @@ +/** + * @license + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash -o ./dist/lodash.compat.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre ES5 environments */ + var undefined; + + /** Used to pool arrays and objects used internally */ + var arrayPool = [], + objectPool = []; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = {}; + + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ + var keyPrefix = +new Date + ''; + + /** Used as the size when optimizations are enabled for large arrays */ + var largeArraySize = 75; + + /** Used as the max size of the `arrayPool` and `objectPool` */ + var maxPoolSize = 40; + + /** Used to detect and test whitespace */ + var whitespace = ( + // whitespace + ' \t\x0B\f\xA0\ufeff' + + + // line terminators + '\n\r\u2028\u2029' + + + // unicode category "Zs" space separators + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' + ); + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detected named functions */ + var reFuncName = /^\s*function[ \n\r\t]+\w/; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match leading whitespace and zeros to be removed */ + var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to detect functions containing a `this` reference */ + var reThis = /\bthis\b/; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to assign default `context` object properties */ + var contextProps = [ + 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', + 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', + 'parseInt', 'setTimeout' + ]; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowedProps = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + errorClass = '[object Error]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used as an internal `_.debounce` options object */ + var debounceOptions = { + 'leading': false, + 'maxWait': 0, + 'trailing': false + }; + + /** Used as the property descriptor for `__bindData__` */ + var descriptor = { + 'configurable': false, + 'enumerable': false, + 'value': null, + 'writable': false + }; + + /** Used as the data object for `iteratorTemplate` */ + var iteratorData = { + 'args': '', + 'array': null, + 'bottom': '', + 'firstArg': '', + 'init': '', + 'keys': null, + 'loop': '', + 'shadowedProps': null, + 'support': null, + 'top': '', + 'useHas': false + }; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports` */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value] ? 0 : -1; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = (cache = cache[type]) && cache[key]; + + return type == 'object' + ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) + : (cache ? 0 : -1); + } + + /** + * Adds a given value to the corresponding cache object. + * + * @private + * @param {*} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + (typeCache[key] || (typeCache[key] = [])).push(value); + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default callback when a given + * collection is a string value. + * + * @private + * @param {string} value The character to inspect. + * @returns {number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` elements, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ac = a.criteria, + bc = b.criteria, + index = -1, + length = ac.length; + + while (++index < length) { + var value = ac[index], + other = bc[index]; + + if (value !== other) { + if (value > other || typeof value == 'undefined') { + return 1; + } + if (value < other || typeof other == 'undefined') { + return -1; + } + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to return the same value for + // `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 + // + // This also ensures a stable sort in V8 and other engines. + // See http://code.google.com/p/v8/issues/detail?id=90 + return a.index - b.index; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length, + first = array[0], + mid = array[(length / 2) | 0], + last = array[length - 1]; + + if (first && typeof first == 'object' && + mid && typeof mid == 'object' && last && typeof last == 'object') { + return false; + } + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Gets an array from the array pool or creates a new one if the pool is empty. + * + * @private + * @returns {Array} The array from the pool. + */ + function getArray() { + return arrayPool.pop() || []; + } + + /** + * Gets an object from the object pool or creates a new one if the pool is empty. + * + * @private + * @returns {Object} The object from the pool. + */ + function getObject() { + return objectPool.pop() || { + 'array': null, + 'cache': null, + 'criteria': null, + 'false': false, + 'index': 0, + 'null': false, + 'number': null, + 'object': null, + 'push': null, + 'string': null, + 'true': false, + 'undefined': false, + 'value': null + }; + } + + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * Releases the given array back to the array pool. + * + * @private + * @param {Array} [array] The array to release. + */ + function releaseArray(array) { + array.length = 0; + if (arrayPool.length < maxPoolSize) { + arrayPool.push(array); + } + } + + /** + * Releases the given object back to the object pool. + * + * @private + * @param {Object} [object] The object to release. + */ + function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } + object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; + if (objectPool.length < maxPoolSize) { + objectPool.push(object); + } + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used instead of `Array#slice` to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|string} collection The collection to slice. + * @param {number} start The start index. + * @param {number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new `lodash` function using the given context object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} [context=root] The context object. + * @returns {Function} Returns the `lodash` function. + */ + function runInContext(context) { + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See http://es5.github.io/#x11.1.5. + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; + + /** Native constructor references */ + var Array = context.Array, + Boolean = context.Boolean, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Number = context.Number, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** + * Used for `Array` method references. + * + * Normally `Array.prototype` would suffice, however, using an array literal + * avoids issues in Narwhal. + */ + var arrayRef = []; + + /** Used for native method references */ + var errorProto = Error.prototype, + objectProto = Object.prototype, + stringProto = String.prototype; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = context._; + + /** Used to resolve the internal [[Class]] of values */ + var toString = objectProto.toString; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + String(toString) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/toString| for [^\]]+/g, '.*?') + '$' + ); + + /** Native method shortcuts */ + var ceil = Math.ceil, + clearTimeout = context.clearTimeout, + floor = Math.floor, + fnToString = Function.prototype.toString, + getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectProto.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + setTimeout = context.setTimeout, + splice = arrayRef.splice, + unshift = arrayRef.unshift; + + /** Used to set meta data on functions */ + var defineProperty = (function() { + // IE 8 only accepts DOM elements + try { + var o = {}, + func = isNative(func = Object.defineProperty) && func, + result = func(o, o, o) && func; + } catch(e) { } + return result; + }()); + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, + nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = context.isFinite, + nativeIsNaN = context.isNaN, + nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random; + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[funcClass] = Function; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /** Used to avoid iterating non-enumerable properties in IE < 9 */ + var nonEnumProps = {}; + nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; + nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; + nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; + nonEnumProps[objectClass] = { 'constructor': true }; + + (function() { + var length = shadowedProps.length; + while (length--) { + var key = shadowedProps[length]; + for (var className in nonEnumProps) { + if (hasOwnProperty.call(nonEnumProps, className) && !hasOwnProperty.call(nonEnumProps[className], key)) { + nonEnumProps[className][key] = false; + } + } + } + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps the given value to enable intuitive + * method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * Chaining is supported in custom builds as long as the `value` method is + * implicitly or explicitly included in the build. + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, + * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, + * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, + * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, + * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, + * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, + * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, + * and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, + * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, + * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, + * `template`, `unescape`, `uniqueId`, and `value` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * provided, otherwise they return unwrapped values. + * + * Explicit chaining can be enabled by using the `_.chain` method. + * + * @name _ + * @constructor + * @category Chaining + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(num) { + * return num * num; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor + return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) + ? value + : new lodashWrapper(value); + } + + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap in a `lodash` instance. + * @param {boolean} chainAll A flag to enable chaining for all methods + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value, chainAll) { + this.__chain__ = !!chainAll; + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + + /** + * An object used to flag environments features. + * + * @static + * @memberOf _ + * @type Object + */ + var support = lodash.support = {}; + + (function() { + var ctor = function() { this.x = 1; }, + object = { '0': 1, 'length': 1 }, + props = []; + + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var key in new ctor) { props.push(key); } + for (key in arguments) { } + + /** + * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.argsClass = toString.call(arguments) == argsClass; + + /** + * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5). + * + * @memberOf _.support + * @type boolean + */ + support.argsObject = arguments.constructor == Object && !(arguments instanceof Array); + + /** + * Detect if `name` or `message` properties of `Error.prototype` are + * enumerable by default. (IE < 9, Safari < 5.1) + * + * @memberOf _.support + * @type boolean + */ + support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); + + /** + * Detect if `prototype` properties are enumerable by default. + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly sets a function's `prototype` property [[Enumerable]] + * value to `true`. + * + * @memberOf _.support + * @type boolean + */ + support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); + + /** + * Detect if functions can be decompiled by `Function#toString` + * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). + * + * @memberOf _.support + * @type boolean + */ + support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); + + /** + * Detect if `Function#name` is supported (all but IE). + * + * @memberOf _.support + * @type boolean + */ + support.funcNames = typeof Function.name == 'string'; + + /** + * Detect if `arguments` object indexes are non-enumerable + * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumArgs = key != 0; + + /** + * Detect if properties shadowing those on `Object.prototype` are non-enumerable. + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well (a.k.a the JScript [[DontEnum]] bug). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumShadows = !/valueOf/.test(props); + + /** + * Detect if own properties are iterated after inherited properties (all but IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.ownLast = props[0] != 'x'; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + * + * @memberOf _.support + * @type boolean + */ + support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]); + + /** + * Detect lack of support for accessing string characters by index. + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + * + * @memberOf _.support + * @type boolean + */ + support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a DOM node's [[Class]] is resolvable (all but IE < 9) + * and that the JS engine errors when attempting to coerce an object to + * a string without a `toString` function. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); + } catch(e) { + support.nodeClass = true; + } + }(1)); + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Object} data The data object used to populate the text. + * @returns {string} Returns the interpolated text. + */ + var iteratorTemplate = function(obj) { + + var __p = 'var index, iterable = ' + + (obj.firstArg) + + ', result = ' + + (obj.init) + + ';\nif (!iterable) return result;\n' + + (obj.top) + + ';'; + if (obj.array) { + __p += '\nvar length = iterable.length; index = -1;\nif (' + + (obj.array) + + ') { '; + if (support.unindexedChars) { + __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; + } + __p += '\n while (++index < length) {\n ' + + (obj.loop) + + ';\n }\n}\nelse { '; + } else if (support.nonEnumArgs) { + __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + + (obj.loop) + + ';\n }\n } else { '; + } + + if (support.enumPrototypes) { + __p += '\n var skipProto = typeof iterable == \'function\';\n '; + } + + if (support.enumErrorProps) { + __p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n '; + } + + var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); } + + if (obj.useHas && obj.keys) { + __p += '\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'; + if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + } else { + __p += '\n for (index in iterable) {\n'; + if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); } if (conditions.length) { + __p += ' if (' + + (conditions.join(' && ')) + + ') {\n '; + } + __p += + (obj.loop) + + '; '; + if (conditions.length) { + __p += '\n }'; + } + __p += '\n } '; + if (support.nonEnumShadows) { + __p += '\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 '; + for (k = 0; k < 7; k++) { + __p += '\n index = \'' + + (obj.shadowedProps[k]) + + '\';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))'; + if (!obj.useHas) { + __p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])'; + } + __p += ') {\n ' + + (obj.loop) + + ';\n } '; + } + __p += '\n } '; + } + + } + + if (obj.array || support.nonEnumArgs) { + __p += '\n}'; + } + __p += + (obj.bottom) + + ';\nreturn result'; + + return __p + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.bind` that creates the bound function and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new bound function. + */ + function baseBind(bindData) { + var func = bindData[0], + partialArgs = bindData[2], + thisArg = bindData[4]; + + function bound() { + // `Function#bind` spec + // http://es5.github.io/#x15.3.4.5 + if (partialArgs) { + // avoid `arguments` object deoptimizations by using `slice` instead + // of `Array.prototype.slice.call` and not assigning `arguments` to a + // variable as a ternary expression + var args = slice(partialArgs); + push.apply(args, arguments); + } + // mimic the constructor's `return` behavior + // http://es5.github.io/#x13.2.2 + if (this instanceof bound) { + // ensure `new bound` is an instance of `func` + var thisBinding = baseCreate(func.prototype), + result = func.apply(thisBinding, args || arguments); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisArg, args || arguments); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.clone` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, callback, stackA, stackB) { + if (callback) { + var result = callback(value); + if (typeof result != 'undefined') { + return result; + } + } + // inspect [[Class]] + var isObj = isObject(value); + if (isObj) { + var className = toString.call(value); + if (!cloneableClasses[className] || (!support.nodeClass && isNode(value))) { + return value; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+value); + + case numberClass: + case stringClass: + return new ctor(value); + + case regexpClass: + result = ctor(value.source, reFlags.exec(value)); + result.lastIndex = value.lastIndex; + return result; + } + } else { + return value; + } + var isArr = isArray(value); + if (isDeep) { + // check for circular references and return corresponding clone + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + result = isArr ? ctor(value.length) : {}; + } + else { + result = isArr ? slice(value) : assign({}, value); + } + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + // exit for shallow clone + if (!isDeep) { + return result; + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? baseEach : forOwn)(value, function(objValue, key) { + result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); + }); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(prototype, properties) { + return isObject(prototype) ? nativeCreate(prototype) : {}; + } + // fallback for browsers without `Object.create` + if (!nativeCreate) { + baseCreate = (function() { + function Object() {} + return function(prototype) { + if (isObject(prototype)) { + Object.prototype = prototype; + var result = new Object; + Object.prototype = null; + } + return result || context.Object(); + }; + }()); + } + + /** + * The base implementation of `_.createCallback` without support for creating + * "_.pluck" or "_.where" style callbacks. + * + * @private + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function baseCreateCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + // exit early for no `thisArg` or already bound by `Function#bind` + if (typeof thisArg == 'undefined' || !('prototype' in func)) { + return func; + } + var bindData = func.__bindData__; + if (typeof bindData == 'undefined') { + if (support.funcNames) { + bindData = !func.name; + } + bindData = bindData || !support.funcDecomp; + if (!bindData) { + var source = fnToString.call(func); + if (!support.funcNames) { + bindData = !reFuncName.test(source); + } + if (!bindData) { + // checks if `func` references the `this` keyword and stores the result + bindData = reThis.test(source); + setBindData(func, bindData); + } + } + } + // exit early if there are no `this` references or `func` is bound + if (bindData === false || (bindData !== true && bindData[1] & 1)) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 2: return function(a, b) { + return func.call(thisArg, a, b); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + } + return bind(func, thisArg); + } + + /** + * The base implementation of `createWrapper` that creates the wrapper and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new function. + */ + function baseCreateWrapper(bindData) { + var func = bindData[0], + bitmask = bindData[1], + partialArgs = bindData[2], + partialRightArgs = bindData[3], + thisArg = bindData[4], + arity = bindData[5]; + + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + key = func; + + function bound() { + var thisBinding = isBind ? thisArg : this; + if (partialArgs) { + var args = slice(partialArgs); + push.apply(args, arguments); + } + if (partialRightArgs || isCurry) { + args || (args = slice(arguments)); + if (partialRightArgs) { + push.apply(args, partialRightArgs); + } + if (isCurry && args.length < arity) { + bitmask |= 16 & ~32; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + } + } + args || (args = arguments); + if (isBindKey) { + func = thisBinding[key]; + } + if (this instanceof bound) { + thisBinding = baseCreate(func.prototype); + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.difference` that accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to process. + * @param {Array} [values] The array of values to exclude. + * @returns {Array} Returns a new array of filtered values. + */ + function baseDifference(array, values) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + isLarge = length >= largeArraySize && indexOf === baseIndexOf, + result = []; + + if (isLarge) { + var cache = createCache(values); + if (cache) { + indexOf = cacheIndexOf; + values = cache; + } else { + isLarge = false; + } + } + while (++index < length) { + var value = array[index]; + if (indexOf(values, value) < 0) { + result.push(value); + } + } + if (isLarge) { + releaseObject(values); + } + return result; + } + + /** + * The base implementation of `_.flatten` without support for callback + * shorthands or `thisArg` binding. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns a new flattened array. + */ + function baseFlatten(array, isShallow, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value && typeof value == 'object' && typeof value.length == 'number' + && (isArray(value) || isArguments(value))) { + // recursively flatten arrays (susceptible to call stack limits) + if (!isShallow) { + value = baseFlatten(value, isShallow, isStrict); + } + var valIndex = -1, + valLength = value.length, + resIndex = result.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[resIndex++] = value[valIndex]; + } + } else if (!isStrict) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.isEqual`, without support for `thisArg` binding, + * that allows partial "_.where" style comparisons. + * + * @private + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `a` objects. + * @param {Array} [stackB=[]] Tracks traversed `b` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + if (callback) { + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + !(a && objectTypes[type]) && + !(b && objectTypes[otherType])) { + return false; + } + // exit early for `null` and `undefined` avoiding ES3's Function#call behavior + // http://es5.github.io/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (a != +a) + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == String(b); + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + var aWrapped = hasOwnProperty.call(a, '__wrapped__'), + bWrapped = hasOwnProperty.call(b, '__wrapped__'); + + if (aWrapped || bWrapped) { + return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, + ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && + !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && + ('constructor' in a && 'constructor' in b) + ) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + // compare lengths to determine if a deep comparison is necessary + length = a.length; + size = b.length; + result = size == length; + + if (result || isWhere) { + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (isWhere) { + while (index--) { + if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } + } + else { + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + } + }); + + if (result && !isWhere) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + } + stackA.pop(); + stackB.pop(); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.merge` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} [callback] The function to customize merging properties. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + */ + function baseMerge(object, source, callback, stackA, stackB) { + (isArray(source) ? forEach : forOwn)(source, function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + var isShallow; + if (callback) { + result = callback(value, source); + if ((isShallow = typeof result != 'undefined')) { + value = result; + } + } + if (!isShallow) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!isShallow) { + baseMerge(value, source, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + + /** + * The base implementation of `_.random` without argument juggling or support + * for returning floating-point numbers. + * + * @private + * @param {number} min The minimum possible value. + * @param {number} max The maximum possible value. + * @returns {number} Returns a random number. + */ + function baseRandom(min, max) { + return min + floor(nativeRandom() * (max - min + 1)); + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * or `thisArg` binding. + * + * @private + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function} [callback] The function called per iteration. + * @returns {Array} Returns a duplicate-value-free array. + */ + function baseUniq(array, isSorted, callback) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + indexOf = cacheIndexOf; + seen = cache; + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + if (isLarge) { + releaseArray(seen.array); + releaseObject(seen); + } else if (callback) { + releaseArray(seen); + } + return result; + } + + /** + * Creates a function that aggregates a collection, creating an object composed + * of keys generated from the results of running each element of the collection + * through a callback. The given `setter` function sets the keys and values + * of the composed object. + * + * @private + * @param {Function} setter The setter function. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter) { + return function(collection, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + setter(result, value, callback(value, index, collection), collection); + } + } else { + baseEach(collection, function(value, key, collection) { + setter(result, value, callback(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a function that, when called, either curries or invokes `func` + * with an optional `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of method flags to compose. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` + * 8 - `_.curry` (bound) + * 16 - `_.partial` + * 32 - `_.partialRight` + * @param {Array} [partialArgs] An array of arguments to prepend to those + * provided to the new function. + * @param {Array} [partialRightArgs] An array of arguments to append to those + * provided to the new function. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new function. + */ + function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + isPartial = bitmask & 16, + isPartialRight = bitmask & 32; + + if (!isBindKey && !isFunction(func)) { + throw new TypeError; + } + if (isPartial && !partialArgs.length) { + bitmask &= ~16; + isPartial = partialArgs = false; + } + if (isPartialRight && !partialRightArgs.length) { + bitmask &= ~32; + isPartialRight = partialRightArgs = false; + } + var bindData = func && func.__bindData__; + if (bindData && bindData !== true) { + // clone `bindData` + bindData = slice(bindData); + if (bindData[2]) { + bindData[2] = slice(bindData[2]); + } + if (bindData[3]) { + bindData[3] = slice(bindData[3]); + } + // set `thisBinding` is not previously bound + if (isBind && !(bindData[1] & 1)) { + bindData[4] = thisArg; + } + // set if previously bound but not currently (subsequent curried functions) + if (!isBind && bindData[1] & 1) { + bitmask |= 8; + } + // set curried arity if not yet set + if (isCurry && !(bindData[1] & 4)) { + bindData[5] = arity; + } + // append partial left arguments + if (isPartial) { + push.apply(bindData[2] || (bindData[2] = []), partialArgs); + } + // append partial right arguments + if (isPartialRight) { + unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs); + } + // merge flags + bindData[1] |= bitmask; + return createWrapper.apply(null, bindData); + } + // fast path for `_.bind` + var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {...Object} [options] The compile options object(s). + * @param {string} [options.array] Code to determine if the iterable is an array or array-like. + * @param {boolean} [options.useHas] Specify using `hasOwnProperty` checks in the object loop. + * @param {Function} [options.keys] A reference to `_.keys` for use in own property iteration. + * @param {string} [options.args] A comma separated string of iteration function arguments. + * @param {string} [options.top] Code to execute before the iteration branches. + * @param {string} [options.loop] Code to execute in the object loop. + * @param {string} [options.bottom] Code to execute after the iteration branches. + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + // data properties + iteratorData.shadowedProps = shadowedProps; + + // iterator options + iteratorData.array = iteratorData.bottom = iteratorData.loop = iteratorData.top = ''; + iteratorData.init = 'iterable'; + iteratorData.useHas = true; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + iteratorData[key] = object[key]; + } + } + var args = iteratorData.args; + iteratorData.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'baseCreateCallback, errorClass, errorProto, hasOwnProperty, ' + + 'indicatorObject, isArguments, isArray, isString, keys, objectProto, ' + + 'objectTypes, nonEnumProps, stringClass, stringProto, toString', + 'return function(' + args + ') {\n' + iteratorTemplate(iteratorData) + '\n}' + ); + + // return the compiled function + return factory( + baseCreateCallback, errorClass, errorProto, hasOwnProperty, + indicatorObject, isArguments, isArray, isString, iteratorData.keys, objectProto, + objectTypes, nonEnumProps, stringClass, stringProto, toString + ); + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized, this method returns the custom method, otherwise it returns + * the `baseIndexOf` function. + * + * @private + * @returns {Function} Returns the "indexOf" function. + */ + function getIndexOf() { + var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; + return result; + } + + /** + * Checks if `value` is a native function. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. + */ + function isNative(value) { + return typeof value == 'function' && reNative.test(value); + } + + /** + * Sets `this` binding data on a given function. + * + * @private + * @param {Function} func The function to set data on. + * @param {Array} value The data array to set. + */ + var setBindData = !defineProperty ? noop : function(func, value) { + descriptor.value = value; + defineProperty(func, '__bindData__', descriptor); + }; + + /** + * A fallback implementation of `isPlainObject` which checks if a given value + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + var ctor, + result; + + // avoid non Object objects, `arguments` objects, and DOM elements + if (!(value && toString.call(value) == objectClass) || + (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor)) || + (!support.argsClass && isArguments(value)) || + (!support.nodeClass && isNode(value))) { + return false; + } + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (support.ownLast) { + forIn(value, function(value, key, object) { + result = hasOwnProperty.call(object, key); + return false; + }); + return result !== false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return typeof result == 'undefined' || hasOwnProperty.call(value, result); + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {string} match The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass || false; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (!support.argsClass) { + isArguments = function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; + }; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass || false; + }; + + /** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ + var shimKeys = createIterator({ + 'args': 'object', + 'init': '[]', + 'top': 'if (!(objectTypes[typeof object])) return result', + 'loop': 'result.push(index)' + }); + + /** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + if ((support.enumPrototypes && typeof object == 'function') || + (support.nonEnumArgs && object.length && isArguments(object))) { + return shimKeys(object); + } + return nativeKeys(object); + }; + + /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ + var eachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)", + 'array': "typeof length == 'number'", + 'keys': keys, + 'loop': 'if (callback(iterable[index], index, collection) === false) return result' + }; + + /** Reusable iterator options for `assign` and `defaults` */ + var defaultsIteratorOptions = { + 'args': 'object, source, guard', + 'top': + 'var args = arguments,\n' + + ' argsIndex = 0,\n' + + " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + + 'while (++argsIndex < argsLength) {\n' + + ' iterable = args[argsIndex];\n' + + ' if (iterable && objectTypes[typeof iterable]) {', + 'keys': keys, + 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", + 'bottom': ' }\n}' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'array': false + }; + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), + reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); + + /** + * A function compiled to iterate `arguments` objects, arrays, objects, and + * strings consistenly across environments, executing the callback for each + * element in the collection. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index|key, collection). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @private + * @type Function + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + */ + var baseEach = createIterator(eachIteratorOptions); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite property assignments of previous + * sources. If a callback is provided it will be executed to produce the + * assigned values. The callback is bound to `thisArg` and invoked with two + * arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var object = { 'name': 'barney' }; + * defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var assign = createIterator(defaultsIteratorOptions, { + 'top': + defaultsIteratorOptions.top.replace(';', + ';\n' + + "if (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]' + }); + + /** + * Creates a clone of `value`. If `isDeep` is `true` nested objects will also + * be cloned, otherwise they will be assigned by reference. If a callback + * is provided it will be executed to produce the cloned values. If the + * callback returns `undefined` cloning will be handled by the method instead. + * The callback is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var shallow = _.clone(characters); + * shallow[0] === characters[0]; + * // => true + * + * var deep = _.clone(characters, true); + * deep[0] === characters[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, isDeep, callback, thisArg) { + // allows working with "Collections" methods without using their `index` + // and `collection` arguments for `isDeep` and `callback` + if (typeof isDeep != 'boolean' && isDeep != null) { + thisArg = callback; + callback = isDeep; + isDeep = false; + } + return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates a deep clone of `value`. If a callback is provided it will be + * executed to produce the cloned values. If the callback returns `undefined` + * cloning will be handled by the method instead. The callback is bound to + * `thisArg` and invoked with one argument; (value). + * + * Note: This method is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var deep = _.cloneDeep(characters); + * deep[0] === characters[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : undefined; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? assign(result, properties) : result; + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var object = { 'name': 'barney' }; + * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var defaults = createIterator(defaultsIteratorOptions); + + /** + * This method is like `_.findIndex` except that it returns the key of the + * first element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': false }, + * 'fred': { 'age': 40, 'blocked': true }, + * 'pebbles': { 'age': 1, 'blocked': false } + * }; + * + * _.findKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => 'barney' (property order is not guaranteed across environments) + * + * // using "_.where" callback shorthand + * _.findKey(characters, { 'age': 1 }); + * // => 'pebbles' + * + * // using "_.pluck" callback shorthand + * _.findKey(characters, 'blocked'); + * // => 'fred' + */ + function findKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwn(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * This method is like `_.findKey` except that it iterates over elements + * of a `collection` in the opposite order. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': true }, + * 'fred': { 'age': 40, 'blocked': false }, + * 'pebbles': { 'age': 1, 'blocked': true } + * }; + * + * _.findLastKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => returns `pebbles`, assuming `_.findKey` returns `barney` + * + * // using "_.where" callback shorthand + * _.findLastKey(characters, { 'age': 40 }); + * // => 'fred' + * + * // using "_.pluck" callback shorthand + * _.findLastKey(characters, 'blocked'); + * // => 'pebbles' + */ + function findLastKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwnRight(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * Iterates over own and inherited enumerable properties of an object, + * executing the callback for each property. The callback is bound to `thisArg` + * and invoked with three arguments; (value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forIn(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) + */ + var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * This method is like `_.forIn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forInRight(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move' + */ + function forInRight(object, callback, thisArg) { + var pairs = []; + + forIn(object, function(value, key) { + pairs.push(key, value); + }); + + var length = pairs.length; + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + if (callback(pairs[length--], pairs[length], object) === false) { + break; + } + } + return object; + } + + /** + * Iterates over own enumerable properties of an object, executing the callback + * for each property. The callback is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) + */ + var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + + /** + * This method is like `_.forOwn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' + */ + function forOwnRight(object, callback, thisArg) { + var props = keys(object), + length = props.length; + + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + var key = props[length]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } + + /** + * Creates a sorted array of property names of all enumerable properties, + * own and inherited, of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified property name exists as a direct property of `object`, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to check. + * @returns {boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, key) { + return object ? hasOwnProperty.call(object, key) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'fred', 'second': 'barney' }); + * // => { 'fred': 'first', 'barney': 'second' } + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass || false; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value && typeof value == 'object' && toString.call(value) == dateClass || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value && value.nodeType === 1 || false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + (support.argsClass ? className == argsClass : isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If a callback is provided it will be executed + * to compare values. If the callback returns `undefined` comparisons will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var copy = { 'name': 'fred' }; + * + * object == copy; + * // => false + * + * _.isEqual(object, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg) { + return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2)); + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite` which will return true for + * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN` which will return `true` for + * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || + value && typeof value == 'object' && toString.call(value) == numberClass || false; + } + + /** + * Checks if `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * _.isPlainObject(new Shape); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { + return false; + } + var valueOf = value.valueOf, + objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/fred/); + * // => true + */ + function isRegExp(value) { + return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('fred'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || + value && typeof value == 'object' && toString.call(value) == stringClass || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new object with values of the results of each `callback` execution. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + * + * var characters = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // using "_.pluck" callback shorthand + * _.mapValues(characters, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } + */ + function mapValues(object, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + forOwn(object, function(value, key, object) { + result[key] = callback(value, key, object); + }); + return result; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * will overwrite property assignments of previous sources. If a callback is + * provided it will be executed to produce the merged values of the destination + * and source properties. If the callback returns `undefined` merging will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'characters': [ + * { 'name': 'barney' }, + * { 'name': 'fred' } + * ] + * }; + * + * var ages = { + * 'characters': [ + * { 'age': 36 }, + * { 'age': 40 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object) { + var args = arguments, + length = 2; + + if (!isObject(object)) { + return object; + } + // allows working with `_.reduce` and `_.reduceRight` without using + // their `index` and `collection` arguments + if (typeof args[2] != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + var callback = baseCreateCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + var sources = slice(arguments, 1, length), + index = -1, + stackA = getArray(), + stackB = getArray(); + + while (++index < length) { + baseMerge(object, sources[index], callback, stackA, stackB); + } + releaseArray(stackA); + releaseArray(stackB); + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` omitting the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The properties to omit or the + * function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'fred', 'age': 40 }, 'age'); + * // => { 'name': 'fred' } + * + * _.omit({ 'name': 'fred', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'fred' } + */ + function omit(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var props = []; + forIn(object, function(value, key) { + props.push(key); + }); + props = baseDifference(props, baseFlatten(arguments, true, false, 1)); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + result[key] = object[key]; + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (!callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates a two dimensional array of an object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` picking the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The function called per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name'); + * // => { 'name': 'fred' } + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'fred' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = -1, + props = baseFlatten(arguments, true, false, 1), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * An alternative to `_.reduce` this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable properties through a callback, with each callback execution + * potentially mutating the `accumulator` object. The callback is bound to + * `thisArg` and invoked with four arguments; (accumulator, value, key, object). + * Callbacks may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { + * num *= num; + * if (num % 2) { + * return result.push(num) < 3; + * } + * }); + * // => [1, 9, 25] + * + * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function transform(object, callback, accumulator, thisArg) { + var isArr = isArray(object); + if (accumulator == null) { + if (isArr) { + accumulator = []; + } else { + var ctor = object && object.constructor, + proto = ctor && ctor.prototype; + + accumulator = baseCreate(proto); + } + } + if (callback) { + callback = lodash.createCallback(callback, thisArg, 4); + (isArr ? baseEach : forOwn)(object, function(value, index, object) { + return callback(accumulator, value, index, object); + }); + } + return accumulator; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] (property order is not guaranteed across environments) + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [index] The indexes of `collection` + * to retrieve, specified as individual indexes or arrays of indexes. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['fred', 'barney', 'pebbles'], 0, 2); + * // => ['fred', 'pebbles'] + */ + function at(collection) { + var args = arguments, + index = -1, + props = baseFlatten(args, true, false, 1), + length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length, + result = Array(length); + + if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given value is present in a collection using strict equality + * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the + * offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {*} target The value to check for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.contains('pebbles', 'eb'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + indexOf = getIndexOf(), + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (isArray(collection)) { + result = indexOf(collection, target, fromIndex) > -1; + } else if (typeof length == 'number') { + result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1; + } else { + baseEach(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through the callback. The corresponding value + * of each key is the number of times the key was returned by the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + + /** + * Checks if the given callback returns truey value for **all** elements of + * a collection. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if all elements passed the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes']); + * // => false + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(characters, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(characters, { 'age': 36 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning an array of all elements + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(characters, 'blocked'); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + * + * // using "_.where" callback shorthand + * _.filter(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning the first element that + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect, findWhere + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.find(characters, function(chr) { + * return chr.age < 40; + * }); + * // => { 'name': 'barney', 'age': 36, 'blocked': false } + * + * // using "_.where" callback shorthand + * _.find(characters, { 'age': 1 }); + * // => { 'name': 'pebbles', 'age': 1, 'blocked': false } + * + * // using "_.pluck" callback shorthand + * _.find(characters, 'blocked'); + * // => { 'name': 'fred', 'age': 40, 'blocked': true } + */ + function find(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + return value; + } + } + } else { + var result; + baseEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + } + + /** + * This method is like `_.find` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(num) { + * return num % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forEachRight(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over elements of a collection, executing the callback for each + * element. The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * Note: As with other "Collections" methods, objects with a `length` property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); + * // => logs each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + * // => logs each number and returns the object (property order is not guaranteed across environments) + */ + function forEach(collection, callback, thisArg) { + if (callback && typeof thisArg == 'undefined' && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + baseEach(collection, callback, thisArg); + } + return collection; + } + + /** + * This method is like `_.forEach` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); + * // => logs each number from right to left and returns '3,2,1' + */ + function forEachRight(collection, callback, thisArg) { + var iterable = collection, + length = collection ? collection.length : 0; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (length--) { + if (callback(collection[length], length, collection) === false) { + break; + } + } + } else { + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (support.unindexedChars && isString(collection)) { + iterable = collection.split(''); + } + baseEach(collection, function(value, key, collection) { + key = props ? props[--length] : --length; + return callback(iterable[key], key, collection); + }); + } + return collection; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of a collection through the callback. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of the collection through the given callback. The corresponding + * value of each key is the last element responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keys = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keys, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method named by `methodName` on each element in the `collection` + * returning an array of the results of each invoked method. Additional arguments + * will be provided to each invoked method. If `methodName` is a function it + * will be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|string} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {...*} [arg] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the collection + * through the callback. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (property order is not guaranteed across environments) + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(characters, 'name'); + * // => ['barney', 'fred'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = lodash.createCallback(callback, thisArg, 3); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of a collection. If the collection is empty or + * falsey `-Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.max(characters, function(chr) { return chr.age; }); + * // => { 'name': 'fred', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.max(characters, 'age'); + * // => { 'name': 'fred', 'age': 40 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of a collection. If the collection is empty or + * falsey `Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.min(characters, function(chr) { return chr.age; }); + * // => { 'name': 'barney', 'age': 36 }; + * + * // using "_.pluck" callback shorthand + * _.min(characters, 'age'); + * // => { 'name': 'barney', 'age': 36 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + baseEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the collection. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {string} property The name of the property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.pluck(characters, 'name'); + * // => ['barney', 'fred'] + */ + var pluck = map; + + /** + * Reduces a collection to a value which is the accumulated result of running + * each element in the collection through the callback, where each successive + * callback execution consumes the return value of the previous execution. If + * `accumulator` is not provided the first element of the collection will be + * used as the initial `accumulator` value. The callback is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + baseEach(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is like `_.reduce` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + forEachRight(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter` this method returns the elements of a + * collection that the callback does **not** return truey for. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that failed the callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(characters, 'blocked'); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + * + * // using "_.where" callback shorthand + * _.reject(characters, { 'age': 36 }); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + */ + function reject(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Retrieves a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Allows working with functions like `_.map` + * without using their `index` arguments as `n`. + * @returns {Array} Returns the random sample(s) of `collection`. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + if (collection && typeof collection.length != 'number') { + collection = values(collection); + } else if (support.unindexedChars && isString(collection)) { + collection = collection.split(''); + } + if (n == null || guard) { + return collection ? collection[baseRandom(0, collection.length - 1)] : undefined; + } + var result = shuffle(collection); + result.length = nativeMin(nativeMax(0, n), result.length); + return result; + } + + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates + * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = baseRandom(0, ++index); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the callback returns a truey value for **any** element of a + * collection. The function returns as soon as it finds a passing value and + * does not iterate over the entire collection. The callback is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if any element passed the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(characters, 'blocked'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(characters, { 'age': 1 }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + baseEach(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through the callback. This method + * performs a stable sort, that is, it will preserve the original sort order + * of equal elements. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an array of property names is provided for `callback` the collection + * will be sorted by each property value. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 26 }, + * { 'name': 'fred', 'age': 30 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(_.sortBy(characters, 'age'), _.values); + * // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]] + * + * // sorting by multiple properties + * _.map(_.sortBy(characters, ['name', 'age']), _.values); + * // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + isArr = isArray(callback), + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + if (!isArr) { + callback = lodash.createCallback(callback, thisArg, 3); + } + forEach(collection, function(value, key, collection) { + var object = result[++index] = getObject(); + if (isArr) { + object.criteria = map(callback, function(key) { return value[key]; }); + } else { + (object.criteria = getArray())[0] = callback(value, key, collection); + } + object.index = index; + object.value = value; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + var object = result[length]; + result[length] = object.value; + if (!isArr) { + releaseArray(object.criteria); + } + releaseObject(object); + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return (support.unindexedChars && isString(collection)) + ? collection.split('') + : slice(collection); + } + return values(collection); + } + + /** + * Performs a deep comparison of each element in a `collection` to the given + * `properties` object, returning an array of all elements that have equivalent + * property values. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} props The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given properties. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.where(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }] + * + * _.where(characters, { 'pets': ['dino'] }); + * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array excluding all values of the provided arrays using strict + * equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {...Array} [values] The arrays of values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + return baseDifference(array, baseFlatten(arguments, true, true, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.findIndex(characters, function(chr) { + * return chr.age < 20; + * }); + * // => 2 + * + * // using "_.where" callback shorthand + * _.findIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findIndex(characters, 'blocked'); + * // => 1 + */ + function findIndex(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + if (callback(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of a `collection` from right to left. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': true }, + * { 'name': 'fred', 'age': 40, 'blocked': false }, + * { 'name': 'pebbles', 'age': 1, 'blocked': true } + * ]; + * + * _.findLastIndex(characters, function(chr) { + * return chr.age > 30; + * }); + * // => 1 + * + * // using "_.where" callback shorthand + * _.findLastIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findLastIndex(characters, 'blocked'); + * // => 2 + */ + function findLastIndex(array, callback, thisArg) { + var length = array ? array.length : 0; + callback = lodash.createCallback(callback, thisArg, 3); + while (length--) { + if (callback(array[length], length, array)) { + return length; + } + } + return -1; + } + + /** + * Gets the first element or first `n` elements of an array. If a callback + * is provided elements at the beginning of the array are returned as long + * as the callback returns truey. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); + * // => ['barney', 'fred'] + */ + function first(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[0] : undefined; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `isShallow` + * is truey, the array will only be flattened a single level. If a callback + * is provided each element of the array is passed through the callback before + * flattening. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + * + * var characters = [ + * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * // using "_.pluck" callback shorthand + * _.flatten(characters, 'pets'); + * // => ['hoppy', 'baby puss', 'dino'] + */ + function flatten(array, isShallow, callback, thisArg) { + // juggle arguments + if (typeof isShallow != 'boolean' && isShallow != null) { + thisArg = callback; + callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow; + isShallow = false; + } + if (callback != null) { + array = map(array, callback, thisArg); + } + return baseFlatten(array, isShallow); + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the array is already sorted + * providing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + if (typeof fromIndex == 'number') { + var length = array ? array.length : 0; + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); + } else if (fromIndex) { + var index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element or last `n` elements of an array. If a + * callback is provided elements at the end of the array are excluded from + * the result as long as the callback returns truey. The callback is bound + * to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); + * // => ['barney', 'fred'] + */ + function initial(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Creates an array of unique values present in all provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of shared values. + * @example + * + * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2] + */ + function intersection() { + var args = [], + argsIndex = -1, + argsLength = arguments.length, + caches = getArray(), + indexOf = getIndexOf(), + trustIndexOf = indexOf === baseIndexOf, + seen = getArray(); + + while (++argsIndex < argsLength) { + var value = arguments[argsIndex]; + if (isArray(value) || isArguments(value)) { + args.push(value); + caches.push(trustIndexOf && value.length >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen)); + } + } + var array = args[0], + index = -1, + length = array ? array.length : 0, + result = []; + + outer: + while (++index < length) { + var cache = caches[0]; + value = array[index]; + + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); + while (--argsIndex) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { + continue outer; + } + } + result.push(value); + } + } + while (argsLength--) { + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } + } + releaseArray(caches); + releaseArray(seen); + return result; + } + + /** + * Gets the last element or last `n` elements of an array. If a callback is + * provided elements at the end of the array are returned as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.last(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.last(characters, { 'employer': 'na' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function last(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[length - 1] : undefined; + } + } + return slice(array, nativeMax(0, length - n)); + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all provided values from the given array using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {...*} [value] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + function pull(array) { + var args = arguments, + argsIndex = 0, + argsLength = args.length, + length = array ? array.length : 0; + + while (++argsIndex < argsLength) { + var index = -1, + value = args[argsIndex]; + while (++index < length) { + if (array[index] === value) { + splice.call(array, index--, 1); + length--; + } + } + } + return array; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. If `start` is less than `stop` a + * zero-length range is created unless a negative `step` is specified. + * + * @static + * @memberOf _ + * @category Arrays + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = typeof step == 'number' ? step : (+step || 1); + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so engines like Chakra and V8 avoid slower modes + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / (step || 1))), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * Removes all elements from an array that the callback returns truey for + * and returns an array of removed elements. The callback is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4, 5, 6]; + * var evens = _.remove(array, function(num) { return num % 2 == 0; }); + * + * console.log(array); + * // => [1, 3, 5] + * + * console.log(evens); + * // => [2, 4, 6] + */ + function remove(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = []; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + var value = array[index]; + if (callback(value, index, array)) { + result.push(value); + splice.call(array, index--, 1); + length--; + } + } + return result; + } + + /** + * The opposite of `_.initial` this method gets all but the first element or + * first `n` elements of an array. If a callback function is provided elements + * at the beginning of the array are excluded from the result as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.rest(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.rest(characters, { 'employer': 'slate' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which a value + * should be inserted into a given sorted array in order to maintain the sort + * order of the array. If a callback is provided it will be executed for + * `value` and each element of `array` to compute their sort ranking. The + * callback is bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + (callback(array[mid]) < value) + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Creates an array of unique values, in order, of the provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of combined values. + * @example + * + * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2, 3, 5, 4] + */ + function union() { + return baseUniq(baseFlatten(arguments, true, true)); + } + + /** + * Creates a duplicate-value-free version of an array using strict equality + * for comparisons, i.e. `===`. If the array is sorted, providing + * `true` for `isSorted` will use a faster algorithm. If a callback is provided + * each element of `array` is passed through the callback before uniqueness + * is computed. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); + * // => ['A', 'b', 'C'] + * + * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2.5, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + // juggle arguments + if (typeof isSorted != 'boolean' && isSorted != null) { + thisArg = callback; + callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted; + isSorted = false; + } + if (callback != null) { + callback = lodash.createCallback(callback, thisArg, 3); + } + return baseUniq(array, isSorted, callback); + } + + /** + * Creates an array excluding all provided values using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {...*} [value] The values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + return baseDifference(array, slice(arguments, 1)); + } + + /** + * Creates an array that is the symmetric difference of the provided arrays. + * See http://en.wikipedia.org/wiki/Symmetric_difference. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of values. + * @example + * + * _.xor([1, 2, 3], [5, 2, 1, 4]); + * // => [3, 5, 4] + * + * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); + * // => [1, 4, 5] + */ + function xor() { + var index = -1, + length = arguments.length; + + while (++index < length) { + var array = arguments[index]; + if (isArray(array) || isArguments(array)) { + var result = result + ? baseUniq(baseDifference(result, array).concat(baseDifference(array, result))) + : array; + } + } + return result || []; + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second + * elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @alias unzip + * @category Arrays + * @param {...Array} [array] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + function zip() { + var array = arguments.length > 1 ? arguments : arguments[0], + index = -1, + length = array ? max(pluck(array, 'length')) : 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = pluck(array, index); + } + return result; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Provide + * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` + * or two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @alias object + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */ + function zipObject(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + if (!values && length && !isArray(keys[0])) { + values = []; + } + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that executes `func`, with the `this` binding and + * arguments of the created function, only after being called `n` times. + * + * @static + * @memberOf _ + * @category Functions + * @param {number} n The number of times the function must be called before + * `func` is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('Done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'Done saving!', after all saves have completed + */ + function after(n, func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * provided to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'fred' }, 'hi'); + * func(); + * // => 'hi fred' + */ + function bind(func, thisArg) { + return arguments.length > 2 + ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) + : createWrapper(func, 1, null, null, thisArg); + } + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all the function properties + * of `object` will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...string} [methodName] The object method names to + * bind, specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { console.log('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), + index = -1, + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = createWrapper(object[key], 1, null, null, object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those provided to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {string} key The key of the method. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'fred', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi fred' + * + * object.greet = function(greeting) { + * return greeting + 'ya ' + this.name + '!'; + * }; + * + * func(); + * // => 'hiya fred!' + */ + function bindKey(object, key) { + return arguments.length > 2 + ? createWrapper(key, 19, slice(arguments, 2), null, object) + : createWrapper(key, 3, null, null, object); + } + + /** + * Creates a function that is the composition of the provided functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {...Function} [func] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var realNameMap = { + * 'pebbles': 'penelope' + * }; + * + * var format = function(name) { + * name = realNameMap[name.toLowerCase()] || name; + * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); + * }; + * + * var greet = function(formatted) { + * return 'Hiya ' + formatted + '!'; + * }; + * + * var welcome = _.compose(greet, format); + * welcome('pebbles'); + * // => 'Hiya Penelope!' + */ + function compose() { + var funcs = arguments, + length = funcs.length; + + while (length--) { + if (!isFunction(funcs[length])) { + throw new TypeError; + } + } + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function which accepts one or more arguments of `func` that when + * invoked either executes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` can be specified + * if `func.length` is not sufficient. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @returns {Function} Returns the new curried function. + * @example + * + * var curried = _.curry(function(a, b, c) { + * console.log(a + b + c); + * }); + * + * curried(1)(2)(3); + * // => 6 + * + * curried(1, 2)(3); + * // => 6 + * + * curried(1, 2, 3); + * // => 6 + */ + function curry(func, arity) { + arity = typeof arity == 'number' ? arity : (+arity || func.length); + return createWrapper(func, 4, null, null, null, arity); + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. + * Provide an options object to indicate that `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. Subsequent calls + * to the debounced function will return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {number} wait The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * var lazyLayout = _.debounce(calculateLayout, 150); + * jQuery(window).on('resize', lazyLayout); + * + * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * }); + * + * // ensure `batchLog` is executed once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * source.addEventListener('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * }, false); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + wait = nativeMax(0, wait) || 0; + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = options.leading; + maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); + trailing = 'trailing' in options ? options.trailing : trailing; + } + var delayed = function() { + var remaining = wait - (now() - stamp); + if (remaining <= 0) { + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + var isCalled = trailingCall; + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + } else { + timeoutId = setTimeout(delayed, remaining); + } + }; + + var maxDelayed = function() { + if (timeoutId) { + clearTimeout(timeoutId); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (trailing || (maxWait !== wait)) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + }; + + return function() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + return result; + }; + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { console.log(text); }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */ + function defer(func) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay execution. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { console.log(text); }, 1000, 'later'); + * // => logs 'later' after one second + */ + function delay(func, wait) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it will be used to determine the cache key for storing the result + * based on the arguments provided to the memoized function. By default, the + * first argument provided to the memoized function is used as the cache key. + * The `func` is executed with the `this` binding of the memoized function. + * The result cache is exposed as the `cache` property on the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + * + * fibonacci(9) + * // => 34 + * + * var data = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // modifying the result cache + * var get = _.memoize(function(name) { return data[name]; }, _.identity); + * get('pebbles'); + * // => { 'name': 'pebbles', 'age': 1 } + * + * get.cache.pebbles.name = 'penelope'; + * get('pebbles'); + * // => { 'name': 'penelope', 'age': 1 } + */ + function memoize(func, resolver) { + if (!isFunction(func)) { + throw new TypeError; + } + var memoized = function() { + var cache = memoized.cache, + key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + } + memoized.cache = {}; + return memoized; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those provided to the new function. This + * method is similar to `_.bind` except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('fred'); + * // => 'hi fred' + */ + function partial(func) { + return createWrapper(func, 16, slice(arguments, 1)); + } + + /** + * This method is like `_.partial` except that `partial` arguments are + * appended to those provided to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createWrapper(func, 32, null, slice(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` function + * at most once per every `wait` milliseconds. Provide an options object to + * indicate that `func` should be invoked on the leading and/or trailing edge + * of the `wait` timeout. Subsequent calls to the throttled function will + * return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {number} wait The number of milliseconds to throttle executions to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + * + * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? options.leading : leading; + trailing = 'trailing' in options ? options.trailing : trailing; + } + debounceOptions.leading = leading; + debounceOptions.maxWait = wait; + debounceOptions.trailing = trailing; + + return debounce(func, wait, debounceOptions); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Additional arguments provided to the function are appended + * to those provided to the wrapper function. The wrapper is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

        ' + func(text) + '

        '; + * }); + * + * p('Fred, Wilma, & Pebbles'); + * // => '

        Fred, Wilma, & Pebbles

        ' + */ + function wrap(value, wrapper) { + return createWrapper(wrapper, 16, [value]); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'name': 'fred' }; + * var getter = _.constant(object); + * getter() === object; + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name the created callback will return the property value for a given element. + * If `func` is an object the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // wrap to create custom callback shorthands + * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { + * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); + * return !match ? func(callback, thisArg) : function(object) { + * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * }; + * }); + * + * _.filter(characters, 'age__gt38'); + * // => [{ 'name': 'fred', 'age': 40 }] + */ + function createCallback(func, thisArg, argCount) { + var type = typeof func; + if (func == null || type == 'function') { + return baseCreateCallback(func, thisArg, argCount); + } + // handle "_.pluck" style callback shorthands + if (type != 'object') { + return property(func); + } + var props = keys(func), + key = props[0], + a = func[key]; + + // handle "_.where" style callback shorthands + if (props.length == 1 && a === a && !isObject(a)) { + // fast path the common case of providing an object with a single + // property containing a primitive value + return function(object) { + var b = object[key]; + return a === b && (a !== 0 || (1 / a == 1 / b)); + }; + } + return function(object) { + var length = props.length, + result = false; + + while (length--) { + if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) { + break; + } + } + return result; + }; + } + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Fred, Wilma, & Pebbles'); + * // => 'Fred, Wilma, & Pebbles' + */ + function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'name': 'fred' }; + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds function properties of a source object to the destination object. + * If `object` is a function methods will be added to its prototype as well. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Function|Object} [object=lodash] object The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options] The options object. + * @param {boolean} [options.chain=true] Specify whether the functions added are chainable. + * @example + * + * function capitalize(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * + * _.mixin({ 'capitalize': capitalize }); + * _.capitalize('fred'); + * // => 'Fred' + * + * _('fred').capitalize().value(); + * // => 'Fred' + * + * _.mixin({ 'capitalize': capitalize }, { 'chain': false }); + * _('fred').capitalize(); + * // => 'Fred' + */ + function mixin(object, source, options) { + var chain = true, + methodNames = source && functions(source); + + if (!source || (!options && !methodNames.length)) { + if (options == null) { + options = source; + } + ctor = lodashWrapper; + source = object; + object = lodash; + methodNames = functions(source); + } + if (options === false) { + chain = false; + } else if (isObject(options) && 'chain' in options) { + chain = options.chain; + } + var ctor = object, + isFunc = isFunction(ctor); + + forEach(methodNames, function(methodName) { + var func = object[methodName] = source[methodName]; + if (isFunc) { + ctor.prototype[methodName] = function() { + var chainAll = this.__chain__, + value = this.__wrapped__, + args = [value]; + + push.apply(args, arguments); + var result = func.apply(object, args); + if (chain || chainAll) { + if (value === result && isObject(result)) { + return this; + } + result = new ctor(result); + result.__chain__ = chainAll; + } + return result; + }; + } + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + context._ = oldDash; + return this; + } + + /** + * A no-operation function. + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var object = { 'name': 'fred' }; + * _.noop(object) === undefined; + * // => true + */ + function noop() { + // no operation performed + } + + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var stamp = _.now(); + * _.defer(function() { console.log(_.now() - stamp); }); + * // => logs the number of milliseconds it took for the deferred function to be called + */ + var now = isNative(now = Date.now) && now || function() { + return new Date().getTime(); + }; + + /** + * Converts the given value into an integer of the specified radix. + * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the + * `value` is a hexadecimal, in which case a `radix` of `16` is used. + * + * Note: This method avoids differences in native ES3 and ES5 `parseInt` + * implementations. See http://es5.github.io/#E. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} value The value to parse. + * @param {number} [radix] The radix used to interpret the value to parse. + * @returns {number} Returns the new integer value. + * @example + * + * _.parseInt('08'); + * // => 8 + */ + var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) { + // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt` + return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0); + }; + + /** + * Creates a "_.pluck" style function, which returns the `key` value of a + * given object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} key The name of the property to retrieve. + * @returns {Function} Returns the new function. + * @example + * + * var characters = [ + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 36 } + * ]; + * + * var getName = _.property('name'); + * + * _.map(characters, getName); + * // => ['barney', 'fred'] + * + * _.sortBy(characters, getName); + * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] + */ + function property(key) { + return function(object) { + return object[key]; + }; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number will be + * returned. If `floating` is truey or either `min` or `max` are floats a + * floating-point number will be returned instead of an integer. + * + * @static + * @memberOf _ + * @category Utilities + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating=false] Specify returning a floating-point number. + * @returns {number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max, floating) { + var noMin = min == null, + noMax = max == null; + + if (floating == null) { + if (typeof min == 'boolean' && noMax) { + floating = min; + min = 1; + } + else if (!noMax && typeof max == 'boolean') { + floating = max; + noMax = true; + } + } + if (noMin && noMax) { + max = 1; + } + min = +min || 0; + if (noMax) { + max = min; + min = 0; + } else { + max = +max || 0; + } + if (floating || min % 1 || max % 1) { + var rand = nativeRandom(); + return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max); + } + return baseRandom(min, max); + } + + /** + * Resolves the value of property `key` on `object`. If `key` is a function + * it will be invoked with the `this` binding of `object` and its result returned, + * else the property value is returned. If `object` is falsey then `undefined` + * is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to resolve. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, key) { + if (object) { + var value = object[key]; + return isFunction(value) ? object[key]() : value; + } + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'fred' }); + * // => 'hello fred' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm i --save lodash\n\n{sudo} npm i -g lodash\nnpm ln lodash\n```\n\nIn [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n// or as Underscore\nvar _ = require('lodash/dist/lodash.underscore');\n```\n\n**Notes:**\n * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL\n * 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 project’s root directory *before* requiring it\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader:\n\n```js\nrequire({\n 'packages': [\n { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }\n ]\n},\n['lodash'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n", + "readmeFilename": "README.md", + "_id": "lodash@2.4.1", + "dist": { + "shasum": "5b7723034dda4d262e5a46fb2c58d7cc22f71420" + }, + "_from": "lodash@~2.4.1", + "_resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz", + "scripts": {} +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/package.json b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/package.json new file mode 100644 index 0000000..63c0fab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/package.json @@ -0,0 +1,58 @@ +{ + "name": "grunt-bowercopy", + "version": "0.7.1", + "description": "Scrupulously manage file locations for bower dependencies.", + "homepage": "https://github.com/timmywil/grunt-bowercopy", + "repository": { + "type": "git", + "url": "https://github.com/timmywil/grunt-bowercopy.git" + }, + "bugs": { + "url": "https://github.com/timmywil/grunt-bowercopy.git/issues" + }, + "author": { + "name": "Timmy Willison", + "email": "timmywillisn@gmail.com", + "url": "http://timmywillison.com" + }, + "keywords": [ + "gruntplugin", + "bowercopy", + "bower", + "copy" + ], + "engines": { + "node": ">= 0.8.0" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "dependencies": { + "bower": "~1.2.8", + "lodash": "~2.4.0", + "glob": "~3.2.8" + }, + "devDependencies": { + "grunt": "~0.4.2", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-jshint": "~0.2.0", + "grunt-contrib-nodeunit": "~0.1.2", + "grunt-contrib-watch": "~0.5.3", + "grunt-jsonlint": "~1.0.4", + "jshint-stylish": "~0.1.3", + "load-grunt-tasks": "~0.2.0" + }, + "scripts": { + "test": "grunt test" + }, + "readme": "# grunt-bowercopy\n[![Build Status](https://travis-ci.org/timmywil/grunt-bowercopy.png?branch=master)](https://travis-ci.org/timmywil/grunt-bowercopy)\n\n> Wrangle those bower dependencies and place each one where it's supposed to be.\n\n- Consistently positions your dependencies where you want them in your repository.\n- Conveniently facilitates [tracking your dependencies](http://addyosmani.com/blog/checking-in-front-end-dependencies/) without committing the entire Bower components folder.\n- Has the potential to reduce build times dramatically. For instance, if you were building a particular source folder for your webapp or website (compiling, concatenating, and minifying JavaScript and CSS), you were forced to include the entire `bower_components` directory in your build to make it work. This plugin clears the detritus.\n\n## Workflow\n\nWhenever you add a new bower dependency, add which file should be copied and where to your Gruntfile `\"bowercopy\"` config. Then, run `grunt bowercopy`.\n\nBy default, bowercopy runs `bower install` for you (turn this off with the `runbower` option). Your bower directory is not removed so you can see which files you need from each component.\nIt is suggested that you add the bower directory (usually `'bower_components'`) to your `.gitignore`.\n\n## Getting Started\nThis plugin requires Grunt.\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-bowercopy --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-bowercopy');\n```\n\n*Note: have a look at [load-grunt-tasks](https://github.com/sindresorhus/load-grunt-tasks) so you can skip this step for all your grunt plugins.*\n\n## The \"bowercopy\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `bowercopy` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n\tbowercopy: {\n\t\toptions: {\n\t\t\t// Task-specific options go here\n\t\t},\n\t\tyour_target: {\n\t\t\t// Target-specific file lists and/or options go here\n\t\t}\n\t}\n});\n```\n\n### Options\n\n#### options.srcPrefix\nType: `String` \nDefault value: The `directory` property value in your `.bowerrc` or `'bower_components'` if the `.bowerrc` cannot be found.\n\n`srcPrefix` will prefix your source locations with the correct bower folder location.\n\n#### options.destPrefix\nType: `String` \nDefault value: `''`\n\n`destPrefix` will be used as the prefix for destinations.\n\n#### options.report\nType: `Boolean` \nDefault value: `true`\n\nReport any modules in your bower.json that have not been configured to copy at least one file with `bowercopy`.\n\n#### options.runBower\nType: `Boolean` \nDefault value: `true`\n\nRun `bower install` in conjunction with the `bowercopy` task.\n\n#### options.clean\nType: `Boolean` \nDefault value: `false`\n\nRemoves the bower components directory on completion. The folder path that is removed is `options.srcPrefix`.\n\n**Note: the directory will only be removed if the following conditions are met.**\n\n 1. All task targets are run (i.e. grunt-bowercopy was run with the command `grunt bowercopy` and not `grunt bowercopy:target`).\n 2. At least one thing was copied from each bower component (grunt-bowercopy tracks this for you).\n\n#### options.copyOptions\nType: `Object` \nDefault value: `{}`\n\nOptions to pass to `grunt.file.copy` when copying the files. See [grunt.file.copy](http://gruntjs.com/api/grunt.file#grunt.file.copy)\n\n### Usage Examples\n\n```js\ngrunt.initConfig({\n\tbowercopy: {\n\t\toptions: {\n\t\t\t// Bower components folder will be removed afterwards\n\t\t\tclean: true\n\t\t},\n\t\t// Anything can be copied\n\t\ttest: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'test/js'\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t// Keys are destinations (prefixed with `options.destPrefix`)\n\t\t\t\t// Values are sources (prefixed with `options.srcPrefix`); One source per destination\n\t\t\t\t// e.g. 'bower_components/chai/lib/chai.js' will be copied to 'test/js/libs/chai.js'\n\t\t\t\t'libs/chai.js': 'chai/lib/chai.js': ,\n\t\t\t\t'mocha/mocha.js': 'libs/mocha/mocha.js',\n\t\t\t\t'mocha/mocha.css': 'libs/mocha/mocha.css'\n\t\t\t}\n\t\t},\n\t\t// Javascript\n\t\tlibs: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'public/js/libs'\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t'jquery.js': 'jquery/jquery.js',\n\t\t\t\t'require.js': 'requirejs/require.js'\n\t\t\t},\n\t\t},\n\t\tplugins: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'public/js/plugins'\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t// Make dependencies follow your naming conventions\n\t\t\t\t'jquery.chosen.js': 'chosen/public/chosen.js'\n\t\t\t}\n\t\t},\n\t\t// Less\n\t\tless: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'less'\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t// If either the src or the dest is not present,\n\t\t\t\t// the specified location will be used for both.\n\t\t\t\t// In other words, this will copy\n\t\t\t\t// 'bower_components/bootstrap/less/dropdowns.less' to 'less/bootstrap/less/dropdowns.less'\n\t\t\t\t// See http://gruntjs.com/configuring-tasks#files for recommended files formats\n\t\t\t\tsrc: 'bootstrap/less/dropdowns.less'\n\t\t\t}\n\t\t},\n\t\t// Images\n\t\timages: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'public/images'\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t'account/chosen-sprite.png': 'chosen/public/chosen-sprite.png',\n\t\t\t\t'account/chosen-sprite@2x.png': 'chosen/public/chosen-sprite@2x.png'\n\t\t\t}\n\t\t},\n\t\t// Entire folders\n\t\tfolders: {\n\t\t\tfiles: {\n\t\t\t\t// Note: when copying folders, the destination (key) will be used as the location for the folder\n\t\t\t\t'public/js/libs/lodash': 'lodash'\n\t\t\t}\n\t\t},\n\t\t// Glob patterns\n\t\tglob: {\n\t\t\tfiles: {\n\t\t\t\t// When using glob patterns, destinations are *always* folder names\n\t\t\t\t// into which matching files will be copied\n\t\t\t\t// Also note that subdirectories are **not** maintained\n\t\t\t\t// if a destination is specified\n\t\t\t\t// For example, one of the files copied here is\n\t\t\t\t// 'lodash/dist/lodash.js' -> 'public/js/libs/lodash/lodash.js'\n\t\t\t\t'public/js/libs/lodash': 'lodash/dist/*.js'\n\t\t\t}\n\t\t},\n\t\t// Glob without destination\n\t\tglobSrc: {\n\t\t\toptions: {\n\t\t\t\tdestPrefix: 'public/js/libs'\n\t\t\t},\n\t\t\t// By not specifying a destination, you are denoting\n\t\t\t// that the lodash directory structure should be maintained\n\t\t\t// when copying.\n\t\t\t// For example, one of the files copied here is\n\t\t\t// 'lodash/dist/lodash.js' -> 'public/js/libs/lodash/dist/lodash.js'\n\t\t\tsrc: 'lodash/**/*.js'\n\t\t}\n\t}\n});\n```\n\n## Contributing\nFollow the same coding style present in the repo and add tests for any bug fix or feature addition.\n\nSee the [CONTRIBUTING.md](https://github.com/timmywil/grunt-bowercopy/blob/master/CONTRIBUTING.md) for more info.\n\n## Release History\n\n- **0.7.1** *1-20-2014* Fix Windows issue with path seperators.\n- **0.7.0** *1-13-2014* Add `options.report`. Camelcase `options.runBower`. Fix an issue with a source format (gh-9).\n- **0.6.0** *1-13-2014* Add glob matcher.\n- **0.5.0** *12-31-2013* Add `options.copyOptions` to be passed along to `grunt.file.copy` and fix issue with local-only bower usage.\n- **0.4.0** *12-3-2013* Update grunt to 0.4.2. Add the ability to copy folders.\n- **0.3.0** *12-2-2013* Add clean option for removing the bower components directory on full task completion.\n- **0.2.0** *11-19-2013* Report any bower components not configured to be copied when all targets are run together.\n- **0.1.0** *11-19-2013* First Release\n\n## License\nCopyright (c) 2013 Timmy Willison. Licensed under the MIT license.\n", + "readmeFilename": "README.md", + "_id": "grunt-bowercopy@0.7.1", + "dist": { + "shasum": "843a8a7161cd9bf8f2e0aff5b6c949b06ccbbaff" + }, + "_from": "grunt-bowercopy@0.7.1", + "_resolved": "https://registry.npmjs.org/grunt-bowercopy/-/grunt-bowercopy-0.7.1.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/tasks/bowercopy.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/tasks/bowercopy.js new file mode 100644 index 0000000..332afb7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/tasks/bowercopy.js @@ -0,0 +1,267 @@ +/* + * grunt-bowercopy + * + * Copyright (c) 2013 Timmy Willison + * Licensed under the MIT license. + */ + +module.exports = function (grunt) { + 'use strict'; + + // Logging + var log = grunt.log, + verbose = grunt.verbose, + fatal = grunt.fatal; + + // Utilities + var _ = require('lodash'); + + // Modules + var path = require('path'), + bower = require('bower'), + glob = require('glob'), + sep = path.sep; + + // Get all modules + var bowerConfig; + try { + bowerConfig = grunt.file.readJSON('bower.json'); + } catch(e) { + return true; + } + var allModules = Object.keys( + _.extend({}, bowerConfig.dependencies, bowerConfig.devDependencies) + ); + var unused = allModules.slice(0); + + // Track number of runs + var numTargets; + var numRuns = 0; + + /** + * Retrieve the number of targets from the grunt config + * @returns {number|undefined} Returns the number of targets, + * or undefined if the bowercopy config could not be found + */ + function getNumTargets() { + if (numTargets) { + return numTargets; + } + var targets = grunt.config('bowercopy'); + if (targets) { + delete targets.options; + numTargets = Object.keys(targets).length; + } + return numTargets; + } + + /** + * Convert from grunt to a cleaner format + * @param {Array} files + */ + function convert(files) { + var converted = []; + files.forEach(function(file) { + // We need originals as the destinations may not yet exist + file = file.orig; + var dest = file.dest; + + // Use destination for source if no source is available + if (!file.src.length) { + converted.push({ + src: dest, + dest: dest + }); + return; + } + + file.src.forEach(function(source) { + converted.push({ + src: source, + dest: dest + }); + }); + }); + return converted; + } + + /** + * Filter out all of the modules represented in the filesSrc array + * @param {Array} modules + * @param {Array} files + * @param {Object} options + */ + function filterRepresented(modules, files, options) { + return _.filter(modules, function(module) { + return !_.some(files, function(file) { + // Look for the module name somewhere in the source path + return path.join(sep, options.srcPrefix, file.src, sep) + .indexOf(sep + module + sep) > -1; + }); + }); + } + + /** + * Ensure all bower dependencies are accounted for + * @param {Array} files Files property from the task + * @param {Object} options + * @returns {boolean} Returns whether all dependencies are accounted for + */ + function ensure(files, options) { + // Update the global array of represented modules + unused = filterRepresented(unused, files, options); + + verbose.writeln('Unrepresented modules list currently at ', unused); + + // Only print message when all targets have been run + if (++numRuns === getNumTargets()) { + if (unused.length) { + if (options.clean) { + log.error('Could not clean directory. Some bower components are not configured: ', unused); + } else if (options.report) { + log.writeln('Some bower components are not configured: ', unused); + } + } else { + // Remove the bower_components directory as it's no longer needed + if (options.clean) { + grunt.file.delete(options.srcPrefix); + log.ok('Bower directory cleaned'); + } + if (options.report) { + log.ok('All modules accounted for'); + } + } + } + } + + /** + * Convert an array of files sources to our format + * @param {Array} files + * @param {Object} options + * @param {String} [dest] A folder destination for all of these sources + */ + function convertMatches(files, options, dest) { + return files.map(function(source) { + return { + src: source, + dest: path.join( + // Build a destination from the new source if no dest + // was specified + dest != null ? + dest : + path.dirname(source).replace(options.srcPrefix + sep, ''), + path.basename(source) + ) + }; + }); + } + + /** + * Copy over specified component files from the bower directory + * files format: [{ src: '', dest: '' }, ...] + * @param {Array} files + * @param {Object} options + */ + function copy(files, options) { + files.forEach(function(file) { + var src = file.src; + // Use source for destination if no destionation is available + // This is done here so globbing can use the original dest + var dest = file.dest || src; + + // Add source prefix if not already added + if (src.indexOf(options.srcPrefix) !== 0) { + src = path.join(options.srcPrefix, src); + } + + // Add dest prefix if not already added + if (dest.indexOf(options.destPrefix) !== 0) { + dest = path.join(options.destPrefix, dest); + } + + // Copy folders + if (grunt.file.isDir(src)) { + grunt.file.recurse(src, function(abspath, rootdir, subdir, filename) { + grunt.file.copy( + abspath, + path.join(dest, subdir || '', filename), + options.copyOptions + ); + }); + log.writeln(src + ' -> ' + dest); + // Copy files + } else if (grunt.file.exists(src)) { + grunt.file.copy(src, dest, options.copyOptions); + log.writeln(src + ' -> ' + dest); + // Glob + } else { + var matches = glob.sync(src); + if (matches.length) { + matches = convertMatches(matches, options, file.dest); + copy(matches, options); + } + } + }); + } + + /** + * Top-level copying run + * files format is Grunt's default: + * [{ orig: { src: '', dest: '' }, src: '', dest: '' }, ...] + * convert to copy()'s format before calling copy() + * @param {Array} files + * @param {Object} options + */ + function run(files, options) { + verbose.writeln('Using srcPrefix: ' + options.srcPrefix); + verbose.writeln('Using destPrefix: ' + options.destPrefix); + + // Build the file list + files = convert(files); + + // Copy files + copy(files, options); + log.ok('Bower components copied to specified locations'); + + // Report if any dependencies have not been copied + ensure(files, options); + } + + grunt.registerMultiTask( + 'bowercopy', + [ + 'Copy only the needed files from bower components', + 'over to their specified file locations' + ].join(' '), + function bowercopy() { + var files = this.files; + + // Options + var options = this.options({ + srcPrefix: bower.config.directory, + destPrefix: '', + report: true, + runBower: true, + clean: false, + copyOptions: {} + }); + + // Back-compat. Non-camelcase + if (options.runBower || options.runbower) { + // Run `bower install` + var done = this.async(); + + bower.commands.install().on('log', function(result) { + log.writeln(['bower', result.id.cyan, result.message].join(' ')); + }).on('error', function(code) { + fatal(code); + }).on('end', function() { + run(files, options); + done(); + }); + } else { + run(files, options); + } + } + ); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/bowercopy_test.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/bowercopy_test.js new file mode 100644 index 0000000..6f2379b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/bowercopy_test.js @@ -0,0 +1,78 @@ +'use strict'; + +var grunt = require('grunt'); + +/* + ======== A Handy Little Nodeunit Reference ======== + https://github.com/caolan/nodeunit + + Test methods: + test.expect(numAssertions) + test.done() + Test assertions: + test.ok(value, [message]) + test.equal(actual, expected, [message]) + test.notEqual(actual, expected, [message]) + test.deepEqual(actual, expected, [message]) + test.notDeepEqual(actual, expected, [message]) + test.strictEqual(actual, expected, [message]) + test.notStrictEqual(actual, expected, [message]) + test.throws(block, [error], [message]) + test.doesNotThrow(block, [error], [message]) + test.ifError(value) +*/ + +exports.bowercopy = { + default_options: function (test) { + test.expect(2); + + test.ok(grunt.file.exists('tmp/js/libs/jquery.js'), 'jQuery file copied to libs directory'); + test.ok(grunt.file.exists('tmp/js/plugins/jquery.panzoom.js'), 'Panzoom file copied to libs directory'); + + test.done(); + }, + prefix_options: function (test) { + test.expect(5); + + test.ok(grunt.file.exists('tmp/js/backbone/backbone.js'), 'Backbone copied to backbone directory'); + test.ok(grunt.file.exists('tmp/js/backbone/backbone-min.js'), 'Backbone copied to backbone directory'); + test.ok(grunt.file.exists('tmp/js/backbone/backbone-min.map'), 'Backbone copied to backbone directory'); + test.ok(grunt.file.exists('tmp/js/backbone/index.html'), 'Backbone copied to backbone directory'); + test.ok(grunt.file.exists('tmp/js/backbone/package.json'), 'Backbone copied to backbone directory'); + + test.done(); + }, + process: function(test) { + test.expect(4); + + test.ok(grunt.file.exists('tmp/js/jquery-ui/jquery.ui.core.js'), 'jQuery UI core copied to jquery-ui directory'); + test.ok(grunt.file.exists('tmp/js/jquery-ui/jquery.ui.widget.js'), 'jQuery UI widget factory copied to jquery-ui directory'); + test.strictEqual(grunt.file.read('tmp/js/jquery-ui/jquery.ui.core.js'), grunt.file.read('test/golden_files/jquery.ui.core.js' ), 'jQuery UI core contains commit hash as its version'); + test.strictEqual(grunt.file.read('tmp/js/jquery-ui/jquery.ui.widget.js'), grunt.file.read('test/golden_files/jquery.ui.widget.js' ), 'jQuery UI widget factory contains commit hash as its version'); + + test.done(); + }, + images: function(test) { + test.expect(2); + + test.ok(grunt.file.exists('tmp/images/chosen/chosen-sprite.png'), 'Copy chosen sprite image'); + test.ok(grunt.file.exists('tmp/images/chosen/chosen-sprite@2x.png'), 'Copy chosen sprite image'); + + test.done(); + }, + glob: function(test) { + test.expect(2); + + test.ok(grunt.file.exists('tmp/js/libs/lodash/dist/lodash.js'), 'Copy lodash files with glob src'); + test.ok(grunt.file.exists('tmp/js/libs/lodash/dist/lodash.compat.js'), 'Copy lodash files with glob src'); + + test.done(); + }, + clean: function(test) { + test.expect(1); + + test.ok(!grunt.file.exists('bower_modules'), 'Remove bower_modules folder'); + + test.done(); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.core.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.core.js new file mode 100644 index 0000000..4e8e38a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.core.js @@ -0,0 +1,293 @@ +/*! + * jQuery UI Core c0ab71056b936627e8a7821f03c044aec6280a40 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */ +(function( $, undefined ) { + +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + +// $.ui might exist from components with no dependencies, e.g., $.ui.position +$.ui = $.ui || {}; + +$.extend( $.ui, { + version: "c0ab71056b936627e8a7821f03c044aec6280a40", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + focus: (function( orig ) { + return function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + orig.apply( this, arguments ); + }; + })( $.fn.focus ), + + scrollParent: function() { + var scrollParent; + if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x")); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x")); + }).eq(0); + } + + return ( /fixed/ ).test( this.css( "position") ) || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; + }, + + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().addBack().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support: jQuery <1.8 +if ( !$( "" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// support: jQuery <1.8 +if ( !$.fn.addBack ) { + $.fn.addBack = function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + }; +} + +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) +if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { + $.fn.removeData = (function( removeData ) { + return function( key ) { + if ( arguments.length ) { + return removeData.call( this, $.camelCase( key ) ); + } else { + return removeData.call( this ); + } + }; + })( $.fn.removeData ); +} + + + + + +// deprecated +$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); + +$.support.selectstart = "onselectstart" in document.createElement( "div" ); +$.fn.extend({ + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
        + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + } +}); + +// $.ui.plugin is deprecated. Use $.widget() extensions instead. +$.ui.plugin = { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args, allowDisconnected ) { + var i, + set = instance.plugins[ name ]; + + if ( !set ) { + return; + } + + if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } +}; + +})( jQuery ); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.widget.js b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.widget.js new file mode 100644 index 0000000..88162b2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-bowercopy/test/golden_files/jquery.ui.widget.js @@ -0,0 +1,523 @@ +/*! + * jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/jQuery.widget/ + */ +(function( $, undefined ) { + +var uuid = 0, + slice = Array.prototype.slice, + _cleanData = $.cleanData; +$.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); +}; + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + // proxiedPrototype allows the provided prototype to remain unmodified + // so that it can be used as a mixin for multiple widgets (#8876) + proxiedPrototype = {}, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( !$.isFunction( value ) ) { + proxiedPrototype[ prop ] = value; + return; + } + proxiedPrototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name + }, proxiedPrototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); + + return constructor; +}; + +$.widget.extend = function( target ) { + var input = slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName || name; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.widget.extend.apply( null, [ options ].concat(args) ) : + options; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( options === "instance" ) { + returnValue = instance; + return false; + } + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, fullName, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
        ", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + $.data( element, this.widgetFullName, this ); + this._on( true, this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( value === undefined ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( value === undefined ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled", !!value ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + + return this; + }, + + enable: function() { + return this._setOptions({ disabled: false }); + }, + disable: function() { + return this._setOptions({ disabled: true }); + }, + + _on: function( suppressDisabledCheck, element, handlers ) { + var delegateElement, + instance = this; + + // no suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } + + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + // accept selectors, DOM elements + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^(\w+)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +})( jQuery ); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/.npmignore new file mode 100644 index 0000000..b785247 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/.npmignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +tmp diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-cli/.travis.yml new file mode 100644 index 0000000..a12e3f0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/AUTHORS b/proj7/jquery-source/jquery/node_modules/grunt-cli/AUTHORS new file mode 100644 index 0000000..a9a3659 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/AUTHORS @@ -0,0 +1,4 @@ +Tyler Kellen (http://goingslowly.com) +Ben Alman (http://gruntjs.com) +Scott González (http://nemikor.com) +Forbes Lindesay (https://github.com/) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/Gruntfile.js new file mode 100644 index 0000000..02fc2ff --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/Gruntfile.js @@ -0,0 +1,49 @@ +/* + * grunt-cli + * http://gruntjs.com/ + * + * Copyright (c) 2012 Tyler Kellen, contributors + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT + */ + +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + jshint: { + all: [ + 'Gruntfile.js', + 'lib/**/*.js', + 'bin/*', + ], + options: { + curly: true, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, + sub: true, + undef: true, + unused: true, + boss: true, + eqnull: true, + node: true, + es5: true + } + }, + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-jshint'); + + // "npm test" runs these tasks + grunt.registerTask('test', ['jshint']); + + // Default task. + grunt.registerTask('default', ['test']); + +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/LICENSE-MIT b/proj7/jquery-source/jquery/node_modules/grunt-cli/LICENSE-MIT new file mode 100644 index 0000000..91df6e9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2012 Tyler Kellen, contributors + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/README.md new file mode 100644 index 0000000..8a0b9fe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/README.md @@ -0,0 +1,30 @@ +# grunt-cli [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-cli.png?branch=master)](http://travis-ci.org/gruntjs/grunt-cli) +> The Grunt command line interface. + +Install this globally and you'll have access to the `grunt` command anywhere on your system. + +```shell +npm install -g grunt-cli +``` + +**Note:** The job of the `grunt` command is to load and run the version of Grunt you have installed locally to your project, irrespective of its version. Starting with Grunt v0.4, you should never install Grunt itself globally. For more information about why, [please read this](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation). + +See the [Getting Started](http://gruntjs.com/getting-started) guide for more information. + +## Shell tab auto-completion +To enable tab auto-completion for Grunt, add one of the following lines to your `~/.bashrc` or `~/.zshrc` file. + +```bash +# Bash, ~/.bashrc +eval "$(grunt --completion=bash)" +``` + +```bash +# Zsh, ~/.zshrc +eval "$(grunt --completion=zsh)" +``` + +## Installing grunt-cli locally +If you prefer the idiomatic Node.js method to get started with a project (`npm install && npm test`) then install grunt-cli locally with `npm install grunt-cli --save-dev`. Then add a script to your `package.json` to run the associated grunt command: `"scripts": { "test": "grunt test" } `. Now `npm test` will use the locally installed `./node_modules/.bin/grunt` executable to run your Grunt commands. + +To read more about npm scripts, please visit the npm docs: [https://npmjs.org/doc/misc/npm-scripts.html](https://npmjs.org/doc/misc/npm-scripts.html). diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/bin/grunt b/proj7/jquery-source/jquery/node_modules/grunt-cli/bin/grunt new file mode 100755 index 0000000..691f875 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/bin/grunt @@ -0,0 +1,45 @@ +#!/usr/bin/env node + +'use strict'; + +process.title = 'grunt'; + +// Especially badass external libs. +var findup = require('findup-sync'); +var resolve = require('resolve').sync; + +// Internal libs. +var options = require('../lib/cli').options; +var completion = require('../lib/completion'); +var info = require('../lib/info'); +var path = require('path'); + + +var basedir = process.cwd(); +var gruntpath; + +// Do stuff based on CLI options. +if ('completion' in options) { + completion.print(options.completion); +} else if (options.version) { + info.version(); +} else if (options.base && !options.gruntfile) { + basedir = path.resolve(options.base); +} else if (options.gruntfile) { + basedir = path.resolve(path.dirname(options.gruntfile)); +} + +try { + gruntpath = resolve('grunt', {basedir: basedir}); +} catch (ex) { + gruntpath = findup('lib/grunt.js'); + // No grunt install found! + if (!gruntpath) { + if (options.version) { process.exit(); } + if (options.help) { info.help(); } + info.fatal('Unable to find local grunt.', 99); + } +} + +// Everything looks good. Require local grunt and run it. +require(gruntpath).cli(); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/bash b/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/bash new file mode 100755 index 0000000..99a96b5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/bash @@ -0,0 +1,49 @@ +#!/bin/bash + +# grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable bash completion for grunt, add the following line (minus the +# leading #, which is the bash comment character) to your ~/.bashrc file: +# +# eval "$(grunt --completion=bash)" + +# Search the current directory and all parent directories for a gruntfile. +function _grunt_gruntfile() { + local curpath="$PWD" + while [[ "$curpath" ]]; do + for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do + if [[ -e "$gruntfile" ]]; then + echo "$gruntfile" + return + fi + done + curpath="${curpath%/*}" + done + return 1 +} + +# Enable bash autocompletion. +function _grunt_completions() { + # The currently-being-completed word. + local cur="${COMP_WORDS[COMP_CWORD]}" + # The current gruntfile, if it exists. + local gruntfile="$(_grunt_gruntfile)" + # The current grunt version, available tasks, options, etc. + local gruntinfo="$(grunt --version --verbose 2>/dev/null)" + # Options and tasks. + local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')" + local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')" + # Only add -- or - options if the user has started typing - + [[ "$cur" == -* ]] && compls="$compls $opts" + # Tell complete what stuff to show. + COMPREPLY=($(compgen -W "$compls" -- "$cur")) +} + +complete -o default -F _grunt_completions grunt diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/zsh b/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/zsh new file mode 100755 index 0000000..f39cca2 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/completion/zsh @@ -0,0 +1,37 @@ +#!/bin/zsh + +# grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable zsh completion for grunt, add the following line (minus the +# leading #, which is the zsh comment character) to your ~/.zshrc file: +# +# eval "$(grunt --completion=zsh)" + +# Enable zsh autocompletion. +function _grunt_completion() { + local completions + # The currently-being-completed word. + local cur="${words[@]}" + # The current grunt version, available tasks, options, etc. + local gruntinfo="$(grunt --version --verbose 2>/dev/null)" + # Options and tasks. + local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')" + local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')" + # Only add -- or - options if the user has started typing - + [[ "$cur" == -* ]] && compls="$compls $opts" + # Trim whitespace. + compls=$(echo "$compls" | sed -e 's/^ *//g' -e 's/ *$//g') + # Turn compls into an array to of completions. + completions=(${=compls}) + # Tell complete what stuff to show. + compadd -- $completions +} + +compdef _grunt_completion grunt diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/cli.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/cli.js new file mode 100644 index 0000000..fc096d4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/cli.js @@ -0,0 +1,24 @@ +/* + * grunt-cli + * http://gruntjs.com/ + * + * Copyright (c) 2012 Tyler Kellen, contributors + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT + */ + +'use strict'; + +// External lib. +var nopt = require('nopt'); + +// CLI options we care about. +exports.known = {help: Boolean, version: Boolean, completion: String}; +exports.aliases = {h: '--help', V: '--version', v: '--verbose'}; + +// Parse them and return an options object. +Object.defineProperty(exports, 'options', { + get: function() { + return nopt(exports.known, exports.aliases, process.argv, 2); + } +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/completion.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/completion.js new file mode 100644 index 0000000..eecee06 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/completion.js @@ -0,0 +1,34 @@ +/* + * grunt-cli + * http://gruntjs.com/ + * + * Copyright (c) 2012 Tyler Kellen, contributors + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT + */ + +'use strict'; + +// Nodejs libs. +var fs = require('fs'); +var path = require('path'); + +exports.print = function(name) { + var code = 0; + var filepath = path.join(__dirname, '../completion', name); + var output; + try { + // Attempt to read shell completion file. + output = String(fs.readFileSync(filepath)); + } catch (err) { + code = 5; + output = 'echo "Specified grunt shell auto-completion rules '; + if (name && name !== 'true') { + output += 'for \'' + name + '\' '; + } + output += 'not found."'; + } + + console.log(output); + process.exit(code); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/info.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/info.js new file mode 100644 index 0000000..f128f39 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/lib/info.js @@ -0,0 +1,51 @@ +/* + * grunt-cli + * http://gruntjs.com/ + * + * Copyright (c) 2012 Tyler Kellen, contributors + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT + */ + +'use strict'; + +// Project metadata. +var pkg = require('../package.json'); + +// Display grunt-cli version. +exports.version = function() { + console.log('grunt-cli v' + pkg.version); +}; + +// Show help, then exit with a message and error code. +exports.fatal = function(msg, code) { + exports.helpHeader(); + console.log('Fatal error: ' + msg); + console.log(''); + exports.helpFooter(); + process.exit(code); +}; + +// Show help and exit. +exports.help = function() { + exports.helpHeader(); + exports.helpFooter(); + process.exit(); +}; + +// Help header. +exports.helpHeader = function() { + console.log('grunt-cli: ' + pkg.description + ' (v' + pkg.version + ')'); + console.log(''); +}; + +// Help footer. +exports.helpFooter = function() { + [ + 'If you\'re seeing this message, either a Gruntfile wasn\'t found or grunt', + 'hasn\'t been installed locally to your project. For more information about', + 'installing and configuring grunt, please see the Getting Started guide:', + '', + 'http://gruntjs.com/getting-started', + ].forEach(function(str) { console.log(str); }); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/.bin/nopt b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/.bin/nopt new file mode 120000 index 0000000..6b6566e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/.jshintrc new file mode 100644 index 0000000..6d171b8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/.jshintrc @@ -0,0 +1,16 @@ +{ + "loopfunc": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "unused": true, + "boss": true, + "eqnull": true, + "node": true, + "es5": true +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/Gruntfile.js new file mode 100644 index 0000000..2f964a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/Gruntfile.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + nodeunit: { + files: ['test/**/*_test.js'], + }, + jshint: { + options: { + jshintrc: '.jshintrc' + }, + all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'] + } + }); + + // Load plugins. + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + + // Default task. + grunt.registerTask('default', ['jshint', 'nodeunit']); + +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/LICENSE-MIT b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/LICENSE-MIT new file mode 100644 index 0000000..bb2aad6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 "Cowboy" Ben Alman + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/README.md new file mode 100644 index 0000000..3b08b4e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/README.md @@ -0,0 +1,44 @@ +# findup-sync + +Find the first file matching a given pattern in the current directory or the nearest ancestor directory. + +## Getting Started +Install the module with: `npm install findup-sync` + +```js +var findup = require('findup-sync'); + +// Start looking in the CWD. +var filepath1 = findup('{a,b}*.txt'); + +// Start looking somewhere else, and ignore case (probably a good idea). +var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); +``` + +## Usage + +```js +findup(patternOrPatterns [, minimatchOptions]) +``` + +### patternOrPatterns +Type: `String` or `Array` +Default: none + +One or more wildcard glob patterns. Or just filenames. + +### minimatchOptions +Type: `Object` +Default: `{}` + +Options to be passed to [minimatch](https://github.com/isaacs/minimatch). + +Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. + +## Contributing +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). + +## Release History +2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. +2012-11-15 - v0.1.1 - Now works without an options object. +2012-11-01 - v0.1.0 - Initial release. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/lib/findup-sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/lib/findup-sync.js new file mode 100644 index 0000000..742a478 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/lib/findup-sync.js @@ -0,0 +1,46 @@ +/* + * findup-sync + * https://github.com/cowboy/node-findup-sync + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + */ + +'use strict'; + +// Nodejs libs. +var path = require('path'); + +// External libs. +var glob = require('glob'); +var _ = require('lodash'); + +// Search for a filename in the given directory or all parent directories. +module.exports = function(patterns, options) { + // Normalize patterns to an array. + if (!Array.isArray(patterns)) { patterns = [patterns]; } + // Create globOptions so that it can be modified without mutating the + // original object. + var globOptions = Object.create(options || {}); + globOptions.maxDepth = 1; + globOptions.cwd = path.resolve(globOptions.cwd || '.'); + + var files, lastpath; + do { + // Search for files matching patterns. + files = _(patterns).map(function(pattern) { + return glob.sync(pattern, globOptions); + }).flatten().uniq().value(); + // Return file if found. + if (files.length > 0) { + return path.resolve(path.join(globOptions.cwd, files[0])); + } + // Go up a directory. + lastpath = globOptions.cwd; + globOptions.cwd = path.resolve(globOptions.cwd, '..'); + // If parentpath is the same as basedir, we can't go any higher. + } while (globOptions.cwd !== lastpath); + + // No files were found! + return null; +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.npmignore new file mode 100644 index 0000000..2af4b71 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.npmignore @@ -0,0 +1,2 @@ +.*.swp +test/a/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.travis.yml new file mode 100644 index 0000000..baa0031 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/README.md new file mode 100644 index 0000000..6e27df6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/README.md @@ -0,0 +1,233 @@ +# Glob + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +## Attention: node-glob users! + +The API has changed dramatically between 2.x and 3.x. This library is +now 100% JavaScript, and the integer flags have been replaced with an +options object. + +Also, there's an event emitter class, proper tests, and all the other +things you've come to expect from node modules. + +And best of all, no compilation! + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Features + +Please see the [minimatch +documentation](https://github.com/isaacs/minimatch) for more details. + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options] + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instanting the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `error` The error encountered. When an error is encountered, the + glob object is in an undefined state, and should be discarded. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `abort` Stop the search. + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the glob object, as well. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. It will cause + ELOOP to be triggered one level sooner in the case of cyclical + symbolic links. +* `silent` When an unusual error is encountered + when attempting to read a directory, a warning will be printed to + stderr. Set the `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered + when attempting to read a directory, the process will just continue on + in search of other matches. Set the `strict` option to raise an error + in these cases. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary to + set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. + Set this flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `nocase` Perform a case-insensitive match. Note that case-insensitive + filesystems will sometimes result in glob returning results that are + case-insensitively matched anyway, since readdir and stat will not + raise an error. +* `debug` Set to enable debug logging in minimatch and glob. +* `globDebug` Set to enable debug logging in glob, but not minimatch. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. **Note that this is different from the way that `**` is +handled by ruby's `Dir` class.** + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the statCache object is reused between glob calls. + +Users are thus advised not to use a glob result as a +guarantee of filesystem state in the face of rapid changes. +For the vast majority of operations, this is never a problem. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/g.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/g.js new file mode 100644 index 0000000..be122df --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/g.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "test/a/**/[cg]/../[cg]" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/usr-local.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/usr-local.js new file mode 100644 index 0000000..327a425 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/examples/usr-local.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "{./*/*,/*,/usr/local/*}" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/glob.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/glob.js new file mode 100644 index 0000000..891c883 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/glob.js @@ -0,0 +1,643 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// readdir(PREFIX) as ENTRIES +// If fails, END +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + + + +module.exports = glob + +var fs = require("graceful-fs") +, minimatch = require("minimatch") +, Minimatch = minimatch.Minimatch +, inherits = require("inherits") +, EE = require("events").EventEmitter +, path = require("path") +, isDir = {} +, assert = require("assert").ok + +function glob (pattern, options, cb) { + if (typeof options === "function") cb = options, options = {} + if (!options) options = {} + + if (typeof options === "number") { + deprecated() + return + } + + var g = new Glob(pattern, options, cb) + return g.sync ? g.found : g +} + +glob.fnmatch = deprecated + +function deprecated () { + throw new Error("glob's interface has changed. Please see the docs.") +} + +glob.sync = globSync +function globSync (pattern, options) { + if (typeof options === "number") { + deprecated() + return + } + + options = options || {} + options.sync = true + return glob(pattern, options) +} + + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options, cb) + } + + if (typeof cb === "function") { + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) + }) + } + + options = options || {} + + this.EOF = {} + this._emitQueue = [] + + this.maxDepth = options.maxDepth || 1000 + this.maxLength = options.maxLength || Infinity + this.statCache = options.statCache || {} + + this.changedCwd = false + var cwd = process.cwd() + if (!options.hasOwnProperty("cwd")) this.cwd = cwd + else { + this.cwd = options.cwd + this.changedCwd = path.resolve(options.cwd) !== cwd + } + + this.root = options.root || path.resolve(this.cwd, "/") + this.root = path.resolve(this.root) + if (process.platform === "win32") + this.root = this.root.replace(/\\/g, "/") + + this.nomount = !!options.nomount + + if (!pattern) { + throw new Error("must provide pattern") + } + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + this.strict = options.strict !== false + this.dot = !!options.dot + this.mark = !!options.mark + this.sync = !!options.sync + this.nounique = !!options.nounique + this.nonull = !!options.nonull + this.nosort = !!options.nosort + this.nocase = !!options.nocase + this.stat = !!options.stat + + this.debug = !!options.debug || !!options.globDebug + if (this.debug) + this.log = console.error + + this.silent = !!options.silent + + var mm = this.minimatch = new Minimatch(pattern, options) + this.options = mm.options + pattern = this.pattern = mm.pattern + + this.error = null + this.aborted = false + + EE.call(this) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + this.minimatch.set.forEach(iterator.bind(this)) + function iterator (pattern, i, set) { + this._process(pattern, 0, i, function (er) { + if (er) this.emit("error", er) + if (-- n <= 0) this._finish() + }) + } +} + +Glob.prototype.log = function () {} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + + var nou = this.nounique + , all = nou ? [] : {} + + for (var i = 0, l = this.matches.length; i < l; i ++) { + var matches = this.matches[i] + this.log("matches[%d] =", i, matches) + // do like the shell, and spit out the literal glob + if (!matches) { + if (this.nonull) { + var literal = this.minimatch.globSet[i] + if (nou) all.push(literal) + else all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) all.push.apply(all, m) + else m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) all = Object.keys(all) + + if (!this.nosort) { + all = all.sort(this.nocase ? alphasorti : alphasort) + } + + if (this.mark) { + // at *some* point we statted all of these + all = all.map(function (m) { + var sc = this.statCache[m] + if (!sc) + return m + var isDir = (Array.isArray(sc) || sc === 2) + if (isDir && m.slice(-1) !== "/") { + return m + "/" + } + if (!isDir && m.slice(-1) === "/") { + return m.replace(/\/+$/, "") + } + return m + }, this) + } + + this.log("emitting end", all) + + this.EOF = this.found = all + this.emitMatch(this.EOF) +} + +function alphasorti (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return alphasort(a, b) +} + +function alphasort (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit("abort") +} + +Glob.prototype.pause = function () { + if (this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = true + this.emit("pause") +} + +Glob.prototype.resume = function () { + if (!this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = false + this.emit("resume") + this._processEmitQueue() + //process.nextTick(this.emit.bind(this, "resume")) +} + +Glob.prototype.emitMatch = function (m) { + this._emitQueue.push(m) + this._processEmitQueue() +} + +Glob.prototype._processEmitQueue = function (m) { + while (!this._processingEmitQueue && + !this.paused) { + this._processingEmitQueue = true + var m = this._emitQueue.shift() + if (!m) { + this._processingEmitQueue = false + break + } + + this.log('emit!', m === this.EOF ? "end" : "match") + + this.emit(m === this.EOF ? "end" : "match", m) + this._processingEmitQueue = false + } +} + +Glob.prototype._process = function (pattern, depth, index, cb_) { + assert(this instanceof Glob) + + var cb = function cb (er, res) { + assert(this instanceof Glob) + if (this.paused) { + if (!this._processQueue) { + this._processQueue = [] + this.once("resume", function () { + var q = this._processQueue + this._processQueue = null + q.forEach(function (cb) { cb() }) + }) + } + this._processQueue.push(cb_.bind(this, er, res)) + } else { + cb_.call(this, er, res) + } + }.bind(this) + + if (this.aborted) return cb() + + if (depth > this.maxDepth) return cb() + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === "string") { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + prefix = pattern.join("/") + this._stat(prefix, function (exists, isDir) { + // either it's there, or it isn't. + // nothing more to do, either way. + if (exists) { + if (prefix && isAbsolute(prefix) && !this.nomount) { + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + this.matches[index] = this.matches[index] || {} + this.matches[index][prefix] = true + this.emitMatch(prefix) + } + return cb() + }) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's "absolute" like /foo/bar, + // or "relative" like "../baz" + prefix = pattern.slice(0, n) + prefix = prefix.join("/") + break + } + + // get the list of entries. + var read + if (prefix === null) read = "." + else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + if (!prefix || !isAbsolute(prefix)) { + prefix = path.join("/", prefix) + } + read = prefix = path.resolve(prefix) + + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } + + this.log('readdir(%j)', read, this.cwd, this.root) + + return this._readdir(read, function (er, entries) { + if (er) { + // not a directory! + // this means that, whatever else comes after this, it can never match + return cb() + } + + // globstar is special + if (pattern[n] === minimatch.GLOBSTAR) { + // test without the globstar, and with every child both below + // and replacing the globstar. + var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] + entries.forEach(function (e) { + if (e.charAt(0) === "." && !this.dot) return + // instead of the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) + // below the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) + }, this) + + // now asyncForEach over this + var l = s.length + , errState = null + s.forEach(function (gsPattern) { + this._process(gsPattern, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l <= 0) return cb() + }) + }, this) + + return + } + + // not a globstar + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = pattern[n] + if (typeof pn === "string") { + var found = entries.indexOf(pn) !== -1 + entries = found ? entries[pn] : [] + } else { + var rawGlob = pattern[n]._glob + , dotOk = this.dot || rawGlob.charAt(0) === "." + + entries = entries.filter(function (e) { + return (e.charAt(0) !== "." || dotOk) && + (typeof pattern[n] === "string" && e === pattern[n] || + e.match(pattern[n])) + }) + } + + // If n === pattern.length - 1, then there's no need for the extra stat + // *unless* the user has specified "mark" or "stat" explicitly. + // We know that they exist, since the readdir returned them. + if (n === pattern.length - 1 && + !this.mark && + !this.stat) { + entries.forEach(function (e) { + if (prefix) { + if (prefix !== "/") e = prefix + "/" + e + else e = prefix + e + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + + if (process.platform === "win32") + e = e.replace(/\\/g, "/") + + this.matches[index] = this.matches[index] || {} + this.matches[index][e] = true + this.emitMatch(e) + }, this) + return cb.call(this) + } + + + // now test all the remaining entries as stand-ins for that part + // of the pattern. + var l = entries.length + , errState = null + if (l === 0) return cb() // no matches possible + entries.forEach(function (e) { + var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) + this._process(p, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l === 0) return cb.call(this) + }) + }, this) + }) + +} + +Glob.prototype._stat = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + this.log('stat', [this.cwd, f, '=', abs]) + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterStat(f, abs, cb, er) + } + + if (this.statCache.hasOwnProperty(f)) { + var exists = this.statCache[f] + , isDir = exists && (Array.isArray(exists) || exists === 2) + if (this.sync) return cb.call(this, !!exists, isDir) + return process.nextTick(cb.bind(this, !!exists, isDir)) + } + + if (this.sync) { + var er, stat + try { + stat = fs.statSync(abs) + } catch (e) { + er = e + } + this._afterStat(f, abs, cb, er, stat) + } else { + fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + } +} + +Glob.prototype._afterStat = function (f, abs, cb, er, stat) { + var exists + assert(this instanceof Glob) + + if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { + this.log("should be ENOTDIR, fake it") + + er = new Error("ENOTDIR, not a directory '" + abs + "'") + er.path = abs + er.code = "ENOTDIR" + stat = null + } + + if (er || !stat) { + exists = false + } else { + exists = stat.isDirectory() ? 2 : 1 + } + this.statCache[f] = this.statCache[f] || exists + cb.call(this, !!exists, exists === 2) +} + +Glob.prototype._readdir = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (isAbsolute(f)) { + abs = f + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + this.log('readdir', [this.cwd, f, abs]) + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterReaddir(f, abs, cb, er) + } + + if (this.statCache.hasOwnProperty(f)) { + var c = this.statCache[f] + if (Array.isArray(c)) { + if (this.sync) return cb.call(this, null, c) + return process.nextTick(cb.bind(this, null, c)) + } + + if (!c || c === 1) { + // either ENOENT or ENOTDIR + var code = c ? "ENOTDIR" : "ENOENT" + , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) + er.path = f + er.code = code + this.log(f, er) + if (this.sync) return cb.call(this, er) + return process.nextTick(cb.bind(this, er)) + } + + // at this point, c === 2, meaning it's a dir, but we haven't + // had to read it yet, or c === true, meaning it's *something* + // but we don't have any idea what. Need to read it, either way. + } + + if (this.sync) { + var er, entries + try { + entries = fs.readdirSync(abs) + } catch (e) { + er = e + } + return this._afterReaddir(f, abs, cb, er, entries) + } + + fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) +} + +Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { + assert(this instanceof Glob) + if (entries && !er) { + this.statCache[f] = entries + // if we haven't asked to stat everything for suresies, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. This also gets us one step + // further into ELOOP territory. + if (!this.mark && !this.stat) { + entries.forEach(function (e) { + if (f === "/") e = f + e + else e = f + "/" + e + this.statCache[e] = true + }, this) + } + + return cb.call(this, er, entries) + } + + // now handle errors, and cache the information + if (er) switch (er.code) { + case "ENOTDIR": // totally normal. means it *does* exist. + this.statCache[f] = 1 + return cb.call(this, er) + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.statCache[f] = false + return cb.call(this, er) + default: // some unusual error. Treat as failure. + this.statCache[f] = false + if (this.strict) this.emit("error", er) + if (!this.silent) console.error("glob error", er) + return cb.call(this, er) + } +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/.npmignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..01af3d6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/README.md @@ -0,0 +1,33 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over fs module + +graceful-fs: + +* keeps track of how many file descriptors are open, and by default + limits this to 1024. Any further requests to open a file are put in a + queue until new slots become available. If 1024 turns out to be too + much, it decreases the limit further. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## Configuration + +The maximum number of open file descriptors that graceful-fs manages may +be adjusted by setting `fs.MAX_OPEN` to a different number. The default +is 1024. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..ca91152 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,442 @@ +// this keeps a queue of opened file descriptors, and will make +// fs operations wait until some have closed before trying to open more. + +var fs = exports = module.exports = {} +fs._originalFs = require("fs") + +Object.getOwnPropertyNames(fs._originalFs).forEach(function(prop) { + var desc = Object.getOwnPropertyDescriptor(fs._originalFs, prop) + Object.defineProperty(fs, prop, desc) +}) + +var queue = [] + , constants = require("constants") + +fs._curOpen = 0 + +fs.MIN_MAX_OPEN = 64 +fs.MAX_OPEN = 1024 + +// prevent EMFILE errors +function OpenReq (path, flags, mode, cb) { + this.path = path + this.flags = flags + this.mode = mode + this.cb = cb +} + +function noop () {} + +fs.open = gracefulOpen + +function gracefulOpen (path, flags, mode, cb) { + if (typeof mode === "function") cb = mode, mode = null + if (typeof cb !== "function") cb = noop + + if (fs._curOpen >= fs.MAX_OPEN) { + queue.push(new OpenReq(path, flags, mode, cb)) + setTimeout(flush) + return + } + open(path, flags, mode, function (er, fd) { + if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { + // that was too many. reduce max, get back in queue. + // this should only happen once in a great while, and only + // if the ulimit -n is set lower than 1024. + fs.MAX_OPEN = fs._curOpen - 1 + return fs.open(path, flags, mode, cb) + } + cb(er, fd) + }) +} + +function open (path, flags, mode, cb) { + cb = cb || noop + fs._curOpen ++ + fs._originalFs.open.call(fs, path, flags, mode, function (er, fd) { + if (er) onclose() + cb(er, fd) + }) +} + +fs.openSync = function (path, flags, mode) { + var ret + ret = fs._originalFs.openSync.call(fs, path, flags, mode) + fs._curOpen ++ + return ret +} + +function onclose () { + fs._curOpen -- + flush() +} + +function flush () { + while (fs._curOpen < fs.MAX_OPEN) { + var req = queue.shift() + if (!req) return + switch (req.constructor.name) { + case 'OpenReq': + open(req.path, req.flags || "r", req.mode || 0777, req.cb) + break + case 'ReaddirReq': + readdir(req.path, req.cb) + break + case 'ReadFileReq': + readFile(req.path, req.options, req.cb) + break + case 'WriteFileReq': + writeFile(req.path, req.data, req.options, req.cb) + break + default: + throw new Error('Unknown req type: ' + req.constructor.name) + } + } +} + +fs.close = function (fd, cb) { + cb = cb || noop + fs._originalFs.close.call(fs, fd, function (er) { + onclose() + cb(er) + }) +} + +fs.closeSync = function (fd) { + try { + return fs._originalFs.closeSync.call(fs, fd) + } finally { + onclose() + } +} + + +// readdir takes a fd as well. +// however, the sync version closes it right away, so +// there's no need to wrap. +// It would be nice to catch when it throws an EMFILE, +// but that's relatively rare anyway. + +fs.readdir = gracefulReaddir + +function gracefulReaddir (path, cb) { + if (fs._curOpen >= fs.MAX_OPEN) { + queue.push(new ReaddirReq(path, cb)) + setTimeout(flush) + return + } + + readdir(path, function (er, files) { + if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { + fs.MAX_OPEN = fs._curOpen - 1 + return fs.readdir(path, cb) + } + cb(er, files) + }) +} + +function readdir (path, cb) { + cb = cb || noop + fs._curOpen ++ + fs._originalFs.readdir.call(fs, path, function (er, files) { + onclose() + cb(er, files) + }) +} + +function ReaddirReq (path, cb) { + this.path = path + this.cb = cb +} + + +fs.readFile = gracefulReadFile + +function gracefulReadFile(path, options, cb) { + if (typeof options === "function") cb = options, options = null + if (typeof cb !== "function") cb = noop + + if (fs._curOpen >= fs.MAX_OPEN) { + queue.push(new ReadFileReq(path, options, cb)) + setTimeout(flush) + return + } + + readFile(path, options, function (er, data) { + if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { + fs.MAX_OPEN = fs._curOpen - 1 + return fs.readFile(path, options, cb) + } + cb(er, data) + }) +} + +function readFile (path, options, cb) { + cb = cb || noop + fs._curOpen ++ + fs._originalFs.readFile.call(fs, path, options, function (er, data) { + onclose() + cb(er, data) + }) +} + +function ReadFileReq (path, options, cb) { + this.path = path + this.options = options + this.cb = cb +} + + + + +fs.writeFile = gracefulWriteFile + +function gracefulWriteFile(path, data, options, cb) { + if (typeof options === "function") cb = options, options = null + if (typeof cb !== "function") cb = noop + + if (fs._curOpen >= fs.MAX_OPEN) { + queue.push(new WriteFileReq(path, data, options, cb)) + setTimeout(flush) + return + } + + writeFile(path, data, options, function (er) { + if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { + fs.MAX_OPEN = fs._curOpen - 1 + return fs.writeFile(path, data, options, cb) + } + cb(er) + }) +} + +function writeFile (path, data, options, cb) { + cb = cb || noop + fs._curOpen ++ + fs._originalFs.writeFile.call(fs, path, data, options, function (er) { + onclose() + cb(er) + }) +} + +function WriteFileReq (path, data, options, cb) { + this.path = path + this.data = data + this.options = options + this.cb = cb +} + + +// (re-)implement some things that are known busted or missing. + +var constants = require("constants") + +// lchmod, broken prior to 0.6.2 +// back-port the fix here. +if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + fs.lchmod = function (path, mode, callback) { + callback = callback || noop + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var err, err2 + try { + var ret = fs.fchmodSync(fd, mode) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } +} + + +// lutimes implementation, or no-op +if (!fs.lutimes) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + cb = cb || noop + if (er) return cb(er) + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + return cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + , err + , err2 + , ret + + try { + var ret = fs.futimesSync(fd, at, mt) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } + + } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { + // maybe utimensat will be bound soonish? + fs.lutimes = function (path, at, mt, cb) { + fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) + } + + fs.lutimesSync = function (path, at, mt) { + return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + + +// https://github.com/isaacs/node-graceful-fs/issues/4 +// Chown should not fail on einval or eperm if non-root. + +fs.chown = chownFix(fs.chown) +fs.fchown = chownFix(fs.fchown) +fs.lchown = chownFix(fs.lchown) + +fs.chownSync = chownFixSync(fs.chownSync) +fs.fchownSync = chownFixSync(fs.fchownSync) +fs.lchownSync = chownFixSync(fs.lchownSync) + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er, res) { + if (chownErOk(er)) er = null + cb(er, res) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + +function chownErOk (er) { + // if there's no getuid, or if getuid() is something other than 0, + // and the error is EINVAL or EPERM, then just ignore it. + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // When running as root, or if other types of errors are encountered, + // then it's strict. + if (!er || (!process.getuid || process.getuid() !== 0) + && (er.code === "EINVAL" || er.code === "EPERM")) return true +} + + +// if lchmod/lchown do not exist, then make them no-ops +if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + process.nextTick(cb) + } + fs.lchmodSync = function () {} +} +if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + process.nextTick(cb) + } + fs.lchownSync = function () {} +} + + + +// on Windows, A/V software can lock the directory, causing this +// to fail with an EACCES or EPERM if the directory contains newly +// created files. Try again on failure, for up to 1 second. +if (process.platform === "win32") { + var rename_ = fs.rename + fs.rename = function rename (from, to, cb) { + var start = Date.now() + rename_(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 1000) { + return rename_(from, to, CB) + } + cb(er) + }) + } +} + + +// if read() returns EAGAIN, then just try it again. +var read = fs.read +fs.read = function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return read.call(fs, fd, buffer, offset, length, position, callback) +} + +var readSync = fs.readSync +fs.readSync = function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..05d8742 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/package.json @@ -0,0 +1,49 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "1.2.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-graceful-fs.git" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "test": "test" + }, + "scripts": { + "test": "tap test/*.js" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "BSD", + "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n limits this to 1024. Any further requests to open a file are put in a\n queue until new slots become available. If 1024 turns out to be too\n much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "homepage": "https://github.com/isaacs/node-graceful-fs", + "_id": "graceful-fs@1.2.3", + "_from": "graceful-fs@~1.2.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/open.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/open.js new file mode 100644 index 0000000..930d532 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/open.js @@ -0,0 +1,46 @@ +var test = require('tap').test +var fs = require('../graceful-fs.js') + +test('graceful fs is not fs', function (t) { + t.notEqual(fs, require('fs')) + t.end() +}) + +test('open an existing file works', function (t) { + var start = fs._curOpen + var fd = fs.openSync(__filename, 'r') + t.equal(fs._curOpen, start + 1) + fs.closeSync(fd) + t.equal(fs._curOpen, start) + fs.open(__filename, 'r', function (er, fd) { + if (er) throw er + t.equal(fs._curOpen, start + 1) + fs.close(fd, function (er) { + if (er) throw er + t.equal(fs._curOpen, start) + t.end() + }) + }) +}) + +test('open a non-existing file throws', function (t) { + var start = fs._curOpen + var er + try { + var fd = fs.openSync('this file does not exist', 'r') + } catch (x) { + er = x + } + t.ok(er, 'should throw') + t.notOk(fd, 'should not get an fd') + t.equal(er.code, 'ENOENT') + t.equal(fs._curOpen, start) + + fs.open('neither does this file', 'r', function (er, fd) { + t.ok(er, 'should throw') + t.notOk(fd, 'should not get an fd') + t.equal(er.code, 'ENOENT') + t.equal(fs._curOpen, start) + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/ulimit.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/ulimit.js new file mode 100644 index 0000000..8d0882d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/graceful-fs/test/ulimit.js @@ -0,0 +1,158 @@ +var test = require('tap').test + +// simulated ulimit +// this is like graceful-fs, but in reverse +var fs_ = require('fs') +var fs = require('../graceful-fs.js') +var files = fs.readdirSync(__dirname) + +// Ok, no more actual file reading! + +var fds = 0 +var nextFd = 60 +var limit = 8 +fs_.open = function (path, flags, mode, cb) { + process.nextTick(function() { + ++fds + if (fds >= limit) { + --fds + var er = new Error('EMFILE Curses!') + er.code = 'EMFILE' + er.path = path + return cb(er) + } else { + cb(null, nextFd++) + } + }) +} + +fs_.openSync = function (path, flags, mode) { + if (fds >= limit) { + var er = new Error('EMFILE Curses!') + er.code = 'EMFILE' + er.path = path + throw er + } else { + ++fds + return nextFd++ + } +} + +fs_.close = function (fd, cb) { + process.nextTick(function () { + --fds + cb() + }) +} + +fs_.closeSync = function (fd) { + --fds +} + +fs_.readdir = function (path, cb) { + process.nextTick(function() { + if (fds >= limit) { + var er = new Error('EMFILE Curses!') + er.code = 'EMFILE' + er.path = path + return cb(er) + } else { + ++fds + process.nextTick(function () { + --fds + cb(null, [__filename, "some-other-file.js"]) + }) + } + }) +} + +fs_.readdirSync = function (path) { + if (fds >= limit) { + var er = new Error('EMFILE Curses!') + er.code = 'EMFILE' + er.path = path + throw er + } else { + return [__filename, "some-other-file.js"] + } +} + + +test('open emfile autoreduce', function (t) { + fs.MIN_MAX_OPEN = 4 + t.equal(fs.MAX_OPEN, 1024) + + var max = 12 + for (var i = 0; i < max; i++) { + fs.open(__filename, 'r', next(i)) + } + + var phase = 0 + + var expect = + [ [ 0, 60, null, 1024, 4, 12, 1 ], + [ 1, 61, null, 1024, 4, 12, 2 ], + [ 2, 62, null, 1024, 4, 12, 3 ], + [ 3, 63, null, 1024, 4, 12, 4 ], + [ 4, 64, null, 1024, 4, 12, 5 ], + [ 5, 65, null, 1024, 4, 12, 6 ], + [ 6, 66, null, 1024, 4, 12, 7 ], + [ 7, 67, null, 6, 4, 5, 1 ], + [ 8, 68, null, 6, 4, 5, 2 ], + [ 9, 69, null, 6, 4, 5, 3 ], + [ 10, 70, null, 6, 4, 5, 4 ], + [ 11, 71, null, 6, 4, 5, 5 ] ] + + var actual = [] + + function next (i) { return function (er, fd) { + if (er) + throw er + actual.push([i, fd, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds]) + + if (i === max - 1) { + t.same(actual, expect) + t.ok(fs.MAX_OPEN < limit) + t.end() + } + + fs.close(fd) + } } +}) + +test('readdir emfile autoreduce', function (t) { + fs.MAX_OPEN = 1024 + var max = 12 + for (var i = 0; i < max; i ++) { + fs.readdir(__dirname, next(i)) + } + + var expect = + [ [0,[__filename,"some-other-file.js"],null,7,4,7,7], + [1,[__filename,"some-other-file.js"],null,7,4,7,6], + [2,[__filename,"some-other-file.js"],null,7,4,7,5], + [3,[__filename,"some-other-file.js"],null,7,4,7,4], + [4,[__filename,"some-other-file.js"],null,7,4,7,3], + [5,[__filename,"some-other-file.js"],null,7,4,6,2], + [6,[__filename,"some-other-file.js"],null,7,4,5,1], + [7,[__filename,"some-other-file.js"],null,7,4,4,0], + [8,[__filename,"some-other-file.js"],null,7,4,3,3], + [9,[__filename,"some-other-file.js"],null,7,4,2,2], + [10,[__filename,"some-other-file.js"],null,7,4,1,1], + [11,[__filename,"some-other-file.js"],null,7,4,0,0] ] + + var actual = [] + + function next (i) { return function (er, files) { + if (er) + throw er + var line = [i, files, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds ] + actual.push(line) + + if (i === max - 1) { + t.ok(fs.MAX_OPEN < limit) + t.same(actual, expect) + t.end() + } + } } +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/README.md new file mode 100644 index 0000000..b2beaed --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/README.md @@ -0,0 +1,51 @@ +A dead simple way to do inheritance in JS. + + var inherits = require("inherits") + + function Animal () { + this.alive = true + } + Animal.prototype.say = function (what) { + console.log(what) + } + + inherits(Dog, Animal) + function Dog () { + Dog.super.apply(this) + } + Dog.prototype.sniff = function () { + this.say("sniff sniff") + } + Dog.prototype.bark = function () { + this.say("woof woof") + } + + inherits(Chihuahua, Dog) + function Chihuahua () { + Chihuahua.super.apply(this) + } + Chihuahua.prototype.bark = function () { + this.say("yip yip") + } + + // also works + function Cat () { + Cat.super.apply(this) + } + Cat.prototype.hiss = function () { + this.say("CHSKKSS!!") + } + inherits(Cat, Animal, { + meow: function () { this.say("miao miao") } + }) + Cat.prototype.purr = function () { + this.say("purr purr") + } + + + var c = new Chihuahua + assert(c instanceof Chihuahua) + assert(c instanceof Dog) + assert(c instanceof Animal) + +The actual function is laughably small. 10-lines small. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/inherits.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/inherits.js new file mode 100644 index 0000000..061b396 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/inherits.js @@ -0,0 +1,29 @@ +module.exports = inherits + +function inherits (c, p, proto) { + proto = proto || {} + var e = {} + ;[c.prototype, proto].forEach(function (s) { + Object.getOwnPropertyNames(s).forEach(function (k) { + e[k] = Object.getOwnPropertyDescriptor(s, k) + }) + }) + c.prototype = Object.create(p.prototype, e) + c.super = p +} + +//function Child () { +// Child.super.call(this) +// console.error([this +// ,this.constructor +// ,this.constructor === Child +// ,this.constructor.super === Parent +// ,Object.getPrototypeOf(this) === Child.prototype +// ,Object.getPrototypeOf(Object.getPrototypeOf(this)) +// === Parent.prototype +// ,this instanceof Child +// ,this instanceof Parent]) +//} +//function Parent () {} +//inherits(Child, Parent) +//new Child diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/package.json new file mode 100644 index 0000000..738a0a5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/inherits/package.json @@ -0,0 +1,30 @@ +{ + "name": "inherits", + "description": "A tiny simple way to do classic inheritance in js", + "version": "1.0.0", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented" + ], + "main": "./inherits.js", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/inherits" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits", + "_id": "inherits@1.0.0", + "_from": "inherits@1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 0000000..978268e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,218 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +Eventually, it will replace the C binding in node-glob. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself. When set, an empty list is returned if there are +no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/minimatch.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..c633f89 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,1055 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + var splitFile = path.basename(f.join("/")).split("/") + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = splitFile + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore new file mode 100644 index 0000000..07e6e47 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS new file mode 100644 index 0000000..4a0bc50 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS @@ -0,0 +1,14 @@ +# Authors, sorted by whether or not they are me +Isaac Z. Schlueter +Brian Cottingham +Carlos Brito Lage +Jesse Dailey +Kevin O'Hara +Marco Rogers +Mark Cavage +Marko Mikulicic +Nathan Rajlich +Satheesh Natesan +Trent Mick +ashleybrener +n4kz diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md new file mode 100644 index 0000000..03ee0f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md @@ -0,0 +1,97 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `n` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 0000000..d1d1381 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,252 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0; + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +// Provided for debugging/dev purposes only. No promises whatsoever that +// this API stays stable. +LRUCache.prototype.dump = function () { + return this._cache +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value) { + if (hOP(this._cache, key)) { + // dispose of the old one before overwriting + if (this._dispose) this._dispose(key, this._cache[key].value) + if (this._maxAge) this._cache[key].now = Date.now() + this._cache[key].value = value + this.get(key) + return true + } + + var len = this._lengthCalculator(value) + var age = this._maxAge ? Date.now() : 0 + var hit = new Entry(key, value, this._mru++, len, age) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + del(this, this._cache[key]) +} + +function get (self, key, doUse) { + var hit = self._cache[key] + if (hit) { + if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now +} + +})() diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json new file mode 100644 index 0000000..4472725 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,33 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.5.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "", + "weak": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" + }, + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache", + "_id": "lru-cache@2.5.0", + "_from": "lru-cache@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js new file mode 100644 index 0000000..f72697c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js @@ -0,0 +1,369 @@ +var test = require("tap").test + , LRU = require("../") + +test("basic", function (t) { + var cache = new LRU({max: 10}) + cache.set("key", "value") + t.equal(cache.get("key"), "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.length, 1) + t.equal(cache.max, 10) + t.end() +}) + +test("least recently set", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.get("a") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), "A") + t.end() +}) + +test("del", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.del("a") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("max", function (t) { + var cache = new LRU(3) + + // test changing the max, verify that the LRU items get dropped. + cache.max = 100 + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + + // now remove the max restriction, and try again. + cache.max = "hello" + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + // should trigger an immediate resize + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + t.end() +}) + +test("reset", function (t) { + var cache = new LRU(10) + cache.set("a", "A") + cache.set("b", "B") + cache.reset() + t.equal(cache.length, 0) + t.equal(cache.max, 10) + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.end() +}) + + +// Note: `.dump()` is a debugging tool only. No guarantees are made +// about the format/layout of the response. +test("dump", function (t) { + var cache = new LRU(10) + var d = cache.dump(); + t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") + cache.set("a", "A") + var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } + t.ok(d.a) + t.equal(d.a.key, "a") + t.equal(d.a.value, "A") + t.equal(d.a.lu, 0) + + cache.set("b", "B") + cache.get("b") + d = cache.dump() + t.ok(d.b) + t.equal(d.b.key, "b") + t.equal(d.b.value, "B") + t.equal(d.b.lu, 2) + + t.end() +}) + + +test("basic with weighed length", function (t) { + var cache = new LRU({ + max: 100, + length: function (item) { return item.size } + }) + cache.set("key", {val: "value", size: 50}) + t.equal(cache.get("key").val, "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.lengthCalculator(cache.get("key")), 50) + t.equal(cache.length, 50) + t.equal(cache.max, 100) + t.end() +}) + + +test("weighed length item too large", function (t) { + var cache = new LRU({ + max: 10, + length: function (item) { return item.size } + }) + t.equal(cache.max, 10) + + // should fall out immediately + cache.set("key", {val: "value", size: 50}) + + t.equal(cache.length, 0) + t.equal(cache.get("key"), undefined) + t.end() +}) + +test("least recently set with weighed length", function (t) { + var cache = new LRU({ + max:8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.set("d", "DDDD") + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("c"), "CCC") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.get("a") + cache.get("b") + cache.set("d", "DDDD") + t.equal(cache.get("c"), undefined) + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("b"), "BB") + t.equal(cache.get("a"), "A") + t.end() +}) + +test("set returns proper booleans", function(t) { + var cache = new LRU({ + max: 5, + length: function (item) { return item.length } + }) + + t.equal(cache.set("a", "A"), true) + + // should return false for max exceeded + t.equal(cache.set("b", "donuts"), false) + + t.equal(cache.set("b", "B"), true) + t.equal(cache.set("c", "CCCC"), true) + t.end() +}) + +test("drop the old items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A") + + setTimeout(function () { + cache.set("b", "b") + t.equal(cache.get("a"), "A") + }, 25) + + setTimeout(function () { + cache.set("c", "C") + // timed out + t.notOk(cache.get("a")) + }, 60) + + setTimeout(function () { + t.notOk(cache.get("b")) + t.equal(cache.get("c"), "C") + }, 90) + + setTimeout(function () { + t.notOk(cache.get("c")) + t.end() + }, 155) +}) + +test("disposal function", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + dispose: function (k, n) { + disposed = n + } + }) + + cache.set(1, 1) + cache.set(2, 2) + t.equal(disposed, 1) + cache.set(3, 3) + t.equal(disposed, 2) + cache.reset() + t.equal(disposed, 3) + t.end() +}) + +test("disposal function on too big of item", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + length: function (k) { + return k.length + }, + dispose: function (k, n) { + disposed = n + } + }) + var obj = [ 1, 2 ] + + t.equal(disposed, false) + cache.set("obj", obj) + t.equal(disposed, obj) + t.end() +}) + +test("has()", function(t) { + var cache = new LRU({ + max: 1, + maxAge: 10 + }) + + cache.set('foo', 'bar') + t.equal(cache.has('foo'), true) + cache.set('blu', 'baz') + t.equal(cache.has('foo'), false) + t.equal(cache.has('blu'), true) + setTimeout(function() { + t.equal(cache.has('blu'), false) + t.end() + }, 15) +}) + +test("stale", function(t) { + var cache = new LRU({ + maxAge: 10, + stale: true + }) + + cache.set('foo', 'bar') + t.equal(cache.get('foo'), 'bar') + t.equal(cache.has('foo'), true) + setTimeout(function() { + t.equal(cache.has('foo'), false) + t.equal(cache.get('foo'), 'bar') + t.equal(cache.get('foo'), undefined) + t.end() + }, 15) +}) + +test("lru update via set", function(t) { + var cache = LRU({ max: 2 }); + + cache.set('foo', 1); + cache.set('bar', 2); + cache.del('bar'); + cache.set('baz', 3); + cache.set('qux', 4); + + t.equal(cache.get('foo'), undefined) + t.equal(cache.get('bar'), undefined) + t.equal(cache.get('baz'), 3) + t.equal(cache.get('qux'), 4) + t.end() +}) + +test("least recently set w/ peek", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + t.equal(cache.peek("a"), "A") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("pop the least used item", function (t) { + var cache = new LRU(3) + , last + + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + + t.equal(cache.length, 3) + t.equal(cache.max, 3) + + // Ensure we pop a, c, b + cache.get("b", "B") + + last = cache.pop() + t.equal(last.key, "a") + t.equal(last.value, "A") + t.equal(cache.length, 2) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "c") + t.equal(last.value, "C") + t.equal(cache.length, 1) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "b") + t.equal(last.value, "B") + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last, null) + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js new file mode 100644 index 0000000..eefb80d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js @@ -0,0 +1,52 @@ +var test = require('tap').test +var LRU = require('../') + +test('forEach', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 9 + l.forEach(function (val, key, cache) { + t.equal(cache, l) + t.equal(key, i.toString()) + t.equal(val, i.toString(2)) + i -= 1 + }) + + // get in order of most recently used + l.get(6) + l.get(8) + + var order = [ 8, 6, 9, 7, 5 ] + var i = 0 + + l.forEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + + t.end() +}) + +test('keys() and values()', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + t.similar(l.keys(), ['9', '8', '7', '6', '5']) + t.similar(l.values(), ['1001', '1000', '111', '110', '101']) + + // get in order of most recently used + l.get(6) + l.get(8) + + t.similar(l.keys(), ['8', '6', '9', '7', '5']) + t.similar(l.values(), ['1000', '110', '1001', '111', '101']) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js new file mode 100644 index 0000000..7af45b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node --expose_gc + +var weak = require('weak'); +var test = require('tap').test +var LRU = require('../') +var l = new LRU({ max: 10 }) +var refs = 0 +function X() { + refs ++ + weak(this, deref) +} + +function deref() { + refs -- +} + +test('no leaks', function (t) { + // fill up the cache + for (var i = 0; i < 100; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var start = process.memoryUsage() + + // capture the memory + var startRefs = refs + + // do it again, but more + for (var i = 0; i < 10000; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var end = process.memoryUsage() + t.equal(refs, startRefs, 'no leaky refs') + + console.error('start: %j\n' + + 'end: %j', start, end); + t.pass(); + t.end(); +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md new file mode 100644 index 0000000..7e36512 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md @@ -0,0 +1,53 @@ +# sigmund + +Quick and dirty signatures for Objects. + +This is like a much faster `deepEquals` comparison, which returns a +string key suitable for caches and the like. + +## Usage + +```javascript +function doSomething (someObj) { + var key = sigmund(someObj, maxDepth) // max depth defaults to 10 + var cached = cache.get(key) + if (cached) return cached) + + var result = expensiveCalculation(someObj) + cache.set(key, result) + return result +} +``` + +The resulting key will be as unique and reproducible as calling +`JSON.stringify` or `util.inspect` on the object, but is much faster. +In order to achieve this speed, some differences are glossed over. +For example, the object `{0:'foo'}` will be treated identically to the +array `['foo']`. + +Also, just as there is no way to summon the soul from the scribblings +of a cocain-addled psychoanalyst, there is no way to revive the object +from the signature string that sigmund gives you. In fact, it's +barely even readable. + +As with `sys.inspect` and `JSON.stringify`, larger objects will +produce larger signature strings. + +Because sigmund is a bit less strict than the more thorough +alternatives, the strings will be shorter, and also there is a +slightly higher chance for collisions. For example, these objects +have the same signature: + + var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} + var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +Like a good Freudian, sigmund is most effective when you already have +some understanding of what you're looking for. It can help you help +yourself, but you must be willing to do some work as well. + +Cycles are handled, and cyclical objects are silently omitted (though +the key is included in the signature output.) + +The second argument is the maximum depth, which defaults to 10, +because that is the maximum object traversal depth covered by most +insurance carriers. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js new file mode 100644 index 0000000..5acfd6d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js @@ -0,0 +1,283 @@ +// different ways to id objects +// use a req/res pair, since it's crazy deep and cyclical + +// sparseFE10 and sigmund are usually pretty close, which is to be expected, +// since they are essentially the same algorithm, except that sigmund handles +// regular expression objects properly. + + +var http = require('http') +var util = require('util') +var sigmund = require('./sigmund.js') +var sreq, sres, creq, cres, test + +http.createServer(function (q, s) { + sreq = q + sres = s + sres.end('ok') + this.close(function () { setTimeout(function () { + start() + }, 200) }) +}).listen(1337, function () { + creq = http.get({ port: 1337 }) + creq.on('response', function (s) { cres = s }) +}) + +function start () { + test = [sreq, sres, creq, cres] + // test = sreq + // sreq.sres = sres + // sreq.creq = creq + // sreq.cres = cres + + for (var i in exports.compare) { + console.log(i) + var hash = exports.compare[i]() + console.log(hash) + console.log(hash.length) + console.log('') + } + + require('bench').runMain() +} + +function customWs (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return customWs(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + customWs(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function custom (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return '' + obj + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return custom(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + custom(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function sparseFE2 (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ':' + ch(v[k], depth + 1) + }) + soFar += '}' + } + ch(obj, 0) + return soFar +} + +function sparseFE (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ch(v[k], depth + 1) + }) + } + ch(obj, 0) + return soFar +} + +function sparse (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ch(v[k], depth + 1) + } + } + ch(obj, 0) + return soFar +} + +function noCommas (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + + +function flatten (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + soFar += ',' + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + +exports.compare = +{ + // 'custom 2': function () { + // return custom(test, 2, 0) + // }, + // 'customWs 2': function () { + // return customWs(test, 2, 0) + // }, + 'JSON.stringify (guarded)': function () { + var seen = [] + return JSON.stringify(test, function (k, v) { + if (typeof v !== 'object' || !v) return v + if (seen.indexOf(v) !== -1) return undefined + seen.push(v) + return v + }) + }, + + 'flatten 10': function () { + return flatten(test, 10) + }, + + // 'flattenFE 10': function () { + // return flattenFE(test, 10) + // }, + + 'noCommas 10': function () { + return noCommas(test, 10) + }, + + 'sparse 10': function () { + return sparse(test, 10) + }, + + 'sparseFE 10': function () { + return sparseFE(test, 10) + }, + + 'sparseFE2 10': function () { + return sparseFE2(test, 10) + }, + + sigmund: function() { + return sigmund(test, 10) + }, + + + // 'util.inspect 1': function () { + // return util.inspect(test, false, 1, false) + // }, + // 'util.inspect undefined': function () { + // util.inspect(test) + // }, + // 'util.inspect 2': function () { + // util.inspect(test, false, 2, false) + // }, + // 'util.inspect 3': function () { + // util.inspect(test, false, 3, false) + // }, + // 'util.inspect 4': function () { + // util.inspect(test, false, 4, false) + // }, + // 'util.inspect Infinity': function () { + // util.inspect(test, false, Infinity, false) + // } +} + +/** results +**/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json new file mode 100644 index 0000000..cb7e2bd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json @@ -0,0 +1,42 @@ +{ + "name": "sigmund", + "version": "1.0.0", + "description": "Quick and dirty signatures for Objects.", + "main": "sigmund.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.3.0" + }, + "scripts": { + "test": "tap test/*.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/sigmund" + }, + "keywords": [ + "object", + "signature", + "key", + "data", + "psychoanalysis" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/sigmund/issues" + }, + "homepage": "https://github.com/isaacs/sigmund", + "_id": "sigmund@1.0.0", + "_from": "sigmund@~1.0.0" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js new file mode 100644 index 0000000..82c7ab8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js @@ -0,0 +1,39 @@ +module.exports = sigmund +function sigmund (subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ''; + var RE = RegExp; + + function psychoAnalyze (subject, session) { + if (session > maxSessions) return; + + if (typeof subject === 'function' || + typeof subject === 'undefined') { + return; + } + + if (typeof subject !== 'object' || !subject || + (subject instanceof RE)) { + analysis += subject; + return; + } + + if (notes.indexOf(subject) !== -1 || session === maxSessions) return; + + notes.push(subject); + analysis += '{'; + Object.keys(subject).forEach(function (issue, _, __) { + // pseudo-private values. skip those. + if (issue.charAt(0) === '_') return; + var to = typeof subject[issue]; + if (to === 'function' || to === 'undefined') return; + analysis += issue; + psychoAnalyze(subject[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; +} + +// vim: set softtabstop=4 shiftwidth=4: diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js new file mode 100644 index 0000000..50c53a1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -0,0 +1,24 @@ +var test = require('tap').test +var sigmund = require('../sigmund.js') + + +// occasionally there are duplicates +// that's an acceptable edge-case. JSON.stringify and util.inspect +// have some collision potential as well, though less, and collision +// detection is expensive. +var hash = '{abc/def/g{0h1i2{jkl' +var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} +var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} + +var obj3 = JSON.parse(JSON.stringify(obj1)) +obj3.c = /def/ +obj3.g[2].cycle = obj3 +var cycleHash = '{abc/def/g{0h1i2{jklcycle' + +test('basic', function (t) { + t.equal(sigmund(obj1), hash) + t.equal(sigmund(obj2), hash) + t.equal(sigmund(obj3), cycleHash) + t.end() +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 0000000..91d861e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.2.14", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@0.2.14", + "_from": "minimatch@0.x.x" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/basic.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/basic.js new file mode 100644 index 0000000..ae7ac73 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/basic.js @@ -0,0 +1,399 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + + +var patterns = + [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + // https://github.com/isaacs/minimatch/issues/5 + , function () { + files = [ 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' + , 'a/b/.x' + , 'a/b/.x/' + , 'a/.x/b' + , '.x' + , '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b/.x/c' + , '.x/.x' ] + } + , ["**/.x/**", [ '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b' + , 'a/b/.x/' + , 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' ] ] + + ] + +var regexps = + [ '/^(?:(?=.)a[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:\\*)$/', + '/^(?:(?=.)\\*[^/]*?)$/', + '/^(?:\\*\\*)$/', + '/^(?:(?=.)b[^/]*?\\/)$/', + '/^(?:(?=.)c[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', + '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', + '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', + '/^(?:(?=.)a[^/]*?[^c])$/', + '/^(?:(?=.)a[X-]b)$/', + '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', + '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[^/]c)$/', + '/^(?:a\\*c)$/', + 'false', + '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', + '/^(?:man\\/man1\\/bash\\.1)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[-abc])$/', + '/^(?:(?!\\.)(?=.)[abc-])$/', + '/^(?:\\\\)$/', + '/^(?:(?!\\.)(?=.)[\\\\])$/', + '/^(?:(?!\\.)(?=.)[\\[])$/', + '/^(?:\\[)$/', + '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[\\]])$/', + '/^(?:(?!\\.)(?=.)[\\]-])$/', + '/^(?:(?!\\.)(?=.)[a-z])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:\\[\\])$/', + '/^(?:\\[abc)$/', + '/^(?:(?=.)XYZ)$/i', + '/^(?:(?=.)ab[^/]*?)$/i', + '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', + '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', + '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', + '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', + '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', + '/^(?:(?=.)a[^/]b)$/', + '/^(?:(?=.)#[^/]*?)$/', + '/^(?!^(?:(?=.)a[^/]*?)$).*$/', + '/^(?:(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)a[^/]*?)$/', + '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] +var re = 0; + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + patterns.forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var m = new mm.Minimatch(pattern, options) + var r = m.makeRe() + var expectRe = regexps[re++] + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + + t.equal(tapOpts.re, expectRe, tapOpts) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/brace-expand.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/brace-expand.js new file mode 100644 index 0000000..7ee278a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/brace-expand.js @@ -0,0 +1,33 @@ +var tap = require("tap") + , minimatch = require("../") + +tap.test("brace expansion", function (t) { + // [ pattern, [expanded] ] + ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" + , [ "abxy" + , "abxz" + , "acdxy" + , "acdxz" + , "acexy" + , "acexz" + , "afhxy" + , "afhxz" + , "aghxy" + , "aghxz" ] ] + , [ "a{1..5}b" + , [ "a1b" + , "a2b" + , "a3b" + , "a4b" + , "a5b" ] ] + , [ "a{b}c", ["a{b}c"] ] + ].forEach(function (tc) { + var p = tc[0] + , expect = tc[1] + t.equivalent(minimatch.braceExpand(p), expect, p) + }) + console.error("ending") + t.end() +}) + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/caching.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/caching.js new file mode 100644 index 0000000..0fec4b0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/caching.js @@ -0,0 +1,14 @@ +var Minimatch = require("../minimatch.js").Minimatch +var tap = require("tap") +tap.test("cache test", function (t) { + var mm1 = new Minimatch("a?b") + var mm2 = new Minimatch("a?b") + t.equal(mm1, mm2, "should get the same object") + // the lru should drop it after 100 entries + for (var i = 0; i < 100; i ++) { + new Minimatch("a"+i) + } + mm2 = new Minimatch("a?b") + t.notEqual(mm1, mm2, "cache should have dropped") + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/defaults.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/defaults.js new file mode 100644 index 0000000..25f1f60 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/defaults.js @@ -0,0 +1,274 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + ; [ "http://www.bashcookbook.com/bashinfo" + + "/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + ].forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var Class = mm.defaults(options).Minimatch + var m = new Class(pattern, {}) + var r = m.makeRe() + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js new file mode 100644 index 0000000..6676e26 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js @@ -0,0 +1,8 @@ +var test = require('tap').test +var minimatch = require('../') + +test('extglob ending with statechar', function(t) { + t.notOk(minimatch('ax', 'a?(b*)')) + t.ok(minimatch('ax', '?(a*|b)')) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/package.json new file mode 100644 index 0000000..fd3bd2e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "3.1.21", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "engines": { + "node": "*" + }, + "dependencies": { + "minimatch": "~0.2.11", + "graceful-fs": "~1.2.0", + "inherits": "1" + }, + "devDependencies": { + "tap": "~0.4.0", + "mkdirp": "0", + "rimraf": "1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "BSD", + "readme": "# Glob\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options]\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the statCache object is reused between glob calls.\n\nUsers are thus advised not to use a glob result as a\nguarantee of filesystem state in the face of rapid changes.\nFor the vast majority of operations, this is never a problem.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob", + "_id": "glob@3.1.21", + "_from": "glob@~3.1.21" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/00-setup.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/00-setup.js new file mode 100644 index 0000000..245afaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/00-setup.js @@ -0,0 +1,176 @@ +// just a little pre-run script to set up the fixtures. +// zz-finish cleans it up + +var mkdirp = require("mkdirp") +var path = require("path") +var i = 0 +var tap = require("tap") +var fs = require("fs") +var rimraf = require("rimraf") + +var files = +[ "a/.abcdef/x/y/z/a" +, "a/abcdef/g/h" +, "a/abcfed/g/h" +, "a/b/c/d" +, "a/bc/e/f" +, "a/c/d/c/b" +, "a/cb/e/f" +] + +var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") +var symlinkFrom = "../.." + +files = files.map(function (f) { + return path.resolve(__dirname, f) +}) + +tap.test("remove fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "remove fixtures") + t.end() + }) +}) + +files.forEach(function (f) { + tap.test(f, function (t) { + var d = path.dirname(f) + mkdirp(d, 0755, function (er) { + if (er) { + t.fail(er) + return t.bailout() + } + fs.writeFile(f, "i like tests", function (er) { + t.ifError(er, "make file") + t.end() + }) + }) + }) +}) + +if (process.platform !== "win32") { + tap.test("symlinky", function (t) { + var d = path.dirname(symlinkTo) + console.error("mkdirp", d) + mkdirp(d, 0755, function (er) { + t.ifError(er) + fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { + t.ifError(er, "make symlink") + t.end() + }) + }) + }) +} + +;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { + w = "/tmp/glob-test/" + w + tap.test("create " + w, function (t) { + mkdirp(w, function (er) { + if (er) + throw er + t.pass(w) + t.end() + }) + }) +}) + + +// generate the bash pattern test-fixtures if possible +if (process.platform === "win32" || !process.env.TEST_REGEN) { + console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") + return +} + +var spawn = require("child_process").spawn; +var globs = + // put more patterns here. + // anything that would be directly in / should be in /tmp/glob-test + ["test/a/*/+(c|g)/./d" + ,"test/a/**/[cg]/../[cg]" + ,"test/a/{b,c,d,e,f}/**/g" + ,"test/a/b/**" + ,"test/**/g" + ,"test/a/abc{fed,def}/g/h" + ,"test/a/abc{fed/g,def}/**/" + ,"test/a/abc{fed/g,def}/**///**/" + ,"test/**/a/**/" + ,"test/+(a|b|c)/a{/,bc*}/**" + ,"test/*/*/*/f" + ,"test/**/f" + ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" + ,"{./*/*,/tmp/glob-test/*}" + ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! + ,"test/a/!(symlink)/**" + ] +var bashOutput = {} +var fs = require("fs") + +globs.forEach(function (pattern) { + tap.test("generate fixture " + pattern, function (t) { + var cmd = "shopt -s globstar && " + + "shopt -s extglob && " + + "shopt -s nullglob && " + + // "shopt >&2; " + + "eval \'for i in " + pattern + "; do echo $i; done\'" + var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) + var out = [] + cp.stdout.on("data", function (c) { + out.push(c) + }) + cp.stderr.pipe(process.stderr) + cp.on("close", function (code) { + out = flatten(out) + if (!out) + out = [] + else + out = cleanResults(out.split(/\r*\n/)) + + bashOutput[pattern] = out + t.notOk(code, "bash test should finish nicely") + t.end() + }) + }) +}) + +tap.test("save fixtures", function (t) { + var fname = path.resolve(__dirname, "bash-results.json") + var data = JSON.stringify(bashOutput, null, 2) + "\n" + fs.writeFile(fname, data, function (er) { + t.ifError(er) + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +function flatten (chunks) { + var s = 0 + chunks.forEach(function (c) { s += c.length }) + var out = new Buffer(s) + s = 0 + chunks.forEach(function (c) { + c.copy(out, s) + s += c.length + }) + + return out.toString().trim() +} + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-comparison.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-comparison.js new file mode 100644 index 0000000..239ed1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-comparison.js @@ -0,0 +1,63 @@ +// basic test +// show that it does the same thing by default as the shell. +var tap = require("tap") +, child_process = require("child_process") +, bashResults = require("./bash-results.json") +, globs = Object.keys(bashResults) +, glob = require("../") +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +globs.forEach(function (pattern) { + var expect = bashResults[pattern] + // anything regarding the symlink thing will fail on windows, so just skip it + if (process.platform === "win32" && + expect.some(function (m) { + return /\/symlink\//.test(m) + })) + return + + tap.test(pattern, function (t) { + glob(pattern, function (er, matches) { + if (er) + throw er + + // sort and unmark, just to match the shell results + matches = cleanResults(matches) + + t.deepEqual(matches, expect, pattern) + t.end() + }) + }) + + tap.test(pattern + " sync", function (t) { + var matches = cleanResults(glob.sync(pattern)) + + t.deepEqual(matches, expect, "should match shell") + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-results.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-results.json new file mode 100644 index 0000000..c227449 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/bash-results.json @@ -0,0 +1,348 @@ +{ + "test/a/*/+(c|g)/./d": [ + "test/a/b/c/./d" + ], + "test/a/**/[cg]/../[cg]": [ + "test/a/abcdef/g/../g", + "test/a/abcfed/g/../g", + "test/a/b/c/../c", + "test/a/c/../c", + "test/a/c/d/c/../c", + "test/a/symlink/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" + ], + "test/a/{b,c,d,e,f}/**/g": [], + "test/a/b/**": [ + "test/a/b", + "test/a/b/c", + "test/a/b/c/d" + ], + "test/**/g": [ + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed,def}/g/h": [ + "test/a/abcdef/g/h", + "test/a/abcfed/g/h" + ], + "test/a/abc{fed/g,def}/**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed/g,def}/**///**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/**/a/**/": [ + "test/a", + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/b", + "test/a/b/c", + "test/a/bc", + "test/a/bc/e", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/cb", + "test/a/cb/e", + "test/a/symlink", + "test/a/symlink/a", + "test/a/symlink/a/b", + "test/a/symlink/a/b/c", + "test/a/symlink/a/b/c/a", + "test/a/symlink/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" + ], + "test/+(a|b|c)/a{/,bc*}/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h" + ], + "test/*/*/*/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/**/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" + ], + "{./*/*,/tmp/glob-test/*}": [ + "./examples/g.js", + "./examples/usr-local.js", + "./node_modules/graceful-fs", + "./node_modules/inherits", + "./node_modules/minimatch", + "./node_modules/mkdirp", + "./node_modules/rimraf", + "./node_modules/tap", + "./test/00-setup.js", + "./test/a", + "./test/bash-comparison.js", + "./test/bash-results.json", + "./test/cwd-test.js", + "./test/mark.js", + "./test/nocase-nomagic.js", + "./test/pause-resume.js", + "./test/root-nomount.js", + "./test/root.js", + "./test/zz-cleanup.js", + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq" + ], + "{/tmp/glob-test/*,*}": [ + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq", + "examples", + "glob.js", + "LICENSE", + "node_modules", + "package.json", + "README.md", + "test" + ], + "test/a/!(symlink)/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h", + "test/a/b", + "test/a/b/c", + "test/a/b/c/d", + "test/a/bc", + "test/a/bc/e", + "test/a/bc/e/f", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/c/d/c/b", + "test/a/cb", + "test/a/cb/e", + "test/a/cb/e/f" + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/cwd-test.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/cwd-test.js new file mode 100644 index 0000000..352c27e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/cwd-test.js @@ -0,0 +1,55 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing cwd and searching for **/d", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('**/d', function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('a', function (t) { + glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'b/c/d', 'c/d' ]) + t.end() + }) + }) + + t.test('a/b', function (t) { + glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('a/b/', function (t) { + glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('.', function (t) { + glob('**/d', {cwd: process.cwd()}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/mark.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/mark.js new file mode 100644 index 0000000..ed68a33 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/mark.js @@ -0,0 +1,74 @@ +var test = require("tap").test +var glob = require('../') +process.chdir(__dirname) + +test("mark, no / on pattern", function (t) { + glob("a/*", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + + if (process.platform !== "win32") + expect.push('a/symlink/') + + t.same(results, expect) + t.end() + }) +}) + +test("mark=false, no / on pattern", function (t) { + glob("a/*", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef', + 'a/abcfed', + 'a/b', + 'a/bc', + 'a/c', + 'a/cb' ] + + if (process.platform !== "win32") + expect.push('a/symlink') + t.same(results, expect) + t.end() + }) +}) + +test("mark=true, / on pattern", function (t) { + glob("a/*/", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }) +}) + +test("mark=false, / on pattern", function (t) { + glob("a/*/", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/nocase-nomagic.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/nocase-nomagic.js new file mode 100644 index 0000000..d862970 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/nocase-nomagic.js @@ -0,0 +1,113 @@ +var fs = require('graceful-fs'); +var test = require('tap').test; +var glob = require('../'); + +test('mock fs', function(t) { + var stat = fs.stat + var statSync = fs.statSync + var readdir = fs.readdir + var readdirSync = fs.readdirSync + + function fakeStat(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = { isDirectory: function() { return true } } + break + case '/tmp/a': + ret = { isDirectory: function() { return false } } + break + } + return ret + } + + fs.stat = function(path, cb) { + var f = fakeStat(path); + if (f) { + process.nextTick(function() { + cb(null, f) + }) + } else { + stat.call(fs, path, cb) + } + } + + fs.statSync = function(path) { + return fakeStat(path) || statSync.call(fs, path) + } + + function fakeReaddir(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = [ 'a', 'A' ] + break + case '/': + ret = ['tmp', 'tMp', 'tMP', 'TMP'] + } + return ret + } + + fs.readdir = function(path, cb) { + var f = fakeReaddir(path) + if (f) + process.nextTick(function() { + cb(null, f) + }) + else + readdir.call(fs, path, cb) + } + + fs.readdirSync = function(path) { + return fakeReaddir(path) || readdirSync.call(fs, path) + } + + t.pass('mocked') + t.end() +}) + +test('nocase, nomagic', function(t) { + var n = 2 + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/a', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) + glob('/tmp/A', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) +}) + +test('nocase, with some magic', function(t) { + t.plan(2) + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/pause-resume.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/pause-resume.js new file mode 100644 index 0000000..e1ffbab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/pause-resume.js @@ -0,0 +1,73 @@ +// show that no match events happen while paused. +var tap = require("tap") +, child_process = require("child_process") +// just some gnarly pattern with lots of matches +, pattern = "test/a/!(symlink)/**" +, bashResults = require("./bash-results.json") +, patterns = Object.keys(bashResults) +, glob = require("../") +, Glob = glob.Glob +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +var globResults = [] +tap.test("use a Glob object, and pause/resume it", function (t) { + var g = new Glob(pattern) + , paused = false + , res = [] + , expect = bashResults[pattern] + + g.on("pause", function () { + console.error("pause") + }) + + g.on("resume", function () { + console.error("resume") + }) + + g.on("match", function (m) { + t.notOk(g.paused, "must not be paused") + globResults.push(m) + g.pause() + t.ok(g.paused, "must be paused") + setTimeout(g.resume.bind(g), 10) + }) + + g.on("end", function (matches) { + t.pass("reached glob end") + globResults = cleanResults(globResults) + matches = cleanResults(matches) + t.deepEqual(matches, globResults, + "end event matches should be the same as match events") + + t.deepEqual(matches, expect, + "glob matches should be the same as bash results") + + t.end() + }) +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root-nomount.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root-nomount.js new file mode 100644 index 0000000..3ac5979 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root-nomount.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing root and searching for /b*/**", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) + }) + + t.test('a', function (t) { + glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root.js new file mode 100644 index 0000000..95c23f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/root.js @@ -0,0 +1,46 @@ +var t = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +var glob = require('../') +var path = require('path') + +t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) +}) + + +t.test('a', function (t) { + console.error("root=" + path.resolve('a')) + glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { + t.ifError(er) + var wanted = [ + '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' + ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + }) + + t.like(matches, wanted) + t.end() + }) +}) + +t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + })) + t.end() + }) +}) + +t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/zz-cleanup.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/zz-cleanup.js new file mode 100644 index 0000000..e085f0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/glob/test/zz-cleanup.js @@ -0,0 +1,11 @@ +// remove the fixtures +var tap = require("tap") +, rimraf = require("rimraf") +, path = require("path") + +tap.test("cleanup fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "removed") + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/README.md new file mode 100644 index 0000000..cac2c65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/README.md @@ -0,0 +1,164 @@ +# Lo-Dash v1.0.1 + +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + +* Lo-Dash builds (for modern environments):
        +[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.js) and +[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.min.js) + +* Lo-Dash compatibility builds (for legacy and modern environments):
        +[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.compat.js) and +[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.compat.min.js) + +* Underscore compatibility builds:
        +[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.underscore.js) and +[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.underscore.min.js) + +* CDN copies of ≤ v1.0.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):
        +[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.js), +[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js),
        +[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.js), +[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.min.js),
        +[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.js), and +[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.min.js) + +* For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need + +## Dive in + +We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). + +For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). + +## Resources + +For more information check out these articles, screencasts, and other videos over Lo-Dash: + + * Posts + - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) + + * Videos + - [Introducing Lo-Dash](https://vimeo.com/44154599) + - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) + - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) + - [Unit testing in Lo-Dash](https://vimeo.com/45865290) + - [Lo-Dash’s 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 + * [_.at](http://lodash.com/docs#at) for cherry-picking collection values + * [_.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 object’s own and inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s 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) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding + * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * [_.where](http://lodash.com/docs#where) supports deep object comparisons + * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), + [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments + * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), + [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings + * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map), + [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands + +## Support + +Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. + +## Installation and usage + +In browsers: + +```html + +``` + +Using [`npm`](http://npmjs.org/): + +```bash +npm install lodash + +npm install -g lodash +npm link 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/): + +```js +var _ = require('lodash'); + +// or as a drop-in replacement for Underscore +var _ = require('lodash/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 project’s root directory before requiring it. + +In [RingoJS v0.7.0-](http://ringojs.org/): + +```js +var _ = require('lodash')._; +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({ + 'paths': { + 'underscore': 'path/to/lodash' + } +}, +['underscore'], function(_) { + console.log(_.VERSION); +}); +``` + +## Release Notes + +### v1.0.1 + + * Add support for specifying source map URLs in `-p`/`--source-map` build options + * Ensured the second argument passed to `_.assign` is not treated as a `callback` + * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL` + * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed + * Made `_.defer` use `setImmediate`, in Node.js, when available + * Made `_.where` search arrays for values regardless of their index position + * Removed dead code from `_.template` + +The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). + +## BestieJS + +Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js new file mode 100644 index 0000000..37ebc92 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js @@ -0,0 +1,5152 @@ +/** + * @license + * Lo-Dash 1.0.1 (Custom Build) + * Build: `lodash -o ./dist/lodash.compat.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.4.4 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * Available under MIT license + */ +;(function(window, undefined) { + + /** Detect free variable `exports` */ + var freeExports = typeof exports == 'object' && exports; + + /** Detect free variable `module` */ + var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; + + /** Detect free variable `global` and use it as `window` */ + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal) { + window = freeGlobal; + } + + /** Used for array and object method references */ + var arrayRef = [], + objectRef = {}; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = objectRef; + + /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ + var largeArraySize = 30; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = window._; + + /** Used to match HTML entities */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g; + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + (objectRef.valueOf + '') + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/valueOf|for [^\]]+/g, '.+?') + '$' + ); + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to match HTML characters */ + var reUnescapedHtml = /[&<>"']/g; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowed = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** Native method shortcuts */ + var ceil = Math.ceil, + concat = arrayRef.concat, + floor = Math.floor, + getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectRef.hasOwnProperty, + push = arrayRef.push, + toString = objectRef.toString; + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, + nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = window.isFinite, + nativeIsNaN = window.isNaN, + nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeRandom = Math.random; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Detect various environments */ + var isIeOpera = !!window.attachEvent, + isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera); + + /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ + var isBindFast = nativeBind && !isV8; + + /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ + var isKeysFast = nativeKeys && (isIeOpera || isV8); + + /** + * Detect the JScript [[DontEnum]] bug: + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well. + */ + var hasDontEnumBug; + + /** + * Detect if a `prototype` properties are enumerable by default: + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly sets a function's `prototype` property [[Enumerable]] + * value to `true`. + */ + var hasEnumPrototype; + + /** Detect if own properties are iterated after inherited properties (IE < 9) */ + var iteratesOwnLast; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects + * incorrectly: + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + */ + var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, + arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); + + /** Detect if `arguments` object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1) */ + var nonEnumArgs = true; + + (function() { + var props = []; + function ctor() { this.x = 1; } + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + for (prop in arguments) { nonEnumArgs = !prop; } + + hasDontEnumBug = !/valueOf/.test(props); + hasEnumPrototype = ctor.propertyIsEnumerable('prototype'); + iteratesOwnLast = props[0] != 'x'; + }(1)); + + /** Detect if `arguments` objects are `Object` objects (all but Opera < 10.5) */ + var argsAreObjects = arguments.constructor == Object; + + /** Detect if `arguments` objects [[Class]] is unresolvable (Firefox < 4, IE < 9) */ + var noArgsClass = !isArguments(arguments); + + /** + * Detect lack of support for accessing string characters by index: + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + */ + var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a DOM node's [[Class]] is unresolvable (IE < 9) + * and that the JS engine won't error when attempting to coerce an object to + * a string without a `toString` function. + */ + try { + var noNodeClass = toString.call(document) == objectClass && !({ 'toString': 0 } + ''); + } catch(e) { } + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object, that wraps the given `value`, to enable method + * chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, + * `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, + * `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, + * `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, + * `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, + * `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, + * `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, + * `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, + * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, + * `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, + * `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * passed, otherwise they return unwrapped values. + * + * @name _ + * @constructor + * @category Chaining + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodash(value) { + // exit early if already wrapped, even if wrapped by a different `lodash` constructor + if (value && typeof value == 'object' && value.__wrapped__) { + return value; + } + // allow invoking `lodash` without the `new` operator + if (!(this instanceof lodash)) { + return new lodash(value); + } + this.__wrapped__ = value; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type String + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Obect} data The data object used to populate the text. + * @returns {String} Returns the interpolated text. + */ + var iteratorTemplate = function(obj) { + + var __p = 'var index, iterable = ' + + (obj.firstArg ) + + ', result = iterable;\nif (!iterable) return result;\n' + + (obj.top ) + + ';\n'; + if (obj.arrays) { + __p += 'var length = iterable.length; index = -1;\nif (' + + (obj.arrays ) + + ') { '; + if (obj.noCharByIndex) { + __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; + } ; + __p += '\n while (++index < length) {\n ' + + (obj.loop ) + + '\n }\n}\nelse { '; + } else if (obj.nonEnumArgs) { + __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + + (obj.loop ) + + '\n }\n } else { '; + } ; + + if (obj.hasEnumPrototype) { + __p += '\n var skipProto = typeof iterable == \'function\';\n '; + } ; + + if (obj.isKeysFast && obj.useHas) { + __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n '; + if (obj.hasEnumPrototype) { + __p += 'if (!(skipProto && index == \'prototype\')) {\n '; + } ; + __p += + (obj.loop ) + + ''; + if (obj.hasEnumPrototype) { + __p += '}\n'; + } ; + __p += ' } '; + } else { + __p += '\n for (index in iterable) {'; + if (obj.hasEnumPrototype || obj.useHas) { + __p += '\n if ('; + if (obj.hasEnumPrototype) { + __p += '!(skipProto && index == \'prototype\')'; + } if (obj.hasEnumPrototype && obj.useHas) { + __p += ' && '; + } if (obj.useHas) { + __p += 'hasOwnProperty.call(iterable, index)'; + } ; + __p += ') { '; + } ; + __p += + (obj.loop ) + + '; '; + if (obj.hasEnumPrototype || obj.useHas) { + __p += '\n }'; + } ; + __p += '\n } '; + } ; + + if (obj.hasDontEnumBug) { + __p += '\n\n var ctor = iterable.constructor;\n '; + for (var k = 0; k < 7; k++) { + __p += '\n index = \'' + + (obj.shadowed[k] ) + + '\';\n if ('; + if (obj.shadowed[k] == 'constructor') { + __p += '!(ctor && ctor.prototype === iterable) && '; + } ; + __p += 'hasOwnProperty.call(iterable, index)) {\n ' + + (obj.loop ) + + '\n } '; + } ; + + } ; + + if (obj.arrays || obj.nonEnumArgs) { + __p += '\n}'; + } ; + __p += + (obj.bottom ) + + ';\nreturn result'; + + + return __p + }; + + /** Reusable iterator options for `assign` and `defaults` */ + var defaultsIteratorOptions = { + 'args': 'object, source, guard', + 'top': + 'var args = arguments,\n' + + ' argsIndex = 0,\n' + + " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + + 'while (++argsIndex < argsLength) {\n' + + ' iterable = args[argsIndex];\n' + + ' if (iterable && objectTypes[typeof iterable]) {', + 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", + 'bottom': ' }\n}' + }; + + /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ + var eachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)", + 'arrays': "typeof length == 'number'", + 'loop': 'if (callback(iterable[index], index, collection) === false) return result' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'arrays': false + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function optimized to search large arrays for a given `value`, + * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @param {Number} [largeSize=30] The length at which an array is considered large. + * @returns {Boolean} Returns `true`, if `value` is found, else `false`. + */ + function cachedContains(array, fromIndex, largeSize) { + fromIndex || (fromIndex = 0); + + var length = array.length, + isLarge = (length - fromIndex) >= (largeSize || largeArraySize); + + if (isLarge) { + var cache = {}, + index = fromIndex - 1; + + while (++index < length) { + // manually coerce `value` to a string because `hasOwnProperty`, in some + // older versions of Firefox, coerces objects incorrectly + var key = array[index] + ''; + (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); + } + } + return function(value) { + if (isLarge) { + var key = value + ''; + return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; + } + return indexOf(array, value, fromIndex) > -1; + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || typeof a == 'undefined') { + return 1; + } + if (a < b || typeof b == 'undefined') { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` binding + * of `thisArg` and prepends any `partialArgs` to the arguments passed to the + * bound function. + * + * @private + * @param {Function|String} func The function to bind or the method name. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Array} partialArgs An array of arguments to be partially applied. + * @param {Object} [rightIndicator] Used to indicate partially applying arguments from the right. + * @returns {Function} Returns the new bound function. + */ + function createBound(func, thisArg, partialArgs, rightIndicator) { + var isFunc = isFunction(func), + isPartial = !partialArgs, + key = thisArg; + + // juggle arguments + if (isPartial) { + partialArgs = thisArg; + } + if (!isFunc) { + thisArg = func; + } + + function bound() { + // `Function#bind` spec + // http://es5.github.com/#x15.3.4.5 + var args = arguments, + thisBinding = isPartial ? this : thisArg; + + if (!isFunc) { + func = thisArg[key]; + } + if (partialArgs.length) { + args = args.length + ? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) + : partialArgs; + } + if (this instanceof bound) { + // ensure `new bound` is an instance of `bound` and `func` + noop.prototype = func.prototype; + thisBinding = new noop; + noop.prototype = null; + + // mimic the constructor's `return` behavior + // http://es5.github.com/#x13.2.2 + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + return bound; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name, the created callback will return the property value for a given element. + * If `func` is an object, the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @private + * @param {Mixed} [func=identity] The value to convert to a callback. + * @param {Mixed} [thisArg] The `this` binding of the created callback. + * @param {Number} [argCount=3] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function createCallback(func, thisArg, argCount) { + if (func == null) { + return identity; + } + var type = typeof func; + if (type != 'function') { + if (type != 'object') { + return function(object) { + return object[func]; + }; + } + var props = keys(func); + return function(object) { + var length = props.length, + result = false; + while (length--) { + if (!(result = isEqual(object[props[length]], func[props[length]], indicatorObject))) { + break; + } + } + return result; + }; + } + if (typeof thisArg != 'undefined') { + if (argCount === 1) { + return function(value) { + return func.call(thisArg, value); + }; + } + if (argCount === 2) { + return function(a, b) { + return func.call(thisArg, a, b); + }; + } + if (argCount === 4) { + return function(accumulator, value, index, object) { + return func.call(thisArg, accumulator, value, index, object); + }; + } + return function(value, index, object) { + return func.call(thisArg, value, index, object); + }; + } + return func; + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {Object} [options1, options2, ...] The compile options object(s). + * arrays - A string of code to determine if the iterable is an array or array-like. + * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. + * args - A string of comma separated arguments the iteration function will accept. + * top - A string of code to execute before the iteration branches. + * loop - A string of code to execute in the object loop. + * bottom - A string of code to execute after the iteration branches. + * + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + var data = { + // support properties + 'hasDontEnumBug': hasDontEnumBug, + 'hasEnumPrototype': hasEnumPrototype, + 'isKeysFast': isKeysFast, + 'nonEnumArgs': nonEnumArgs, + 'noCharByIndex': noCharByIndex, + 'shadowed': shadowed, + + // iterator options + 'arrays': 'isArray(iterable)', + 'bottom': '', + 'loop': '', + 'top': '', + 'useHas': true + }; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + data[key] = object[key]; + } + } + var args = data.args; + data.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'createCallback, hasOwnProperty, isArguments, isArray, isString, ' + + 'objectTypes, nativeKeys', + 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' + ); + // return the compiled function + return factory( + createCallback, hasOwnProperty, isArguments, isArray, isString, + objectTypes, nativeKeys + ); + } + + /** + * A function compiled to iterate `arguments` objects, arrays, objects, and + * strings consistenly across environments, executing the `callback` for each + * element in the `collection`. The `callback` is bound to `thisArg` and invoked + * with three arguments; (value, index|key, collection). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @private + * @type Function + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + */ + var each = createIterator(eachIteratorOptions); + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used, instead of `Array#slice`, to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|String} collection The collection to slice. + * @param {Number} start The start index. + * @param {Number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {String} match The matched character to unescape. + * @returns {String} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return toString.call(value) == argsClass; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (noArgsClass) { + isArguments = function(value) { + return value ? hasOwnProperty.call(value, 'callee') : false; + }; + } + + /** + * Iterates over `object`'s own and inherited enumerable properties, executing + * the `callback` for each property. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, key, object). Callbacks may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * alert('Woof, woof!'); + * }; + * + * _.forIn(new Dog('Dagny'), function(value, key) { + * alert(key); + * }); + * // => alerts 'name' and 'bark' (order is not guaranteed) + */ + var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * Iterates over an object's own enumerable properties, executing the `callback` + * for each property. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by explicitly + * returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * alert(key); + * }); + * // => alerts '0', '1', and 'length' (order is not guaranteed) + */ + var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + // `instanceof` may cause a memory leak in IE 7 if `value` is a host object + // http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak + return (argsAreObjects && value instanceof Array) || toString.call(value) == arrayClass; + }; + + /** + * Creates an array composed of the own enumerable property names of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (order is not guaranteed) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + if ((hasEnumPrototype && typeof object == 'function') || + (nonEnumArgs && object.length && isArguments(object))) { + return shimKeys(object); + } + return nativeKeys(object); + }; + + /** + * A fallback implementation of `isPlainObject` that checks if a given `value` + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects + var result = false; + if (!(value && typeof value == 'object') || isArguments(value)) { + return result; + } + // check that the constructor is `Object` (i.e. `Object instanceof Object`) + var ctor = value.constructor; + if ((!isFunction(ctor) && (!noNodeClass || !isNode(value))) || ctor instanceof ctor) { + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (iteratesOwnLast) { + forIn(value, function(value, key, object) { + result = !hasOwnProperty.call(object, key); + return false; + }); + return result === false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return result === false || hasOwnProperty.call(value, result); + } + return result; + } + + /** + * A fallback implementation of `Object.keys` that produces an array of the + * given object's own enumerable property names. + * + * @private + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + */ + function shimKeys(object) { + var result = []; + forOwn(object, function(value, key) { + result.push(key); + }); + return result; + } + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite propery assignments of previous + * sources. If a `callback` function is passed, it will be executed to produce + * the assigned values. The `callback` is bound to `thisArg` and invoked with + * two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'moe' }, { 'age': 40 }); + * // => { 'name': 'moe', 'age': 40 } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var food = { 'name': 'apple' }; + * defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var assign = createIterator(defaultsIteratorOptions, { + 'top': + defaultsIteratorOptions.top.replace(';', + ';\n' + + "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + + ' var callback = createCallback(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]' + }); + + /** + * Creates a clone of `value`. If `deep` is `true`, nested objects will also + * be cloned, otherwise they will be assigned by reference. If a `callback` + * function is passed, it will be executed to produce the cloned values. If + * `callback` returns `undefined`, cloning will be handled by the method instead. + * The `callback` is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to clone. + * @param {Boolean} [deep=false] A flag to indicate a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate clones with source counterparts. + * @returns {Mixed} Returns the cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var shallow = _.clone(stooges); + * shallow[0] === stooges[0]; + * // => true + * + * var deep = _.clone(stooges, true); + * deep[0] === stooges[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, deep, callback, thisArg, stackA, stackB) { + var result = value; + + // allows working with "Collections" methods without using their `callback` + // argument, `index|key`, for this method's `callback` + if (typeof deep == 'function') { + thisArg = callback; + callback = deep; + deep = false; + } + if (typeof callback == 'function') { + callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 1); + result = callback(result); + + var done = typeof result != 'undefined'; + if (!done) { + result = value; + } + } + // inspect [[Class]] + var isObj = isObject(result); + if (isObj) { + var className = toString.call(result); + if (!cloneableClasses[className] || (noNodeClass && isNode(result))) { + return result; + } + var isArr = isArray(result); + } + // shallow clone + if (!isObj || !deep) { + return isObj && !done + ? (isArr ? slice(result) : assign({}, result)) + : result; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return done ? result : new ctor(+result); + + case numberClass: + case stringClass: + return done ? result : new ctor(result); + + case regexpClass: + return done ? result : ctor(result.source, reFlags.exec(result)); + } + // check for circular references and return corresponding clone + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // init cloned object + if (!done) { + result = isArr ? ctor(result.length) : {}; + + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? forEach : forOwn)(done ? result : value, function(objValue, key) { + result[key] = clone(objValue, deep, callback, undefined, stackA, stackB); + }); + + return result; + } + + /** + * Creates a deep clone of `value`. If a `callback` function is passed, it will + * be executed to produce the cloned values. If `callback` returns the value it + * was passed, cloning will be handled by the method instead. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). + * + * Note: This function is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the deep cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * var deep = _.cloneDeep(stooges); + * deep[0] === stooges[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : value; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return clone(value, true, callback, thisArg); + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param- {Object} [guard] Internally used to allow working with `_.reduce` + * without using its callback's `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var food = { 'name': 'apple' }; + * _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); + * // => { 'name': 'apple', 'type': 'fruit' } + */ + var defaults = createIterator(defaultsIteratorOptions); + + /** + * Creates a sorted array of all enumerable properties, own and inherited, + * of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified object `property` exists and is a direct property, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to check. + * @param {String} property The property to check for. + * @returns {Boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, property) { + return object ? hasOwnProperty.call(object, property) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'moe', 'second': 'larry' }); + * // => { 'moe': 'first', 'larry': 'second' } (order is not guaranteed) + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || toString.call(value) == boolClass; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value instanceof Date || toString.call(value) == dateClass; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value ? value.nodeType === 1 : false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|String} value The value to inspect. + * @returns {Boolean} Returns `true`, if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + className == argsClass || (noArgsClass && isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If `callback` is passed, it will be executed to + * compare values. If `callback` returns `undefined`, comparisons will be handled + * by the method instead. The `callback` is bound to `thisArg` and invoked with + * two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} a The value to compare. + * @param {Mixed} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. + * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. + * @returns {Boolean} Returns `true`, if the values are equvalent, else `false`. + * @example + * + * var moe = { 'name': 'moe', 'age': 40 }; + * var copy = { 'name': 'moe', 'age': 40 }; + * + * moe == copy; + * // => false + * + * _.isEqual(moe, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + var whereIndicator = callback === indicatorObject; + if (callback && !whereIndicator) { + callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 2); + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + (!a || (type != 'function' && type != 'object')) && + (!b || (otherType != 'function' && otherType != 'object'))) { + return false; + } + // exit early for `null` and `undefined`, avoiding ES3's Function#call behavior + // http://es5.github.com/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return a != +a + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == b + ''; + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + if (a.__wrapped__ || b.__wrapped__) { + return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, thisArg, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass || (noNodeClass && (isNode(a) || isNode(b)))) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = !argsAreObjects && isArguments(a) ? Object : a.constructor, + ctorB = !argsAreObjects && isArguments(b) ? Object : b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && !( + isFunction(ctorA) && ctorA instanceof ctorA && + isFunction(ctorB) && ctorB instanceof ctorB + )) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + length = a.length; + size = b.length; + + // compare lengths to determine if a deep comparison is necessary + result = size == a.length; + if (!result && !whereIndicator) { + return result; + } + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (whereIndicator) { + while (index--) { + if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) { + break; + } + } + } else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) { + break; + } + } + return result; + } + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && isEqual(a[key], value, callback, thisArg, stackA, stackB)); + } + }); + + if (result && !whereIndicator) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + return result; + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite`, which will return true for + * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return value instanceof Function || toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.com/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return value ? objectTypes[typeof value] : false; + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN`, which will return `true` for + * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || toString.call(value) == numberClass; + } + + /** + * Checks if a given `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. + * @example + * + * function Stooge(name, age) { + * this.name = name; + * this.age = age; + * } + * + * _.isPlainObject(new Stooge('moe', 40)); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'name': 'moe', 'age': 40 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && typeof value == 'object')) { + return false; + } + var valueOf = value.valueOf, + objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/moe/); + * // => true + */ + function isRegExp(value) { + return value instanceof RegExp || toString.call(value) == regexpClass; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is a string, else `false`. + * @example + * + * _.isString('moe'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || toString.call(value) == stringClass; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true`, if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined`, into the destination object. Subsequent sources + * will overwrite propery assignments of previous sources. If a `callback` function + * is passed, it will be executed to produce the merged values of the destination + * and source properties. If `callback` returns `undefined`, merging will be + * handled by the method instead. The `callback` is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @param- {Object} [deepIndicator] Internally used to indicate that `stackA` + * and `stackB` are arrays of traversed objects instead of source objects. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate values with their + * source counterparts. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'stooges': [ + * { 'name': 'moe' }, + * { 'name': 'larry' } + * ] + * }; + * + * var ages = { + * 'stooges': [ + * { 'age': 40 }, + * { 'age': 50 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object, source, deepIndicator) { + var args = arguments, + index = 0, + length = 2; + + if (!isObject(object)) { + return object; + } + if (deepIndicator === indicatorObject) { + var callback = args[3], + stackA = args[4], + stackB = args[5]; + } else { + stackA = []; + stackB = []; + + // allows working with `_.reduce` and `_.reduceRight` without + // using their `callback` arguments, `index|key` and `collection` + if (typeof deepIndicator != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + callback = createCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + } + while (++index < length) { + (isArray(args[index]) ? forEach : forOwn)(args[index], function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + + if (callback) { + result = callback(value, source); + if (typeof result != 'undefined') { + value = result; + } + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!callback) { + value = merge(value, source, indicatorObject, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a `callback` function is passed, it will be executed + * for each property in the `object`, omitting the properties `callback` + * returns truthy for. The `callback` is bound to `thisArg` and invoked + * with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'moe', 'age': 40 }, 'age'); + * // => { 'name': 'moe' } + * + * _.omit({ 'name': 'moe', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'moe' } + */ + function omit(object, callback, thisArg) { + var isFunc = typeof callback == 'function', + result = {}; + + if (isFunc) { + callback = createCallback(callback, thisArg); + } else { + var props = concat.apply(arrayRef, arguments); + } + forIn(object, function(value, key, object) { + if (isFunc + ? !callback(value, key, object) + : indexOf(props, key, 1) < 0 + ) { + result[key] = value; + } + }); + return result; + } + + /** + * Creates a two dimensional array of the given object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'moe': 30, 'larry': 40 }); + * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of property + * names. If `callback` is passed, it will be executed for each property in the + * `object`, picking the properties `callback` returns truthy for. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Array|Function|String} callback|[prop1, prop2, ...] The function called + * per iteration or properties to pick, either as individual arguments or arrays. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); + * // => { 'name': 'moe' } + * + * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'moe' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = 0, + props = concat.apply(arrayRef, arguments), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = createCallback(callback, thisArg); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Array|Number|String} [index1, index2, ...] The indexes of + * `collection` to retrieve, either as individual arguments or arrays. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['moe', 'larry', 'curly'], 0, 2); + * // => ['moe', 'curly'] + */ + function at(collection) { + var index = -1, + props = concat.apply(arrayRef, slice(arguments, 1)), + length = props.length, + result = Array(length); + + if (noCharByIndex && isString(collection)) { + collection = collection.split(''); + } + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given `target` element is present in a `collection` using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Mixed} target The value to check for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); + * // => true + * + * _.contains('curly', 'ur'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (typeof length == 'number') { + result = (isString(collection) + ? collection.indexOf(target, fromIndex) + : indexOf(collection, target, fromIndex) + ) > -1; + } else { + each(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys returned from running each element of the + * `collection` through the given `callback`. The corresponding value of each key + * is the number of times the key was returned by the `callback`. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + function countBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection) + ''; + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + return result; + } + + /** + * Checks if the `callback` returns a truthy value for **all** elements of a + * `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if all elements pass the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(stooges, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(stooges, { 'age': 50 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + each(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * the `callback` returns truthy for. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + * + * // using "_.where" callback shorthand + * _.filter(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + each(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning the first that the `callback` + * returns truthy for. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the element that passed the callback check, + * else `undefined`. + * @example + * + * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => 2 + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'banana', 'organic': true, 'type': 'fruit' }, + * { 'name': 'beet', 'organic': false, 'type': 'vegetable' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * var veggie = _.find(food, { 'type': 'vegetable' }); + * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + * + * // using "_.pluck" callback shorthand + * var healthy = _.find(food, 'organic'); + * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' } + */ + function find(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over a `collection`, executing the `callback` for each element in + * the `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). Callbacks may exit iteration early + * by explicitly returning `false`. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(alert).join(','); + * // => alerts each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); + * // => alerts each number value (order is not guaranteed) + */ + function forEach(collection, callback, thisArg) { + if (callback && typeof thisArg == 'undefined' && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + each(collection, callback, thisArg); + } + return collection; + } + + /** + * Creates an object composed of keys returned from running each element of the + * `collection` through the `callback`. The corresponding value of each key is + * an array of elements passed to `callback` that returned the key. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + function groupBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection) + ''; + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + return result; + } + + /** + * Invokes the method named by `methodName` on each element in the `collection`, + * returning an array of the results of each invoked method. Additional arguments + * will be passed to each invoked method. If `methodName` is a function, it will + * be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the `collection` + * through the `callback`. The `callback` is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (order is not guaranteed) + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(stooges, 'name'); + * // => ['moe', 'larry'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + each(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.max(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'larry', 'age': 50 }; + * + * // using "_.pluck" callback shorthand + * _.max(stooges, 'age'); + * // => { 'name': 'larry', 'age': 50 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + each(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.min(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'moe', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.min(stooges, 'age'); + * // => { 'name': 'moe', 'age': 40 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + if (!callback && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + each(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the `collection`. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {String} property The property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.pluck(stooges, 'name'); + * // => ['moe', 'larry'] + */ + var pluck = map; + + /** + * Reduces a `collection` to a value that is the accumulated result of running + * each element in the `collection` through the `callback`, where each successive + * `callback` execution consumes the return value of the previous execution. + * If `accumulator` is not passed, the first element of the `collection` will be + * used as the initial `accumulator` value. The `callback` is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg, 4); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + each(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is similar to `_.reduce`, except that it iterates over a + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var iterable = collection, + length = collection ? collection.length : 0, + noaccum = arguments.length < 3; + + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (noCharByIndex && isString(collection)) { + iterable = collection.split(''); + } + callback = createCallback(callback, thisArg, 4); + forEach(collection, function(value, index, collection) { + index = props ? props[--length] : --length; + accumulator = noaccum + ? (noaccum = false, iterable[index]) + : callback(accumulator, iterable[index], index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter`, this method returns the elements of a + * `collection` that `callback` does **not** return truthy for. + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that did **not** pass the + * callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(food, 'organic'); + * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] + * + * // using "_.where" callback shorthand + * _.reject(food, { 'type': 'fruit' }); + * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] + */ + function reject(collection, callback, thisArg) { + callback = createCallback(callback, thisArg); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Creates an array of shuffled `array` values, using a version of the + * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = floor(nativeRandom() * (++index + 1)); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to inspect. + * @returns {Number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('curly'); + * // => 5 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the `callback` returns a truthy value for **any** element of a + * `collection`. The function returns as soon as it finds passing value, and + * does not iterate over the entire `collection`. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if any element passes the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(food, 'organic'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(food, { 'type': 'meat' }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + each(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in the `collection` through the `callback`. This method + * performs a stable sort, that is, it will preserve the original sort order of + * equal elements. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * // using "_.pluck" callback shorthand + * _.sortBy(['banana', 'strawberry', 'apple'], 'length'); + * // => ['apple', 'banana', 'strawberry'] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + result[++index] = { + 'criteria': callback(value, key, collection), + 'index': index, + 'value': value + }; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + result[length] = result[length].value; + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return noCharByIndex && isString(collection) + ? collection.split('') + : slice(collection); + } + return values(collection); + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * that have the given `properties`. When checking `properties`, this method + * performs a deep comparison between values to determine if they are equivalent + * to each other. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given `properties`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 } + * ]; + * + * _.where(stooges, { 'age': 40 }); + * // => [{ 'name': 'moe', 'age': 40 }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values of `array` removed. The values + * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array of `array` elements not present in the other arrays + * using strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {Array} [array1, array2, ...] Arrays to check. + * @returns {Array} Returns a new array of `array` elements not present in the + * other arrays. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + var index = -1, + length = array ? array.length : 0, + flattened = concat.apply(arrayRef, arguments), + contains = cachedContains(flattened, length), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Gets the first element of the `array`. If a number `n` is passed, the first + * `n` elements of the `array` are returned. If a `callback` function is passed, + * the first elements the `callback` returns truthy for are returned. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n] The function called + * per element or the number of elements to return. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(food, 'organic'); + * // => [{ 'name': 'banana', 'organic': true }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.first(food, { 'type': 'fruit' }); + * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] + */ + function first(array, callback, thisArg) { + if (array) { + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = createCallback(callback, thisArg); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array[0]; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `shallow` is + * truthy, `array` will only be flattened a single level. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @param {Boolean} shallow A flag to indicate only flattening a single level. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + */ + function flatten(array, shallow) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + // recursively flatten arrays (susceptible to call stack limits) + if (isArray(value)) { + push.apply(result, shallow ? value : flatten(value)); + } else { + result.push(value); + } + } + return result; + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the `array` is already + * sorted, passing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to + * perform a binary search on a sorted `array`. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + var index = -1, + length = array ? array.length : 0; + + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; + } else if (fromIndex) { + index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Gets all but the last element of `array`. If a number `n` is passed, the + * last `n` elements are excluded from the result. If a `callback` function + * is passed, the last elements the `callback` returns truthy for are excluded + * from the result. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.initial(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'banana', 'type': 'fruit' }] + */ + function initial(array, callback, thisArg) { + if (!array) { + return []; + } + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Computes the intersection of all the passed-in arrays using strict equality + * for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique elements that are present + * in **all** of the arrays. + * @example + * + * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2] + */ + function intersection(array) { + var args = arguments, + argsLength = args.length, + cache = { '0': {} }, + index = -1, + length = array ? array.length : 0, + isLarge = length >= 100, + result = [], + seen = result; + + outer: + while (++index < length) { + var value = array[index]; + if (isLarge) { + var key = value + ''; + var inited = hasOwnProperty.call(cache[0], key) + ? !(seen = cache[0][key]) + : (seen = cache[0][key] = []); + } + if (inited || indexOf(seen, value) < 0) { + if (isLarge) { + seen.push(value); + } + var argsIndex = argsLength; + while (--argsIndex) { + if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) { + continue outer; + } + } + result.push(value); + } + } + return result; + } + + /** + * Gets the last element of the `array`. If a number `n` is passed, the last + * `n` elements of the `array` are returned. If a `callback` function is passed, + * the last elements the `callback` returns truthy for are returned. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n] The function called + * per element or the number of elements to return. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var food = [ + * { 'name': 'beet', 'organic': false }, + * { 'name': 'carrot', 'organic': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.last(food, 'organic'); + * // => [{ 'name': 'carrot', 'organic': true }] + * + * var food = [ + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' }, + * { 'name': 'carrot', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.last(food, { 'type': 'vegetable' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] + */ + function last(array, callback, thisArg) { + if (array) { + var n = 0, + length = array.length; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array[length - 1]; + } + } + return slice(array, nativeMax(0, length - n)); + } + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=array.length-1] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Pass either + * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or + * two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.object(['moe', 'larry'], [30, 40]); + * // => { 'moe': 30, 'larry': 40 } + */ + function object(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else { + result[key[0]] = key[1]; + } + } + return result; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Number} [start=0] The start of the range. + * @param {Number} end The end of the range. + * @param {Number} [step=1] The value to increment or descrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(10); + * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + * + * _.range(1, 11); + * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * _.range(0, 30, 5); + * // => [0, 5, 10, 15, 20, 25] + * + * _.range(0, -10, -1); + * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = +step || 1; + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / step)), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * The opposite of `_.initial`, this method gets all but the first value of `array`. + * If a number `n` is passed, the first `n` values are excluded from the result. + * If a `callback` function is passed, the first elements the `callback` returns + * truthy for are excluded from the result. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|Number|String} [callback|n=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is passed, it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var food = [ + * { 'name': 'banana', 'organic': true }, + * { 'name': 'beet', 'organic': false }, + * ]; + * + * // using "_.pluck" callback shorthand + * _.rest(food, 'organic'); + * // => [{ 'name': 'beet', 'organic': false }] + * + * var food = [ + * { 'name': 'apple', 'type': 'fruit' }, + * { 'name': 'banana', 'type': 'fruit' }, + * { 'name': 'beet', 'type': 'vegetable' } + * ]; + * + * // using "_.where" callback shorthand + * _.rest(food, { 'type': 'fruit' }); + * // => [{ 'name': 'beet', 'type': 'vegetable' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = createCallback(callback, thisArg); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which the `value` + * should be inserted into `array` in order to maintain the sort order of the + * sorted `array`. If `callback` is passed, it will be executed for `value` and + * each element in `array` to compute their sort ranking. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to iterate over. + * @param {Mixed} value The value to evaluate. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Number} Returns the index at which the value should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + callback(array[mid]) < value + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Computes the union of the passed-in arrays using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique values, in order, that are + * present in one or more of the arrays. + * @example + * + * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2, 3, 101, 10] + */ + function union() { + return uniq(concat.apply(arrayRef, arguments)); + } + + /** + * Creates a duplicate-value-free version of the `array` using strict equality + * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` + * for `isSorted` will run a faster algorithm. If `callback` is passed, each + * element of `array` is passed through a callback` before uniqueness is computed. + * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is passed for `callback`, the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is passed for `callback`, the created "_.where" style callback + * will return `true` for elements that have the propeties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. + * @param {Function|Object|String} [callback=identity] The function called per + * iteration. If a property name or object is passed, it will be used to create + * a "_.pluck" or "_.where" style callback, respectively. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = [], + seen = result; + + // juggle arguments + if (typeof isSorted == 'function') { + thisArg = callback; + callback = isSorted; + isSorted = false; + } + // init value cache for large arrays + var isLarge = !isSorted && length >= 75; + if (isLarge) { + var cache = {}; + } + if (callback) { + seen = []; + callback = createCallback(callback, thisArg); + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isLarge) { + var key = computed + ''; + var inited = hasOwnProperty.call(cache, key) + ? !(seen = cache[key]) + : (seen = cache[key] = []); + } + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : inited || indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * Creates an array with all occurrences of the passed values removed using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {Mixed} [value1, value2, ...] Values to remove. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + var index = -1, + length = array ? array.length : 0, + contains = cachedContains(arguments, 1), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Groups the elements of each array at their corresponding indexes. Useful for + * separate data sources that are coordinated through matching array indexes. + * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix + * in a similar fashion. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['moe', 'larry'], [30, 40], [true, false]); + * // => [['moe', 30, true], ['larry', 40, false]] + */ + function zip(array) { + var index = -1, + length = array ? max(pluck(arguments, 'length')) : 0, + result = Array(length); + + while (++index < length) { + result[index] = pluck(arguments, index); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that is restricted to executing `func` only after it is + * called `n` times. The `func` is executed with the `this` binding of the + * created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Number} n The number of times the function must be called before + * it is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var renderNotes = _.after(notes.length, render); + * _.forEach(notes, function(note) { + * note.asyncSave({ 'success': renderNotes }); + * }); + * // `renderNotes` is run once, after all notes have saved + */ + function after(n, func) { + if (n < 1) { + return func(); + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * passed to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'moe' }, 'hi'); + * func(); + * // => 'hi moe' + */ + function bind(func, thisArg) { + // use `Function#bind` if it exists and is fast + // (in V8 `Function#bind` is slower except when partially applied) + return isBindFast || (nativeBind && arguments.length > 2) + ? nativeBind.call.apply(nativeBind, arguments) + : createBound(func, thisArg, slice(arguments, 2)); + } + + /** + * Binds methods on `object` to `object`, overwriting the existing method. + * Method names may be specified as individual arguments or as arrays of method + * names. If no method names are provided, all the function properties of `object` + * will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { alert('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => alerts 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = concat.apply(arrayRef, arguments), + index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = bind(object[key], object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those passed to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {String} key The key of the method. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'moe', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi moe' + * + * object.greet = function(greeting) { + * return greeting + ', ' + this.name + '!'; + * }; + * + * func(); + * // => 'hi, moe!' + */ + function bindKey(object, key) { + return createBound(object, key, slice(arguments, 2)); + } + + /** + * Creates a function that is the composition of the passed functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} [func1, func2, ...] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var greet = function(name) { return 'hi ' + name; }; + * var exclaim = function(statement) { return statement + '!'; }; + * var welcome = _.compose(exclaim, greet); + * welcome('moe'); + * // => 'hi moe!' + */ + function compose() { + var funcs = arguments; + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. Pass + * `true` for `immediate` to cause debounce to invoke `func` on the leading, + * instead of the trailing, edge of the `wait` timeout. Subsequent calls to + * the debounced function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {Number} wait The number of milliseconds to delay. + * @param {Boolean} immediate A flag to indicate execution is on the leading + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * var lazyLayout = _.debounce(calculateLayout, 300); + * jQuery(window).on('resize', lazyLayout); + */ + function debounce(func, wait, immediate) { + var args, + result, + thisArg, + timeoutId; + + function delayed() { + timeoutId = null; + if (!immediate) { + result = func.apply(thisArg, args); + } + } + return function() { + var isImmediate = immediate && !timeoutId; + args = arguments; + thisArg = this; + + clearTimeout(timeoutId); + timeoutId = setTimeout(delayed, wait); + + if (isImmediate) { + result = func.apply(thisArg, args); + } + return result; + }; + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {Number} wait The number of milliseconds to delay execution. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * var log = _.bind(console.log, console); + * _.delay(log, 1000, 'logged later'); + * // => 'logged later' (Appears after one second.) + */ + function delay(func, wait) { + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * _.defer(function() { alert('deferred'); }); + * // returns from the function before `alert` is called + */ + function defer(func) { + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + // use `setImmediate` if it's available in Node.js + if (isV8 && freeModule && typeof setImmediate == 'function') { + defer = bind(setImmediate, window); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * passed, it will be used to determine the cache key for storing the result + * based on the arguments passed to the memoized function. By default, the first + * argument passed to the memoized function is used as the cache key. The `func` + * is executed with the `this` binding of the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + */ + function memoize(func, resolver) { + var cache = {}; + return function() { + var key = (resolver ? resolver.apply(this, arguments) : arguments[0]) + ''; + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + }; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those passed to the new function. This + * method is similar to `_.bind`, except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('moe'); + * // => 'hi moe' + */ + function partial(func) { + return createBound(func, slice(arguments, 1)); + } + + /** + * This method is similar to `_.partial`, except that `partial` arguments are + * appended to those passed to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createBound(func, slice(arguments, 1), null, indicatorObject); + } + + /** + * Creates a function that, when executed, will only call the `func` + * function at most once per every `wait` milliseconds. If the throttled + * function is invoked more than once during the `wait` timeout, `func` will + * also be called on the trailing edge of the timeout. Subsequent calls to the + * throttled function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {Number} wait The number of milliseconds to throttle executions to. + * @returns {Function} Returns the new throttled function. + * @example + * + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + */ + function throttle(func, wait) { + var args, + result, + thisArg, + timeoutId, + lastCalled = 0; + + function trailingCall() { + lastCalled = new Date; + timeoutId = null; + result = func.apply(thisArg, args); + } + return function() { + var now = new Date, + remaining = wait - (now - lastCalled); + + args = arguments; + thisArg = this; + + if (remaining <= 0) { + clearTimeout(timeoutId); + timeoutId = null; + lastCalled = now; + result = func.apply(thisArg, args); + } + else if (!timeoutId) { + timeoutId = setTimeout(trailingCall, remaining); + } + return result; + }; + } + + /** + * Creates a function that passes `value` to the `wrapper` function as its + * first argument. Additional arguments passed to the function are appended + * to those passed to the `wrapper` function. The `wrapper` is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Mixed} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var hello = function(name) { return 'hello ' + name; }; + * hello = _.wrap(hello, function(func) { + * return 'before, ' + func('moe') + ', after'; + * }); + * hello(); + * // => 'before, hello moe, after' + */ + function wrap(value, wrapper) { + return function() { + var args = [value]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} string The string to escape. + * @returns {String} Returns the escaped string. + * @example + * + * _.escape('Moe, Larry & Curly'); + * // => 'Moe, Larry & Curly' + */ + function escape(string) { + return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This function returns the first argument passed to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Mixed} value Any value. + * @returns {Mixed} Returns `value`. + * @example + * + * var moe = { 'name': 'moe' }; + * moe === _.identity(moe); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds functions properties of `object` to the `lodash` function and chainable + * wrapper. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object of function properties to add to `lodash`. + * @example + * + * _.mixin({ + * 'capitalize': function(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * }); + * + * _.capitalize('moe'); + * // => 'Moe' + * + * _('moe').capitalize(); + * // => 'Moe' + */ + function mixin(object) { + forEach(functions(object), function(methodName) { + var func = lodash[methodName] = object[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + return new lodash(func.apply(lodash, args)); + }; + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + window._ = oldDash; + return this; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is passed, a number between `0` and the given number will be returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Number} [min=0] The minimum possible value. + * @param {Number} [max=1] The maximum possible value. + * @returns {Number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => a number between 0 and 5 + * + * _.random(5); + * // => also a number between 0 and 5 + */ + function random(min, max) { + if (min == null && max == null) { + max = 1; + } + min = +min || 0; + if (max == null) { + max = min; + min = 0; + } + return min + floor(nativeRandom() * ((+max || 0) - min + 1)); + } + + /** + * Resolves the value of `property` on `object`. If `property` is a function, + * it will be invoked and its result returned, else the property value is + * returned. If `object` is falsey, then `null` is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {String} property The property to get the value of. + * @returns {Mixed} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, property) { + var value = object ? object[property] : undefined; + return isFunction(value) ? object[property]() : value; + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` + * build and using precompiled templates, or loading Lo-Dash in a sandbox. + * + * For more information on precompiling templates see: + * http://lodash.com/#custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} text The template text. + * @param {Obect} data The data object used to populate the text. + * @param {Object} options The options object. + * escape - The "escape" delimiter regexp. + * evaluate - The "evaluate" delimiter regexp. + * interpolate - The "interpolate" delimiter regexp. + * sourceURL - The sourceURL of the template's compiled source. + * variable - The data object variable name. + * + * @returns {Function|String} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'moe' }); + * // => 'hello moe' + * + * var list = '<% _.forEach(people, function(name) { %>
      1. <%= name %>
      2. <% }); %>'; + * _.template(list, { 'people': ['moe', 'larry'] }); + * // => '
      3. moe
      4. larry
      5. ' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nTo avoid potential issues, update `npm` before installing Lo-Dash:\n\n```bash\nnpm install npm -g\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n\n// or as a drop-in replacement for Underscore\nvar _ = require('lodash/lodash.underscore');\n```\n\n**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 project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Release Notes\n\n### v1.0.1\n\n * Add support for specifying source map URLs in `-p`/`--source-map` build options\n * Ensured the second argument passed to `_.assign` is not treated as a `callback`\n * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL`\n * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed\n * Made `_.defer` use `setImmediate`, in Node.js, when available\n * Made `_.where` search arrays for values regardless of their index position\n * Removed dead code from `_.template`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash@1.0.1", + "_from": "lodash@~1.0.1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/package.json new file mode 100644 index 0000000..7940868 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/package.json @@ -0,0 +1,48 @@ +{ + "name": "findup-sync", + "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", + "version": "0.1.2", + "homepage": "https://github.com/cowboy/node-findup-sync", + "author": { + "name": "\"Cowboy\" Ben Alman", + "url": "http://benalman.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/cowboy/node-findup-sync.git" + }, + "bugs": { + "url": "https://github.com/cowboy/node-findup-sync/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/cowboy/node-findup-sync/blob/master/LICENSE-MIT" + } + ], + "main": "lib/findup-sync", + "engines": { + "node": ">= 0.6.0" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "dependencies": { + "glob": "~3.1.21", + "lodash": "~1.0.1" + }, + "devDependencies": { + "grunt": "~0.4.0", + "grunt-contrib-jshint": "~0.2.0", + "grunt-contrib-nodeunit": "~0.1.2" + }, + "keywords": [ + "find", + "glob", + "file" + ], + "readme": "# findup-sync\n\nFind the first file matching a given pattern in the current directory or the nearest ancestor directory.\n\n## Getting Started\nInstall the module with: `npm install findup-sync`\n\n```js\nvar findup = require('findup-sync');\n\n// Start looking in the CWD.\nvar filepath1 = findup('{a,b}*.txt');\n\n// Start looking somewhere else, and ignore case (probably a good idea).\nvar filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});\n```\n\n## Usage\n\n```js\nfindup(patternOrPatterns [, minimatchOptions])\n```\n\n### patternOrPatterns\nType: `String` or `Array` \nDefault: none\n\nOne or more wildcard glob patterns. Or just filenames.\n\n### minimatchOptions\nType: `Object` \nDefault: `{}`\n\nOptions to be passed to [minimatch](https://github.com/isaacs/minimatch).\n\nNote that if you want to start in a different directory than the current working directory, specify a `cwd` property here.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. \n2012-11-15 - v0.1.1 - Now works without an options object. \n2012-11-01 - v0.1.0 - Initial release.\n", + "readmeFilename": "README.md", + "_id": "findup-sync@0.1.2", + "_from": "findup-sync@~0.1.2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/findup-sync_test.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/findup-sync_test.js new file mode 100644 index 0000000..f8baf9e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/findup-sync_test.js @@ -0,0 +1,48 @@ +'use strict'; + +// Nodejs lib. +var path = require('path'); + +var findup = require('../lib/findup-sync.js'); + +// Get a relative path. +var rel = function(abspath) { + return typeof abspath === 'string' ? path.relative('.', abspath) : abspath; +}; + +exports['findup'] = { + setUp: function(done) { + this.cwd = process.cwd(); + done(); + }, + tearDown: function(done) { + process.chdir(this.cwd); + done(); + }, + 'simple': function(test) { + test.expect(8); + var opts = {cwd: 'test/fixtures/a/b'}; + test.equal(rel(findup('foo.txt', opts)), path.normalize('test/fixtures/a/foo.txt'), 'should find files'); + test.equal(rel(findup('bar.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find files'); + test.equal(rel(findup('a.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should find files'); + test.equal(rel(findup('?.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should support glob patterns'); + test.equal(rel(findup('*.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches the glob pattern'); + test.equal(rel(findup(['b*.txt', 'f*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); + test.equal(rel(findup(['f*.txt', 'b*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); + test.equal(findup('not-gonna-exist-i-hope.txt', opts), null, 'should returning null if no files found'); + test.done(); + }, + 'cwd': function(test) { + test.expect(8); + process.chdir('test/fixtures/a/b'); + test.equal(rel(findup('foo.txt')), path.normalize('../foo.txt'), 'should find files'); + test.equal(rel(findup('bar.txt')), 'bar.txt', 'should find files'); + test.equal(rel(findup('a.txt')), path.normalize('../../a.txt'), 'should find files'); + test.equal(rel(findup('?.txt')), path.normalize('../../a.txt'), 'should support glob patterns'); + test.equal(rel(findup('*.txt')), 'bar.txt', 'should find the first thing that matches the glob pattern'); + test.equal(rel(findup(['b*.txt', 'f*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); + test.equal(rel(findup(['f*.txt', 'b*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); + test.equal(findup('not-gonna-exist-i-hope.txt'), null, 'should returning null if no files found'); + test.done(); + }, +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a.txt b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a/b/bar.txt b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a/b/bar.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a/foo.txt b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/a/foo.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/aaa.txt b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/findup-sync/test/fixtures/aaa.txt new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/README.md new file mode 100644 index 0000000..eeddfd4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/README.md @@ -0,0 +1,208 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you go half-insane just trying to manage them all, and put +it off with duct-tape solutions until you see exactly to the core of the +problem, and finally snap and write an awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + + // my-program.js + var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many" : [String, Array] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + console.log(parsed) + +This would give you support for any of the following: + +```bash +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk 1000 -fp # unknown opts are ok. +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --blatzk true -fp # but they need a value +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many 1 --many null --many foo +{ many: ["1", "null", "foo"] } + +$ node my-program.js --many foo +{ many: ["foo"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents, and numeric values will be +interpreted as a number. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid +options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/bin/nopt.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/bin/nopt.js new file mode 100755 index 0000000..df90c72 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/bin/nopt.js @@ -0,0 +1,44 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/examples/my-program.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/examples/my-program.js new file mode 100755 index 0000000..142447e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/examples/my-program.js @@ -0,0 +1,30 @@ +#!/usr/bin/env node + +//process.env.DEBUG_NOPT = 1 + +// my-program.js +var nopt = require("../lib/nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag", "true"] + , "g" : ["--flag"] + , "s" : "--flag" + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + +console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/lib/nopt.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/lib/nopt.js new file mode 100644 index 0000000..ff802da --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/lib/nopt.js @@ -0,0 +1,552 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + data.argv.toString = function () { + return this.original.map(JSON.stringify).join(" ") + } + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Number] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && type === t.type) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + if (arg.charAt(0) === "-") { + if (arg.indexOf("=") !== -1) { + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = false + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + var val + , la = args[i + 1] + + var isBool = no || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + if (abbrevs[arg] && !shorthands[arg]) { + return null + } + if (shortAbbr[arg]) { + arg = shortAbbr[arg] + } else { + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { l[r] = true ; return l }, {}) + shorthands.___singles = singles + } + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + } + + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + return shorthands[arg] +} + +if (module === require.main) { +var assert = require("assert") + , util = require("util") + + , shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + } + + , types = + { aoa: Array + , nullstream: [null, Stream] + , date: Date + , str: String + , browser : String + , cache : path + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : path + , force : Boolean + , global : Boolean + , globalconfig : path + , group : [String, Number] + , gzipbin : String + , logfd : [Number, Stream] + , loglevel : ["silent","win","error","warn","info","verbose","silly"] + , long : Boolean + , "node-version" : [false, String] + , npaturl : url + , npat : Boolean + , "onload-script" : [false, String] + , outfd : [Number, Stream] + , parseable : Boolean + , pre: Boolean + , prefix: path + , proxy : url + , "rebuild-bundle" : Boolean + , registry : url + , searchopts : String + , searchexclude: [null, String] + , shell : path + , t: [Array, String] + , tag : String + , tar : String + , tmp : path + , "unsafe-perm" : Boolean + , usage : Boolean + , user : String + , username : String + , userconfig : path + , version : Boolean + , viewer: path + , _exit : Boolean + } + +; [["-v", {version:true}, []] + ,["---v", {version:true}, []] + ,["ls -s --no-reg connect -d", + {loglevel:"info",registry:null},["ls","connect"]] + ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] + ,["ls --registry blargle", {}, ["ls"]] + ,["--no-registry", {registry:null}, []] + ,["--no-color true", {color:false}, []] + ,["--no-color false", {color:true}, []] + ,["--no-color", {color:false}, []] + ,["--color false", {color:false}, []] + ,["--color --logfd 7", {logfd:7,color:true}, []] + ,["--color=true", {color:true}, []] + ,["--logfd=10", {logfd:10}, []] + ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] + ,["--tmp=tmp -tar=gtar", + {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] + ,["--logfd x", {}, []] + ,["a -true -- -no-false", {true:true},["a","-no-false"]] + ,["a -no-false", {false:false},["a"]] + ,["a -no-no-true", {true:true}, ["a"]] + ,["a -no-no-no-false", {false:false}, ["a"]] + ,["---NO-no-No-no-no-no-nO-no-no"+ + "-No-no-no-no-no-no-no-no-no"+ + "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ + "-no-body-can-do-the-boogaloo-like-I-do" + ,{"body-can-do-the-boogaloo-like-I-do":false}, []] + ,["we are -no-strangers-to-love "+ + "--you-know the-rules --and so-do-i "+ + "---im-thinking-of=a-full-commitment "+ + "--no-you-would-get-this-from-any-other-guy "+ + "--no-gonna-give-you-up "+ + "-no-gonna-let-you-down=true "+ + "--no-no-gonna-run-around false "+ + "--desert-you=false "+ + "--make-you-cry false "+ + "--no-tell-a-lie "+ + "--no-no-and-hurt-you false" + ,{"strangers-to-love":false + ,"you-know":"the-rules" + ,"and":"so-do-i" + ,"you-would-get-this-from-any-other-guy":false + ,"gonna-give-you-up":false + ,"gonna-let-you-down":false + ,"gonna-run-around":false + ,"desert-you":false + ,"make-you-cry":false + ,"tell-a-lie":false + ,"and-hurt-you":false + },["we", "are"]] + ,["-t one -t two -t three" + ,{t: ["one", "two", "three"]} + ,[]] + ,["-t one -t null -t three four five null" + ,{t: ["one", "null", "three"]} + ,["four", "five", "null"]] + ,["-t foo" + ,{t:["foo"]} + ,[]] + ,["--no-t" + ,{t:["false"]} + ,[]] + ,["-no-no-t" + ,{t:["true"]} + ,[]] + ,["-aoa one -aoa null -aoa 100" + ,{aoa:["one", null, 100]} + ,[]] + ,["-str 100" + ,{str:"100"} + ,[]] + ,["--color always" + ,{color:"always"} + ,[]] + ,["--no-nullstream" + ,{nullstream:null} + ,[]] + ,["--nullstream false" + ,{nullstream:null} + ,[]] + ,["--notadate 2011-01-25" + ,{notadate: "2011-01-25"} + ,[]] + ,["--date 2011-01-25" + ,{date: new Date("2011-01-25")} + ,[]] + ].forEach(function (test) { + var argv = test[0].split(/\s+/) + , opts = test[1] + , rem = test[2] + , actual = nopt(types, shorthands, argv, 0) + , parsed = actual.argv + delete actual.argv + console.log(util.inspect(actual, false, 2, true), parsed.remain) + for (var i in opts) { + var e = JSON.stringify(opts[i]) + , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) + if (e && typeof e === "object") { + assert.deepEqual(e, a) + } else { + assert.equal(e, a) + } + } + assert.deepEqual(rem, parsed.remain) + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/README.md b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/README.md new file mode 100644 index 0000000..99746fe --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/lib/abbrev.js new file mode 100644 index 0000000..bee4132 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/lib/abbrev.js @@ -0,0 +1,111 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} + + +// tests +if (module === require.main) { + +var assert = require("assert") +var util = require("util") + +console.log("running tests") +function test (list, expect) { + var actual = abbrev(list) + assert.deepEqual(actual, expect, + "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ + "actual: "+util.inspect(actual)) + actual = abbrev.apply(exports, list) + assert.deepEqual(abbrev.apply(exports, list), expect, + "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ + "actual: "+util.inspect(actual)) +} + +test([ "ruby", "ruby", "rules", "rules", "rules" ], +{ rub: 'ruby' +, ruby: 'ruby' +, rul: 'rules' +, rule: 'rules' +, rules: 'rules' +}) +test(["fool", "foom", "pool", "pope"], +{ fool: 'fool' +, foom: 'foom' +, poo: 'pool' +, pool: 'pool' +, pop: 'pope' +, pope: 'pope' +}) +test(["a", "ab", "abc", "abcd", "abcde", "acde"], +{ a: 'a' +, ab: 'ab' +, abc: 'abc' +, abcd: 'abcd' +, abcde: 'abcde' +, ac: 'acde' +, acd: 'acde' +, acde: 'acde' +}) + +console.log("pass") + +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/package.json new file mode 100644 index 0000000..2190dd4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/node_modules/abbrev/package.json @@ -0,0 +1,29 @@ +{ + "name": "abbrev", + "version": "1.0.4", + "description": "Like ruby's abbrev module, but in js", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "main": "./lib/abbrev.js", + "scripts": { + "test": "node lib/abbrev.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/isaacs/abbrev-js" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" + }, + "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "homepage": "https://github.com/isaacs/abbrev-js", + "_id": "abbrev@1.0.4", + "_from": "abbrev@1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/package.json new file mode 100644 index 0000000..ca3ad65 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/nopt/package.json @@ -0,0 +1,36 @@ +{ + "name": "nopt", + "version": "1.0.10", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "main": "lib/nopt.js", + "scripts": { + "test": "node lib/nopt.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/isaacs/nopt" + }, + "bin": { + "nopt": "./bin/nopt.js" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" + }, + "dependencies": { + "abbrev": "1" + }, + "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/nopt/issues" + }, + "homepage": "https://github.com/isaacs/nopt", + "_id": "nopt@1.0.10", + "_from": "nopt@~1.0.10" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/.travis.yml new file mode 100644 index 0000000..895dbd3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/async.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/async.js new file mode 100644 index 0000000..6624ff7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err) + else console.log(res) +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/sync.js new file mode 100644 index 0000000..54b2cc1 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/index.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/index.js new file mode 100644 index 0000000..51f194b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/index.js @@ -0,0 +1,5 @@ +var core = require('./lib/core'); +exports = module.exports = require('./lib/async'); +exports.core = core; +exports.isCore = function (x) { return core[x] }; +exports.sync = require('./lib/sync'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/async.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/async.js new file mode 100644 index 0000000..7c5a01a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/async.js @@ -0,0 +1,131 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); + +module.exports = function resolve (x, opts, cb) { + if (core[x]) return cb(null, x); + + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (!opts) opts = {}; + + var isFile = opts.isFile || function (file, cb) { + fs.stat(file, function (err, stat) { + if (err && err.code === 'ENOENT') cb(null, false) + else if (err) cb(err) + else cb(null, stat.isFile() || stat.isFIFO()) + }); + }; + var readFile = opts.readFile || fs.readFile; + + var extensions = opts.extensions || [ '.js' ]; + var y = opts.basedir + || path.dirname(require.cache[__filename].parent.filename) + ; + + opts.paths = opts.paths || []; + + if (x.match(/^(?:\.\.?\/|\/|([A-Za-z]:)?\\)/)) { + loadAsFile(path.resolve(y, x), function (err, m) { + if (err) cb(err) + else if (m) cb(null, m) + else loadAsDirectory(path.resolve(y, x), function (err, d) { + if (err) cb(err) + else if (d) cb(null, d) + else cb(new Error("Cannot find module '" + x + "'")) + }) + }); + } + else loadNodeModules(x, y, function (err, n) { + if (err) cb(err) + else if (n) cb(null, n) + else cb(new Error("Cannot find module '" + x + "'")) + }); + + function loadAsFile (x, cb) { + (function load (exts) { + if (exts.length === 0) return cb(null, undefined); + var file = x + exts[0]; + + isFile(file, function (err, ex) { + if (err) cb(err) + else if (ex) cb(null, file) + else load(exts.slice(1)) + }); + })([''].concat(extensions)); + } + + function loadAsDirectory (x, cb) { + var pkgfile = path.join(x, '/package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, '/index'), cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } + catch (err) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + loadAsFile(path.resolve(x, pkg.main), function (err, m) { + if (err) return cb(err); + if (m) return cb(null, m); + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, function (err, n) { + if (err) return cb(err); + if (n) return cb(null, n); + loadAsFile(path.join(x, '/index'), cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), cb); + }); + }); + } + + function loadNodeModules (x, start, cb) { + (function process (dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + loadAsFile(path.join(dir, '/', x), function (err, m) { + if (err) return cb(err); + if (m) return cb(null, m); + loadAsDirectory(path.join(dir, '/', x), function (err, n) { + if (err) return cb(err); + if (n) return cb(null, n); + process(dirs.slice(1)); + }); + }); + })(nodeModulesPaths(start)); + } + + function nodeModulesPaths (start, cb) { + var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/; + var parts = start.split(splitRe); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = path.join( + path.join.apply(path, parts.slice(0, i + 1)), + 'node_modules' + ); + if (!parts[0].match(/([A-Za-z]:)/)) { + dir = '/' + dir; + } + dirs.push(dir); + } + return dirs.concat(opts.paths); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.js new file mode 100644 index 0000000..ea4a6c8 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.js @@ -0,0 +1,4 @@ +module.exports = require('./core.json').reduce(function (acc, x) { + acc[x] = true; + return acc; +}, {}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.json new file mode 100644 index 0000000..28560f7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/core.json @@ -0,0 +1,38 @@ +[ + "assert", + "buffer_ieee754", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "_debugger", + "dgram", + "dns", + "domain", + "events", + "freelist", + "fs", + "http", + "https", + "_linklist", + "module", + "net", + "os", + "path", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "sys", + "timers", + "tls", + "tty", + "url", + "util", + "vm", + "zlib" +] diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/sync.js new file mode 100644 index 0000000..6b8576b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/lib/sync.js @@ -0,0 +1,99 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); + +module.exports = function (x, opts) { + if (core[x]) return x; + + if (!opts) opts = {}; + var isFile = opts.isFile || function (file) { + try { var stat = fs.statSync(file) } + catch (err) { if (err && err.code === 'ENOENT') return false } + return stat.isFile() || stat.isFIFO(); + }; + var readFileSync = opts.readFileSync || fs.readFileSync; + + var extensions = opts.extensions || [ '.js' ]; + var y = opts.basedir + || path.dirname(require.cache[__filename].parent.filename) + ; + + opts.paths = opts.paths || []; + + if (x.match(/^(?:\.\.?\/|\/|([A-Za-z]:)?\\)/)) { + var m = loadAsFileSync(path.resolve(y, x)) + || loadAsDirectorySync(path.resolve(y, x)); + if (m) return m; + } else { + var n = loadNodeModulesSync(x, y); + if (n) return n; + } + + throw new Error("Cannot find module '" + x + "'"); + + function loadAsFileSync (x) { + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadAsDirectorySync (x) { + var pkgfile = path.join(x, '/package.json'); + if (isFile(pkgfile)) { + var body = readFileSync(pkgfile, 'utf8'); + try { + var pkg = JSON.parse(body); + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } + } + catch (err) {} + } + + return loadAsFileSync(path.join( x, '/index')); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPathsSync(start); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(path.join( dir, '/', x)); + if (m) return m; + var n = loadAsDirectorySync(path.join( dir, '/', x )); + if (n) return n; + } + } + + function nodeModulesPathsSync (start) { + var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/; + var parts = start.split(splitRe); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = path.join( + path.join.apply(path, parts.slice(0, i + 1)), + 'node_modules' + ); + if (!parts[0].match(/([A-Za-z]:)/)) { + dir = '/' + dir; + } + dirs.push(dir); + } + return dirs.concat(opts.paths); + } +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/package.json new file mode 100644 index 0000000..de6e854 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/package.json @@ -0,0 +1,36 @@ +{ + "name": "resolve", + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "version": "0.3.1", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-resolve.git" + }, + "main": "index.js", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "scripts": { + "test": "tap test/*.js" + }, + "devDependencies": { + "tap": "~0.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "readme": "# resolve\n\nimplements the [node `require.resolve()`\nalgorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)\nsuch that you can `require.resolve()` on behalf of a file asynchronously and\nsynchronously\n\n[![build status](https://secure.travis-ci.org/substack/node-resolve.png)](http://travis-ci.org/substack/node-resolve)\n\n# example\n\nasynchronously resolve:\n\n``` js\nvar resolve = require('resolve');\nresolve('tap', { basedir: __dirname }, function (err, res) {\n if (err) console.error(err)\n else console.log(res)\n});\n```\n\n```\n$ node example/async.js\n/home/substack/projects/node-resolve/node_modules/tap/lib/main.js\n```\n\nsynchronously resolve:\n\n``` js\nvar resolve = require('resolve');\nvar res = resolve.sync('tap', { basedir: __dirname });\nconsole.log(res);\n```\n\n```\n$ node example/sync.js\n/home/substack/projects/node-resolve/node_modules/tap/lib/main.js\n```\n\n# methods\n\n``` js\nvar resolve = require('resolve')\n```\n\n## resolve(pkg, opts={}, cb)\n\nAsynchronously resolve the module path string `pkg` into `cb(err, res)`.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.readFile - how to read files asynchronously\n\n* opts.isFile - function to asynchronously test whether a file exists\n\n* opts.packageFilter - transform the parsed package.json contents before looking\nat the \"main\" field\n\n* opts.paths - require.paths array to use if nothing is found on the normal\nnode_modules recursive walk (probably don't use this)\n\ndefault `opts` values:\n\n``` javascript\n{\n paths: [],\n basedir: __dirname,\n extensions: [ '.js' ],\n readFile: fs.readFile,\n isFile: function (file, cb) {\n fs.stat(file, function (err, stat) {\n if (err && err.code === 'ENOENT') cb(null, false)\n else if (err) cb(err)\n else cb(null, stat.isFile())\n });\n }\n}\n```\n\n## resolve.sync(pkg, opts)\n\nSynchronously resolve the module path string `pkg`, returning the result and\nthrowing an error when `pkg` can't be resolved.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.readFile - how to read files synchronously\n\n* opts.isFile - function to synchronously test whether a file exists\n\n* opts.packageFilter - transform the parsed package.json contents before looking\nat the \"main\" field\n\n* opts.paths - require.paths array to use if nothing is found on the normal\nnode_modules recursive walk (probably don't use this)\n\ndefault `opts` values:\n\n``` javascript\n{\n paths: [],\n basedir: __dirname,\n extensions: [ '.js' ],\n readFileSync: fs.readFileSync,\n isFile: function (file) {\n try { return fs.statSync(file).isFile() }\n catch (e) { return false }\n }\n}\n````\n\n## resolve.isCore(pkg)\n\nReturn whether a package is in core.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install resolve\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/node-resolve/issues" + }, + "homepage": "https://github.com/substack/node-resolve", + "_id": "resolve@0.3.1", + "_from": "resolve@~0.3.1" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/readme.markdown b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/readme.markdown new file mode 100644 index 0000000..8da922c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/readme.markdown @@ -0,0 +1,134 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/substack/node-resolve.png)](http://travis-ci.org/substack/node-resolve) + +# example + +asynchronously resolve: + +``` js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err) + else console.log(res) +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +``` js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +``` js +var resolve = require('resolve') +``` + +## resolve(pkg, opts={}, cb) + +Asynchronously resolve the module path string `pkg` into `cb(err, res)`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.packageFilter - transform the parsed package.json contents before looking +at the "main" field + +* opts.paths - require.paths array to use if nothing is found on the normal +node_modules recursive walk (probably don't use this) + +default `opts` values: + +``` javascript +{ + paths: [], + basedir: __dirname, + extensions: [ '.js' ], + readFile: fs.readFile, + isFile: function (file, cb) { + fs.stat(file, function (err, stat) { + if (err && err.code === 'ENOENT') cb(null, false) + else if (err) cb(err) + else cb(null, stat.isFile()) + }); + } +} +``` + +## resolve.sync(pkg, opts) + +Synchronously resolve the module path string `pkg`, returning the result and +throwing an error when `pkg` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* opts.packageFilter - transform the parsed package.json contents before looking +at the "main" field + +* opts.paths - require.paths array to use if nothing is found on the normal +node_modules recursive walk (probably don't use this) + +default `opts` values: + +``` javascript +{ + paths: [], + basedir: __dirname, + extensions: [ '.js' ], + readFileSync: fs.readFileSync, + isFile: function (file) { + try { return fs.statSync(file).isFile() } + catch (e) { return false } + } +} +```` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install resolve +``` + +# license + +MIT diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/core.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/core.js new file mode 100644 index 0000000..88a510c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/core.js @@ -0,0 +1,12 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('core modules', function (t) { + t.ok(resolve.isCore('fs')); + t.ok(resolve.isCore('net')); + t.ok(resolve.isCore('http')); + + t.ok(!resolve.isCore('seq')); + t.ok(!resolve.isCore('../')); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter.js new file mode 100644 index 0000000..eb64642 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter.js @@ -0,0 +1,17 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('filter', function (t) { + t.plan(1); + var dir = __dirname + '/resolver'; + resolve('./baz', { + basedir : dir, + packageFilter : function (pkg) { + pkg.main = 'doom'; + return pkg; + } + }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/baz/doom.js'); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter_sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter_sync.js new file mode 100644 index 0000000..8856c01 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,15 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('filter', function (t) { + var dir = __dirname + '/resolver'; + var res = resolve.sync('./baz', { + basedir : dir, + packageFilter : function (pkg) { + pkg.main = 'doom' + return pkg; + } + }); + t.equal(res, dir + '/baz/doom.js'); + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock.js new file mode 100644 index 0000000..76bdd75 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock.js @@ -0,0 +1,68 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = { + '/foo/bar/baz.js' : 'beep' + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('./baz', opts('/foo/bar'), function (err, res) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz'"); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz'"); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = { + '/foo/node_modules/bar/baz.js' : 'beep', + '/foo/node_modules/bar/package.json' : JSON.stringify({ + main : './baz.js' + }) + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('bar', opts('/foo'), function (err, res) { + if (err) t.fail(err); + t.equal(res, '/foo/node_modules/bar/baz.js'); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock_sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock_sync.js new file mode 100644 index 0000000..963afa5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,68 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = { + '/foo/bar/baz.js' : 'beep' + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file) { + return files.hasOwnProperty(file) + }, + readFileSync : function (file) { + return files[file] + } + } + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + '/foo/bar/baz.js' + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + '/foo/bar/baz.js' + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = { + '/foo/node_modules/bar/baz.js' : 'beep', + '/foo/node_modules/bar/package.json' : JSON.stringify({ + main : './baz.js' + }) + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file) { + return files.hasOwnProperty(file) + }, + readFileSync : function (file) { + return files[file] + } + } + } + + t.equal( + resolve.sync('bar', opts('/foo')), + '/foo/node_modules/bar/baz.js' + ); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver.js new file mode 100644 index 0000000..3fb64f5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver.js @@ -0,0 +1,144 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('async foo', function (t) { + t.plan(3); + var dir = __dirname + '/resolver'; + + resolve('./foo', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + }); + + resolve('./foo.js', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + }); + + resolve('foo', { basedir : dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo'"); + }); +}); + +test('bar', function (t) { + t.plan(2); + var dir = __dirname + '/resolver'; + + resolve('foo', { basedir : dir + '/bar' }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/bar/node_modules/foo/index.js'); + }); + + resolve('foo', { basedir : dir + '/bar' }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/bar/node_modules/foo/index.js'); + }); +}); + +test('baz', function (t) { + t.plan(1); + var dir = __dirname + '/resolver'; + + resolve('./baz', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/baz/quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(3); + var dir = __dirname + '/resolver/biz/node_modules'; + + resolve('./grux', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + }); + + resolve('tiv', { basedir : dir + '/grux' }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/tiv/index.js'); + }); + + resolve('grux', { basedir : dir + '/tiv' }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + }); +}); + +test('normalize', function (t) { + t.plan(1); + var dir = __dirname + '/resolver/biz/node_modules/grux'; + + resolve('../grux', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/index.js'); + }); +}); + +test('cup', function (t) { + t.plan(3); + var dir = __dirname + '/resolver'; + + resolve('./cup', { basedir : dir, extensions : [ '.js', '.coffee' ] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/cup.coffee'); + }); + + resolve('./cup.coffee', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/cup.coffee'); + }); + + resolve('./cup', { basedir : dir, extensions : [ '.js' ] }, + function (err, res) { + t.equal(err.message, "Cannot find module './cup'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = __dirname + '/resolver'; + + resolve('./mug', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/mug.js'); + }); + + resolve('./mug', { basedir : dir, extensions : [ '.coffee', '.js' ] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/mug.coffee'); + }); + + resolve('./mug', { basedir : dir, extensions : [ '.js', '.coffee' ] }, + function (err, res) { + t.equal(res, dir + '/mug.js'); + }); +}); + +test('other path', function (t) { + t.plan(4); + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/bar'; + var otherDir = resolverDir + '/other_path'; + + resolve('root', { basedir : dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/other_path/root.js'); + }); + + resolve('lib/other-lib', { basedir : dir, paths: [otherDir] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/other_path/lib/other-lib.js'); + }); + + resolve('root', { basedir : dir, }, function (err, res) { + t.equal(err.message, "Cannot find module 'root'"); + }); + + resolve('zzz', { basedir : dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz'"); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/doom.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/doom.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 0000000..6b81dcd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,3 @@ +{ + "main" : "quux.js" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/quux.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js new file mode 100644 index 0000000..4996055 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js @@ -0,0 +1 @@ +module.exports = require('tiv') * 100; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js new file mode 100644 index 0000000..690aad3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/cup.coffee b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/foo.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/mug.coffee b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/mug.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/other_path/root.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 0000000..e69de29 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver_sync.js b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 0000000..80f5aa5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,157 @@ +var test = require('tap').test; +var resolve = require('../'); + +test('foo', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('./foo', { basedir : dir }), + dir + '/foo.js' + ); + + t.equal( + resolve.sync('./foo.js', { basedir : dir }), + dir + '/foo.js' + ); + + t.throws(function () { + resolve.sync('foo', { basedir : dir }); + }); + + t.end(); +}); + +test('bar', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('foo', { basedir : dir + '/bar' }), + dir + '/bar/node_modules/foo/index.js' + ); + t.end(); +}); + +test('baz', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('./baz', { basedir : dir }), + dir + '/baz/quux.js' + ); + t.end(); +}); + +test('biz', function (t) { + var dir = __dirname + '/resolver/biz/node_modules'; + t.equal( + resolve.sync('./grux', { basedir : dir }), + dir + '/grux/index.js' + ); + + t.equal( + resolve.sync('tiv', { basedir : dir + '/grux' }), + dir + '/tiv/index.js' + ); + + t.equal( + resolve.sync('grux', { basedir : dir + '/tiv' }), + dir + '/grux/index.js' + ); + t.end(); +}); + +test('normalize', function (t) { + var dir = __dirname + '/resolver/biz/node_modules/grux'; + t.equal( + resolve.sync('../grux', { basedir : dir }), + dir + '/index.js' + ); + t.end(); +}); + +test('cup', function (t) { + var dir = __dirname + '/resolver'; + t.equal( + resolve.sync('./cup', { + basedir : dir, + extensions : [ '.js', '.coffee' ] + }), + dir + '/cup.coffee' + ); + + t.equal( + resolve.sync('./cup.coffee', { + basedir : dir + }), + dir + '/cup.coffee' + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir : dir, + extensions : [ '.js' ] + }) + }); + + t.end(); +}); + +test('mug', function (t) { + var dir = __dirname + '/resolver'; + t.equal( + resolve.sync('./mug', { basedir : dir }), + dir + '/mug.js' + ); + + t.equal( + resolve.sync('./mug', { + basedir : dir, + extensions : [ '.coffee', '.js' ] + }), + dir + '/mug.coffee' + ); + + t.equal( + resolve.sync('./mug', { + basedir : dir, + extensions : [ '.js', '.coffee' ] + }), + dir + '/mug.js' + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/bar'; + var otherDir = resolverDir + '/other_path'; + + var path = require('path'); + + t.equal( + resolve.sync('root', { + basedir : dir, + paths: [otherDir] }), + resolverDir + '/other_path/root.js' + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir : dir, + paths: [otherDir] }), + resolverDir + '/other_path/lib/other-lib.js' + ); + + t.throws(function () { + resolve.sync('root', { basedir : dir, }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir : dir, + paths: [otherDir] }); + }); + + t.end(); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-cli/package.json b/proj7/jquery-source/jquery/node_modules/grunt-cli/package.json new file mode 100644 index 0000000..956f427 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-cli/package.json @@ -0,0 +1,67 @@ +{ + "name": "grunt-cli", + "description": "The grunt command line interface.", + "version": "0.1.13", + "author": { + "name": "Grunt Team" + }, + "homepage": "http://gruntjs.com/", + "repository": { + "type": "git", + "url": "git://github.com/gruntjs/grunt-cli.git" + }, + "bugs": { + "url": "http://github.com/gruntjs/grunt-cli/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/gruntjs/grunt-cli/blob/master/LICENSE-MIT" + } + ], + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "node bin/grunt test" + }, + "preferGlobal": true, + "dependencies": { + "nopt": "~1.0.10", + "findup-sync": "~0.1.0", + "resolve": "~0.3.1" + }, + "devDependencies": { + "grunt": "~0.4.0", + "grunt-contrib-jshint": "~0.2.0" + }, + "contributors": [ + { + "name": "Tyler Kellen", + "url": "http://goingslowly.com" + }, + { + "name": "Ben Alman", + "url": "http://gruntjs.com" + }, + { + "name": "Scott González", + "url": "http://nemikor.com" + }, + { + "name": "Forbes Lindesay", + "url": "https://github.com/" + } + ], + "readme": "# grunt-cli [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-cli.png?branch=master)](http://travis-ci.org/gruntjs/grunt-cli)\n> The Grunt command line interface.\n\nInstall this globally and you'll have access to the `grunt` command anywhere on your system.\n\n```shell\nnpm install -g grunt-cli\n```\n\n**Note:** The job of the `grunt` command is to load and run the version of Grunt you have installed locally to your project, irrespective of its version. Starting with Grunt v0.4, you should never install Grunt itself globally. For more information about why, [please read this](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation).\n\nSee the [Getting Started](http://gruntjs.com/getting-started) guide for more information.\n\n## Shell tab auto-completion\nTo enable tab auto-completion for Grunt, add one of the following lines to your `~/.bashrc` or `~/.zshrc` file.\n\n```bash\n# Bash, ~/.bashrc\neval \"$(grunt --completion=bash)\"\n```\n\n```bash\n# Zsh, ~/.zshrc\neval \"$(grunt --completion=zsh)\"\n```\n\n## Installing grunt-cli locally\nIf you prefer the idiomatic Node.js method to get started with a project (`npm install && npm test`) then install grunt-cli locally with `npm install grunt-cli --save-dev`. Then add a script to your `package.json` to run the associated grunt command: `\"scripts\": { \"test\": \"grunt test\" } `. Now `npm test` will use the locally installed `./node_modules/.bin/grunt` executable to run your Grunt commands.\n\nTo read more about npm scripts, please visit the npm docs: [https://npmjs.org/doc/misc/npm-scripts.html](https://npmjs.org/doc/misc/npm-scripts.html).\n", + "readmeFilename": "README.md", + "_id": "grunt-cli@0.1.13", + "dist": { + "shasum": "e9ebc4047631f5012d922770c39378133cad10f4" + }, + "_from": "grunt-cli@0.1.13", + "_resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.jshintrc b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.jshintrc new file mode 100644 index 0000000..e0cc7bb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.jshintrc @@ -0,0 +1,14 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "boss": true, + "eqnull": true, + "node": true, + "es5": true +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.npmignore new file mode 100644 index 0000000..2ccbe46 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.npmignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.sizecache.json b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.sizecache.json new file mode 100644 index 0000000..264e26f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/.sizecache.json @@ -0,0 +1 @@ +{"":{"version":0.4,"tips":{"master":"fb20cee7fef36d855cb5edde4b1870d67447b63e"}}," last run":{"tasks/compare-size.js":{"":13039,"gz":3724},"test/compare-size.js":{"":31483,"gz":4968}},"master":{"tasks/compare-size.js":{"":11738,"gz":3481},"test/compare-size.js":{"":27698,"gz":4595}}} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/Gruntfile.js b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/Gruntfile.js new file mode 100644 index 0000000..ae682eb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/Gruntfile.js @@ -0,0 +1,49 @@ +"use strict"; + +module.exports = function(grunt) { + + var gzip = require("gzip-js"); + + // Project configuration. + grunt.initConfig({ + compare_size: { + files: [ + "tasks/compare-size.js", + "test/compare-size.js" + ], + options: { + compress: { + gz: function( contents ) { + return gzip.zip( contents, {} ).length; + } + } + } + }, + nodeunit: { + tests: [ "test/**/*.js" ] + }, + jshint: { + files: [ "Gruntfile.js", "tasks/**/*.js", "test/**/*.js" ], + options: { + jshintrc: ".jshintrc" + } + }, + watch: { + files: "<%= jshint.files %>", + tasks: "default" + } + }); + + // Load local tasks. + grunt.loadTasks("tasks"); + + grunt.loadNpmTasks("grunt-contrib-jshint"); + grunt.loadNpmTasks("grunt-contrib-nodeunit"); + grunt.loadNpmTasks("grunt-contrib-watch"); + + // Default task. + grunt.registerTask( "default", [ "jshint", "nodeunit" ] ); + + // Task aliases. + grunt.registerTask( "test", [ "nodeunit" ] ); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/LICENSE-MIT b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/LICENSE-MIT new file mode 100644 index 0000000..f8e8617 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2012 Rick Waldron , Corey Frang , Richard Gibson + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-compare-size/README.md b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/README.md new file mode 100644 index 0000000..df53b4f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-compare-size/README.md @@ -0,0 +1,106 @@ +# grunt-compare-size + +Compare file sizes on this branch to master + +## Getting Started + +Add this to your project's `Gruntfile.js` gruntfile: +```javascript +grunt.loadNpmTasks('grunt-compare-size'); +``` + +Then add "grunt-compare-size" to your package.json dependencies. + +Then install the plugin with: `npm install` + +The name to use in your own task definitions is `compare_size` (with an underscore). + +## Documentation + +Add an entry to your Gruntfile.js's `initConfig` object, which will define the files to measure the size of. The last file in the list will also be gzipped and measured. + +```js + ... + + compare_size: { + files: [ + "library.js", + "library.min.js" + ], + options: { + // Location of stored size data + cache: ".sizecache.json", + + // Compressor label-function pairs + compress: { + gz: function( fileContents ) { + return require("gzip-js").zip( fileContents, {} ).length; + }, + otherCompressorLabel: function( fileContents ) { + return compressedSize( fileContents ); + }, + ... + } + } + } + + ... +``` + +To run a size comparison: + +``` +grunt compare_size +``` + +To get compressed comparisons of a single file: + +``` +grunt compare_size:: +``` + +To add a labeled measurement to the saved list of measurements: + +``` +grunt compare_size:add:
        " + cmt[1] + ""; + tr += "" + cmt[3].replace(/(#(\d+))/, "$1") + ""; + html += "" + tr + "\n"; + + if (cmt[2] !== "Anton Kovalyov") + authors[cmt[2]] = true; + }); + + echo(""); + echo("\n" + html + "
        \n"); + + if (Object.keys(authors).length) { + echo("

        Thanks to " + Object.keys(authors).join(", ") + " for sending patches!

        "); + } +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint new file mode 100755 index 0000000..f56105f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require("../src/cli.js").interpret(process.argv); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land new file mode 100755 index 0000000..ab3eafb --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".patch"; +var https = require("https"); +var shjs = require("shelljs"); +var opts = require("url").parse(url); +var msg = process.argv[3]; + +opts.rejectUnauthorized = false; +opts.agent = new https.Agent(opts); + +https.get(opts, succ).on("error", err); + +function succ(res) { + if (res.statusCode !== 200) + return void console.log("error:", res.statusCode); + + var data = ""; + res.on("data", function (chunk) { + data += chunk.toString(); + }); + + res.on("end", function () { + data = data.split("\n"); + data = data[1].replace(/^From\:\s/, ""); + data = data.replace(/"/g, ""); + + shjs.exec("git commit -s --author=\"" + data + "\" --message=\"" + msg + "\""); + }) +} + +function err(res) { + console.log("error:", res.message); +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/ascii-identifier-data.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/ascii-identifier-data.js new file mode 100644 index 0000000..00b5c64 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/ascii-identifier-data.js @@ -0,0 +1,22 @@ +var identifierStartTable = []; + +for (var i = 0; i < 128; i++) { + identifierStartTable[i] = + i === 36 || // $ + i >= 65 && i <= 90 || // A-Z + i === 95 || // _ + i >= 97 && i <= 122; // a-z +} + +var identifierPartTable = []; + +for (var i = 0; i < 128; i++) { + identifierPartTable[i] = + identifierStartTable[i] || // $, _, A-Z, a-z + i >= 48 && i <= 57; // 0-9 +} + +module.exports = { + asciiIdentifierStartTable: identifierStartTable, + asciiIdentifierPartTable: identifierPartTable +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-part-only.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-part-only.js new file mode 100644 index 0000000..3de6314 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-part-only.js @@ -0,0 +1,1570 @@ +module.exports = [ + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 799, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 823, + 824, + 825, + 826, + 827, + 828, + 829, + 830, + 831, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 839, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 847, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 855, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 863, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 871, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 879, + 1155, + 1156, + 1157, + 1158, + 1159, + 1425, + 1426, + 1427, + 1428, + 1429, + 1430, + 1431, + 1432, + 1433, + 1434, + 1435, + 1436, + 1437, + 1438, + 1439, + 1440, + 1441, + 1442, + 1443, + 1444, + 1445, + 1446, + 1447, + 1448, + 1449, + 1450, + 1451, + 1452, + 1453, + 1454, + 1455, + 1456, + 1457, + 1458, + 1459, + 1460, + 1461, + 1462, + 1463, + 1464, + 1465, + 1466, + 1467, + 1468, + 1469, + 1471, + 1473, + 1474, + 1476, + 1477, + 1479, + 1552, + 1553, + 1554, + 1555, + 1556, + 1557, + 1558, + 1559, + 1560, + 1561, + 1562, + 1611, + 1612, + 1613, + 1614, + 1615, + 1616, + 1617, + 1618, + 1619, + 1620, + 1621, + 1622, + 1623, + 1624, + 1625, + 1626, + 1627, + 1628, + 1629, + 1630, + 1631, + 1632, + 1633, + 1634, + 1635, + 1636, + 1637, + 1638, + 1639, + 1640, + 1641, + 1648, + 1750, + 1751, + 1752, + 1753, + 1754, + 1755, + 1756, + 1759, + 1760, + 1761, + 1762, + 1763, + 1764, + 1767, + 1768, + 1770, + 1771, + 1772, + 1773, + 1776, + 1777, + 1778, + 1779, + 1780, + 1781, + 1782, + 1783, + 1784, + 1785, + 1809, + 1840, + 1841, + 1842, + 1843, + 1844, + 1845, + 1846, + 1847, + 1848, + 1849, + 1850, + 1851, + 1852, + 1853, + 1854, + 1855, + 1856, + 1857, + 1858, + 1859, + 1860, + 1861, + 1862, + 1863, + 1864, + 1865, + 1866, + 1958, + 1959, + 1960, + 1961, + 1962, + 1963, + 1964, + 1965, + 1966, + 1967, + 1968, + 1984, + 1985, + 1986, + 1987, + 1988, + 1989, + 1990, + 1991, + 1992, + 1993, + 2027, + 2028, + 2029, + 2030, + 2031, + 2032, + 2033, + 2034, + 2035, + 2070, + 2071, + 2072, + 2073, + 2075, + 2076, + 2077, + 2078, + 2079, + 2080, + 2081, + 2082, + 2083, + 2085, + 2086, + 2087, + 2089, + 2090, + 2091, + 2092, + 2093, + 2137, + 2138, + 2139, + 2276, + 2277, + 2278, + 2279, + 2280, + 2281, + 2282, + 2283, + 2284, + 2285, + 2286, + 2287, + 2288, + 2289, + 2290, + 2291, + 2292, + 2293, + 2294, + 2295, + 2296, + 2297, + 2298, + 2299, + 2300, + 2301, + 2302, + 2304, + 2305, + 2306, + 2307, + 2362, + 2363, + 2364, + 2366, + 2367, + 2368, + 2369, + 2370, + 2371, + 2372, + 2373, + 2374, + 2375, + 2376, + 2377, + 2378, + 2379, + 2380, + 2381, + 2382, + 2383, + 2385, + 2386, + 2387, + 2388, + 2389, + 2390, + 2391, + 2402, + 2403, + 2406, + 2407, + 2408, + 2409, + 2410, + 2411, + 2412, + 2413, + 2414, + 2415, + 2433, + 2434, + 2435, + 2492, + 2494, + 2495, + 2496, + 2497, + 2498, + 2499, + 2500, + 2503, + 2504, + 2507, + 2508, + 2509, + 2519, + 2530, + 2531, + 2534, + 2535, + 2536, + 2537, + 2538, + 2539, + 2540, + 2541, + 2542, + 2543, + 2561, + 2562, + 2563, + 2620, + 2622, + 2623, + 2624, + 2625, + 2626, + 2631, + 2632, + 2635, + 2636, + 2637, + 2641, + 2662, + 2663, + 2664, + 2665, + 2666, + 2667, + 2668, + 2669, + 2670, + 2671, + 2672, + 2673, + 2677, + 2689, + 2690, + 2691, + 2748, + 2750, + 2751, + 2752, + 2753, + 2754, + 2755, + 2756, + 2757, + 2759, + 2760, + 2761, + 2763, + 2764, + 2765, + 2786, + 2787, + 2790, + 2791, + 2792, + 2793, + 2794, + 2795, + 2796, + 2797, + 2798, + 2799, + 2817, + 2818, + 2819, + 2876, + 2878, + 2879, + 2880, + 2881, + 2882, + 2883, + 2884, + 2887, + 2888, + 2891, + 2892, + 2893, + 2902, + 2903, + 2914, + 2915, + 2918, + 2919, + 2920, + 2921, + 2922, + 2923, + 2924, + 2925, + 2926, + 2927, + 2946, + 3006, + 3007, + 3008, + 3009, + 3010, + 3014, + 3015, + 3016, + 3018, + 3019, + 3020, + 3021, + 3031, + 3046, + 3047, + 3048, + 3049, + 3050, + 3051, + 3052, + 3053, + 3054, + 3055, + 3073, + 3074, + 3075, + 3134, + 3135, + 3136, + 3137, + 3138, + 3139, + 3140, + 3142, + 3143, + 3144, + 3146, + 3147, + 3148, + 3149, + 3157, + 3158, + 3170, + 3171, + 3174, + 3175, + 3176, + 3177, + 3178, + 3179, + 3180, + 3181, + 3182, + 3183, + 3202, + 3203, + 3260, + 3262, + 3263, + 3264, + 3265, + 3266, + 3267, + 3268, + 3270, + 3271, + 3272, + 3274, + 3275, + 3276, + 3277, + 3285, + 3286, + 3298, + 3299, + 3302, + 3303, + 3304, + 3305, + 3306, + 3307, + 3308, + 3309, + 3310, + 3311, + 3330, + 3331, + 3390, + 3391, + 3392, + 3393, + 3394, + 3395, + 3396, + 3398, + 3399, + 3400, + 3402, + 3403, + 3404, + 3405, + 3415, + 3426, + 3427, + 3430, + 3431, + 3432, + 3433, + 3434, + 3435, + 3436, + 3437, + 3438, + 3439, + 3458, + 3459, + 3530, + 3535, + 3536, + 3537, + 3538, + 3539, + 3540, + 3542, + 3544, + 3545, + 3546, + 3547, + 3548, + 3549, + 3550, + 3551, + 3570, + 3571, + 3633, + 3636, + 3637, + 3638, + 3639, + 3640, + 3641, + 3642, + 3655, + 3656, + 3657, + 3658, + 3659, + 3660, + 3661, + 3662, + 3664, + 3665, + 3666, + 3667, + 3668, + 3669, + 3670, + 3671, + 3672, + 3673, + 3761, + 3764, + 3765, + 3766, + 3767, + 3768, + 3769, + 3771, + 3772, + 3784, + 3785, + 3786, + 3787, + 3788, + 3789, + 3792, + 3793, + 3794, + 3795, + 3796, + 3797, + 3798, + 3799, + 3800, + 3801, + 3864, + 3865, + 3872, + 3873, + 3874, + 3875, + 3876, + 3877, + 3878, + 3879, + 3880, + 3881, + 3893, + 3895, + 3897, + 3902, + 3903, + 3953, + 3954, + 3955, + 3956, + 3957, + 3958, + 3959, + 3960, + 3961, + 3962, + 3963, + 3964, + 3965, + 3966, + 3967, + 3968, + 3969, + 3970, + 3971, + 3972, + 3974, + 3975, + 3981, + 3982, + 3983, + 3984, + 3985, + 3986, + 3987, + 3988, + 3989, + 3990, + 3991, + 3993, + 3994, + 3995, + 3996, + 3997, + 3998, + 3999, + 4000, + 4001, + 4002, + 4003, + 4004, + 4005, + 4006, + 4007, + 4008, + 4009, + 4010, + 4011, + 4012, + 4013, + 4014, + 4015, + 4016, + 4017, + 4018, + 4019, + 4020, + 4021, + 4022, + 4023, + 4024, + 4025, + 4026, + 4027, + 4028, + 4038, + 4139, + 4140, + 4141, + 4142, + 4143, + 4144, + 4145, + 4146, + 4147, + 4148, + 4149, + 4150, + 4151, + 4152, + 4153, + 4154, + 4155, + 4156, + 4157, + 4158, + 4160, + 4161, + 4162, + 4163, + 4164, + 4165, + 4166, + 4167, + 4168, + 4169, + 4182, + 4183, + 4184, + 4185, + 4190, + 4191, + 4192, + 4194, + 4195, + 4196, + 4199, + 4200, + 4201, + 4202, + 4203, + 4204, + 4205, + 4209, + 4210, + 4211, + 4212, + 4226, + 4227, + 4228, + 4229, + 4230, + 4231, + 4232, + 4233, + 4234, + 4235, + 4236, + 4237, + 4239, + 4240, + 4241, + 4242, + 4243, + 4244, + 4245, + 4246, + 4247, + 4248, + 4249, + 4250, + 4251, + 4252, + 4253, + 4957, + 4958, + 4959, + 5906, + 5907, + 5908, + 5938, + 5939, + 5940, + 5970, + 5971, + 6002, + 6003, + 6068, + 6069, + 6070, + 6071, + 6072, + 6073, + 6074, + 6075, + 6076, + 6077, + 6078, + 6079, + 6080, + 6081, + 6082, + 6083, + 6084, + 6085, + 6086, + 6087, + 6088, + 6089, + 6090, + 6091, + 6092, + 6093, + 6094, + 6095, + 6096, + 6097, + 6098, + 6099, + 6109, + 6112, + 6113, + 6114, + 6115, + 6116, + 6117, + 6118, + 6119, + 6120, + 6121, + 6155, + 6156, + 6157, + 6160, + 6161, + 6162, + 6163, + 6164, + 6165, + 6166, + 6167, + 6168, + 6169, + 6313, + 6432, + 6433, + 6434, + 6435, + 6436, + 6437, + 6438, + 6439, + 6440, + 6441, + 6442, + 6443, + 6448, + 6449, + 6450, + 6451, + 6452, + 6453, + 6454, + 6455, + 6456, + 6457, + 6458, + 6459, + 6470, + 6471, + 6472, + 6473, + 6474, + 6475, + 6476, + 6477, + 6478, + 6479, + 6576, + 6577, + 6578, + 6579, + 6580, + 6581, + 6582, + 6583, + 6584, + 6585, + 6586, + 6587, + 6588, + 6589, + 6590, + 6591, + 6592, + 6600, + 6601, + 6608, + 6609, + 6610, + 6611, + 6612, + 6613, + 6614, + 6615, + 6616, + 6617, + 6679, + 6680, + 6681, + 6682, + 6683, + 6741, + 6742, + 6743, + 6744, + 6745, + 6746, + 6747, + 6748, + 6749, + 6750, + 6752, + 6753, + 6754, + 6755, + 6756, + 6757, + 6758, + 6759, + 6760, + 6761, + 6762, + 6763, + 6764, + 6765, + 6766, + 6767, + 6768, + 6769, + 6770, + 6771, + 6772, + 6773, + 6774, + 6775, + 6776, + 6777, + 6778, + 6779, + 6780, + 6783, + 6784, + 6785, + 6786, + 6787, + 6788, + 6789, + 6790, + 6791, + 6792, + 6793, + 6800, + 6801, + 6802, + 6803, + 6804, + 6805, + 6806, + 6807, + 6808, + 6809, + 6912, + 6913, + 6914, + 6915, + 6916, + 6964, + 6965, + 6966, + 6967, + 6968, + 6969, + 6970, + 6971, + 6972, + 6973, + 6974, + 6975, + 6976, + 6977, + 6978, + 6979, + 6980, + 6992, + 6993, + 6994, + 6995, + 6996, + 6997, + 6998, + 6999, + 7000, + 7001, + 7019, + 7020, + 7021, + 7022, + 7023, + 7024, + 7025, + 7026, + 7027, + 7040, + 7041, + 7042, + 7073, + 7074, + 7075, + 7076, + 7077, + 7078, + 7079, + 7080, + 7081, + 7082, + 7083, + 7084, + 7085, + 7088, + 7089, + 7090, + 7091, + 7092, + 7093, + 7094, + 7095, + 7096, + 7097, + 7142, + 7143, + 7144, + 7145, + 7146, + 7147, + 7148, + 7149, + 7150, + 7151, + 7152, + 7153, + 7154, + 7155, + 7204, + 7205, + 7206, + 7207, + 7208, + 7209, + 7210, + 7211, + 7212, + 7213, + 7214, + 7215, + 7216, + 7217, + 7218, + 7219, + 7220, + 7221, + 7222, + 7223, + 7232, + 7233, + 7234, + 7235, + 7236, + 7237, + 7238, + 7239, + 7240, + 7241, + 7248, + 7249, + 7250, + 7251, + 7252, + 7253, + 7254, + 7255, + 7256, + 7257, + 7376, + 7377, + 7378, + 7380, + 7381, + 7382, + 7383, + 7384, + 7385, + 7386, + 7387, + 7388, + 7389, + 7390, + 7391, + 7392, + 7393, + 7394, + 7395, + 7396, + 7397, + 7398, + 7399, + 7400, + 7405, + 7410, + 7411, + 7412, + 7616, + 7617, + 7618, + 7619, + 7620, + 7621, + 7622, + 7623, + 7624, + 7625, + 7626, + 7627, + 7628, + 7629, + 7630, + 7631, + 7632, + 7633, + 7634, + 7635, + 7636, + 7637, + 7638, + 7639, + 7640, + 7641, + 7642, + 7643, + 7644, + 7645, + 7646, + 7647, + 7648, + 7649, + 7650, + 7651, + 7652, + 7653, + 7654, + 7676, + 7677, + 7678, + 7679, + 8204, + 8205, + 8255, + 8256, + 8276, + 8400, + 8401, + 8402, + 8403, + 8404, + 8405, + 8406, + 8407, + 8408, + 8409, + 8410, + 8411, + 8412, + 8417, + 8421, + 8422, + 8423, + 8424, + 8425, + 8426, + 8427, + 8428, + 8429, + 8430, + 8431, + 8432, + 11503, + 11504, + 11505, + 11647, + 11744, + 11745, + 11746, + 11747, + 11748, + 11749, + 11750, + 11751, + 11752, + 11753, + 11754, + 11755, + 11756, + 11757, + 11758, + 11759, + 11760, + 11761, + 11762, + 11763, + 11764, + 11765, + 11766, + 11767, + 11768, + 11769, + 11770, + 11771, + 11772, + 11773, + 11774, + 11775, + 12330, + 12331, + 12332, + 12333, + 12334, + 12335, + 12441, + 12442, + 42528, + 42529, + 42530, + 42531, + 42532, + 42533, + 42534, + 42535, + 42536, + 42537, + 42607, + 42612, + 42613, + 42614, + 42615, + 42616, + 42617, + 42618, + 42619, + 42620, + 42621, + 42655, + 42736, + 42737, + 43010, + 43014, + 43019, + 43043, + 43044, + 43045, + 43046, + 43047, + 43136, + 43137, + 43188, + 43189, + 43190, + 43191, + 43192, + 43193, + 43194, + 43195, + 43196, + 43197, + 43198, + 43199, + 43200, + 43201, + 43202, + 43203, + 43204, + 43216, + 43217, + 43218, + 43219, + 43220, + 43221, + 43222, + 43223, + 43224, + 43225, + 43232, + 43233, + 43234, + 43235, + 43236, + 43237, + 43238, + 43239, + 43240, + 43241, + 43242, + 43243, + 43244, + 43245, + 43246, + 43247, + 43248, + 43249, + 43264, + 43265, + 43266, + 43267, + 43268, + 43269, + 43270, + 43271, + 43272, + 43273, + 43302, + 43303, + 43304, + 43305, + 43306, + 43307, + 43308, + 43309, + 43335, + 43336, + 43337, + 43338, + 43339, + 43340, + 43341, + 43342, + 43343, + 43344, + 43345, + 43346, + 43347, + 43392, + 43393, + 43394, + 43395, + 43443, + 43444, + 43445, + 43446, + 43447, + 43448, + 43449, + 43450, + 43451, + 43452, + 43453, + 43454, + 43455, + 43456, + 43472, + 43473, + 43474, + 43475, + 43476, + 43477, + 43478, + 43479, + 43480, + 43481, + 43561, + 43562, + 43563, + 43564, + 43565, + 43566, + 43567, + 43568, + 43569, + 43570, + 43571, + 43572, + 43573, + 43574, + 43587, + 43596, + 43597, + 43600, + 43601, + 43602, + 43603, + 43604, + 43605, + 43606, + 43607, + 43608, + 43609, + 43643, + 43696, + 43698, + 43699, + 43700, + 43703, + 43704, + 43710, + 43711, + 43713, + 43755, + 43756, + 43757, + 43758, + 43759, + 43765, + 43766, + 44003, + 44004, + 44005, + 44006, + 44007, + 44008, + 44009, + 44010, + 44012, + 44013, + 44016, + 44017, + 44018, + 44019, + 44020, + 44021, + 44022, + 44023, + 44024, + 44025, + 64286, + 65024, + 65025, + 65026, + 65027, + 65028, + 65029, + 65030, + 65031, + 65032, + 65033, + 65034, + 65035, + 65036, + 65037, + 65038, + 65039, + 65056, + 65057, + 65058, + 65059, + 65060, + 65061, + 65062, + 65075, + 65076, + 65101, + 65102, + 65103, + 65296, + 65297, + 65298, + 65299, + 65300, + 65301, + 65302, + 65303, + 65304, + 65305, + 65343 +]; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-start.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-start.js new file mode 100644 index 0000000..61f14f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/data/non-ascii-identifier-start.js @@ -0,0 +1,48477 @@ +module.exports = [ + 170, + 181, + 186, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 227, + 228, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274, + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 283, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 354, + 355, + 356, + 357, + 358, + 359, + 360, + 361, + 362, + 363, + 364, + 365, + 366, + 367, + 368, + 369, + 370, + 371, + 372, + 373, + 374, + 375, + 376, + 377, + 378, + 379, + 380, + 381, + 382, + 383, + 384, + 385, + 386, + 387, + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 408, + 409, + 410, + 411, + 412, + 413, + 414, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 424, + 425, + 426, + 427, + 428, + 429, + 430, + 431, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 439, + 440, + 441, + 442, + 443, + 444, + 445, + 446, + 447, + 448, + 449, + 450, + 451, + 452, + 453, + 454, + 455, + 456, + 457, + 458, + 459, + 460, + 461, + 462, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 472, + 473, + 474, + 475, + 476, + 477, + 478, + 479, + 480, + 481, + 482, + 483, + 484, + 485, + 486, + 487, + 488, + 489, + 490, + 491, + 492, + 493, + 494, + 495, + 496, + 497, + 498, + 499, + 500, + 501, + 502, + 503, + 504, + 505, + 506, + 507, + 508, + 509, + 510, + 511, + 512, + 513, + 514, + 515, + 516, + 517, + 518, + 519, + 520, + 521, + 522, + 523, + 524, + 525, + 526, + 527, + 528, + 529, + 530, + 531, + 532, + 533, + 534, + 535, + 536, + 537, + 538, + 539, + 540, + 541, + 542, + 543, + 544, + 545, + 546, + 547, + 548, + 549, + 550, + 551, + 552, + 553, + 554, + 555, + 556, + 557, + 558, + 559, + 560, + 561, + 562, + 563, + 564, + 565, + 566, + 567, + 568, + 569, + 570, + 571, + 572, + 573, + 574, + 575, + 576, + 577, + 578, + 579, + 580, + 581, + 582, + 583, + 584, + 585, + 586, + 587, + 588, + 589, + 590, + 591, + 592, + 593, + 594, + 595, + 596, + 597, + 598, + 599, + 600, + 601, + 602, + 603, + 604, + 605, + 606, + 607, + 608, + 609, + 610, + 611, + 612, + 613, + 614, + 615, + 616, + 617, + 618, + 619, + 620, + 621, + 622, + 623, + 624, + 625, + 626, + 627, + 628, + 629, + 630, + 631, + 632, + 633, + 634, + 635, + 636, + 637, + 638, + 639, + 640, + 641, + 642, + 643, + 644, + 645, + 646, + 647, + 648, + 649, + 650, + 651, + 652, + 653, + 654, + 655, + 656, + 657, + 658, + 659, + 660, + 661, + 662, + 663, + 664, + 665, + 666, + 667, + 668, + 669, + 670, + 671, + 672, + 673, + 674, + 675, + 676, + 677, + 678, + 679, + 680, + 681, + 682, + 683, + 684, + 685, + 686, + 687, + 688, + 689, + 690, + 691, + 692, + 693, + 694, + 695, + 696, + 697, + 698, + 699, + 700, + 701, + 702, + 703, + 704, + 705, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 719, + 720, + 721, + 736, + 737, + 738, + 739, + 740, + 748, + 750, + 880, + 881, + 882, + 883, + 884, + 886, + 887, + 890, + 891, + 892, + 893, + 902, + 904, + 905, + 906, + 908, + 910, + 911, + 912, + 913, + 914, + 915, + 916, + 917, + 918, + 919, + 920, + 921, + 922, + 923, + 924, + 925, + 926, + 927, + 928, + 929, + 931, + 932, + 933, + 934, + 935, + 936, + 937, + 938, + 939, + 940, + 941, + 942, + 943, + 944, + 945, + 946, + 947, + 948, + 949, + 950, + 951, + 952, + 953, + 954, + 955, + 956, + 957, + 958, + 959, + 960, + 961, + 962, + 963, + 964, + 965, + 966, + 967, + 968, + 969, + 970, + 971, + 972, + 973, + 974, + 975, + 976, + 977, + 978, + 979, + 980, + 981, + 982, + 983, + 984, + 985, + 986, + 987, + 988, + 989, + 990, + 991, + 992, + 993, + 994, + 995, + 996, + 997, + 998, + 999, + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1007, + 1008, + 1009, + 1010, + 1011, + 1012, + 1013, + 1015, + 1016, + 1017, + 1018, + 1019, + 1020, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1055, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1071, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1079, + 1080, + 1081, + 1082, + 1083, + 1084, + 1085, + 1086, + 1087, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1119, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1135, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1143, + 1144, + 1145, + 1146, + 1147, + 1148, + 1149, + 1150, + 1151, + 1152, + 1153, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1183, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1199, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1207, + 1208, + 1209, + 1210, + 1211, + 1212, + 1213, + 1214, + 1215, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223, + 1224, + 1225, + 1226, + 1227, + 1228, + 1229, + 1230, + 1231, + 1232, + 1233, + 1234, + 1235, + 1236, + 1237, + 1238, + 1239, + 1240, + 1241, + 1242, + 1243, + 1244, + 1245, + 1246, + 1247, + 1248, + 1249, + 1250, + 1251, + 1252, + 1253, + 1254, + 1255, + 1256, + 1257, + 1258, + 1259, + 1260, + 1261, + 1262, + 1263, + 1264, + 1265, + 1266, + 1267, + 1268, + 1269, + 1270, + 1271, + 1272, + 1273, + 1274, + 1275, + 1276, + 1277, + 1278, + 1279, + 1280, + 1281, + 1282, + 1283, + 1284, + 1285, + 1286, + 1287, + 1288, + 1289, + 1290, + 1291, + 1292, + 1293, + 1294, + 1295, + 1296, + 1297, + 1298, + 1299, + 1300, + 1301, + 1302, + 1303, + 1304, + 1305, + 1306, + 1307, + 1308, + 1309, + 1310, + 1311, + 1312, + 1313, + 1314, + 1315, + 1316, + 1317, + 1318, + 1319, + 1329, + 1330, + 1331, + 1332, + 1333, + 1334, + 1335, + 1336, + 1337, + 1338, + 1339, + 1340, + 1341, + 1342, + 1343, + 1344, + 1345, + 1346, + 1347, + 1348, + 1349, + 1350, + 1351, + 1352, + 1353, + 1354, + 1355, + 1356, + 1357, + 1358, + 1359, + 1360, + 1361, + 1362, + 1363, + 1364, + 1365, + 1366, + 1369, + 1377, + 1378, + 1379, + 1380, + 1381, + 1382, + 1383, + 1384, + 1385, + 1386, + 1387, + 1388, + 1389, + 1390, + 1391, + 1392, + 1393, + 1394, + 1395, + 1396, + 1397, + 1398, + 1399, + 1400, + 1401, + 1402, + 1403, + 1404, + 1405, + 1406, + 1407, + 1408, + 1409, + 1410, + 1411, + 1412, + 1413, + 1414, + 1415, + 1488, + 1489, + 1490, + 1491, + 1492, + 1493, + 1494, + 1495, + 1496, + 1497, + 1498, + 1499, + 1500, + 1501, + 1502, + 1503, + 1504, + 1505, + 1506, + 1507, + 1508, + 1509, + 1510, + 1511, + 1512, + 1513, + 1514, + 1520, + 1521, + 1522, + 1568, + 1569, + 1570, + 1571, + 1572, + 1573, + 1574, + 1575, + 1576, + 1577, + 1578, + 1579, + 1580, + 1581, + 1582, + 1583, + 1584, + 1585, + 1586, + 1587, + 1588, + 1589, + 1590, + 1591, + 1592, + 1593, + 1594, + 1595, + 1596, + 1597, + 1598, + 1599, + 1600, + 1601, + 1602, + 1603, + 1604, + 1605, + 1606, + 1607, + 1608, + 1609, + 1610, + 1646, + 1647, + 1649, + 1650, + 1651, + 1652, + 1653, + 1654, + 1655, + 1656, + 1657, + 1658, + 1659, + 1660, + 1661, + 1662, + 1663, + 1664, + 1665, + 1666, + 1667, + 1668, + 1669, + 1670, + 1671, + 1672, + 1673, + 1674, + 1675, + 1676, + 1677, + 1678, + 1679, + 1680, + 1681, + 1682, + 1683, + 1684, + 1685, + 1686, + 1687, + 1688, + 1689, + 1690, + 1691, + 1692, + 1693, + 1694, + 1695, + 1696, + 1697, + 1698, + 1699, + 1700, + 1701, + 1702, + 1703, + 1704, + 1705, + 1706, + 1707, + 1708, + 1709, + 1710, + 1711, + 1712, + 1713, + 1714, + 1715, + 1716, + 1717, + 1718, + 1719, + 1720, + 1721, + 1722, + 1723, + 1724, + 1725, + 1726, + 1727, + 1728, + 1729, + 1730, + 1731, + 1732, + 1733, + 1734, + 1735, + 1736, + 1737, + 1738, + 1739, + 1740, + 1741, + 1742, + 1743, + 1744, + 1745, + 1746, + 1747, + 1749, + 1765, + 1766, + 1774, + 1775, + 1786, + 1787, + 1788, + 1791, + 1808, + 1810, + 1811, + 1812, + 1813, + 1814, + 1815, + 1816, + 1817, + 1818, + 1819, + 1820, + 1821, + 1822, + 1823, + 1824, + 1825, + 1826, + 1827, + 1828, + 1829, + 1830, + 1831, + 1832, + 1833, + 1834, + 1835, + 1836, + 1837, + 1838, + 1839, + 1869, + 1870, + 1871, + 1872, + 1873, + 1874, + 1875, + 1876, + 1877, + 1878, + 1879, + 1880, + 1881, + 1882, + 1883, + 1884, + 1885, + 1886, + 1887, + 1888, + 1889, + 1890, + 1891, + 1892, + 1893, + 1894, + 1895, + 1896, + 1897, + 1898, + 1899, + 1900, + 1901, + 1902, + 1903, + 1904, + 1905, + 1906, + 1907, + 1908, + 1909, + 1910, + 1911, + 1912, + 1913, + 1914, + 1915, + 1916, + 1917, + 1918, + 1919, + 1920, + 1921, + 1922, + 1923, + 1924, + 1925, + 1926, + 1927, + 1928, + 1929, + 1930, + 1931, + 1932, + 1933, + 1934, + 1935, + 1936, + 1937, + 1938, + 1939, + 1940, + 1941, + 1942, + 1943, + 1944, + 1945, + 1946, + 1947, + 1948, + 1949, + 1950, + 1951, + 1952, + 1953, + 1954, + 1955, + 1956, + 1957, + 1969, + 1994, + 1995, + 1996, + 1997, + 1998, + 1999, + 2000, + 2001, + 2002, + 2003, + 2004, + 2005, + 2006, + 2007, + 2008, + 2009, + 2010, + 2011, + 2012, + 2013, + 2014, + 2015, + 2016, + 2017, + 2018, + 2019, + 2020, + 2021, + 2022, + 2023, + 2024, + 2025, + 2026, + 2036, + 2037, + 2042, + 2048, + 2049, + 2050, + 2051, + 2052, + 2053, + 2054, + 2055, + 2056, + 2057, + 2058, + 2059, + 2060, + 2061, + 2062, + 2063, + 2064, + 2065, + 2066, + 2067, + 2068, + 2069, + 2074, + 2084, + 2088, + 2112, + 2113, + 2114, + 2115, + 2116, + 2117, + 2118, + 2119, + 2120, + 2121, + 2122, + 2123, + 2124, + 2125, + 2126, + 2127, + 2128, + 2129, + 2130, + 2131, + 2132, + 2133, + 2134, + 2135, + 2136, + 2208, + 2210, + 2211, + 2212, + 2213, + 2214, + 2215, + 2216, + 2217, + 2218, + 2219, + 2220, + 2308, + 2309, + 2310, + 2311, + 2312, + 2313, + 2314, + 2315, + 2316, + 2317, + 2318, + 2319, + 2320, + 2321, + 2322, + 2323, + 2324, + 2325, + 2326, + 2327, + 2328, + 2329, + 2330, + 2331, + 2332, + 2333, + 2334, + 2335, + 2336, + 2337, + 2338, + 2339, + 2340, + 2341, + 2342, + 2343, + 2344, + 2345, + 2346, + 2347, + 2348, + 2349, + 2350, + 2351, + 2352, + 2353, + 2354, + 2355, + 2356, + 2357, + 2358, + 2359, + 2360, + 2361, + 2365, + 2384, + 2392, + 2393, + 2394, + 2395, + 2396, + 2397, + 2398, + 2399, + 2400, + 2401, + 2417, + 2418, + 2419, + 2420, + 2421, + 2422, + 2423, + 2425, + 2426, + 2427, + 2428, + 2429, + 2430, + 2431, + 2437, + 2438, + 2439, + 2440, + 2441, + 2442, + 2443, + 2444, + 2447, + 2448, + 2451, + 2452, + 2453, + 2454, + 2455, + 2456, + 2457, + 2458, + 2459, + 2460, + 2461, + 2462, + 2463, + 2464, + 2465, + 2466, + 2467, + 2468, + 2469, + 2470, + 2471, + 2472, + 2474, + 2475, + 2476, + 2477, + 2478, + 2479, + 2480, + 2482, + 2486, + 2487, + 2488, + 2489, + 2493, + 2510, + 2524, + 2525, + 2527, + 2528, + 2529, + 2544, + 2545, + 2565, + 2566, + 2567, + 2568, + 2569, + 2570, + 2575, + 2576, + 2579, + 2580, + 2581, + 2582, + 2583, + 2584, + 2585, + 2586, + 2587, + 2588, + 2589, + 2590, + 2591, + 2592, + 2593, + 2594, + 2595, + 2596, + 2597, + 2598, + 2599, + 2600, + 2602, + 2603, + 2604, + 2605, + 2606, + 2607, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2650, + 2651, + 2652, + 2654, + 2674, + 2675, + 2676, + 2693, + 2694, + 2695, + 2696, + 2697, + 2698, + 2699, + 2700, + 2701, + 2703, + 2704, + 2705, + 2707, + 2708, + 2709, + 2710, + 2711, + 2712, + 2713, + 2714, + 2715, + 2716, + 2717, + 2718, + 2719, + 2720, + 2721, + 2722, + 2723, + 2724, + 2725, + 2726, + 2727, + 2728, + 2730, + 2731, + 2732, + 2733, + 2734, + 2735, + 2736, + 2738, + 2739, + 2741, + 2742, + 2743, + 2744, + 2745, + 2749, + 2768, + 2784, + 2785, + 2821, + 2822, + 2823, + 2824, + 2825, + 2826, + 2827, + 2828, + 2831, + 2832, + 2835, + 2836, + 2837, + 2838, + 2839, + 2840, + 2841, + 2842, + 2843, + 2844, + 2845, + 2846, + 2847, + 2848, + 2849, + 2850, + 2851, + 2852, + 2853, + 2854, + 2855, + 2856, + 2858, + 2859, + 2860, + 2861, + 2862, + 2863, + 2864, + 2866, + 2867, + 2869, + 2870, + 2871, + 2872, + 2873, + 2877, + 2908, + 2909, + 2911, + 2912, + 2913, + 2929, + 2947, + 2949, + 2950, + 2951, + 2952, + 2953, + 2954, + 2958, + 2959, + 2960, + 2962, + 2963, + 2964, + 2965, + 2969, + 2970, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2985, + 2986, + 2990, + 2991, + 2992, + 2993, + 2994, + 2995, + 2996, + 2997, + 2998, + 2999, + 3000, + 3001, + 3024, + 3077, + 3078, + 3079, + 3080, + 3081, + 3082, + 3083, + 3084, + 3086, + 3087, + 3088, + 3090, + 3091, + 3092, + 3093, + 3094, + 3095, + 3096, + 3097, + 3098, + 3099, + 3100, + 3101, + 3102, + 3103, + 3104, + 3105, + 3106, + 3107, + 3108, + 3109, + 3110, + 3111, + 3112, + 3114, + 3115, + 3116, + 3117, + 3118, + 3119, + 3120, + 3121, + 3122, + 3123, + 3125, + 3126, + 3127, + 3128, + 3129, + 3133, + 3160, + 3161, + 3168, + 3169, + 3205, + 3206, + 3207, + 3208, + 3209, + 3210, + 3211, + 3212, + 3214, + 3215, + 3216, + 3218, + 3219, + 3220, + 3221, + 3222, + 3223, + 3224, + 3225, + 3226, + 3227, + 3228, + 3229, + 3230, + 3231, + 3232, + 3233, + 3234, + 3235, + 3236, + 3237, + 3238, + 3239, + 3240, + 3242, + 3243, + 3244, + 3245, + 3246, + 3247, + 3248, + 3249, + 3250, + 3251, + 3253, + 3254, + 3255, + 3256, + 3257, + 3261, + 3294, + 3296, + 3297, + 3313, + 3314, + 3333, + 3334, + 3335, + 3336, + 3337, + 3338, + 3339, + 3340, + 3342, + 3343, + 3344, + 3346, + 3347, + 3348, + 3349, + 3350, + 3351, + 3352, + 3353, + 3354, + 3355, + 3356, + 3357, + 3358, + 3359, + 3360, + 3361, + 3362, + 3363, + 3364, + 3365, + 3366, + 3367, + 3368, + 3369, + 3370, + 3371, + 3372, + 3373, + 3374, + 3375, + 3376, + 3377, + 3378, + 3379, + 3380, + 3381, + 3382, + 3383, + 3384, + 3385, + 3386, + 3389, + 3406, + 3424, + 3425, + 3450, + 3451, + 3452, + 3453, + 3454, + 3455, + 3461, + 3462, + 3463, + 3464, + 3465, + 3466, + 3467, + 3468, + 3469, + 3470, + 3471, + 3472, + 3473, + 3474, + 3475, + 3476, + 3477, + 3478, + 3482, + 3483, + 3484, + 3485, + 3486, + 3487, + 3488, + 3489, + 3490, + 3491, + 3492, + 3493, + 3494, + 3495, + 3496, + 3497, + 3498, + 3499, + 3500, + 3501, + 3502, + 3503, + 3504, + 3505, + 3507, + 3508, + 3509, + 3510, + 3511, + 3512, + 3513, + 3514, + 3515, + 3517, + 3520, + 3521, + 3522, + 3523, + 3524, + 3525, + 3526, + 3585, + 3586, + 3587, + 3588, + 3589, + 3590, + 3591, + 3592, + 3593, + 3594, + 3595, + 3596, + 3597, + 3598, + 3599, + 3600, + 3601, + 3602, + 3603, + 3604, + 3605, + 3606, + 3607, + 3608, + 3609, + 3610, + 3611, + 3612, + 3613, + 3614, + 3615, + 3616, + 3617, + 3618, + 3619, + 3620, + 3621, + 3622, + 3623, + 3624, + 3625, + 3626, + 3627, + 3628, + 3629, + 3630, + 3631, + 3632, + 3634, + 3635, + 3648, + 3649, + 3650, + 3651, + 3652, + 3653, + 3654, + 3713, + 3714, + 3716, + 3719, + 3720, + 3722, + 3725, + 3732, + 3733, + 3734, + 3735, + 3737, + 3738, + 3739, + 3740, + 3741, + 3742, + 3743, + 3745, + 3746, + 3747, + 3749, + 3751, + 3754, + 3755, + 3757, + 3758, + 3759, + 3760, + 3762, + 3763, + 3773, + 3776, + 3777, + 3778, + 3779, + 3780, + 3782, + 3804, + 3805, + 3806, + 3807, + 3840, + 3904, + 3905, + 3906, + 3907, + 3908, + 3909, + 3910, + 3911, + 3913, + 3914, + 3915, + 3916, + 3917, + 3918, + 3919, + 3920, + 3921, + 3922, + 3923, + 3924, + 3925, + 3926, + 3927, + 3928, + 3929, + 3930, + 3931, + 3932, + 3933, + 3934, + 3935, + 3936, + 3937, + 3938, + 3939, + 3940, + 3941, + 3942, + 3943, + 3944, + 3945, + 3946, + 3947, + 3948, + 3976, + 3977, + 3978, + 3979, + 3980, + 4096, + 4097, + 4098, + 4099, + 4100, + 4101, + 4102, + 4103, + 4104, + 4105, + 4106, + 4107, + 4108, + 4109, + 4110, + 4111, + 4112, + 4113, + 4114, + 4115, + 4116, + 4117, + 4118, + 4119, + 4120, + 4121, + 4122, + 4123, + 4124, + 4125, + 4126, + 4127, + 4128, + 4129, + 4130, + 4131, + 4132, + 4133, + 4134, + 4135, + 4136, + 4137, + 4138, + 4159, + 4176, + 4177, + 4178, + 4179, + 4180, + 4181, + 4186, + 4187, + 4188, + 4189, + 4193, + 4197, + 4198, + 4206, + 4207, + 4208, + 4213, + 4214, + 4215, + 4216, + 4217, + 4218, + 4219, + 4220, + 4221, + 4222, + 4223, + 4224, + 4225, + 4238, + 4256, + 4257, + 4258, + 4259, + 4260, + 4261, + 4262, + 4263, + 4264, + 4265, + 4266, + 4267, + 4268, + 4269, + 4270, + 4271, + 4272, + 4273, + 4274, + 4275, + 4276, + 4277, + 4278, + 4279, + 4280, + 4281, + 4282, + 4283, + 4284, + 4285, + 4286, + 4287, + 4288, + 4289, + 4290, + 4291, + 4292, + 4293, + 4295, + 4301, + 4304, + 4305, + 4306, + 4307, + 4308, + 4309, + 4310, + 4311, + 4312, + 4313, + 4314, + 4315, + 4316, + 4317, + 4318, + 4319, + 4320, + 4321, + 4322, + 4323, + 4324, + 4325, + 4326, + 4327, + 4328, + 4329, + 4330, + 4331, + 4332, + 4333, + 4334, + 4335, + 4336, + 4337, + 4338, + 4339, + 4340, + 4341, + 4342, + 4343, + 4344, + 4345, + 4346, + 4348, + 4349, + 4350, + 4351, + 4352, + 4353, + 4354, + 4355, + 4356, + 4357, + 4358, + 4359, + 4360, + 4361, + 4362, + 4363, + 4364, + 4365, + 4366, + 4367, + 4368, + 4369, + 4370, + 4371, + 4372, + 4373, + 4374, + 4375, + 4376, + 4377, + 4378, + 4379, + 4380, + 4381, + 4382, + 4383, + 4384, + 4385, + 4386, + 4387, + 4388, + 4389, + 4390, + 4391, + 4392, + 4393, + 4394, + 4395, + 4396, + 4397, + 4398, + 4399, + 4400, + 4401, + 4402, + 4403, + 4404, + 4405, + 4406, + 4407, + 4408, + 4409, + 4410, + 4411, + 4412, + 4413, + 4414, + 4415, + 4416, + 4417, + 4418, + 4419, + 4420, + 4421, + 4422, + 4423, + 4424, + 4425, + 4426, + 4427, + 4428, + 4429, + 4430, + 4431, + 4432, + 4433, + 4434, + 4435, + 4436, + 4437, + 4438, + 4439, + 4440, + 4441, + 4442, + 4443, + 4444, + 4445, + 4446, + 4447, + 4448, + 4449, + 4450, + 4451, + 4452, + 4453, + 4454, + 4455, + 4456, + 4457, + 4458, + 4459, + 4460, + 4461, + 4462, + 4463, + 4464, + 4465, + 4466, + 4467, + 4468, + 4469, + 4470, + 4471, + 4472, + 4473, + 4474, + 4475, + 4476, + 4477, + 4478, + 4479, + 4480, + 4481, + 4482, + 4483, + 4484, + 4485, + 4486, + 4487, + 4488, + 4489, + 4490, + 4491, + 4492, + 4493, + 4494, + 4495, + 4496, + 4497, + 4498, + 4499, + 4500, + 4501, + 4502, + 4503, + 4504, + 4505, + 4506, + 4507, + 4508, + 4509, + 4510, + 4511, + 4512, + 4513, + 4514, + 4515, + 4516, + 4517, + 4518, + 4519, + 4520, + 4521, + 4522, + 4523, + 4524, + 4525, + 4526, + 4527, + 4528, + 4529, + 4530, + 4531, + 4532, + 4533, + 4534, + 4535, + 4536, + 4537, + 4538, + 4539, + 4540, + 4541, + 4542, + 4543, + 4544, + 4545, + 4546, + 4547, + 4548, + 4549, + 4550, + 4551, + 4552, + 4553, + 4554, + 4555, + 4556, + 4557, + 4558, + 4559, + 4560, + 4561, + 4562, + 4563, + 4564, + 4565, + 4566, + 4567, + 4568, + 4569, + 4570, + 4571, + 4572, + 4573, + 4574, + 4575, + 4576, + 4577, + 4578, + 4579, + 4580, + 4581, + 4582, + 4583, + 4584, + 4585, + 4586, + 4587, + 4588, + 4589, + 4590, + 4591, + 4592, + 4593, + 4594, + 4595, + 4596, + 4597, + 4598, + 4599, + 4600, + 4601, + 4602, + 4603, + 4604, + 4605, + 4606, + 4607, + 4608, + 4609, + 4610, + 4611, + 4612, + 4613, + 4614, + 4615, + 4616, + 4617, + 4618, + 4619, + 4620, + 4621, + 4622, + 4623, + 4624, + 4625, + 4626, + 4627, + 4628, + 4629, + 4630, + 4631, + 4632, + 4633, + 4634, + 4635, + 4636, + 4637, + 4638, + 4639, + 4640, + 4641, + 4642, + 4643, + 4644, + 4645, + 4646, + 4647, + 4648, + 4649, + 4650, + 4651, + 4652, + 4653, + 4654, + 4655, + 4656, + 4657, + 4658, + 4659, + 4660, + 4661, + 4662, + 4663, + 4664, + 4665, + 4666, + 4667, + 4668, + 4669, + 4670, + 4671, + 4672, + 4673, + 4674, + 4675, + 4676, + 4677, + 4678, + 4679, + 4680, + 4682, + 4683, + 4684, + 4685, + 4688, + 4689, + 4690, + 4691, + 4692, + 4693, + 4694, + 4696, + 4698, + 4699, + 4700, + 4701, + 4704, + 4705, + 4706, + 4707, + 4708, + 4709, + 4710, + 4711, + 4712, + 4713, + 4714, + 4715, + 4716, + 4717, + 4718, + 4719, + 4720, + 4721, + 4722, + 4723, + 4724, + 4725, + 4726, + 4727, + 4728, + 4729, + 4730, + 4731, + 4732, + 4733, + 4734, + 4735, + 4736, + 4737, + 4738, + 4739, + 4740, + 4741, + 4742, + 4743, + 4744, + 4746, + 4747, + 4748, + 4749, + 4752, + 4753, + 4754, + 4755, + 4756, + 4757, + 4758, + 4759, + 4760, + 4761, + 4762, + 4763, + 4764, + 4765, + 4766, + 4767, + 4768, + 4769, + 4770, + 4771, + 4772, + 4773, + 4774, + 4775, + 4776, + 4777, + 4778, + 4779, + 4780, + 4781, + 4782, + 4783, + 4784, + 4786, + 4787, + 4788, + 4789, + 4792, + 4793, + 4794, + 4795, + 4796, + 4797, + 4798, + 4800, + 4802, + 4803, + 4804, + 4805, + 4808, + 4809, + 4810, + 4811, + 4812, + 4813, + 4814, + 4815, + 4816, + 4817, + 4818, + 4819, + 4820, + 4821, + 4822, + 4824, + 4825, + 4826, + 4827, + 4828, + 4829, + 4830, + 4831, + 4832, + 4833, + 4834, + 4835, + 4836, + 4837, + 4838, + 4839, + 4840, + 4841, + 4842, + 4843, + 4844, + 4845, + 4846, + 4847, + 4848, + 4849, + 4850, + 4851, + 4852, + 4853, + 4854, + 4855, + 4856, + 4857, + 4858, + 4859, + 4860, + 4861, + 4862, + 4863, + 4864, + 4865, + 4866, + 4867, + 4868, + 4869, + 4870, + 4871, + 4872, + 4873, + 4874, + 4875, + 4876, + 4877, + 4878, + 4879, + 4880, + 4882, + 4883, + 4884, + 4885, + 4888, + 4889, + 4890, + 4891, + 4892, + 4893, + 4894, + 4895, + 4896, + 4897, + 4898, + 4899, + 4900, + 4901, + 4902, + 4903, + 4904, + 4905, + 4906, + 4907, + 4908, + 4909, + 4910, + 4911, + 4912, + 4913, + 4914, + 4915, + 4916, + 4917, + 4918, + 4919, + 4920, + 4921, + 4922, + 4923, + 4924, + 4925, + 4926, + 4927, + 4928, + 4929, + 4930, + 4931, + 4932, + 4933, + 4934, + 4935, + 4936, + 4937, + 4938, + 4939, + 4940, + 4941, + 4942, + 4943, + 4944, + 4945, + 4946, + 4947, + 4948, + 4949, + 4950, + 4951, + 4952, + 4953, + 4954, + 4992, + 4993, + 4994, + 4995, + 4996, + 4997, + 4998, + 4999, + 5000, + 5001, + 5002, + 5003, + 5004, + 5005, + 5006, + 5007, + 5024, + 5025, + 5026, + 5027, + 5028, + 5029, + 5030, + 5031, + 5032, + 5033, + 5034, + 5035, + 5036, + 5037, + 5038, + 5039, + 5040, + 5041, + 5042, + 5043, + 5044, + 5045, + 5046, + 5047, + 5048, + 5049, + 5050, + 5051, + 5052, + 5053, + 5054, + 5055, + 5056, + 5057, + 5058, + 5059, + 5060, + 5061, + 5062, + 5063, + 5064, + 5065, + 5066, + 5067, + 5068, + 5069, + 5070, + 5071, + 5072, + 5073, + 5074, + 5075, + 5076, + 5077, + 5078, + 5079, + 5080, + 5081, + 5082, + 5083, + 5084, + 5085, + 5086, + 5087, + 5088, + 5089, + 5090, + 5091, + 5092, + 5093, + 5094, + 5095, + 5096, + 5097, + 5098, + 5099, + 5100, + 5101, + 5102, + 5103, + 5104, + 5105, + 5106, + 5107, + 5108, + 5121, + 5122, + 5123, + 5124, + 5125, + 5126, + 5127, + 5128, + 5129, + 5130, + 5131, + 5132, + 5133, + 5134, + 5135, + 5136, + 5137, + 5138, + 5139, + 5140, + 5141, + 5142, + 5143, + 5144, + 5145, + 5146, + 5147, + 5148, + 5149, + 5150, + 5151, + 5152, + 5153, + 5154, + 5155, + 5156, + 5157, + 5158, + 5159, + 5160, + 5161, + 5162, + 5163, + 5164, + 5165, + 5166, + 5167, + 5168, + 5169, + 5170, + 5171, + 5172, + 5173, + 5174, + 5175, + 5176, + 5177, + 5178, + 5179, + 5180, + 5181, + 5182, + 5183, + 5184, + 5185, + 5186, + 5187, + 5188, + 5189, + 5190, + 5191, + 5192, + 5193, + 5194, + 5195, + 5196, + 5197, + 5198, + 5199, + 5200, + 5201, + 5202, + 5203, + 5204, + 5205, + 5206, + 5207, + 5208, + 5209, + 5210, + 5211, + 5212, + 5213, + 5214, + 5215, + 5216, + 5217, + 5218, + 5219, + 5220, + 5221, + 5222, + 5223, + 5224, + 5225, + 5226, + 5227, + 5228, + 5229, + 5230, + 5231, + 5232, + 5233, + 5234, + 5235, + 5236, + 5237, + 5238, + 5239, + 5240, + 5241, + 5242, + 5243, + 5244, + 5245, + 5246, + 5247, + 5248, + 5249, + 5250, + 5251, + 5252, + 5253, + 5254, + 5255, + 5256, + 5257, + 5258, + 5259, + 5260, + 5261, + 5262, + 5263, + 5264, + 5265, + 5266, + 5267, + 5268, + 5269, + 5270, + 5271, + 5272, + 5273, + 5274, + 5275, + 5276, + 5277, + 5278, + 5279, + 5280, + 5281, + 5282, + 5283, + 5284, + 5285, + 5286, + 5287, + 5288, + 5289, + 5290, + 5291, + 5292, + 5293, + 5294, + 5295, + 5296, + 5297, + 5298, + 5299, + 5300, + 5301, + 5302, + 5303, + 5304, + 5305, + 5306, + 5307, + 5308, + 5309, + 5310, + 5311, + 5312, + 5313, + 5314, + 5315, + 5316, + 5317, + 5318, + 5319, + 5320, + 5321, + 5322, + 5323, + 5324, + 5325, + 5326, + 5327, + 5328, + 5329, + 5330, + 5331, + 5332, + 5333, + 5334, + 5335, + 5336, + 5337, + 5338, + 5339, + 5340, + 5341, + 5342, + 5343, + 5344, + 5345, + 5346, + 5347, + 5348, + 5349, + 5350, + 5351, + 5352, + 5353, + 5354, + 5355, + 5356, + 5357, + 5358, + 5359, + 5360, + 5361, + 5362, + 5363, + 5364, + 5365, + 5366, + 5367, + 5368, + 5369, + 5370, + 5371, + 5372, + 5373, + 5374, + 5375, + 5376, + 5377, + 5378, + 5379, + 5380, + 5381, + 5382, + 5383, + 5384, + 5385, + 5386, + 5387, + 5388, + 5389, + 5390, + 5391, + 5392, + 5393, + 5394, + 5395, + 5396, + 5397, + 5398, + 5399, + 5400, + 5401, + 5402, + 5403, + 5404, + 5405, + 5406, + 5407, + 5408, + 5409, + 5410, + 5411, + 5412, + 5413, + 5414, + 5415, + 5416, + 5417, + 5418, + 5419, + 5420, + 5421, + 5422, + 5423, + 5424, + 5425, + 5426, + 5427, + 5428, + 5429, + 5430, + 5431, + 5432, + 5433, + 5434, + 5435, + 5436, + 5437, + 5438, + 5439, + 5440, + 5441, + 5442, + 5443, + 5444, + 5445, + 5446, + 5447, + 5448, + 5449, + 5450, + 5451, + 5452, + 5453, + 5454, + 5455, + 5456, + 5457, + 5458, + 5459, + 5460, + 5461, + 5462, + 5463, + 5464, + 5465, + 5466, + 5467, + 5468, + 5469, + 5470, + 5471, + 5472, + 5473, + 5474, + 5475, + 5476, + 5477, + 5478, + 5479, + 5480, + 5481, + 5482, + 5483, + 5484, + 5485, + 5486, + 5487, + 5488, + 5489, + 5490, + 5491, + 5492, + 5493, + 5494, + 5495, + 5496, + 5497, + 5498, + 5499, + 5500, + 5501, + 5502, + 5503, + 5504, + 5505, + 5506, + 5507, + 5508, + 5509, + 5510, + 5511, + 5512, + 5513, + 5514, + 5515, + 5516, + 5517, + 5518, + 5519, + 5520, + 5521, + 5522, + 5523, + 5524, + 5525, + 5526, + 5527, + 5528, + 5529, + 5530, + 5531, + 5532, + 5533, + 5534, + 5535, + 5536, + 5537, + 5538, + 5539, + 5540, + 5541, + 5542, + 5543, + 5544, + 5545, + 5546, + 5547, + 5548, + 5549, + 5550, + 5551, + 5552, + 5553, + 5554, + 5555, + 5556, + 5557, + 5558, + 5559, + 5560, + 5561, + 5562, + 5563, + 5564, + 5565, + 5566, + 5567, + 5568, + 5569, + 5570, + 5571, + 5572, + 5573, + 5574, + 5575, + 5576, + 5577, + 5578, + 5579, + 5580, + 5581, + 5582, + 5583, + 5584, + 5585, + 5586, + 5587, + 5588, + 5589, + 5590, + 5591, + 5592, + 5593, + 5594, + 5595, + 5596, + 5597, + 5598, + 5599, + 5600, + 5601, + 5602, + 5603, + 5604, + 5605, + 5606, + 5607, + 5608, + 5609, + 5610, + 5611, + 5612, + 5613, + 5614, + 5615, + 5616, + 5617, + 5618, + 5619, + 5620, + 5621, + 5622, + 5623, + 5624, + 5625, + 5626, + 5627, + 5628, + 5629, + 5630, + 5631, + 5632, + 5633, + 5634, + 5635, + 5636, + 5637, + 5638, + 5639, + 5640, + 5641, + 5642, + 5643, + 5644, + 5645, + 5646, + 5647, + 5648, + 5649, + 5650, + 5651, + 5652, + 5653, + 5654, + 5655, + 5656, + 5657, + 5658, + 5659, + 5660, + 5661, + 5662, + 5663, + 5664, + 5665, + 5666, + 5667, + 5668, + 5669, + 5670, + 5671, + 5672, + 5673, + 5674, + 5675, + 5676, + 5677, + 5678, + 5679, + 5680, + 5681, + 5682, + 5683, + 5684, + 5685, + 5686, + 5687, + 5688, + 5689, + 5690, + 5691, + 5692, + 5693, + 5694, + 5695, + 5696, + 5697, + 5698, + 5699, + 5700, + 5701, + 5702, + 5703, + 5704, + 5705, + 5706, + 5707, + 5708, + 5709, + 5710, + 5711, + 5712, + 5713, + 5714, + 5715, + 5716, + 5717, + 5718, + 5719, + 5720, + 5721, + 5722, + 5723, + 5724, + 5725, + 5726, + 5727, + 5728, + 5729, + 5730, + 5731, + 5732, + 5733, + 5734, + 5735, + 5736, + 5737, + 5738, + 5739, + 5740, + 5743, + 5744, + 5745, + 5746, + 5747, + 5748, + 5749, + 5750, + 5751, + 5752, + 5753, + 5754, + 5755, + 5756, + 5757, + 5758, + 5759, + 5761, + 5762, + 5763, + 5764, + 5765, + 5766, + 5767, + 5768, + 5769, + 5770, + 5771, + 5772, + 5773, + 5774, + 5775, + 5776, + 5777, + 5778, + 5779, + 5780, + 5781, + 5782, + 5783, + 5784, + 5785, + 5786, + 5792, + 5793, + 5794, + 5795, + 5796, + 5797, + 5798, + 5799, + 5800, + 5801, + 5802, + 5803, + 5804, + 5805, + 5806, + 5807, + 5808, + 5809, + 5810, + 5811, + 5812, + 5813, + 5814, + 5815, + 5816, + 5817, + 5818, + 5819, + 5820, + 5821, + 5822, + 5823, + 5824, + 5825, + 5826, + 5827, + 5828, + 5829, + 5830, + 5831, + 5832, + 5833, + 5834, + 5835, + 5836, + 5837, + 5838, + 5839, + 5840, + 5841, + 5842, + 5843, + 5844, + 5845, + 5846, + 5847, + 5848, + 5849, + 5850, + 5851, + 5852, + 5853, + 5854, + 5855, + 5856, + 5857, + 5858, + 5859, + 5860, + 5861, + 5862, + 5863, + 5864, + 5865, + 5866, + 5870, + 5871, + 5872, + 5888, + 5889, + 5890, + 5891, + 5892, + 5893, + 5894, + 5895, + 5896, + 5897, + 5898, + 5899, + 5900, + 5902, + 5903, + 5904, + 5905, + 5920, + 5921, + 5922, + 5923, + 5924, + 5925, + 5926, + 5927, + 5928, + 5929, + 5930, + 5931, + 5932, + 5933, + 5934, + 5935, + 5936, + 5937, + 5952, + 5953, + 5954, + 5955, + 5956, + 5957, + 5958, + 5959, + 5960, + 5961, + 5962, + 5963, + 5964, + 5965, + 5966, + 5967, + 5968, + 5969, + 5984, + 5985, + 5986, + 5987, + 5988, + 5989, + 5990, + 5991, + 5992, + 5993, + 5994, + 5995, + 5996, + 5998, + 5999, + 6000, + 6016, + 6017, + 6018, + 6019, + 6020, + 6021, + 6022, + 6023, + 6024, + 6025, + 6026, + 6027, + 6028, + 6029, + 6030, + 6031, + 6032, + 6033, + 6034, + 6035, + 6036, + 6037, + 6038, + 6039, + 6040, + 6041, + 6042, + 6043, + 6044, + 6045, + 6046, + 6047, + 6048, + 6049, + 6050, + 6051, + 6052, + 6053, + 6054, + 6055, + 6056, + 6057, + 6058, + 6059, + 6060, + 6061, + 6062, + 6063, + 6064, + 6065, + 6066, + 6067, + 6103, + 6108, + 6176, + 6177, + 6178, + 6179, + 6180, + 6181, + 6182, + 6183, + 6184, + 6185, + 6186, + 6187, + 6188, + 6189, + 6190, + 6191, + 6192, + 6193, + 6194, + 6195, + 6196, + 6197, + 6198, + 6199, + 6200, + 6201, + 6202, + 6203, + 6204, + 6205, + 6206, + 6207, + 6208, + 6209, + 6210, + 6211, + 6212, + 6213, + 6214, + 6215, + 6216, + 6217, + 6218, + 6219, + 6220, + 6221, + 6222, + 6223, + 6224, + 6225, + 6226, + 6227, + 6228, + 6229, + 6230, + 6231, + 6232, + 6233, + 6234, + 6235, + 6236, + 6237, + 6238, + 6239, + 6240, + 6241, + 6242, + 6243, + 6244, + 6245, + 6246, + 6247, + 6248, + 6249, + 6250, + 6251, + 6252, + 6253, + 6254, + 6255, + 6256, + 6257, + 6258, + 6259, + 6260, + 6261, + 6262, + 6263, + 6272, + 6273, + 6274, + 6275, + 6276, + 6277, + 6278, + 6279, + 6280, + 6281, + 6282, + 6283, + 6284, + 6285, + 6286, + 6287, + 6288, + 6289, + 6290, + 6291, + 6292, + 6293, + 6294, + 6295, + 6296, + 6297, + 6298, + 6299, + 6300, + 6301, + 6302, + 6303, + 6304, + 6305, + 6306, + 6307, + 6308, + 6309, + 6310, + 6311, + 6312, + 6314, + 6320, + 6321, + 6322, + 6323, + 6324, + 6325, + 6326, + 6327, + 6328, + 6329, + 6330, + 6331, + 6332, + 6333, + 6334, + 6335, + 6336, + 6337, + 6338, + 6339, + 6340, + 6341, + 6342, + 6343, + 6344, + 6345, + 6346, + 6347, + 6348, + 6349, + 6350, + 6351, + 6352, + 6353, + 6354, + 6355, + 6356, + 6357, + 6358, + 6359, + 6360, + 6361, + 6362, + 6363, + 6364, + 6365, + 6366, + 6367, + 6368, + 6369, + 6370, + 6371, + 6372, + 6373, + 6374, + 6375, + 6376, + 6377, + 6378, + 6379, + 6380, + 6381, + 6382, + 6383, + 6384, + 6385, + 6386, + 6387, + 6388, + 6389, + 6400, + 6401, + 6402, + 6403, + 6404, + 6405, + 6406, + 6407, + 6408, + 6409, + 6410, + 6411, + 6412, + 6413, + 6414, + 6415, + 6416, + 6417, + 6418, + 6419, + 6420, + 6421, + 6422, + 6423, + 6424, + 6425, + 6426, + 6427, + 6428, + 6480, + 6481, + 6482, + 6483, + 6484, + 6485, + 6486, + 6487, + 6488, + 6489, + 6490, + 6491, + 6492, + 6493, + 6494, + 6495, + 6496, + 6497, + 6498, + 6499, + 6500, + 6501, + 6502, + 6503, + 6504, + 6505, + 6506, + 6507, + 6508, + 6509, + 6512, + 6513, + 6514, + 6515, + 6516, + 6528, + 6529, + 6530, + 6531, + 6532, + 6533, + 6534, + 6535, + 6536, + 6537, + 6538, + 6539, + 6540, + 6541, + 6542, + 6543, + 6544, + 6545, + 6546, + 6547, + 6548, + 6549, + 6550, + 6551, + 6552, + 6553, + 6554, + 6555, + 6556, + 6557, + 6558, + 6559, + 6560, + 6561, + 6562, + 6563, + 6564, + 6565, + 6566, + 6567, + 6568, + 6569, + 6570, + 6571, + 6593, + 6594, + 6595, + 6596, + 6597, + 6598, + 6599, + 6656, + 6657, + 6658, + 6659, + 6660, + 6661, + 6662, + 6663, + 6664, + 6665, + 6666, + 6667, + 6668, + 6669, + 6670, + 6671, + 6672, + 6673, + 6674, + 6675, + 6676, + 6677, + 6678, + 6688, + 6689, + 6690, + 6691, + 6692, + 6693, + 6694, + 6695, + 6696, + 6697, + 6698, + 6699, + 6700, + 6701, + 6702, + 6703, + 6704, + 6705, + 6706, + 6707, + 6708, + 6709, + 6710, + 6711, + 6712, + 6713, + 6714, + 6715, + 6716, + 6717, + 6718, + 6719, + 6720, + 6721, + 6722, + 6723, + 6724, + 6725, + 6726, + 6727, + 6728, + 6729, + 6730, + 6731, + 6732, + 6733, + 6734, + 6735, + 6736, + 6737, + 6738, + 6739, + 6740, + 6823, + 6917, + 6918, + 6919, + 6920, + 6921, + 6922, + 6923, + 6924, + 6925, + 6926, + 6927, + 6928, + 6929, + 6930, + 6931, + 6932, + 6933, + 6934, + 6935, + 6936, + 6937, + 6938, + 6939, + 6940, + 6941, + 6942, + 6943, + 6944, + 6945, + 6946, + 6947, + 6948, + 6949, + 6950, + 6951, + 6952, + 6953, + 6954, + 6955, + 6956, + 6957, + 6958, + 6959, + 6960, + 6961, + 6962, + 6963, + 6981, + 6982, + 6983, + 6984, + 6985, + 6986, + 6987, + 7043, + 7044, + 7045, + 7046, + 7047, + 7048, + 7049, + 7050, + 7051, + 7052, + 7053, + 7054, + 7055, + 7056, + 7057, + 7058, + 7059, + 7060, + 7061, + 7062, + 7063, + 7064, + 7065, + 7066, + 7067, + 7068, + 7069, + 7070, + 7071, + 7072, + 7086, + 7087, + 7098, + 7099, + 7100, + 7101, + 7102, + 7103, + 7104, + 7105, + 7106, + 7107, + 7108, + 7109, + 7110, + 7111, + 7112, + 7113, + 7114, + 7115, + 7116, + 7117, + 7118, + 7119, + 7120, + 7121, + 7122, + 7123, + 7124, + 7125, + 7126, + 7127, + 7128, + 7129, + 7130, + 7131, + 7132, + 7133, + 7134, + 7135, + 7136, + 7137, + 7138, + 7139, + 7140, + 7141, + 7168, + 7169, + 7170, + 7171, + 7172, + 7173, + 7174, + 7175, + 7176, + 7177, + 7178, + 7179, + 7180, + 7181, + 7182, + 7183, + 7184, + 7185, + 7186, + 7187, + 7188, + 7189, + 7190, + 7191, + 7192, + 7193, + 7194, + 7195, + 7196, + 7197, + 7198, + 7199, + 7200, + 7201, + 7202, + 7203, + 7245, + 7246, + 7247, + 7258, + 7259, + 7260, + 7261, + 7262, + 7263, + 7264, + 7265, + 7266, + 7267, + 7268, + 7269, + 7270, + 7271, + 7272, + 7273, + 7274, + 7275, + 7276, + 7277, + 7278, + 7279, + 7280, + 7281, + 7282, + 7283, + 7284, + 7285, + 7286, + 7287, + 7288, + 7289, + 7290, + 7291, + 7292, + 7293, + 7401, + 7402, + 7403, + 7404, + 7406, + 7407, + 7408, + 7409, + 7413, + 7414, + 7424, + 7425, + 7426, + 7427, + 7428, + 7429, + 7430, + 7431, + 7432, + 7433, + 7434, + 7435, + 7436, + 7437, + 7438, + 7439, + 7440, + 7441, + 7442, + 7443, + 7444, + 7445, + 7446, + 7447, + 7448, + 7449, + 7450, + 7451, + 7452, + 7453, + 7454, + 7455, + 7456, + 7457, + 7458, + 7459, + 7460, + 7461, + 7462, + 7463, + 7464, + 7465, + 7466, + 7467, + 7468, + 7469, + 7470, + 7471, + 7472, + 7473, + 7474, + 7475, + 7476, + 7477, + 7478, + 7479, + 7480, + 7481, + 7482, + 7483, + 7484, + 7485, + 7486, + 7487, + 7488, + 7489, + 7490, + 7491, + 7492, + 7493, + 7494, + 7495, + 7496, + 7497, + 7498, + 7499, + 7500, + 7501, + 7502, + 7503, + 7504, + 7505, + 7506, + 7507, + 7508, + 7509, + 7510, + 7511, + 7512, + 7513, + 7514, + 7515, + 7516, + 7517, + 7518, + 7519, + 7520, + 7521, + 7522, + 7523, + 7524, + 7525, + 7526, + 7527, + 7528, + 7529, + 7530, + 7531, + 7532, + 7533, + 7534, + 7535, + 7536, + 7537, + 7538, + 7539, + 7540, + 7541, + 7542, + 7543, + 7544, + 7545, + 7546, + 7547, + 7548, + 7549, + 7550, + 7551, + 7552, + 7553, + 7554, + 7555, + 7556, + 7557, + 7558, + 7559, + 7560, + 7561, + 7562, + 7563, + 7564, + 7565, + 7566, + 7567, + 7568, + 7569, + 7570, + 7571, + 7572, + 7573, + 7574, + 7575, + 7576, + 7577, + 7578, + 7579, + 7580, + 7581, + 7582, + 7583, + 7584, + 7585, + 7586, + 7587, + 7588, + 7589, + 7590, + 7591, + 7592, + 7593, + 7594, + 7595, + 7596, + 7597, + 7598, + 7599, + 7600, + 7601, + 7602, + 7603, + 7604, + 7605, + 7606, + 7607, + 7608, + 7609, + 7610, + 7611, + 7612, + 7613, + 7614, + 7615, + 7680, + 7681, + 7682, + 7683, + 7684, + 7685, + 7686, + 7687, + 7688, + 7689, + 7690, + 7691, + 7692, + 7693, + 7694, + 7695, + 7696, + 7697, + 7698, + 7699, + 7700, + 7701, + 7702, + 7703, + 7704, + 7705, + 7706, + 7707, + 7708, + 7709, + 7710, + 7711, + 7712, + 7713, + 7714, + 7715, + 7716, + 7717, + 7718, + 7719, + 7720, + 7721, + 7722, + 7723, + 7724, + 7725, + 7726, + 7727, + 7728, + 7729, + 7730, + 7731, + 7732, + 7733, + 7734, + 7735, + 7736, + 7737, + 7738, + 7739, + 7740, + 7741, + 7742, + 7743, + 7744, + 7745, + 7746, + 7747, + 7748, + 7749, + 7750, + 7751, + 7752, + 7753, + 7754, + 7755, + 7756, + 7757, + 7758, + 7759, + 7760, + 7761, + 7762, + 7763, + 7764, + 7765, + 7766, + 7767, + 7768, + 7769, + 7770, + 7771, + 7772, + 7773, + 7774, + 7775, + 7776, + 7777, + 7778, + 7779, + 7780, + 7781, + 7782, + 7783, + 7784, + 7785, + 7786, + 7787, + 7788, + 7789, + 7790, + 7791, + 7792, + 7793, + 7794, + 7795, + 7796, + 7797, + 7798, + 7799, + 7800, + 7801, + 7802, + 7803, + 7804, + 7805, + 7806, + 7807, + 7808, + 7809, + 7810, + 7811, + 7812, + 7813, + 7814, + 7815, + 7816, + 7817, + 7818, + 7819, + 7820, + 7821, + 7822, + 7823, + 7824, + 7825, + 7826, + 7827, + 7828, + 7829, + 7830, + 7831, + 7832, + 7833, + 7834, + 7835, + 7836, + 7837, + 7838, + 7839, + 7840, + 7841, + 7842, + 7843, + 7844, + 7845, + 7846, + 7847, + 7848, + 7849, + 7850, + 7851, + 7852, + 7853, + 7854, + 7855, + 7856, + 7857, + 7858, + 7859, + 7860, + 7861, + 7862, + 7863, + 7864, + 7865, + 7866, + 7867, + 7868, + 7869, + 7870, + 7871, + 7872, + 7873, + 7874, + 7875, + 7876, + 7877, + 7878, + 7879, + 7880, + 7881, + 7882, + 7883, + 7884, + 7885, + 7886, + 7887, + 7888, + 7889, + 7890, + 7891, + 7892, + 7893, + 7894, + 7895, + 7896, + 7897, + 7898, + 7899, + 7900, + 7901, + 7902, + 7903, + 7904, + 7905, + 7906, + 7907, + 7908, + 7909, + 7910, + 7911, + 7912, + 7913, + 7914, + 7915, + 7916, + 7917, + 7918, + 7919, + 7920, + 7921, + 7922, + 7923, + 7924, + 7925, + 7926, + 7927, + 7928, + 7929, + 7930, + 7931, + 7932, + 7933, + 7934, + 7935, + 7936, + 7937, + 7938, + 7939, + 7940, + 7941, + 7942, + 7943, + 7944, + 7945, + 7946, + 7947, + 7948, + 7949, + 7950, + 7951, + 7952, + 7953, + 7954, + 7955, + 7956, + 7957, + 7960, + 7961, + 7962, + 7963, + 7964, + 7965, + 7968, + 7969, + 7970, + 7971, + 7972, + 7973, + 7974, + 7975, + 7976, + 7977, + 7978, + 7979, + 7980, + 7981, + 7982, + 7983, + 7984, + 7985, + 7986, + 7987, + 7988, + 7989, + 7990, + 7991, + 7992, + 7993, + 7994, + 7995, + 7996, + 7997, + 7998, + 7999, + 8000, + 8001, + 8002, + 8003, + 8004, + 8005, + 8008, + 8009, + 8010, + 8011, + 8012, + 8013, + 8016, + 8017, + 8018, + 8019, + 8020, + 8021, + 8022, + 8023, + 8025, + 8027, + 8029, + 8031, + 8032, + 8033, + 8034, + 8035, + 8036, + 8037, + 8038, + 8039, + 8040, + 8041, + 8042, + 8043, + 8044, + 8045, + 8046, + 8047, + 8048, + 8049, + 8050, + 8051, + 8052, + 8053, + 8054, + 8055, + 8056, + 8057, + 8058, + 8059, + 8060, + 8061, + 8064, + 8065, + 8066, + 8067, + 8068, + 8069, + 8070, + 8071, + 8072, + 8073, + 8074, + 8075, + 8076, + 8077, + 8078, + 8079, + 8080, + 8081, + 8082, + 8083, + 8084, + 8085, + 8086, + 8087, + 8088, + 8089, + 8090, + 8091, + 8092, + 8093, + 8094, + 8095, + 8096, + 8097, + 8098, + 8099, + 8100, + 8101, + 8102, + 8103, + 8104, + 8105, + 8106, + 8107, + 8108, + 8109, + 8110, + 8111, + 8112, + 8113, + 8114, + 8115, + 8116, + 8118, + 8119, + 8120, + 8121, + 8122, + 8123, + 8124, + 8126, + 8130, + 8131, + 8132, + 8134, + 8135, + 8136, + 8137, + 8138, + 8139, + 8140, + 8144, + 8145, + 8146, + 8147, + 8150, + 8151, + 8152, + 8153, + 8154, + 8155, + 8160, + 8161, + 8162, + 8163, + 8164, + 8165, + 8166, + 8167, + 8168, + 8169, + 8170, + 8171, + 8172, + 8178, + 8179, + 8180, + 8182, + 8183, + 8184, + 8185, + 8186, + 8187, + 8188, + 8305, + 8319, + 8336, + 8337, + 8338, + 8339, + 8340, + 8341, + 8342, + 8343, + 8344, + 8345, + 8346, + 8347, + 8348, + 8450, + 8455, + 8458, + 8459, + 8460, + 8461, + 8462, + 8463, + 8464, + 8465, + 8466, + 8467, + 8469, + 8473, + 8474, + 8475, + 8476, + 8477, + 8484, + 8486, + 8488, + 8490, + 8491, + 8492, + 8493, + 8495, + 8496, + 8497, + 8498, + 8499, + 8500, + 8501, + 8502, + 8503, + 8504, + 8505, + 8508, + 8509, + 8510, + 8511, + 8517, + 8518, + 8519, + 8520, + 8521, + 8526, + 8544, + 8545, + 8546, + 8547, + 8548, + 8549, + 8550, + 8551, + 8552, + 8553, + 8554, + 8555, + 8556, + 8557, + 8558, + 8559, + 8560, + 8561, + 8562, + 8563, + 8564, + 8565, + 8566, + 8567, + 8568, + 8569, + 8570, + 8571, + 8572, + 8573, + 8574, + 8575, + 8576, + 8577, + 8578, + 8579, + 8580, + 8581, + 8582, + 8583, + 8584, + 11264, + 11265, + 11266, + 11267, + 11268, + 11269, + 11270, + 11271, + 11272, + 11273, + 11274, + 11275, + 11276, + 11277, + 11278, + 11279, + 11280, + 11281, + 11282, + 11283, + 11284, + 11285, + 11286, + 11287, + 11288, + 11289, + 11290, + 11291, + 11292, + 11293, + 11294, + 11295, + 11296, + 11297, + 11298, + 11299, + 11300, + 11301, + 11302, + 11303, + 11304, + 11305, + 11306, + 11307, + 11308, + 11309, + 11310, + 11312, + 11313, + 11314, + 11315, + 11316, + 11317, + 11318, + 11319, + 11320, + 11321, + 11322, + 11323, + 11324, + 11325, + 11326, + 11327, + 11328, + 11329, + 11330, + 11331, + 11332, + 11333, + 11334, + 11335, + 11336, + 11337, + 11338, + 11339, + 11340, + 11341, + 11342, + 11343, + 11344, + 11345, + 11346, + 11347, + 11348, + 11349, + 11350, + 11351, + 11352, + 11353, + 11354, + 11355, + 11356, + 11357, + 11358, + 11360, + 11361, + 11362, + 11363, + 11364, + 11365, + 11366, + 11367, + 11368, + 11369, + 11370, + 11371, + 11372, + 11373, + 11374, + 11375, + 11376, + 11377, + 11378, + 11379, + 11380, + 11381, + 11382, + 11383, + 11384, + 11385, + 11386, + 11387, + 11388, + 11389, + 11390, + 11391, + 11392, + 11393, + 11394, + 11395, + 11396, + 11397, + 11398, + 11399, + 11400, + 11401, + 11402, + 11403, + 11404, + 11405, + 11406, + 11407, + 11408, + 11409, + 11410, + 11411, + 11412, + 11413, + 11414, + 11415, + 11416, + 11417, + 11418, + 11419, + 11420, + 11421, + 11422, + 11423, + 11424, + 11425, + 11426, + 11427, + 11428, + 11429, + 11430, + 11431, + 11432, + 11433, + 11434, + 11435, + 11436, + 11437, + 11438, + 11439, + 11440, + 11441, + 11442, + 11443, + 11444, + 11445, + 11446, + 11447, + 11448, + 11449, + 11450, + 11451, + 11452, + 11453, + 11454, + 11455, + 11456, + 11457, + 11458, + 11459, + 11460, + 11461, + 11462, + 11463, + 11464, + 11465, + 11466, + 11467, + 11468, + 11469, + 11470, + 11471, + 11472, + 11473, + 11474, + 11475, + 11476, + 11477, + 11478, + 11479, + 11480, + 11481, + 11482, + 11483, + 11484, + 11485, + 11486, + 11487, + 11488, + 11489, + 11490, + 11491, + 11492, + 11499, + 11500, + 11501, + 11502, + 11506, + 11507, + 11520, + 11521, + 11522, + 11523, + 11524, + 11525, + 11526, + 11527, + 11528, + 11529, + 11530, + 11531, + 11532, + 11533, + 11534, + 11535, + 11536, + 11537, + 11538, + 11539, + 11540, + 11541, + 11542, + 11543, + 11544, + 11545, + 11546, + 11547, + 11548, + 11549, + 11550, + 11551, + 11552, + 11553, + 11554, + 11555, + 11556, + 11557, + 11559, + 11565, + 11568, + 11569, + 11570, + 11571, + 11572, + 11573, + 11574, + 11575, + 11576, + 11577, + 11578, + 11579, + 11580, + 11581, + 11582, + 11583, + 11584, + 11585, + 11586, + 11587, + 11588, + 11589, + 11590, + 11591, + 11592, + 11593, + 11594, + 11595, + 11596, + 11597, + 11598, + 11599, + 11600, + 11601, + 11602, + 11603, + 11604, + 11605, + 11606, + 11607, + 11608, + 11609, + 11610, + 11611, + 11612, + 11613, + 11614, + 11615, + 11616, + 11617, + 11618, + 11619, + 11620, + 11621, + 11622, + 11623, + 11631, + 11648, + 11649, + 11650, + 11651, + 11652, + 11653, + 11654, + 11655, + 11656, + 11657, + 11658, + 11659, + 11660, + 11661, + 11662, + 11663, + 11664, + 11665, + 11666, + 11667, + 11668, + 11669, + 11670, + 11680, + 11681, + 11682, + 11683, + 11684, + 11685, + 11686, + 11688, + 11689, + 11690, + 11691, + 11692, + 11693, + 11694, + 11696, + 11697, + 11698, + 11699, + 11700, + 11701, + 11702, + 11704, + 11705, + 11706, + 11707, + 11708, + 11709, + 11710, + 11712, + 11713, + 11714, + 11715, + 11716, + 11717, + 11718, + 11720, + 11721, + 11722, + 11723, + 11724, + 11725, + 11726, + 11728, + 11729, + 11730, + 11731, + 11732, + 11733, + 11734, + 11736, + 11737, + 11738, + 11739, + 11740, + 11741, + 11742, + 11823, + 12293, + 12294, + 12295, + 12321, + 12322, + 12323, + 12324, + 12325, + 12326, + 12327, + 12328, + 12329, + 12337, + 12338, + 12339, + 12340, + 12341, + 12344, + 12345, + 12346, + 12347, + 12348, + 12353, + 12354, + 12355, + 12356, + 12357, + 12358, + 12359, + 12360, + 12361, + 12362, + 12363, + 12364, + 12365, + 12366, + 12367, + 12368, + 12369, + 12370, + 12371, + 12372, + 12373, + 12374, + 12375, + 12376, + 12377, + 12378, + 12379, + 12380, + 12381, + 12382, + 12383, + 12384, + 12385, + 12386, + 12387, + 12388, + 12389, + 12390, + 12391, + 12392, + 12393, + 12394, + 12395, + 12396, + 12397, + 12398, + 12399, + 12400, + 12401, + 12402, + 12403, + 12404, + 12405, + 12406, + 12407, + 12408, + 12409, + 12410, + 12411, + 12412, + 12413, + 12414, + 12415, + 12416, + 12417, + 12418, + 12419, + 12420, + 12421, + 12422, + 12423, + 12424, + 12425, + 12426, + 12427, + 12428, + 12429, + 12430, + 12431, + 12432, + 12433, + 12434, + 12435, + 12436, + 12437, + 12438, + 12445, + 12446, + 12447, + 12449, + 12450, + 12451, + 12452, + 12453, + 12454, + 12455, + 12456, + 12457, + 12458, + 12459, + 12460, + 12461, + 12462, + 12463, + 12464, + 12465, + 12466, + 12467, + 12468, + 12469, + 12470, + 12471, + 12472, + 12473, + 12474, + 12475, + 12476, + 12477, + 12478, + 12479, + 12480, + 12481, + 12482, + 12483, + 12484, + 12485, + 12486, + 12487, + 12488, + 12489, + 12490, + 12491, + 12492, + 12493, + 12494, + 12495, + 12496, + 12497, + 12498, + 12499, + 12500, + 12501, + 12502, + 12503, + 12504, + 12505, + 12506, + 12507, + 12508, + 12509, + 12510, + 12511, + 12512, + 12513, + 12514, + 12515, + 12516, + 12517, + 12518, + 12519, + 12520, + 12521, + 12522, + 12523, + 12524, + 12525, + 12526, + 12527, + 12528, + 12529, + 12530, + 12531, + 12532, + 12533, + 12534, + 12535, + 12536, + 12537, + 12538, + 12540, + 12541, + 12542, + 12543, + 12549, + 12550, + 12551, + 12552, + 12553, + 12554, + 12555, + 12556, + 12557, + 12558, + 12559, + 12560, + 12561, + 12562, + 12563, + 12564, + 12565, + 12566, + 12567, + 12568, + 12569, + 12570, + 12571, + 12572, + 12573, + 12574, + 12575, + 12576, + 12577, + 12578, + 12579, + 12580, + 12581, + 12582, + 12583, + 12584, + 12585, + 12586, + 12587, + 12588, + 12589, + 12593, + 12594, + 12595, + 12596, + 12597, + 12598, + 12599, + 12600, + 12601, + 12602, + 12603, + 12604, + 12605, + 12606, + 12607, + 12608, + 12609, + 12610, + 12611, + 12612, + 12613, + 12614, + 12615, + 12616, + 12617, + 12618, + 12619, + 12620, + 12621, + 12622, + 12623, + 12624, + 12625, + 12626, + 12627, + 12628, + 12629, + 12630, + 12631, + 12632, + 12633, + 12634, + 12635, + 12636, + 12637, + 12638, + 12639, + 12640, + 12641, + 12642, + 12643, + 12644, + 12645, + 12646, + 12647, + 12648, + 12649, + 12650, + 12651, + 12652, + 12653, + 12654, + 12655, + 12656, + 12657, + 12658, + 12659, + 12660, + 12661, + 12662, + 12663, + 12664, + 12665, + 12666, + 12667, + 12668, + 12669, + 12670, + 12671, + 12672, + 12673, + 12674, + 12675, + 12676, + 12677, + 12678, + 12679, + 12680, + 12681, + 12682, + 12683, + 12684, + 12685, + 12686, + 12704, + 12705, + 12706, + 12707, + 12708, + 12709, + 12710, + 12711, + 12712, + 12713, + 12714, + 12715, + 12716, + 12717, + 12718, + 12719, + 12720, + 12721, + 12722, + 12723, + 12724, + 12725, + 12726, + 12727, + 12728, + 12729, + 12730, + 12784, + 12785, + 12786, + 12787, + 12788, + 12789, + 12790, + 12791, + 12792, + 12793, + 12794, + 12795, + 12796, + 12797, + 12798, + 12799, + 13312, + 13313, + 13314, + 13315, + 13316, + 13317, + 13318, + 13319, + 13320, + 13321, + 13322, + 13323, + 13324, + 13325, + 13326, + 13327, + 13328, + 13329, + 13330, + 13331, + 13332, + 13333, + 13334, + 13335, + 13336, + 13337, + 13338, + 13339, + 13340, + 13341, + 13342, + 13343, + 13344, + 13345, + 13346, + 13347, + 13348, + 13349, + 13350, + 13351, + 13352, + 13353, + 13354, + 13355, + 13356, + 13357, + 13358, + 13359, + 13360, + 13361, + 13362, + 13363, + 13364, + 13365, + 13366, + 13367, + 13368, + 13369, + 13370, + 13371, + 13372, + 13373, + 13374, + 13375, + 13376, + 13377, + 13378, + 13379, + 13380, + 13381, + 13382, + 13383, + 13384, + 13385, + 13386, + 13387, + 13388, + 13389, + 13390, + 13391, + 13392, + 13393, + 13394, + 13395, + 13396, + 13397, + 13398, + 13399, + 13400, + 13401, + 13402, + 13403, + 13404, + 13405, + 13406, + 13407, + 13408, + 13409, + 13410, + 13411, + 13412, + 13413, + 13414, + 13415, + 13416, + 13417, + 13418, + 13419, + 13420, + 13421, + 13422, + 13423, + 13424, + 13425, + 13426, + 13427, + 13428, + 13429, + 13430, + 13431, + 13432, + 13433, + 13434, + 13435, + 13436, + 13437, + 13438, + 13439, + 13440, + 13441, + 13442, + 13443, + 13444, + 13445, + 13446, + 13447, + 13448, + 13449, + 13450, + 13451, + 13452, + 13453, + 13454, + 13455, + 13456, + 13457, + 13458, + 13459, + 13460, + 13461, + 13462, + 13463, + 13464, + 13465, + 13466, + 13467, + 13468, + 13469, + 13470, + 13471, + 13472, + 13473, + 13474, + 13475, + 13476, + 13477, + 13478, + 13479, + 13480, + 13481, + 13482, + 13483, + 13484, + 13485, + 13486, + 13487, + 13488, + 13489, + 13490, + 13491, + 13492, + 13493, + 13494, + 13495, + 13496, + 13497, + 13498, + 13499, + 13500, + 13501, + 13502, + 13503, + 13504, + 13505, + 13506, + 13507, + 13508, + 13509, + 13510, + 13511, + 13512, + 13513, + 13514, + 13515, + 13516, + 13517, + 13518, + 13519, + 13520, + 13521, + 13522, + 13523, + 13524, + 13525, + 13526, + 13527, + 13528, + 13529, + 13530, + 13531, + 13532, + 13533, + 13534, + 13535, + 13536, + 13537, + 13538, + 13539, + 13540, + 13541, + 13542, + 13543, + 13544, + 13545, + 13546, + 13547, + 13548, + 13549, + 13550, + 13551, + 13552, + 13553, + 13554, + 13555, + 13556, + 13557, + 13558, + 13559, + 13560, + 13561, + 13562, + 13563, + 13564, + 13565, + 13566, + 13567, + 13568, + 13569, + 13570, + 13571, + 13572, + 13573, + 13574, + 13575, + 13576, + 13577, + 13578, + 13579, + 13580, + 13581, + 13582, + 13583, + 13584, + 13585, + 13586, + 13587, + 13588, + 13589, + 13590, + 13591, + 13592, + 13593, + 13594, + 13595, + 13596, + 13597, + 13598, + 13599, + 13600, + 13601, + 13602, + 13603, + 13604, + 13605, + 13606, + 13607, + 13608, + 13609, + 13610, + 13611, + 13612, + 13613, + 13614, + 13615, + 13616, + 13617, + 13618, + 13619, + 13620, + 13621, + 13622, + 13623, + 13624, + 13625, + 13626, + 13627, + 13628, + 13629, + 13630, + 13631, + 13632, + 13633, + 13634, + 13635, + 13636, + 13637, + 13638, + 13639, + 13640, + 13641, + 13642, + 13643, + 13644, + 13645, + 13646, + 13647, + 13648, + 13649, + 13650, + 13651, + 13652, + 13653, + 13654, + 13655, + 13656, + 13657, + 13658, + 13659, + 13660, + 13661, + 13662, + 13663, + 13664, + 13665, + 13666, + 13667, + 13668, + 13669, + 13670, + 13671, + 13672, + 13673, + 13674, + 13675, + 13676, + 13677, + 13678, + 13679, + 13680, + 13681, + 13682, + 13683, + 13684, + 13685, + 13686, + 13687, + 13688, + 13689, + 13690, + 13691, + 13692, + 13693, + 13694, + 13695, + 13696, + 13697, + 13698, + 13699, + 13700, + 13701, + 13702, + 13703, + 13704, + 13705, + 13706, + 13707, + 13708, + 13709, + 13710, + 13711, + 13712, + 13713, + 13714, + 13715, + 13716, + 13717, + 13718, + 13719, + 13720, + 13721, + 13722, + 13723, + 13724, + 13725, + 13726, + 13727, + 13728, + 13729, + 13730, + 13731, + 13732, + 13733, + 13734, + 13735, + 13736, + 13737, + 13738, + 13739, + 13740, + 13741, + 13742, + 13743, + 13744, + 13745, + 13746, + 13747, + 13748, + 13749, + 13750, + 13751, + 13752, + 13753, + 13754, + 13755, + 13756, + 13757, + 13758, + 13759, + 13760, + 13761, + 13762, + 13763, + 13764, + 13765, + 13766, + 13767, + 13768, + 13769, + 13770, + 13771, + 13772, + 13773, + 13774, + 13775, + 13776, + 13777, + 13778, + 13779, + 13780, + 13781, + 13782, + 13783, + 13784, + 13785, + 13786, + 13787, + 13788, + 13789, + 13790, + 13791, + 13792, + 13793, + 13794, + 13795, + 13796, + 13797, + 13798, + 13799, + 13800, + 13801, + 13802, + 13803, + 13804, + 13805, + 13806, + 13807, + 13808, + 13809, + 13810, + 13811, + 13812, + 13813, + 13814, + 13815, + 13816, + 13817, + 13818, + 13819, + 13820, + 13821, + 13822, + 13823, + 13824, + 13825, + 13826, + 13827, + 13828, + 13829, + 13830, + 13831, + 13832, + 13833, + 13834, + 13835, + 13836, + 13837, + 13838, + 13839, + 13840, + 13841, + 13842, + 13843, + 13844, + 13845, + 13846, + 13847, + 13848, + 13849, + 13850, + 13851, + 13852, + 13853, + 13854, + 13855, + 13856, + 13857, + 13858, + 13859, + 13860, + 13861, + 13862, + 13863, + 13864, + 13865, + 13866, + 13867, + 13868, + 13869, + 13870, + 13871, + 13872, + 13873, + 13874, + 13875, + 13876, + 13877, + 13878, + 13879, + 13880, + 13881, + 13882, + 13883, + 13884, + 13885, + 13886, + 13887, + 13888, + 13889, + 13890, + 13891, + 13892, + 13893, + 13894, + 13895, + 13896, + 13897, + 13898, + 13899, + 13900, + 13901, + 13902, + 13903, + 13904, + 13905, + 13906, + 13907, + 13908, + 13909, + 13910, + 13911, + 13912, + 13913, + 13914, + 13915, + 13916, + 13917, + 13918, + 13919, + 13920, + 13921, + 13922, + 13923, + 13924, + 13925, + 13926, + 13927, + 13928, + 13929, + 13930, + 13931, + 13932, + 13933, + 13934, + 13935, + 13936, + 13937, + 13938, + 13939, + 13940, + 13941, + 13942, + 13943, + 13944, + 13945, + 13946, + 13947, + 13948, + 13949, + 13950, + 13951, + 13952, + 13953, + 13954, + 13955, + 13956, + 13957, + 13958, + 13959, + 13960, + 13961, + 13962, + 13963, + 13964, + 13965, + 13966, + 13967, + 13968, + 13969, + 13970, + 13971, + 13972, + 13973, + 13974, + 13975, + 13976, + 13977, + 13978, + 13979, + 13980, + 13981, + 13982, + 13983, + 13984, + 13985, + 13986, + 13987, + 13988, + 13989, + 13990, + 13991, + 13992, + 13993, + 13994, + 13995, + 13996, + 13997, + 13998, + 13999, + 14000, + 14001, + 14002, + 14003, + 14004, + 14005, + 14006, + 14007, + 14008, + 14009, + 14010, + 14011, + 14012, + 14013, + 14014, + 14015, + 14016, + 14017, + 14018, + 14019, + 14020, + 14021, + 14022, + 14023, + 14024, + 14025, + 14026, + 14027, + 14028, + 14029, + 14030, + 14031, + 14032, + 14033, + 14034, + 14035, + 14036, + 14037, + 14038, + 14039, + 14040, + 14041, + 14042, + 14043, + 14044, + 14045, + 14046, + 14047, + 14048, + 14049, + 14050, + 14051, + 14052, + 14053, + 14054, + 14055, + 14056, + 14057, + 14058, + 14059, + 14060, + 14061, + 14062, + 14063, + 14064, + 14065, + 14066, + 14067, + 14068, + 14069, + 14070, + 14071, + 14072, + 14073, + 14074, + 14075, + 14076, + 14077, + 14078, + 14079, + 14080, + 14081, + 14082, + 14083, + 14084, + 14085, + 14086, + 14087, + 14088, + 14089, + 14090, + 14091, + 14092, + 14093, + 14094, + 14095, + 14096, + 14097, + 14098, + 14099, + 14100, + 14101, + 14102, + 14103, + 14104, + 14105, + 14106, + 14107, + 14108, + 14109, + 14110, + 14111, + 14112, + 14113, + 14114, + 14115, + 14116, + 14117, + 14118, + 14119, + 14120, + 14121, + 14122, + 14123, + 14124, + 14125, + 14126, + 14127, + 14128, + 14129, + 14130, + 14131, + 14132, + 14133, + 14134, + 14135, + 14136, + 14137, + 14138, + 14139, + 14140, + 14141, + 14142, + 14143, + 14144, + 14145, + 14146, + 14147, + 14148, + 14149, + 14150, + 14151, + 14152, + 14153, + 14154, + 14155, + 14156, + 14157, + 14158, + 14159, + 14160, + 14161, + 14162, + 14163, + 14164, + 14165, + 14166, + 14167, + 14168, + 14169, + 14170, + 14171, + 14172, + 14173, + 14174, + 14175, + 14176, + 14177, + 14178, + 14179, + 14180, + 14181, + 14182, + 14183, + 14184, + 14185, + 14186, + 14187, + 14188, + 14189, + 14190, + 14191, + 14192, + 14193, + 14194, + 14195, + 14196, + 14197, + 14198, + 14199, + 14200, + 14201, + 14202, + 14203, + 14204, + 14205, + 14206, + 14207, + 14208, + 14209, + 14210, + 14211, + 14212, + 14213, + 14214, + 14215, + 14216, + 14217, + 14218, + 14219, + 14220, + 14221, + 14222, + 14223, + 14224, + 14225, + 14226, + 14227, + 14228, + 14229, + 14230, + 14231, + 14232, + 14233, + 14234, + 14235, + 14236, + 14237, + 14238, + 14239, + 14240, + 14241, + 14242, + 14243, + 14244, + 14245, + 14246, + 14247, + 14248, + 14249, + 14250, + 14251, + 14252, + 14253, + 14254, + 14255, + 14256, + 14257, + 14258, + 14259, + 14260, + 14261, + 14262, + 14263, + 14264, + 14265, + 14266, + 14267, + 14268, + 14269, + 14270, + 14271, + 14272, + 14273, + 14274, + 14275, + 14276, + 14277, + 14278, + 14279, + 14280, + 14281, + 14282, + 14283, + 14284, + 14285, + 14286, + 14287, + 14288, + 14289, + 14290, + 14291, + 14292, + 14293, + 14294, + 14295, + 14296, + 14297, + 14298, + 14299, + 14300, + 14301, + 14302, + 14303, + 14304, + 14305, + 14306, + 14307, + 14308, + 14309, + 14310, + 14311, + 14312, + 14313, + 14314, + 14315, + 14316, + 14317, + 14318, + 14319, + 14320, + 14321, + 14322, + 14323, + 14324, + 14325, + 14326, + 14327, + 14328, + 14329, + 14330, + 14331, + 14332, + 14333, + 14334, + 14335, + 14336, + 14337, + 14338, + 14339, + 14340, + 14341, + 14342, + 14343, + 14344, + 14345, + 14346, + 14347, + 14348, + 14349, + 14350, + 14351, + 14352, + 14353, + 14354, + 14355, + 14356, + 14357, + 14358, + 14359, + 14360, + 14361, + 14362, + 14363, + 14364, + 14365, + 14366, + 14367, + 14368, + 14369, + 14370, + 14371, + 14372, + 14373, + 14374, + 14375, + 14376, + 14377, + 14378, + 14379, + 14380, + 14381, + 14382, + 14383, + 14384, + 14385, + 14386, + 14387, + 14388, + 14389, + 14390, + 14391, + 14392, + 14393, + 14394, + 14395, + 14396, + 14397, + 14398, + 14399, + 14400, + 14401, + 14402, + 14403, + 14404, + 14405, + 14406, + 14407, + 14408, + 14409, + 14410, + 14411, + 14412, + 14413, + 14414, + 14415, + 14416, + 14417, + 14418, + 14419, + 14420, + 14421, + 14422, + 14423, + 14424, + 14425, + 14426, + 14427, + 14428, + 14429, + 14430, + 14431, + 14432, + 14433, + 14434, + 14435, + 14436, + 14437, + 14438, + 14439, + 14440, + 14441, + 14442, + 14443, + 14444, + 14445, + 14446, + 14447, + 14448, + 14449, + 14450, + 14451, + 14452, + 14453, + 14454, + 14455, + 14456, + 14457, + 14458, + 14459, + 14460, + 14461, + 14462, + 14463, + 14464, + 14465, + 14466, + 14467, + 14468, + 14469, + 14470, + 14471, + 14472, + 14473, + 14474, + 14475, + 14476, + 14477, + 14478, + 14479, + 14480, + 14481, + 14482, + 14483, + 14484, + 14485, + 14486, + 14487, + 14488, + 14489, + 14490, + 14491, + 14492, + 14493, + 14494, + 14495, + 14496, + 14497, + 14498, + 14499, + 14500, + 14501, + 14502, + 14503, + 14504, + 14505, + 14506, + 14507, + 14508, + 14509, + 14510, + 14511, + 14512, + 14513, + 14514, + 14515, + 14516, + 14517, + 14518, + 14519, + 14520, + 14521, + 14522, + 14523, + 14524, + 14525, + 14526, + 14527, + 14528, + 14529, + 14530, + 14531, + 14532, + 14533, + 14534, + 14535, + 14536, + 14537, + 14538, + 14539, + 14540, + 14541, + 14542, + 14543, + 14544, + 14545, + 14546, + 14547, + 14548, + 14549, + 14550, + 14551, + 14552, + 14553, + 14554, + 14555, + 14556, + 14557, + 14558, + 14559, + 14560, + 14561, + 14562, + 14563, + 14564, + 14565, + 14566, + 14567, + 14568, + 14569, + 14570, + 14571, + 14572, + 14573, + 14574, + 14575, + 14576, + 14577, + 14578, + 14579, + 14580, + 14581, + 14582, + 14583, + 14584, + 14585, + 14586, + 14587, + 14588, + 14589, + 14590, + 14591, + 14592, + 14593, + 14594, + 14595, + 14596, + 14597, + 14598, + 14599, + 14600, + 14601, + 14602, + 14603, + 14604, + 14605, + 14606, + 14607, + 14608, + 14609, + 14610, + 14611, + 14612, + 14613, + 14614, + 14615, + 14616, + 14617, + 14618, + 14619, + 14620, + 14621, + 14622, + 14623, + 14624, + 14625, + 14626, + 14627, + 14628, + 14629, + 14630, + 14631, + 14632, + 14633, + 14634, + 14635, + 14636, + 14637, + 14638, + 14639, + 14640, + 14641, + 14642, + 14643, + 14644, + 14645, + 14646, + 14647, + 14648, + 14649, + 14650, + 14651, + 14652, + 14653, + 14654, + 14655, + 14656, + 14657, + 14658, + 14659, + 14660, + 14661, + 14662, + 14663, + 14664, + 14665, + 14666, + 14667, + 14668, + 14669, + 14670, + 14671, + 14672, + 14673, + 14674, + 14675, + 14676, + 14677, + 14678, + 14679, + 14680, + 14681, + 14682, + 14683, + 14684, + 14685, + 14686, + 14687, + 14688, + 14689, + 14690, + 14691, + 14692, + 14693, + 14694, + 14695, + 14696, + 14697, + 14698, + 14699, + 14700, + 14701, + 14702, + 14703, + 14704, + 14705, + 14706, + 14707, + 14708, + 14709, + 14710, + 14711, + 14712, + 14713, + 14714, + 14715, + 14716, + 14717, + 14718, + 14719, + 14720, + 14721, + 14722, + 14723, + 14724, + 14725, + 14726, + 14727, + 14728, + 14729, + 14730, + 14731, + 14732, + 14733, + 14734, + 14735, + 14736, + 14737, + 14738, + 14739, + 14740, + 14741, + 14742, + 14743, + 14744, + 14745, + 14746, + 14747, + 14748, + 14749, + 14750, + 14751, + 14752, + 14753, + 14754, + 14755, + 14756, + 14757, + 14758, + 14759, + 14760, + 14761, + 14762, + 14763, + 14764, + 14765, + 14766, + 14767, + 14768, + 14769, + 14770, + 14771, + 14772, + 14773, + 14774, + 14775, + 14776, + 14777, + 14778, + 14779, + 14780, + 14781, + 14782, + 14783, + 14784, + 14785, + 14786, + 14787, + 14788, + 14789, + 14790, + 14791, + 14792, + 14793, + 14794, + 14795, + 14796, + 14797, + 14798, + 14799, + 14800, + 14801, + 14802, + 14803, + 14804, + 14805, + 14806, + 14807, + 14808, + 14809, + 14810, + 14811, + 14812, + 14813, + 14814, + 14815, + 14816, + 14817, + 14818, + 14819, + 14820, + 14821, + 14822, + 14823, + 14824, + 14825, + 14826, + 14827, + 14828, + 14829, + 14830, + 14831, + 14832, + 14833, + 14834, + 14835, + 14836, + 14837, + 14838, + 14839, + 14840, + 14841, + 14842, + 14843, + 14844, + 14845, + 14846, + 14847, + 14848, + 14849, + 14850, + 14851, + 14852, + 14853, + 14854, + 14855, + 14856, + 14857, + 14858, + 14859, + 14860, + 14861, + 14862, + 14863, + 14864, + 14865, + 14866, + 14867, + 14868, + 14869, + 14870, + 14871, + 14872, + 14873, + 14874, + 14875, + 14876, + 14877, + 14878, + 14879, + 14880, + 14881, + 14882, + 14883, + 14884, + 14885, + 14886, + 14887, + 14888, + 14889, + 14890, + 14891, + 14892, + 14893, + 14894, + 14895, + 14896, + 14897, + 14898, + 14899, + 14900, + 14901, + 14902, + 14903, + 14904, + 14905, + 14906, + 14907, + 14908, + 14909, + 14910, + 14911, + 14912, + 14913, + 14914, + 14915, + 14916, + 14917, + 14918, + 14919, + 14920, + 14921, + 14922, + 14923, + 14924, + 14925, + 14926, + 14927, + 14928, + 14929, + 14930, + 14931, + 14932, + 14933, + 14934, + 14935, + 14936, + 14937, + 14938, + 14939, + 14940, + 14941, + 14942, + 14943, + 14944, + 14945, + 14946, + 14947, + 14948, + 14949, + 14950, + 14951, + 14952, + 14953, + 14954, + 14955, + 14956, + 14957, + 14958, + 14959, + 14960, + 14961, + 14962, + 14963, + 14964, + 14965, + 14966, + 14967, + 14968, + 14969, + 14970, + 14971, + 14972, + 14973, + 14974, + 14975, + 14976, + 14977, + 14978, + 14979, + 14980, + 14981, + 14982, + 14983, + 14984, + 14985, + 14986, + 14987, + 14988, + 14989, + 14990, + 14991, + 14992, + 14993, + 14994, + 14995, + 14996, + 14997, + 14998, + 14999, + 15000, + 15001, + 15002, + 15003, + 15004, + 15005, + 15006, + 15007, + 15008, + 15009, + 15010, + 15011, + 15012, + 15013, + 15014, + 15015, + 15016, + 15017, + 15018, + 15019, + 15020, + 15021, + 15022, + 15023, + 15024, + 15025, + 15026, + 15027, + 15028, + 15029, + 15030, + 15031, + 15032, + 15033, + 15034, + 15035, + 15036, + 15037, + 15038, + 15039, + 15040, + 15041, + 15042, + 15043, + 15044, + 15045, + 15046, + 15047, + 15048, + 15049, + 15050, + 15051, + 15052, + 15053, + 15054, + 15055, + 15056, + 15057, + 15058, + 15059, + 15060, + 15061, + 15062, + 15063, + 15064, + 15065, + 15066, + 15067, + 15068, + 15069, + 15070, + 15071, + 15072, + 15073, + 15074, + 15075, + 15076, + 15077, + 15078, + 15079, + 15080, + 15081, + 15082, + 15083, + 15084, + 15085, + 15086, + 15087, + 15088, + 15089, + 15090, + 15091, + 15092, + 15093, + 15094, + 15095, + 15096, + 15097, + 15098, + 15099, + 15100, + 15101, + 15102, + 15103, + 15104, + 15105, + 15106, + 15107, + 15108, + 15109, + 15110, + 15111, + 15112, + 15113, + 15114, + 15115, + 15116, + 15117, + 15118, + 15119, + 15120, + 15121, + 15122, + 15123, + 15124, + 15125, + 15126, + 15127, + 15128, + 15129, + 15130, + 15131, + 15132, + 15133, + 15134, + 15135, + 15136, + 15137, + 15138, + 15139, + 15140, + 15141, + 15142, + 15143, + 15144, + 15145, + 15146, + 15147, + 15148, + 15149, + 15150, + 15151, + 15152, + 15153, + 15154, + 15155, + 15156, + 15157, + 15158, + 15159, + 15160, + 15161, + 15162, + 15163, + 15164, + 15165, + 15166, + 15167, + 15168, + 15169, + 15170, + 15171, + 15172, + 15173, + 15174, + 15175, + 15176, + 15177, + 15178, + 15179, + 15180, + 15181, + 15182, + 15183, + 15184, + 15185, + 15186, + 15187, + 15188, + 15189, + 15190, + 15191, + 15192, + 15193, + 15194, + 15195, + 15196, + 15197, + 15198, + 15199, + 15200, + 15201, + 15202, + 15203, + 15204, + 15205, + 15206, + 15207, + 15208, + 15209, + 15210, + 15211, + 15212, + 15213, + 15214, + 15215, + 15216, + 15217, + 15218, + 15219, + 15220, + 15221, + 15222, + 15223, + 15224, + 15225, + 15226, + 15227, + 15228, + 15229, + 15230, + 15231, + 15232, + 15233, + 15234, + 15235, + 15236, + 15237, + 15238, + 15239, + 15240, + 15241, + 15242, + 15243, + 15244, + 15245, + 15246, + 15247, + 15248, + 15249, + 15250, + 15251, + 15252, + 15253, + 15254, + 15255, + 15256, + 15257, + 15258, + 15259, + 15260, + 15261, + 15262, + 15263, + 15264, + 15265, + 15266, + 15267, + 15268, + 15269, + 15270, + 15271, + 15272, + 15273, + 15274, + 15275, + 15276, + 15277, + 15278, + 15279, + 15280, + 15281, + 15282, + 15283, + 15284, + 15285, + 15286, + 15287, + 15288, + 15289, + 15290, + 15291, + 15292, + 15293, + 15294, + 15295, + 15296, + 15297, + 15298, + 15299, + 15300, + 15301, + 15302, + 15303, + 15304, + 15305, + 15306, + 15307, + 15308, + 15309, + 15310, + 15311, + 15312, + 15313, + 15314, + 15315, + 15316, + 15317, + 15318, + 15319, + 15320, + 15321, + 15322, + 15323, + 15324, + 15325, + 15326, + 15327, + 15328, + 15329, + 15330, + 15331, + 15332, + 15333, + 15334, + 15335, + 15336, + 15337, + 15338, + 15339, + 15340, + 15341, + 15342, + 15343, + 15344, + 15345, + 15346, + 15347, + 15348, + 15349, + 15350, + 15351, + 15352, + 15353, + 15354, + 15355, + 15356, + 15357, + 15358, + 15359, + 15360, + 15361, + 15362, + 15363, + 15364, + 15365, + 15366, + 15367, + 15368, + 15369, + 15370, + 15371, + 15372, + 15373, + 15374, + 15375, + 15376, + 15377, + 15378, + 15379, + 15380, + 15381, + 15382, + 15383, + 15384, + 15385, + 15386, + 15387, + 15388, + 15389, + 15390, + 15391, + 15392, + 15393, + 15394, + 15395, + 15396, + 15397, + 15398, + 15399, + 15400, + 15401, + 15402, + 15403, + 15404, + 15405, + 15406, + 15407, + 15408, + 15409, + 15410, + 15411, + 15412, + 15413, + 15414, + 15415, + 15416, + 15417, + 15418, + 15419, + 15420, + 15421, + 15422, + 15423, + 15424, + 15425, + 15426, + 15427, + 15428, + 15429, + 15430, + 15431, + 15432, + 15433, + 15434, + 15435, + 15436, + 15437, + 15438, + 15439, + 15440, + 15441, + 15442, + 15443, + 15444, + 15445, + 15446, + 15447, + 15448, + 15449, + 15450, + 15451, + 15452, + 15453, + 15454, + 15455, + 15456, + 15457, + 15458, + 15459, + 15460, + 15461, + 15462, + 15463, + 15464, + 15465, + 15466, + 15467, + 15468, + 15469, + 15470, + 15471, + 15472, + 15473, + 15474, + 15475, + 15476, + 15477, + 15478, + 15479, + 15480, + 15481, + 15482, + 15483, + 15484, + 15485, + 15486, + 15487, + 15488, + 15489, + 15490, + 15491, + 15492, + 15493, + 15494, + 15495, + 15496, + 15497, + 15498, + 15499, + 15500, + 15501, + 15502, + 15503, + 15504, + 15505, + 15506, + 15507, + 15508, + 15509, + 15510, + 15511, + 15512, + 15513, + 15514, + 15515, + 15516, + 15517, + 15518, + 15519, + 15520, + 15521, + 15522, + 15523, + 15524, + 15525, + 15526, + 15527, + 15528, + 15529, + 15530, + 15531, + 15532, + 15533, + 15534, + 15535, + 15536, + 15537, + 15538, + 15539, + 15540, + 15541, + 15542, + 15543, + 15544, + 15545, + 15546, + 15547, + 15548, + 15549, + 15550, + 15551, + 15552, + 15553, + 15554, + 15555, + 15556, + 15557, + 15558, + 15559, + 15560, + 15561, + 15562, + 15563, + 15564, + 15565, + 15566, + 15567, + 15568, + 15569, + 15570, + 15571, + 15572, + 15573, + 15574, + 15575, + 15576, + 15577, + 15578, + 15579, + 15580, + 15581, + 15582, + 15583, + 15584, + 15585, + 15586, + 15587, + 15588, + 15589, + 15590, + 15591, + 15592, + 15593, + 15594, + 15595, + 15596, + 15597, + 15598, + 15599, + 15600, + 15601, + 15602, + 15603, + 15604, + 15605, + 15606, + 15607, + 15608, + 15609, + 15610, + 15611, + 15612, + 15613, + 15614, + 15615, + 15616, + 15617, + 15618, + 15619, + 15620, + 15621, + 15622, + 15623, + 15624, + 15625, + 15626, + 15627, + 15628, + 15629, + 15630, + 15631, + 15632, + 15633, + 15634, + 15635, + 15636, + 15637, + 15638, + 15639, + 15640, + 15641, + 15642, + 15643, + 15644, + 15645, + 15646, + 15647, + 15648, + 15649, + 15650, + 15651, + 15652, + 15653, + 15654, + 15655, + 15656, + 15657, + 15658, + 15659, + 15660, + 15661, + 15662, + 15663, + 15664, + 15665, + 15666, + 15667, + 15668, + 15669, + 15670, + 15671, + 15672, + 15673, + 15674, + 15675, + 15676, + 15677, + 15678, + 15679, + 15680, + 15681, + 15682, + 15683, + 15684, + 15685, + 15686, + 15687, + 15688, + 15689, + 15690, + 15691, + 15692, + 15693, + 15694, + 15695, + 15696, + 15697, + 15698, + 15699, + 15700, + 15701, + 15702, + 15703, + 15704, + 15705, + 15706, + 15707, + 15708, + 15709, + 15710, + 15711, + 15712, + 15713, + 15714, + 15715, + 15716, + 15717, + 15718, + 15719, + 15720, + 15721, + 15722, + 15723, + 15724, + 15725, + 15726, + 15727, + 15728, + 15729, + 15730, + 15731, + 15732, + 15733, + 15734, + 15735, + 15736, + 15737, + 15738, + 15739, + 15740, + 15741, + 15742, + 15743, + 15744, + 15745, + 15746, + 15747, + 15748, + 15749, + 15750, + 15751, + 15752, + 15753, + 15754, + 15755, + 15756, + 15757, + 15758, + 15759, + 15760, + 15761, + 15762, + 15763, + 15764, + 15765, + 15766, + 15767, + 15768, + 15769, + 15770, + 15771, + 15772, + 15773, + 15774, + 15775, + 15776, + 15777, + 15778, + 15779, + 15780, + 15781, + 15782, + 15783, + 15784, + 15785, + 15786, + 15787, + 15788, + 15789, + 15790, + 15791, + 15792, + 15793, + 15794, + 15795, + 15796, + 15797, + 15798, + 15799, + 15800, + 15801, + 15802, + 15803, + 15804, + 15805, + 15806, + 15807, + 15808, + 15809, + 15810, + 15811, + 15812, + 15813, + 15814, + 15815, + 15816, + 15817, + 15818, + 15819, + 15820, + 15821, + 15822, + 15823, + 15824, + 15825, + 15826, + 15827, + 15828, + 15829, + 15830, + 15831, + 15832, + 15833, + 15834, + 15835, + 15836, + 15837, + 15838, + 15839, + 15840, + 15841, + 15842, + 15843, + 15844, + 15845, + 15846, + 15847, + 15848, + 15849, + 15850, + 15851, + 15852, + 15853, + 15854, + 15855, + 15856, + 15857, + 15858, + 15859, + 15860, + 15861, + 15862, + 15863, + 15864, + 15865, + 15866, + 15867, + 15868, + 15869, + 15870, + 15871, + 15872, + 15873, + 15874, + 15875, + 15876, + 15877, + 15878, + 15879, + 15880, + 15881, + 15882, + 15883, + 15884, + 15885, + 15886, + 15887, + 15888, + 15889, + 15890, + 15891, + 15892, + 15893, + 15894, + 15895, + 15896, + 15897, + 15898, + 15899, + 15900, + 15901, + 15902, + 15903, + 15904, + 15905, + 15906, + 15907, + 15908, + 15909, + 15910, + 15911, + 15912, + 15913, + 15914, + 15915, + 15916, + 15917, + 15918, + 15919, + 15920, + 15921, + 15922, + 15923, + 15924, + 15925, + 15926, + 15927, + 15928, + 15929, + 15930, + 15931, + 15932, + 15933, + 15934, + 15935, + 15936, + 15937, + 15938, + 15939, + 15940, + 15941, + 15942, + 15943, + 15944, + 15945, + 15946, + 15947, + 15948, + 15949, + 15950, + 15951, + 15952, + 15953, + 15954, + 15955, + 15956, + 15957, + 15958, + 15959, + 15960, + 15961, + 15962, + 15963, + 15964, + 15965, + 15966, + 15967, + 15968, + 15969, + 15970, + 15971, + 15972, + 15973, + 15974, + 15975, + 15976, + 15977, + 15978, + 15979, + 15980, + 15981, + 15982, + 15983, + 15984, + 15985, + 15986, + 15987, + 15988, + 15989, + 15990, + 15991, + 15992, + 15993, + 15994, + 15995, + 15996, + 15997, + 15998, + 15999, + 16000, + 16001, + 16002, + 16003, + 16004, + 16005, + 16006, + 16007, + 16008, + 16009, + 16010, + 16011, + 16012, + 16013, + 16014, + 16015, + 16016, + 16017, + 16018, + 16019, + 16020, + 16021, + 16022, + 16023, + 16024, + 16025, + 16026, + 16027, + 16028, + 16029, + 16030, + 16031, + 16032, + 16033, + 16034, + 16035, + 16036, + 16037, + 16038, + 16039, + 16040, + 16041, + 16042, + 16043, + 16044, + 16045, + 16046, + 16047, + 16048, + 16049, + 16050, + 16051, + 16052, + 16053, + 16054, + 16055, + 16056, + 16057, + 16058, + 16059, + 16060, + 16061, + 16062, + 16063, + 16064, + 16065, + 16066, + 16067, + 16068, + 16069, + 16070, + 16071, + 16072, + 16073, + 16074, + 16075, + 16076, + 16077, + 16078, + 16079, + 16080, + 16081, + 16082, + 16083, + 16084, + 16085, + 16086, + 16087, + 16088, + 16089, + 16090, + 16091, + 16092, + 16093, + 16094, + 16095, + 16096, + 16097, + 16098, + 16099, + 16100, + 16101, + 16102, + 16103, + 16104, + 16105, + 16106, + 16107, + 16108, + 16109, + 16110, + 16111, + 16112, + 16113, + 16114, + 16115, + 16116, + 16117, + 16118, + 16119, + 16120, + 16121, + 16122, + 16123, + 16124, + 16125, + 16126, + 16127, + 16128, + 16129, + 16130, + 16131, + 16132, + 16133, + 16134, + 16135, + 16136, + 16137, + 16138, + 16139, + 16140, + 16141, + 16142, + 16143, + 16144, + 16145, + 16146, + 16147, + 16148, + 16149, + 16150, + 16151, + 16152, + 16153, + 16154, + 16155, + 16156, + 16157, + 16158, + 16159, + 16160, + 16161, + 16162, + 16163, + 16164, + 16165, + 16166, + 16167, + 16168, + 16169, + 16170, + 16171, + 16172, + 16173, + 16174, + 16175, + 16176, + 16177, + 16178, + 16179, + 16180, + 16181, + 16182, + 16183, + 16184, + 16185, + 16186, + 16187, + 16188, + 16189, + 16190, + 16191, + 16192, + 16193, + 16194, + 16195, + 16196, + 16197, + 16198, + 16199, + 16200, + 16201, + 16202, + 16203, + 16204, + 16205, + 16206, + 16207, + 16208, + 16209, + 16210, + 16211, + 16212, + 16213, + 16214, + 16215, + 16216, + 16217, + 16218, + 16219, + 16220, + 16221, + 16222, + 16223, + 16224, + 16225, + 16226, + 16227, + 16228, + 16229, + 16230, + 16231, + 16232, + 16233, + 16234, + 16235, + 16236, + 16237, + 16238, + 16239, + 16240, + 16241, + 16242, + 16243, + 16244, + 16245, + 16246, + 16247, + 16248, + 16249, + 16250, + 16251, + 16252, + 16253, + 16254, + 16255, + 16256, + 16257, + 16258, + 16259, + 16260, + 16261, + 16262, + 16263, + 16264, + 16265, + 16266, + 16267, + 16268, + 16269, + 16270, + 16271, + 16272, + 16273, + 16274, + 16275, + 16276, + 16277, + 16278, + 16279, + 16280, + 16281, + 16282, + 16283, + 16284, + 16285, + 16286, + 16287, + 16288, + 16289, + 16290, + 16291, + 16292, + 16293, + 16294, + 16295, + 16296, + 16297, + 16298, + 16299, + 16300, + 16301, + 16302, + 16303, + 16304, + 16305, + 16306, + 16307, + 16308, + 16309, + 16310, + 16311, + 16312, + 16313, + 16314, + 16315, + 16316, + 16317, + 16318, + 16319, + 16320, + 16321, + 16322, + 16323, + 16324, + 16325, + 16326, + 16327, + 16328, + 16329, + 16330, + 16331, + 16332, + 16333, + 16334, + 16335, + 16336, + 16337, + 16338, + 16339, + 16340, + 16341, + 16342, + 16343, + 16344, + 16345, + 16346, + 16347, + 16348, + 16349, + 16350, + 16351, + 16352, + 16353, + 16354, + 16355, + 16356, + 16357, + 16358, + 16359, + 16360, + 16361, + 16362, + 16363, + 16364, + 16365, + 16366, + 16367, + 16368, + 16369, + 16370, + 16371, + 16372, + 16373, + 16374, + 16375, + 16376, + 16377, + 16378, + 16379, + 16380, + 16381, + 16382, + 16383, + 16384, + 16385, + 16386, + 16387, + 16388, + 16389, + 16390, + 16391, + 16392, + 16393, + 16394, + 16395, + 16396, + 16397, + 16398, + 16399, + 16400, + 16401, + 16402, + 16403, + 16404, + 16405, + 16406, + 16407, + 16408, + 16409, + 16410, + 16411, + 16412, + 16413, + 16414, + 16415, + 16416, + 16417, + 16418, + 16419, + 16420, + 16421, + 16422, + 16423, + 16424, + 16425, + 16426, + 16427, + 16428, + 16429, + 16430, + 16431, + 16432, + 16433, + 16434, + 16435, + 16436, + 16437, + 16438, + 16439, + 16440, + 16441, + 16442, + 16443, + 16444, + 16445, + 16446, + 16447, + 16448, + 16449, + 16450, + 16451, + 16452, + 16453, + 16454, + 16455, + 16456, + 16457, + 16458, + 16459, + 16460, + 16461, + 16462, + 16463, + 16464, + 16465, + 16466, + 16467, + 16468, + 16469, + 16470, + 16471, + 16472, + 16473, + 16474, + 16475, + 16476, + 16477, + 16478, + 16479, + 16480, + 16481, + 16482, + 16483, + 16484, + 16485, + 16486, + 16487, + 16488, + 16489, + 16490, + 16491, + 16492, + 16493, + 16494, + 16495, + 16496, + 16497, + 16498, + 16499, + 16500, + 16501, + 16502, + 16503, + 16504, + 16505, + 16506, + 16507, + 16508, + 16509, + 16510, + 16511, + 16512, + 16513, + 16514, + 16515, + 16516, + 16517, + 16518, + 16519, + 16520, + 16521, + 16522, + 16523, + 16524, + 16525, + 16526, + 16527, + 16528, + 16529, + 16530, + 16531, + 16532, + 16533, + 16534, + 16535, + 16536, + 16537, + 16538, + 16539, + 16540, + 16541, + 16542, + 16543, + 16544, + 16545, + 16546, + 16547, + 16548, + 16549, + 16550, + 16551, + 16552, + 16553, + 16554, + 16555, + 16556, + 16557, + 16558, + 16559, + 16560, + 16561, + 16562, + 16563, + 16564, + 16565, + 16566, + 16567, + 16568, + 16569, + 16570, + 16571, + 16572, + 16573, + 16574, + 16575, + 16576, + 16577, + 16578, + 16579, + 16580, + 16581, + 16582, + 16583, + 16584, + 16585, + 16586, + 16587, + 16588, + 16589, + 16590, + 16591, + 16592, + 16593, + 16594, + 16595, + 16596, + 16597, + 16598, + 16599, + 16600, + 16601, + 16602, + 16603, + 16604, + 16605, + 16606, + 16607, + 16608, + 16609, + 16610, + 16611, + 16612, + 16613, + 16614, + 16615, + 16616, + 16617, + 16618, + 16619, + 16620, + 16621, + 16622, + 16623, + 16624, + 16625, + 16626, + 16627, + 16628, + 16629, + 16630, + 16631, + 16632, + 16633, + 16634, + 16635, + 16636, + 16637, + 16638, + 16639, + 16640, + 16641, + 16642, + 16643, + 16644, + 16645, + 16646, + 16647, + 16648, + 16649, + 16650, + 16651, + 16652, + 16653, + 16654, + 16655, + 16656, + 16657, + 16658, + 16659, + 16660, + 16661, + 16662, + 16663, + 16664, + 16665, + 16666, + 16667, + 16668, + 16669, + 16670, + 16671, + 16672, + 16673, + 16674, + 16675, + 16676, + 16677, + 16678, + 16679, + 16680, + 16681, + 16682, + 16683, + 16684, + 16685, + 16686, + 16687, + 16688, + 16689, + 16690, + 16691, + 16692, + 16693, + 16694, + 16695, + 16696, + 16697, + 16698, + 16699, + 16700, + 16701, + 16702, + 16703, + 16704, + 16705, + 16706, + 16707, + 16708, + 16709, + 16710, + 16711, + 16712, + 16713, + 16714, + 16715, + 16716, + 16717, + 16718, + 16719, + 16720, + 16721, + 16722, + 16723, + 16724, + 16725, + 16726, + 16727, + 16728, + 16729, + 16730, + 16731, + 16732, + 16733, + 16734, + 16735, + 16736, + 16737, + 16738, + 16739, + 16740, + 16741, + 16742, + 16743, + 16744, + 16745, + 16746, + 16747, + 16748, + 16749, + 16750, + 16751, + 16752, + 16753, + 16754, + 16755, + 16756, + 16757, + 16758, + 16759, + 16760, + 16761, + 16762, + 16763, + 16764, + 16765, + 16766, + 16767, + 16768, + 16769, + 16770, + 16771, + 16772, + 16773, + 16774, + 16775, + 16776, + 16777, + 16778, + 16779, + 16780, + 16781, + 16782, + 16783, + 16784, + 16785, + 16786, + 16787, + 16788, + 16789, + 16790, + 16791, + 16792, + 16793, + 16794, + 16795, + 16796, + 16797, + 16798, + 16799, + 16800, + 16801, + 16802, + 16803, + 16804, + 16805, + 16806, + 16807, + 16808, + 16809, + 16810, + 16811, + 16812, + 16813, + 16814, + 16815, + 16816, + 16817, + 16818, + 16819, + 16820, + 16821, + 16822, + 16823, + 16824, + 16825, + 16826, + 16827, + 16828, + 16829, + 16830, + 16831, + 16832, + 16833, + 16834, + 16835, + 16836, + 16837, + 16838, + 16839, + 16840, + 16841, + 16842, + 16843, + 16844, + 16845, + 16846, + 16847, + 16848, + 16849, + 16850, + 16851, + 16852, + 16853, + 16854, + 16855, + 16856, + 16857, + 16858, + 16859, + 16860, + 16861, + 16862, + 16863, + 16864, + 16865, + 16866, + 16867, + 16868, + 16869, + 16870, + 16871, + 16872, + 16873, + 16874, + 16875, + 16876, + 16877, + 16878, + 16879, + 16880, + 16881, + 16882, + 16883, + 16884, + 16885, + 16886, + 16887, + 16888, + 16889, + 16890, + 16891, + 16892, + 16893, + 16894, + 16895, + 16896, + 16897, + 16898, + 16899, + 16900, + 16901, + 16902, + 16903, + 16904, + 16905, + 16906, + 16907, + 16908, + 16909, + 16910, + 16911, + 16912, + 16913, + 16914, + 16915, + 16916, + 16917, + 16918, + 16919, + 16920, + 16921, + 16922, + 16923, + 16924, + 16925, + 16926, + 16927, + 16928, + 16929, + 16930, + 16931, + 16932, + 16933, + 16934, + 16935, + 16936, + 16937, + 16938, + 16939, + 16940, + 16941, + 16942, + 16943, + 16944, + 16945, + 16946, + 16947, + 16948, + 16949, + 16950, + 16951, + 16952, + 16953, + 16954, + 16955, + 16956, + 16957, + 16958, + 16959, + 16960, + 16961, + 16962, + 16963, + 16964, + 16965, + 16966, + 16967, + 16968, + 16969, + 16970, + 16971, + 16972, + 16973, + 16974, + 16975, + 16976, + 16977, + 16978, + 16979, + 16980, + 16981, + 16982, + 16983, + 16984, + 16985, + 16986, + 16987, + 16988, + 16989, + 16990, + 16991, + 16992, + 16993, + 16994, + 16995, + 16996, + 16997, + 16998, + 16999, + 17000, + 17001, + 17002, + 17003, + 17004, + 17005, + 17006, + 17007, + 17008, + 17009, + 17010, + 17011, + 17012, + 17013, + 17014, + 17015, + 17016, + 17017, + 17018, + 17019, + 17020, + 17021, + 17022, + 17023, + 17024, + 17025, + 17026, + 17027, + 17028, + 17029, + 17030, + 17031, + 17032, + 17033, + 17034, + 17035, + 17036, + 17037, + 17038, + 17039, + 17040, + 17041, + 17042, + 17043, + 17044, + 17045, + 17046, + 17047, + 17048, + 17049, + 17050, + 17051, + 17052, + 17053, + 17054, + 17055, + 17056, + 17057, + 17058, + 17059, + 17060, + 17061, + 17062, + 17063, + 17064, + 17065, + 17066, + 17067, + 17068, + 17069, + 17070, + 17071, + 17072, + 17073, + 17074, + 17075, + 17076, + 17077, + 17078, + 17079, + 17080, + 17081, + 17082, + 17083, + 17084, + 17085, + 17086, + 17087, + 17088, + 17089, + 17090, + 17091, + 17092, + 17093, + 17094, + 17095, + 17096, + 17097, + 17098, + 17099, + 17100, + 17101, + 17102, + 17103, + 17104, + 17105, + 17106, + 17107, + 17108, + 17109, + 17110, + 17111, + 17112, + 17113, + 17114, + 17115, + 17116, + 17117, + 17118, + 17119, + 17120, + 17121, + 17122, + 17123, + 17124, + 17125, + 17126, + 17127, + 17128, + 17129, + 17130, + 17131, + 17132, + 17133, + 17134, + 17135, + 17136, + 17137, + 17138, + 17139, + 17140, + 17141, + 17142, + 17143, + 17144, + 17145, + 17146, + 17147, + 17148, + 17149, + 17150, + 17151, + 17152, + 17153, + 17154, + 17155, + 17156, + 17157, + 17158, + 17159, + 17160, + 17161, + 17162, + 17163, + 17164, + 17165, + 17166, + 17167, + 17168, + 17169, + 17170, + 17171, + 17172, + 17173, + 17174, + 17175, + 17176, + 17177, + 17178, + 17179, + 17180, + 17181, + 17182, + 17183, + 17184, + 17185, + 17186, + 17187, + 17188, + 17189, + 17190, + 17191, + 17192, + 17193, + 17194, + 17195, + 17196, + 17197, + 17198, + 17199, + 17200, + 17201, + 17202, + 17203, + 17204, + 17205, + 17206, + 17207, + 17208, + 17209, + 17210, + 17211, + 17212, + 17213, + 17214, + 17215, + 17216, + 17217, + 17218, + 17219, + 17220, + 17221, + 17222, + 17223, + 17224, + 17225, + 17226, + 17227, + 17228, + 17229, + 17230, + 17231, + 17232, + 17233, + 17234, + 17235, + 17236, + 17237, + 17238, + 17239, + 17240, + 17241, + 17242, + 17243, + 17244, + 17245, + 17246, + 17247, + 17248, + 17249, + 17250, + 17251, + 17252, + 17253, + 17254, + 17255, + 17256, + 17257, + 17258, + 17259, + 17260, + 17261, + 17262, + 17263, + 17264, + 17265, + 17266, + 17267, + 17268, + 17269, + 17270, + 17271, + 17272, + 17273, + 17274, + 17275, + 17276, + 17277, + 17278, + 17279, + 17280, + 17281, + 17282, + 17283, + 17284, + 17285, + 17286, + 17287, + 17288, + 17289, + 17290, + 17291, + 17292, + 17293, + 17294, + 17295, + 17296, + 17297, + 17298, + 17299, + 17300, + 17301, + 17302, + 17303, + 17304, + 17305, + 17306, + 17307, + 17308, + 17309, + 17310, + 17311, + 17312, + 17313, + 17314, + 17315, + 17316, + 17317, + 17318, + 17319, + 17320, + 17321, + 17322, + 17323, + 17324, + 17325, + 17326, + 17327, + 17328, + 17329, + 17330, + 17331, + 17332, + 17333, + 17334, + 17335, + 17336, + 17337, + 17338, + 17339, + 17340, + 17341, + 17342, + 17343, + 17344, + 17345, + 17346, + 17347, + 17348, + 17349, + 17350, + 17351, + 17352, + 17353, + 17354, + 17355, + 17356, + 17357, + 17358, + 17359, + 17360, + 17361, + 17362, + 17363, + 17364, + 17365, + 17366, + 17367, + 17368, + 17369, + 17370, + 17371, + 17372, + 17373, + 17374, + 17375, + 17376, + 17377, + 17378, + 17379, + 17380, + 17381, + 17382, + 17383, + 17384, + 17385, + 17386, + 17387, + 17388, + 17389, + 17390, + 17391, + 17392, + 17393, + 17394, + 17395, + 17396, + 17397, + 17398, + 17399, + 17400, + 17401, + 17402, + 17403, + 17404, + 17405, + 17406, + 17407, + 17408, + 17409, + 17410, + 17411, + 17412, + 17413, + 17414, + 17415, + 17416, + 17417, + 17418, + 17419, + 17420, + 17421, + 17422, + 17423, + 17424, + 17425, + 17426, + 17427, + 17428, + 17429, + 17430, + 17431, + 17432, + 17433, + 17434, + 17435, + 17436, + 17437, + 17438, + 17439, + 17440, + 17441, + 17442, + 17443, + 17444, + 17445, + 17446, + 17447, + 17448, + 17449, + 17450, + 17451, + 17452, + 17453, + 17454, + 17455, + 17456, + 17457, + 17458, + 17459, + 17460, + 17461, + 17462, + 17463, + 17464, + 17465, + 17466, + 17467, + 17468, + 17469, + 17470, + 17471, + 17472, + 17473, + 17474, + 17475, + 17476, + 17477, + 17478, + 17479, + 17480, + 17481, + 17482, + 17483, + 17484, + 17485, + 17486, + 17487, + 17488, + 17489, + 17490, + 17491, + 17492, + 17493, + 17494, + 17495, + 17496, + 17497, + 17498, + 17499, + 17500, + 17501, + 17502, + 17503, + 17504, + 17505, + 17506, + 17507, + 17508, + 17509, + 17510, + 17511, + 17512, + 17513, + 17514, + 17515, + 17516, + 17517, + 17518, + 17519, + 17520, + 17521, + 17522, + 17523, + 17524, + 17525, + 17526, + 17527, + 17528, + 17529, + 17530, + 17531, + 17532, + 17533, + 17534, + 17535, + 17536, + 17537, + 17538, + 17539, + 17540, + 17541, + 17542, + 17543, + 17544, + 17545, + 17546, + 17547, + 17548, + 17549, + 17550, + 17551, + 17552, + 17553, + 17554, + 17555, + 17556, + 17557, + 17558, + 17559, + 17560, + 17561, + 17562, + 17563, + 17564, + 17565, + 17566, + 17567, + 17568, + 17569, + 17570, + 17571, + 17572, + 17573, + 17574, + 17575, + 17576, + 17577, + 17578, + 17579, + 17580, + 17581, + 17582, + 17583, + 17584, + 17585, + 17586, + 17587, + 17588, + 17589, + 17590, + 17591, + 17592, + 17593, + 17594, + 17595, + 17596, + 17597, + 17598, + 17599, + 17600, + 17601, + 17602, + 17603, + 17604, + 17605, + 17606, + 17607, + 17608, + 17609, + 17610, + 17611, + 17612, + 17613, + 17614, + 17615, + 17616, + 17617, + 17618, + 17619, + 17620, + 17621, + 17622, + 17623, + 17624, + 17625, + 17626, + 17627, + 17628, + 17629, + 17630, + 17631, + 17632, + 17633, + 17634, + 17635, + 17636, + 17637, + 17638, + 17639, + 17640, + 17641, + 17642, + 17643, + 17644, + 17645, + 17646, + 17647, + 17648, + 17649, + 17650, + 17651, + 17652, + 17653, + 17654, + 17655, + 17656, + 17657, + 17658, + 17659, + 17660, + 17661, + 17662, + 17663, + 17664, + 17665, + 17666, + 17667, + 17668, + 17669, + 17670, + 17671, + 17672, + 17673, + 17674, + 17675, + 17676, + 17677, + 17678, + 17679, + 17680, + 17681, + 17682, + 17683, + 17684, + 17685, + 17686, + 17687, + 17688, + 17689, + 17690, + 17691, + 17692, + 17693, + 17694, + 17695, + 17696, + 17697, + 17698, + 17699, + 17700, + 17701, + 17702, + 17703, + 17704, + 17705, + 17706, + 17707, + 17708, + 17709, + 17710, + 17711, + 17712, + 17713, + 17714, + 17715, + 17716, + 17717, + 17718, + 17719, + 17720, + 17721, + 17722, + 17723, + 17724, + 17725, + 17726, + 17727, + 17728, + 17729, + 17730, + 17731, + 17732, + 17733, + 17734, + 17735, + 17736, + 17737, + 17738, + 17739, + 17740, + 17741, + 17742, + 17743, + 17744, + 17745, + 17746, + 17747, + 17748, + 17749, + 17750, + 17751, + 17752, + 17753, + 17754, + 17755, + 17756, + 17757, + 17758, + 17759, + 17760, + 17761, + 17762, + 17763, + 17764, + 17765, + 17766, + 17767, + 17768, + 17769, + 17770, + 17771, + 17772, + 17773, + 17774, + 17775, + 17776, + 17777, + 17778, + 17779, + 17780, + 17781, + 17782, + 17783, + 17784, + 17785, + 17786, + 17787, + 17788, + 17789, + 17790, + 17791, + 17792, + 17793, + 17794, + 17795, + 17796, + 17797, + 17798, + 17799, + 17800, + 17801, + 17802, + 17803, + 17804, + 17805, + 17806, + 17807, + 17808, + 17809, + 17810, + 17811, + 17812, + 17813, + 17814, + 17815, + 17816, + 17817, + 17818, + 17819, + 17820, + 17821, + 17822, + 17823, + 17824, + 17825, + 17826, + 17827, + 17828, + 17829, + 17830, + 17831, + 17832, + 17833, + 17834, + 17835, + 17836, + 17837, + 17838, + 17839, + 17840, + 17841, + 17842, + 17843, + 17844, + 17845, + 17846, + 17847, + 17848, + 17849, + 17850, + 17851, + 17852, + 17853, + 17854, + 17855, + 17856, + 17857, + 17858, + 17859, + 17860, + 17861, + 17862, + 17863, + 17864, + 17865, + 17866, + 17867, + 17868, + 17869, + 17870, + 17871, + 17872, + 17873, + 17874, + 17875, + 17876, + 17877, + 17878, + 17879, + 17880, + 17881, + 17882, + 17883, + 17884, + 17885, + 17886, + 17887, + 17888, + 17889, + 17890, + 17891, + 17892, + 17893, + 17894, + 17895, + 17896, + 17897, + 17898, + 17899, + 17900, + 17901, + 17902, + 17903, + 17904, + 17905, + 17906, + 17907, + 17908, + 17909, + 17910, + 17911, + 17912, + 17913, + 17914, + 17915, + 17916, + 17917, + 17918, + 17919, + 17920, + 17921, + 17922, + 17923, + 17924, + 17925, + 17926, + 17927, + 17928, + 17929, + 17930, + 17931, + 17932, + 17933, + 17934, + 17935, + 17936, + 17937, + 17938, + 17939, + 17940, + 17941, + 17942, + 17943, + 17944, + 17945, + 17946, + 17947, + 17948, + 17949, + 17950, + 17951, + 17952, + 17953, + 17954, + 17955, + 17956, + 17957, + 17958, + 17959, + 17960, + 17961, + 17962, + 17963, + 17964, + 17965, + 17966, + 17967, + 17968, + 17969, + 17970, + 17971, + 17972, + 17973, + 17974, + 17975, + 17976, + 17977, + 17978, + 17979, + 17980, + 17981, + 17982, + 17983, + 17984, + 17985, + 17986, + 17987, + 17988, + 17989, + 17990, + 17991, + 17992, + 17993, + 17994, + 17995, + 17996, + 17997, + 17998, + 17999, + 18000, + 18001, + 18002, + 18003, + 18004, + 18005, + 18006, + 18007, + 18008, + 18009, + 18010, + 18011, + 18012, + 18013, + 18014, + 18015, + 18016, + 18017, + 18018, + 18019, + 18020, + 18021, + 18022, + 18023, + 18024, + 18025, + 18026, + 18027, + 18028, + 18029, + 18030, + 18031, + 18032, + 18033, + 18034, + 18035, + 18036, + 18037, + 18038, + 18039, + 18040, + 18041, + 18042, + 18043, + 18044, + 18045, + 18046, + 18047, + 18048, + 18049, + 18050, + 18051, + 18052, + 18053, + 18054, + 18055, + 18056, + 18057, + 18058, + 18059, + 18060, + 18061, + 18062, + 18063, + 18064, + 18065, + 18066, + 18067, + 18068, + 18069, + 18070, + 18071, + 18072, + 18073, + 18074, + 18075, + 18076, + 18077, + 18078, + 18079, + 18080, + 18081, + 18082, + 18083, + 18084, + 18085, + 18086, + 18087, + 18088, + 18089, + 18090, + 18091, + 18092, + 18093, + 18094, + 18095, + 18096, + 18097, + 18098, + 18099, + 18100, + 18101, + 18102, + 18103, + 18104, + 18105, + 18106, + 18107, + 18108, + 18109, + 18110, + 18111, + 18112, + 18113, + 18114, + 18115, + 18116, + 18117, + 18118, + 18119, + 18120, + 18121, + 18122, + 18123, + 18124, + 18125, + 18126, + 18127, + 18128, + 18129, + 18130, + 18131, + 18132, + 18133, + 18134, + 18135, + 18136, + 18137, + 18138, + 18139, + 18140, + 18141, + 18142, + 18143, + 18144, + 18145, + 18146, + 18147, + 18148, + 18149, + 18150, + 18151, + 18152, + 18153, + 18154, + 18155, + 18156, + 18157, + 18158, + 18159, + 18160, + 18161, + 18162, + 18163, + 18164, + 18165, + 18166, + 18167, + 18168, + 18169, + 18170, + 18171, + 18172, + 18173, + 18174, + 18175, + 18176, + 18177, + 18178, + 18179, + 18180, + 18181, + 18182, + 18183, + 18184, + 18185, + 18186, + 18187, + 18188, + 18189, + 18190, + 18191, + 18192, + 18193, + 18194, + 18195, + 18196, + 18197, + 18198, + 18199, + 18200, + 18201, + 18202, + 18203, + 18204, + 18205, + 18206, + 18207, + 18208, + 18209, + 18210, + 18211, + 18212, + 18213, + 18214, + 18215, + 18216, + 18217, + 18218, + 18219, + 18220, + 18221, + 18222, + 18223, + 18224, + 18225, + 18226, + 18227, + 18228, + 18229, + 18230, + 18231, + 18232, + 18233, + 18234, + 18235, + 18236, + 18237, + 18238, + 18239, + 18240, + 18241, + 18242, + 18243, + 18244, + 18245, + 18246, + 18247, + 18248, + 18249, + 18250, + 18251, + 18252, + 18253, + 18254, + 18255, + 18256, + 18257, + 18258, + 18259, + 18260, + 18261, + 18262, + 18263, + 18264, + 18265, + 18266, + 18267, + 18268, + 18269, + 18270, + 18271, + 18272, + 18273, + 18274, + 18275, + 18276, + 18277, + 18278, + 18279, + 18280, + 18281, + 18282, + 18283, + 18284, + 18285, + 18286, + 18287, + 18288, + 18289, + 18290, + 18291, + 18292, + 18293, + 18294, + 18295, + 18296, + 18297, + 18298, + 18299, + 18300, + 18301, + 18302, + 18303, + 18304, + 18305, + 18306, + 18307, + 18308, + 18309, + 18310, + 18311, + 18312, + 18313, + 18314, + 18315, + 18316, + 18317, + 18318, + 18319, + 18320, + 18321, + 18322, + 18323, + 18324, + 18325, + 18326, + 18327, + 18328, + 18329, + 18330, + 18331, + 18332, + 18333, + 18334, + 18335, + 18336, + 18337, + 18338, + 18339, + 18340, + 18341, + 18342, + 18343, + 18344, + 18345, + 18346, + 18347, + 18348, + 18349, + 18350, + 18351, + 18352, + 18353, + 18354, + 18355, + 18356, + 18357, + 18358, + 18359, + 18360, + 18361, + 18362, + 18363, + 18364, + 18365, + 18366, + 18367, + 18368, + 18369, + 18370, + 18371, + 18372, + 18373, + 18374, + 18375, + 18376, + 18377, + 18378, + 18379, + 18380, + 18381, + 18382, + 18383, + 18384, + 18385, + 18386, + 18387, + 18388, + 18389, + 18390, + 18391, + 18392, + 18393, + 18394, + 18395, + 18396, + 18397, + 18398, + 18399, + 18400, + 18401, + 18402, + 18403, + 18404, + 18405, + 18406, + 18407, + 18408, + 18409, + 18410, + 18411, + 18412, + 18413, + 18414, + 18415, + 18416, + 18417, + 18418, + 18419, + 18420, + 18421, + 18422, + 18423, + 18424, + 18425, + 18426, + 18427, + 18428, + 18429, + 18430, + 18431, + 18432, + 18433, + 18434, + 18435, + 18436, + 18437, + 18438, + 18439, + 18440, + 18441, + 18442, + 18443, + 18444, + 18445, + 18446, + 18447, + 18448, + 18449, + 18450, + 18451, + 18452, + 18453, + 18454, + 18455, + 18456, + 18457, + 18458, + 18459, + 18460, + 18461, + 18462, + 18463, + 18464, + 18465, + 18466, + 18467, + 18468, + 18469, + 18470, + 18471, + 18472, + 18473, + 18474, + 18475, + 18476, + 18477, + 18478, + 18479, + 18480, + 18481, + 18482, + 18483, + 18484, + 18485, + 18486, + 18487, + 18488, + 18489, + 18490, + 18491, + 18492, + 18493, + 18494, + 18495, + 18496, + 18497, + 18498, + 18499, + 18500, + 18501, + 18502, + 18503, + 18504, + 18505, + 18506, + 18507, + 18508, + 18509, + 18510, + 18511, + 18512, + 18513, + 18514, + 18515, + 18516, + 18517, + 18518, + 18519, + 18520, + 18521, + 18522, + 18523, + 18524, + 18525, + 18526, + 18527, + 18528, + 18529, + 18530, + 18531, + 18532, + 18533, + 18534, + 18535, + 18536, + 18537, + 18538, + 18539, + 18540, + 18541, + 18542, + 18543, + 18544, + 18545, + 18546, + 18547, + 18548, + 18549, + 18550, + 18551, + 18552, + 18553, + 18554, + 18555, + 18556, + 18557, + 18558, + 18559, + 18560, + 18561, + 18562, + 18563, + 18564, + 18565, + 18566, + 18567, + 18568, + 18569, + 18570, + 18571, + 18572, + 18573, + 18574, + 18575, + 18576, + 18577, + 18578, + 18579, + 18580, + 18581, + 18582, + 18583, + 18584, + 18585, + 18586, + 18587, + 18588, + 18589, + 18590, + 18591, + 18592, + 18593, + 18594, + 18595, + 18596, + 18597, + 18598, + 18599, + 18600, + 18601, + 18602, + 18603, + 18604, + 18605, + 18606, + 18607, + 18608, + 18609, + 18610, + 18611, + 18612, + 18613, + 18614, + 18615, + 18616, + 18617, + 18618, + 18619, + 18620, + 18621, + 18622, + 18623, + 18624, + 18625, + 18626, + 18627, + 18628, + 18629, + 18630, + 18631, + 18632, + 18633, + 18634, + 18635, + 18636, + 18637, + 18638, + 18639, + 18640, + 18641, + 18642, + 18643, + 18644, + 18645, + 18646, + 18647, + 18648, + 18649, + 18650, + 18651, + 18652, + 18653, + 18654, + 18655, + 18656, + 18657, + 18658, + 18659, + 18660, + 18661, + 18662, + 18663, + 18664, + 18665, + 18666, + 18667, + 18668, + 18669, + 18670, + 18671, + 18672, + 18673, + 18674, + 18675, + 18676, + 18677, + 18678, + 18679, + 18680, + 18681, + 18682, + 18683, + 18684, + 18685, + 18686, + 18687, + 18688, + 18689, + 18690, + 18691, + 18692, + 18693, + 18694, + 18695, + 18696, + 18697, + 18698, + 18699, + 18700, + 18701, + 18702, + 18703, + 18704, + 18705, + 18706, + 18707, + 18708, + 18709, + 18710, + 18711, + 18712, + 18713, + 18714, + 18715, + 18716, + 18717, + 18718, + 18719, + 18720, + 18721, + 18722, + 18723, + 18724, + 18725, + 18726, + 18727, + 18728, + 18729, + 18730, + 18731, + 18732, + 18733, + 18734, + 18735, + 18736, + 18737, + 18738, + 18739, + 18740, + 18741, + 18742, + 18743, + 18744, + 18745, + 18746, + 18747, + 18748, + 18749, + 18750, + 18751, + 18752, + 18753, + 18754, + 18755, + 18756, + 18757, + 18758, + 18759, + 18760, + 18761, + 18762, + 18763, + 18764, + 18765, + 18766, + 18767, + 18768, + 18769, + 18770, + 18771, + 18772, + 18773, + 18774, + 18775, + 18776, + 18777, + 18778, + 18779, + 18780, + 18781, + 18782, + 18783, + 18784, + 18785, + 18786, + 18787, + 18788, + 18789, + 18790, + 18791, + 18792, + 18793, + 18794, + 18795, + 18796, + 18797, + 18798, + 18799, + 18800, + 18801, + 18802, + 18803, + 18804, + 18805, + 18806, + 18807, + 18808, + 18809, + 18810, + 18811, + 18812, + 18813, + 18814, + 18815, + 18816, + 18817, + 18818, + 18819, + 18820, + 18821, + 18822, + 18823, + 18824, + 18825, + 18826, + 18827, + 18828, + 18829, + 18830, + 18831, + 18832, + 18833, + 18834, + 18835, + 18836, + 18837, + 18838, + 18839, + 18840, + 18841, + 18842, + 18843, + 18844, + 18845, + 18846, + 18847, + 18848, + 18849, + 18850, + 18851, + 18852, + 18853, + 18854, + 18855, + 18856, + 18857, + 18858, + 18859, + 18860, + 18861, + 18862, + 18863, + 18864, + 18865, + 18866, + 18867, + 18868, + 18869, + 18870, + 18871, + 18872, + 18873, + 18874, + 18875, + 18876, + 18877, + 18878, + 18879, + 18880, + 18881, + 18882, + 18883, + 18884, + 18885, + 18886, + 18887, + 18888, + 18889, + 18890, + 18891, + 18892, + 18893, + 18894, + 18895, + 18896, + 18897, + 18898, + 18899, + 18900, + 18901, + 18902, + 18903, + 18904, + 18905, + 18906, + 18907, + 18908, + 18909, + 18910, + 18911, + 18912, + 18913, + 18914, + 18915, + 18916, + 18917, + 18918, + 18919, + 18920, + 18921, + 18922, + 18923, + 18924, + 18925, + 18926, + 18927, + 18928, + 18929, + 18930, + 18931, + 18932, + 18933, + 18934, + 18935, + 18936, + 18937, + 18938, + 18939, + 18940, + 18941, + 18942, + 18943, + 18944, + 18945, + 18946, + 18947, + 18948, + 18949, + 18950, + 18951, + 18952, + 18953, + 18954, + 18955, + 18956, + 18957, + 18958, + 18959, + 18960, + 18961, + 18962, + 18963, + 18964, + 18965, + 18966, + 18967, + 18968, + 18969, + 18970, + 18971, + 18972, + 18973, + 18974, + 18975, + 18976, + 18977, + 18978, + 18979, + 18980, + 18981, + 18982, + 18983, + 18984, + 18985, + 18986, + 18987, + 18988, + 18989, + 18990, + 18991, + 18992, + 18993, + 18994, + 18995, + 18996, + 18997, + 18998, + 18999, + 19000, + 19001, + 19002, + 19003, + 19004, + 19005, + 19006, + 19007, + 19008, + 19009, + 19010, + 19011, + 19012, + 19013, + 19014, + 19015, + 19016, + 19017, + 19018, + 19019, + 19020, + 19021, + 19022, + 19023, + 19024, + 19025, + 19026, + 19027, + 19028, + 19029, + 19030, + 19031, + 19032, + 19033, + 19034, + 19035, + 19036, + 19037, + 19038, + 19039, + 19040, + 19041, + 19042, + 19043, + 19044, + 19045, + 19046, + 19047, + 19048, + 19049, + 19050, + 19051, + 19052, + 19053, + 19054, + 19055, + 19056, + 19057, + 19058, + 19059, + 19060, + 19061, + 19062, + 19063, + 19064, + 19065, + 19066, + 19067, + 19068, + 19069, + 19070, + 19071, + 19072, + 19073, + 19074, + 19075, + 19076, + 19077, + 19078, + 19079, + 19080, + 19081, + 19082, + 19083, + 19084, + 19085, + 19086, + 19087, + 19088, + 19089, + 19090, + 19091, + 19092, + 19093, + 19094, + 19095, + 19096, + 19097, + 19098, + 19099, + 19100, + 19101, + 19102, + 19103, + 19104, + 19105, + 19106, + 19107, + 19108, + 19109, + 19110, + 19111, + 19112, + 19113, + 19114, + 19115, + 19116, + 19117, + 19118, + 19119, + 19120, + 19121, + 19122, + 19123, + 19124, + 19125, + 19126, + 19127, + 19128, + 19129, + 19130, + 19131, + 19132, + 19133, + 19134, + 19135, + 19136, + 19137, + 19138, + 19139, + 19140, + 19141, + 19142, + 19143, + 19144, + 19145, + 19146, + 19147, + 19148, + 19149, + 19150, + 19151, + 19152, + 19153, + 19154, + 19155, + 19156, + 19157, + 19158, + 19159, + 19160, + 19161, + 19162, + 19163, + 19164, + 19165, + 19166, + 19167, + 19168, + 19169, + 19170, + 19171, + 19172, + 19173, + 19174, + 19175, + 19176, + 19177, + 19178, + 19179, + 19180, + 19181, + 19182, + 19183, + 19184, + 19185, + 19186, + 19187, + 19188, + 19189, + 19190, + 19191, + 19192, + 19193, + 19194, + 19195, + 19196, + 19197, + 19198, + 19199, + 19200, + 19201, + 19202, + 19203, + 19204, + 19205, + 19206, + 19207, + 19208, + 19209, + 19210, + 19211, + 19212, + 19213, + 19214, + 19215, + 19216, + 19217, + 19218, + 19219, + 19220, + 19221, + 19222, + 19223, + 19224, + 19225, + 19226, + 19227, + 19228, + 19229, + 19230, + 19231, + 19232, + 19233, + 19234, + 19235, + 19236, + 19237, + 19238, + 19239, + 19240, + 19241, + 19242, + 19243, + 19244, + 19245, + 19246, + 19247, + 19248, + 19249, + 19250, + 19251, + 19252, + 19253, + 19254, + 19255, + 19256, + 19257, + 19258, + 19259, + 19260, + 19261, + 19262, + 19263, + 19264, + 19265, + 19266, + 19267, + 19268, + 19269, + 19270, + 19271, + 19272, + 19273, + 19274, + 19275, + 19276, + 19277, + 19278, + 19279, + 19280, + 19281, + 19282, + 19283, + 19284, + 19285, + 19286, + 19287, + 19288, + 19289, + 19290, + 19291, + 19292, + 19293, + 19294, + 19295, + 19296, + 19297, + 19298, + 19299, + 19300, + 19301, + 19302, + 19303, + 19304, + 19305, + 19306, + 19307, + 19308, + 19309, + 19310, + 19311, + 19312, + 19313, + 19314, + 19315, + 19316, + 19317, + 19318, + 19319, + 19320, + 19321, + 19322, + 19323, + 19324, + 19325, + 19326, + 19327, + 19328, + 19329, + 19330, + 19331, + 19332, + 19333, + 19334, + 19335, + 19336, + 19337, + 19338, + 19339, + 19340, + 19341, + 19342, + 19343, + 19344, + 19345, + 19346, + 19347, + 19348, + 19349, + 19350, + 19351, + 19352, + 19353, + 19354, + 19355, + 19356, + 19357, + 19358, + 19359, + 19360, + 19361, + 19362, + 19363, + 19364, + 19365, + 19366, + 19367, + 19368, + 19369, + 19370, + 19371, + 19372, + 19373, + 19374, + 19375, + 19376, + 19377, + 19378, + 19379, + 19380, + 19381, + 19382, + 19383, + 19384, + 19385, + 19386, + 19387, + 19388, + 19389, + 19390, + 19391, + 19392, + 19393, + 19394, + 19395, + 19396, + 19397, + 19398, + 19399, + 19400, + 19401, + 19402, + 19403, + 19404, + 19405, + 19406, + 19407, + 19408, + 19409, + 19410, + 19411, + 19412, + 19413, + 19414, + 19415, + 19416, + 19417, + 19418, + 19419, + 19420, + 19421, + 19422, + 19423, + 19424, + 19425, + 19426, + 19427, + 19428, + 19429, + 19430, + 19431, + 19432, + 19433, + 19434, + 19435, + 19436, + 19437, + 19438, + 19439, + 19440, + 19441, + 19442, + 19443, + 19444, + 19445, + 19446, + 19447, + 19448, + 19449, + 19450, + 19451, + 19452, + 19453, + 19454, + 19455, + 19456, + 19457, + 19458, + 19459, + 19460, + 19461, + 19462, + 19463, + 19464, + 19465, + 19466, + 19467, + 19468, + 19469, + 19470, + 19471, + 19472, + 19473, + 19474, + 19475, + 19476, + 19477, + 19478, + 19479, + 19480, + 19481, + 19482, + 19483, + 19484, + 19485, + 19486, + 19487, + 19488, + 19489, + 19490, + 19491, + 19492, + 19493, + 19494, + 19495, + 19496, + 19497, + 19498, + 19499, + 19500, + 19501, + 19502, + 19503, + 19504, + 19505, + 19506, + 19507, + 19508, + 19509, + 19510, + 19511, + 19512, + 19513, + 19514, + 19515, + 19516, + 19517, + 19518, + 19519, + 19520, + 19521, + 19522, + 19523, + 19524, + 19525, + 19526, + 19527, + 19528, + 19529, + 19530, + 19531, + 19532, + 19533, + 19534, + 19535, + 19536, + 19537, + 19538, + 19539, + 19540, + 19541, + 19542, + 19543, + 19544, + 19545, + 19546, + 19547, + 19548, + 19549, + 19550, + 19551, + 19552, + 19553, + 19554, + 19555, + 19556, + 19557, + 19558, + 19559, + 19560, + 19561, + 19562, + 19563, + 19564, + 19565, + 19566, + 19567, + 19568, + 19569, + 19570, + 19571, + 19572, + 19573, + 19574, + 19575, + 19576, + 19577, + 19578, + 19579, + 19580, + 19581, + 19582, + 19583, + 19584, + 19585, + 19586, + 19587, + 19588, + 19589, + 19590, + 19591, + 19592, + 19593, + 19594, + 19595, + 19596, + 19597, + 19598, + 19599, + 19600, + 19601, + 19602, + 19603, + 19604, + 19605, + 19606, + 19607, + 19608, + 19609, + 19610, + 19611, + 19612, + 19613, + 19614, + 19615, + 19616, + 19617, + 19618, + 19619, + 19620, + 19621, + 19622, + 19623, + 19624, + 19625, + 19626, + 19627, + 19628, + 19629, + 19630, + 19631, + 19632, + 19633, + 19634, + 19635, + 19636, + 19637, + 19638, + 19639, + 19640, + 19641, + 19642, + 19643, + 19644, + 19645, + 19646, + 19647, + 19648, + 19649, + 19650, + 19651, + 19652, + 19653, + 19654, + 19655, + 19656, + 19657, + 19658, + 19659, + 19660, + 19661, + 19662, + 19663, + 19664, + 19665, + 19666, + 19667, + 19668, + 19669, + 19670, + 19671, + 19672, + 19673, + 19674, + 19675, + 19676, + 19677, + 19678, + 19679, + 19680, + 19681, + 19682, + 19683, + 19684, + 19685, + 19686, + 19687, + 19688, + 19689, + 19690, + 19691, + 19692, + 19693, + 19694, + 19695, + 19696, + 19697, + 19698, + 19699, + 19700, + 19701, + 19702, + 19703, + 19704, + 19705, + 19706, + 19707, + 19708, + 19709, + 19710, + 19711, + 19712, + 19713, + 19714, + 19715, + 19716, + 19717, + 19718, + 19719, + 19720, + 19721, + 19722, + 19723, + 19724, + 19725, + 19726, + 19727, + 19728, + 19729, + 19730, + 19731, + 19732, + 19733, + 19734, + 19735, + 19736, + 19737, + 19738, + 19739, + 19740, + 19741, + 19742, + 19743, + 19744, + 19745, + 19746, + 19747, + 19748, + 19749, + 19750, + 19751, + 19752, + 19753, + 19754, + 19755, + 19756, + 19757, + 19758, + 19759, + 19760, + 19761, + 19762, + 19763, + 19764, + 19765, + 19766, + 19767, + 19768, + 19769, + 19770, + 19771, + 19772, + 19773, + 19774, + 19775, + 19776, + 19777, + 19778, + 19779, + 19780, + 19781, + 19782, + 19783, + 19784, + 19785, + 19786, + 19787, + 19788, + 19789, + 19790, + 19791, + 19792, + 19793, + 19794, + 19795, + 19796, + 19797, + 19798, + 19799, + 19800, + 19801, + 19802, + 19803, + 19804, + 19805, + 19806, + 19807, + 19808, + 19809, + 19810, + 19811, + 19812, + 19813, + 19814, + 19815, + 19816, + 19817, + 19818, + 19819, + 19820, + 19821, + 19822, + 19823, + 19824, + 19825, + 19826, + 19827, + 19828, + 19829, + 19830, + 19831, + 19832, + 19833, + 19834, + 19835, + 19836, + 19837, + 19838, + 19839, + 19840, + 19841, + 19842, + 19843, + 19844, + 19845, + 19846, + 19847, + 19848, + 19849, + 19850, + 19851, + 19852, + 19853, + 19854, + 19855, + 19856, + 19857, + 19858, + 19859, + 19860, + 19861, + 19862, + 19863, + 19864, + 19865, + 19866, + 19867, + 19868, + 19869, + 19870, + 19871, + 19872, + 19873, + 19874, + 19875, + 19876, + 19877, + 19878, + 19879, + 19880, + 19881, + 19882, + 19883, + 19884, + 19885, + 19886, + 19887, + 19888, + 19889, + 19890, + 19891, + 19892, + 19893, + 19968, + 19969, + 19970, + 19971, + 19972, + 19973, + 19974, + 19975, + 19976, + 19977, + 19978, + 19979, + 19980, + 19981, + 19982, + 19983, + 19984, + 19985, + 19986, + 19987, + 19988, + 19989, + 19990, + 19991, + 19992, + 19993, + 19994, + 19995, + 19996, + 19997, + 19998, + 19999, + 20000, + 20001, + 20002, + 20003, + 20004, + 20005, + 20006, + 20007, + 20008, + 20009, + 20010, + 20011, + 20012, + 20013, + 20014, + 20015, + 20016, + 20017, + 20018, + 20019, + 20020, + 20021, + 20022, + 20023, + 20024, + 20025, + 20026, + 20027, + 20028, + 20029, + 20030, + 20031, + 20032, + 20033, + 20034, + 20035, + 20036, + 20037, + 20038, + 20039, + 20040, + 20041, + 20042, + 20043, + 20044, + 20045, + 20046, + 20047, + 20048, + 20049, + 20050, + 20051, + 20052, + 20053, + 20054, + 20055, + 20056, + 20057, + 20058, + 20059, + 20060, + 20061, + 20062, + 20063, + 20064, + 20065, + 20066, + 20067, + 20068, + 20069, + 20070, + 20071, + 20072, + 20073, + 20074, + 20075, + 20076, + 20077, + 20078, + 20079, + 20080, + 20081, + 20082, + 20083, + 20084, + 20085, + 20086, + 20087, + 20088, + 20089, + 20090, + 20091, + 20092, + 20093, + 20094, + 20095, + 20096, + 20097, + 20098, + 20099, + 20100, + 20101, + 20102, + 20103, + 20104, + 20105, + 20106, + 20107, + 20108, + 20109, + 20110, + 20111, + 20112, + 20113, + 20114, + 20115, + 20116, + 20117, + 20118, + 20119, + 20120, + 20121, + 20122, + 20123, + 20124, + 20125, + 20126, + 20127, + 20128, + 20129, + 20130, + 20131, + 20132, + 20133, + 20134, + 20135, + 20136, + 20137, + 20138, + 20139, + 20140, + 20141, + 20142, + 20143, + 20144, + 20145, + 20146, + 20147, + 20148, + 20149, + 20150, + 20151, + 20152, + 20153, + 20154, + 20155, + 20156, + 20157, + 20158, + 20159, + 20160, + 20161, + 20162, + 20163, + 20164, + 20165, + 20166, + 20167, + 20168, + 20169, + 20170, + 20171, + 20172, + 20173, + 20174, + 20175, + 20176, + 20177, + 20178, + 20179, + 20180, + 20181, + 20182, + 20183, + 20184, + 20185, + 20186, + 20187, + 20188, + 20189, + 20190, + 20191, + 20192, + 20193, + 20194, + 20195, + 20196, + 20197, + 20198, + 20199, + 20200, + 20201, + 20202, + 20203, + 20204, + 20205, + 20206, + 20207, + 20208, + 20209, + 20210, + 20211, + 20212, + 20213, + 20214, + 20215, + 20216, + 20217, + 20218, + 20219, + 20220, + 20221, + 20222, + 20223, + 20224, + 20225, + 20226, + 20227, + 20228, + 20229, + 20230, + 20231, + 20232, + 20233, + 20234, + 20235, + 20236, + 20237, + 20238, + 20239, + 20240, + 20241, + 20242, + 20243, + 20244, + 20245, + 20246, + 20247, + 20248, + 20249, + 20250, + 20251, + 20252, + 20253, + 20254, + 20255, + 20256, + 20257, + 20258, + 20259, + 20260, + 20261, + 20262, + 20263, + 20264, + 20265, + 20266, + 20267, + 20268, + 20269, + 20270, + 20271, + 20272, + 20273, + 20274, + 20275, + 20276, + 20277, + 20278, + 20279, + 20280, + 20281, + 20282, + 20283, + 20284, + 20285, + 20286, + 20287, + 20288, + 20289, + 20290, + 20291, + 20292, + 20293, + 20294, + 20295, + 20296, + 20297, + 20298, + 20299, + 20300, + 20301, + 20302, + 20303, + 20304, + 20305, + 20306, + 20307, + 20308, + 20309, + 20310, + 20311, + 20312, + 20313, + 20314, + 20315, + 20316, + 20317, + 20318, + 20319, + 20320, + 20321, + 20322, + 20323, + 20324, + 20325, + 20326, + 20327, + 20328, + 20329, + 20330, + 20331, + 20332, + 20333, + 20334, + 20335, + 20336, + 20337, + 20338, + 20339, + 20340, + 20341, + 20342, + 20343, + 20344, + 20345, + 20346, + 20347, + 20348, + 20349, + 20350, + 20351, + 20352, + 20353, + 20354, + 20355, + 20356, + 20357, + 20358, + 20359, + 20360, + 20361, + 20362, + 20363, + 20364, + 20365, + 20366, + 20367, + 20368, + 20369, + 20370, + 20371, + 20372, + 20373, + 20374, + 20375, + 20376, + 20377, + 20378, + 20379, + 20380, + 20381, + 20382, + 20383, + 20384, + 20385, + 20386, + 20387, + 20388, + 20389, + 20390, + 20391, + 20392, + 20393, + 20394, + 20395, + 20396, + 20397, + 20398, + 20399, + 20400, + 20401, + 20402, + 20403, + 20404, + 20405, + 20406, + 20407, + 20408, + 20409, + 20410, + 20411, + 20412, + 20413, + 20414, + 20415, + 20416, + 20417, + 20418, + 20419, + 20420, + 20421, + 20422, + 20423, + 20424, + 20425, + 20426, + 20427, + 20428, + 20429, + 20430, + 20431, + 20432, + 20433, + 20434, + 20435, + 20436, + 20437, + 20438, + 20439, + 20440, + 20441, + 20442, + 20443, + 20444, + 20445, + 20446, + 20447, + 20448, + 20449, + 20450, + 20451, + 20452, + 20453, + 20454, + 20455, + 20456, + 20457, + 20458, + 20459, + 20460, + 20461, + 20462, + 20463, + 20464, + 20465, + 20466, + 20467, + 20468, + 20469, + 20470, + 20471, + 20472, + 20473, + 20474, + 20475, + 20476, + 20477, + 20478, + 20479, + 20480, + 20481, + 20482, + 20483, + 20484, + 20485, + 20486, + 20487, + 20488, + 20489, + 20490, + 20491, + 20492, + 20493, + 20494, + 20495, + 20496, + 20497, + 20498, + 20499, + 20500, + 20501, + 20502, + 20503, + 20504, + 20505, + 20506, + 20507, + 20508, + 20509, + 20510, + 20511, + 20512, + 20513, + 20514, + 20515, + 20516, + 20517, + 20518, + 20519, + 20520, + 20521, + 20522, + 20523, + 20524, + 20525, + 20526, + 20527, + 20528, + 20529, + 20530, + 20531, + 20532, + 20533, + 20534, + 20535, + 20536, + 20537, + 20538, + 20539, + 20540, + 20541, + 20542, + 20543, + 20544, + 20545, + 20546, + 20547, + 20548, + 20549, + 20550, + 20551, + 20552, + 20553, + 20554, + 20555, + 20556, + 20557, + 20558, + 20559, + 20560, + 20561, + 20562, + 20563, + 20564, + 20565, + 20566, + 20567, + 20568, + 20569, + 20570, + 20571, + 20572, + 20573, + 20574, + 20575, + 20576, + 20577, + 20578, + 20579, + 20580, + 20581, + 20582, + 20583, + 20584, + 20585, + 20586, + 20587, + 20588, + 20589, + 20590, + 20591, + 20592, + 20593, + 20594, + 20595, + 20596, + 20597, + 20598, + 20599, + 20600, + 20601, + 20602, + 20603, + 20604, + 20605, + 20606, + 20607, + 20608, + 20609, + 20610, + 20611, + 20612, + 20613, + 20614, + 20615, + 20616, + 20617, + 20618, + 20619, + 20620, + 20621, + 20622, + 20623, + 20624, + 20625, + 20626, + 20627, + 20628, + 20629, + 20630, + 20631, + 20632, + 20633, + 20634, + 20635, + 20636, + 20637, + 20638, + 20639, + 20640, + 20641, + 20642, + 20643, + 20644, + 20645, + 20646, + 20647, + 20648, + 20649, + 20650, + 20651, + 20652, + 20653, + 20654, + 20655, + 20656, + 20657, + 20658, + 20659, + 20660, + 20661, + 20662, + 20663, + 20664, + 20665, + 20666, + 20667, + 20668, + 20669, + 20670, + 20671, + 20672, + 20673, + 20674, + 20675, + 20676, + 20677, + 20678, + 20679, + 20680, + 20681, + 20682, + 20683, + 20684, + 20685, + 20686, + 20687, + 20688, + 20689, + 20690, + 20691, + 20692, + 20693, + 20694, + 20695, + 20696, + 20697, + 20698, + 20699, + 20700, + 20701, + 20702, + 20703, + 20704, + 20705, + 20706, + 20707, + 20708, + 20709, + 20710, + 20711, + 20712, + 20713, + 20714, + 20715, + 20716, + 20717, + 20718, + 20719, + 20720, + 20721, + 20722, + 20723, + 20724, + 20725, + 20726, + 20727, + 20728, + 20729, + 20730, + 20731, + 20732, + 20733, + 20734, + 20735, + 20736, + 20737, + 20738, + 20739, + 20740, + 20741, + 20742, + 20743, + 20744, + 20745, + 20746, + 20747, + 20748, + 20749, + 20750, + 20751, + 20752, + 20753, + 20754, + 20755, + 20756, + 20757, + 20758, + 20759, + 20760, + 20761, + 20762, + 20763, + 20764, + 20765, + 20766, + 20767, + 20768, + 20769, + 20770, + 20771, + 20772, + 20773, + 20774, + 20775, + 20776, + 20777, + 20778, + 20779, + 20780, + 20781, + 20782, + 20783, + 20784, + 20785, + 20786, + 20787, + 20788, + 20789, + 20790, + 20791, + 20792, + 20793, + 20794, + 20795, + 20796, + 20797, + 20798, + 20799, + 20800, + 20801, + 20802, + 20803, + 20804, + 20805, + 20806, + 20807, + 20808, + 20809, + 20810, + 20811, + 20812, + 20813, + 20814, + 20815, + 20816, + 20817, + 20818, + 20819, + 20820, + 20821, + 20822, + 20823, + 20824, + 20825, + 20826, + 20827, + 20828, + 20829, + 20830, + 20831, + 20832, + 20833, + 20834, + 20835, + 20836, + 20837, + 20838, + 20839, + 20840, + 20841, + 20842, + 20843, + 20844, + 20845, + 20846, + 20847, + 20848, + 20849, + 20850, + 20851, + 20852, + 20853, + 20854, + 20855, + 20856, + 20857, + 20858, + 20859, + 20860, + 20861, + 20862, + 20863, + 20864, + 20865, + 20866, + 20867, + 20868, + 20869, + 20870, + 20871, + 20872, + 20873, + 20874, + 20875, + 20876, + 20877, + 20878, + 20879, + 20880, + 20881, + 20882, + 20883, + 20884, + 20885, + 20886, + 20887, + 20888, + 20889, + 20890, + 20891, + 20892, + 20893, + 20894, + 20895, + 20896, + 20897, + 20898, + 20899, + 20900, + 20901, + 20902, + 20903, + 20904, + 20905, + 20906, + 20907, + 20908, + 20909, + 20910, + 20911, + 20912, + 20913, + 20914, + 20915, + 20916, + 20917, + 20918, + 20919, + 20920, + 20921, + 20922, + 20923, + 20924, + 20925, + 20926, + 20927, + 20928, + 20929, + 20930, + 20931, + 20932, + 20933, + 20934, + 20935, + 20936, + 20937, + 20938, + 20939, + 20940, + 20941, + 20942, + 20943, + 20944, + 20945, + 20946, + 20947, + 20948, + 20949, + 20950, + 20951, + 20952, + 20953, + 20954, + 20955, + 20956, + 20957, + 20958, + 20959, + 20960, + 20961, + 20962, + 20963, + 20964, + 20965, + 20966, + 20967, + 20968, + 20969, + 20970, + 20971, + 20972, + 20973, + 20974, + 20975, + 20976, + 20977, + 20978, + 20979, + 20980, + 20981, + 20982, + 20983, + 20984, + 20985, + 20986, + 20987, + 20988, + 20989, + 20990, + 20991, + 20992, + 20993, + 20994, + 20995, + 20996, + 20997, + 20998, + 20999, + 21000, + 21001, + 21002, + 21003, + 21004, + 21005, + 21006, + 21007, + 21008, + 21009, + 21010, + 21011, + 21012, + 21013, + 21014, + 21015, + 21016, + 21017, + 21018, + 21019, + 21020, + 21021, + 21022, + 21023, + 21024, + 21025, + 21026, + 21027, + 21028, + 21029, + 21030, + 21031, + 21032, + 21033, + 21034, + 21035, + 21036, + 21037, + 21038, + 21039, + 21040, + 21041, + 21042, + 21043, + 21044, + 21045, + 21046, + 21047, + 21048, + 21049, + 21050, + 21051, + 21052, + 21053, + 21054, + 21055, + 21056, + 21057, + 21058, + 21059, + 21060, + 21061, + 21062, + 21063, + 21064, + 21065, + 21066, + 21067, + 21068, + 21069, + 21070, + 21071, + 21072, + 21073, + 21074, + 21075, + 21076, + 21077, + 21078, + 21079, + 21080, + 21081, + 21082, + 21083, + 21084, + 21085, + 21086, + 21087, + 21088, + 21089, + 21090, + 21091, + 21092, + 21093, + 21094, + 21095, + 21096, + 21097, + 21098, + 21099, + 21100, + 21101, + 21102, + 21103, + 21104, + 21105, + 21106, + 21107, + 21108, + 21109, + 21110, + 21111, + 21112, + 21113, + 21114, + 21115, + 21116, + 21117, + 21118, + 21119, + 21120, + 21121, + 21122, + 21123, + 21124, + 21125, + 21126, + 21127, + 21128, + 21129, + 21130, + 21131, + 21132, + 21133, + 21134, + 21135, + 21136, + 21137, + 21138, + 21139, + 21140, + 21141, + 21142, + 21143, + 21144, + 21145, + 21146, + 21147, + 21148, + 21149, + 21150, + 21151, + 21152, + 21153, + 21154, + 21155, + 21156, + 21157, + 21158, + 21159, + 21160, + 21161, + 21162, + 21163, + 21164, + 21165, + 21166, + 21167, + 21168, + 21169, + 21170, + 21171, + 21172, + 21173, + 21174, + 21175, + 21176, + 21177, + 21178, + 21179, + 21180, + 21181, + 21182, + 21183, + 21184, + 21185, + 21186, + 21187, + 21188, + 21189, + 21190, + 21191, + 21192, + 21193, + 21194, + 21195, + 21196, + 21197, + 21198, + 21199, + 21200, + 21201, + 21202, + 21203, + 21204, + 21205, + 21206, + 21207, + 21208, + 21209, + 21210, + 21211, + 21212, + 21213, + 21214, + 21215, + 21216, + 21217, + 21218, + 21219, + 21220, + 21221, + 21222, + 21223, + 21224, + 21225, + 21226, + 21227, + 21228, + 21229, + 21230, + 21231, + 21232, + 21233, + 21234, + 21235, + 21236, + 21237, + 21238, + 21239, + 21240, + 21241, + 21242, + 21243, + 21244, + 21245, + 21246, + 21247, + 21248, + 21249, + 21250, + 21251, + 21252, + 21253, + 21254, + 21255, + 21256, + 21257, + 21258, + 21259, + 21260, + 21261, + 21262, + 21263, + 21264, + 21265, + 21266, + 21267, + 21268, + 21269, + 21270, + 21271, + 21272, + 21273, + 21274, + 21275, + 21276, + 21277, + 21278, + 21279, + 21280, + 21281, + 21282, + 21283, + 21284, + 21285, + 21286, + 21287, + 21288, + 21289, + 21290, + 21291, + 21292, + 21293, + 21294, + 21295, + 21296, + 21297, + 21298, + 21299, + 21300, + 21301, + 21302, + 21303, + 21304, + 21305, + 21306, + 21307, + 21308, + 21309, + 21310, + 21311, + 21312, + 21313, + 21314, + 21315, + 21316, + 21317, + 21318, + 21319, + 21320, + 21321, + 21322, + 21323, + 21324, + 21325, + 21326, + 21327, + 21328, + 21329, + 21330, + 21331, + 21332, + 21333, + 21334, + 21335, + 21336, + 21337, + 21338, + 21339, + 21340, + 21341, + 21342, + 21343, + 21344, + 21345, + 21346, + 21347, + 21348, + 21349, + 21350, + 21351, + 21352, + 21353, + 21354, + 21355, + 21356, + 21357, + 21358, + 21359, + 21360, + 21361, + 21362, + 21363, + 21364, + 21365, + 21366, + 21367, + 21368, + 21369, + 21370, + 21371, + 21372, + 21373, + 21374, + 21375, + 21376, + 21377, + 21378, + 21379, + 21380, + 21381, + 21382, + 21383, + 21384, + 21385, + 21386, + 21387, + 21388, + 21389, + 21390, + 21391, + 21392, + 21393, + 21394, + 21395, + 21396, + 21397, + 21398, + 21399, + 21400, + 21401, + 21402, + 21403, + 21404, + 21405, + 21406, + 21407, + 21408, + 21409, + 21410, + 21411, + 21412, + 21413, + 21414, + 21415, + 21416, + 21417, + 21418, + 21419, + 21420, + 21421, + 21422, + 21423, + 21424, + 21425, + 21426, + 21427, + 21428, + 21429, + 21430, + 21431, + 21432, + 21433, + 21434, + 21435, + 21436, + 21437, + 21438, + 21439, + 21440, + 21441, + 21442, + 21443, + 21444, + 21445, + 21446, + 21447, + 21448, + 21449, + 21450, + 21451, + 21452, + 21453, + 21454, + 21455, + 21456, + 21457, + 21458, + 21459, + 21460, + 21461, + 21462, + 21463, + 21464, + 21465, + 21466, + 21467, + 21468, + 21469, + 21470, + 21471, + 21472, + 21473, + 21474, + 21475, + 21476, + 21477, + 21478, + 21479, + 21480, + 21481, + 21482, + 21483, + 21484, + 21485, + 21486, + 21487, + 21488, + 21489, + 21490, + 21491, + 21492, + 21493, + 21494, + 21495, + 21496, + 21497, + 21498, + 21499, + 21500, + 21501, + 21502, + 21503, + 21504, + 21505, + 21506, + 21507, + 21508, + 21509, + 21510, + 21511, + 21512, + 21513, + 21514, + 21515, + 21516, + 21517, + 21518, + 21519, + 21520, + 21521, + 21522, + 21523, + 21524, + 21525, + 21526, + 21527, + 21528, + 21529, + 21530, + 21531, + 21532, + 21533, + 21534, + 21535, + 21536, + 21537, + 21538, + 21539, + 21540, + 21541, + 21542, + 21543, + 21544, + 21545, + 21546, + 21547, + 21548, + 21549, + 21550, + 21551, + 21552, + 21553, + 21554, + 21555, + 21556, + 21557, + 21558, + 21559, + 21560, + 21561, + 21562, + 21563, + 21564, + 21565, + 21566, + 21567, + 21568, + 21569, + 21570, + 21571, + 21572, + 21573, + 21574, + 21575, + 21576, + 21577, + 21578, + 21579, + 21580, + 21581, + 21582, + 21583, + 21584, + 21585, + 21586, + 21587, + 21588, + 21589, + 21590, + 21591, + 21592, + 21593, + 21594, + 21595, + 21596, + 21597, + 21598, + 21599, + 21600, + 21601, + 21602, + 21603, + 21604, + 21605, + 21606, + 21607, + 21608, + 21609, + 21610, + 21611, + 21612, + 21613, + 21614, + 21615, + 21616, + 21617, + 21618, + 21619, + 21620, + 21621, + 21622, + 21623, + 21624, + 21625, + 21626, + 21627, + 21628, + 21629, + 21630, + 21631, + 21632, + 21633, + 21634, + 21635, + 21636, + 21637, + 21638, + 21639, + 21640, + 21641, + 21642, + 21643, + 21644, + 21645, + 21646, + 21647, + 21648, + 21649, + 21650, + 21651, + 21652, + 21653, + 21654, + 21655, + 21656, + 21657, + 21658, + 21659, + 21660, + 21661, + 21662, + 21663, + 21664, + 21665, + 21666, + 21667, + 21668, + 21669, + 21670, + 21671, + 21672, + 21673, + 21674, + 21675, + 21676, + 21677, + 21678, + 21679, + 21680, + 21681, + 21682, + 21683, + 21684, + 21685, + 21686, + 21687, + 21688, + 21689, + 21690, + 21691, + 21692, + 21693, + 21694, + 21695, + 21696, + 21697, + 21698, + 21699, + 21700, + 21701, + 21702, + 21703, + 21704, + 21705, + 21706, + 21707, + 21708, + 21709, + 21710, + 21711, + 21712, + 21713, + 21714, + 21715, + 21716, + 21717, + 21718, + 21719, + 21720, + 21721, + 21722, + 21723, + 21724, + 21725, + 21726, + 21727, + 21728, + 21729, + 21730, + 21731, + 21732, + 21733, + 21734, + 21735, + 21736, + 21737, + 21738, + 21739, + 21740, + 21741, + 21742, + 21743, + 21744, + 21745, + 21746, + 21747, + 21748, + 21749, + 21750, + 21751, + 21752, + 21753, + 21754, + 21755, + 21756, + 21757, + 21758, + 21759, + 21760, + 21761, + 21762, + 21763, + 21764, + 21765, + 21766, + 21767, + 21768, + 21769, + 21770, + 21771, + 21772, + 21773, + 21774, + 21775, + 21776, + 21777, + 21778, + 21779, + 21780, + 21781, + 21782, + 21783, + 21784, + 21785, + 21786, + 21787, + 21788, + 21789, + 21790, + 21791, + 21792, + 21793, + 21794, + 21795, + 21796, + 21797, + 21798, + 21799, + 21800, + 21801, + 21802, + 21803, + 21804, + 21805, + 21806, + 21807, + 21808, + 21809, + 21810, + 21811, + 21812, + 21813, + 21814, + 21815, + 21816, + 21817, + 21818, + 21819, + 21820, + 21821, + 21822, + 21823, + 21824, + 21825, + 21826, + 21827, + 21828, + 21829, + 21830, + 21831, + 21832, + 21833, + 21834, + 21835, + 21836, + 21837, + 21838, + 21839, + 21840, + 21841, + 21842, + 21843, + 21844, + 21845, + 21846, + 21847, + 21848, + 21849, + 21850, + 21851, + 21852, + 21853, + 21854, + 21855, + 21856, + 21857, + 21858, + 21859, + 21860, + 21861, + 21862, + 21863, + 21864, + 21865, + 21866, + 21867, + 21868, + 21869, + 21870, + 21871, + 21872, + 21873, + 21874, + 21875, + 21876, + 21877, + 21878, + 21879, + 21880, + 21881, + 21882, + 21883, + 21884, + 21885, + 21886, + 21887, + 21888, + 21889, + 21890, + 21891, + 21892, + 21893, + 21894, + 21895, + 21896, + 21897, + 21898, + 21899, + 21900, + 21901, + 21902, + 21903, + 21904, + 21905, + 21906, + 21907, + 21908, + 21909, + 21910, + 21911, + 21912, + 21913, + 21914, + 21915, + 21916, + 21917, + 21918, + 21919, + 21920, + 21921, + 21922, + 21923, + 21924, + 21925, + 21926, + 21927, + 21928, + 21929, + 21930, + 21931, + 21932, + 21933, + 21934, + 21935, + 21936, + 21937, + 21938, + 21939, + 21940, + 21941, + 21942, + 21943, + 21944, + 21945, + 21946, + 21947, + 21948, + 21949, + 21950, + 21951, + 21952, + 21953, + 21954, + 21955, + 21956, + 21957, + 21958, + 21959, + 21960, + 21961, + 21962, + 21963, + 21964, + 21965, + 21966, + 21967, + 21968, + 21969, + 21970, + 21971, + 21972, + 21973, + 21974, + 21975, + 21976, + 21977, + 21978, + 21979, + 21980, + 21981, + 21982, + 21983, + 21984, + 21985, + 21986, + 21987, + 21988, + 21989, + 21990, + 21991, + 21992, + 21993, + 21994, + 21995, + 21996, + 21997, + 21998, + 21999, + 22000, + 22001, + 22002, + 22003, + 22004, + 22005, + 22006, + 22007, + 22008, + 22009, + 22010, + 22011, + 22012, + 22013, + 22014, + 22015, + 22016, + 22017, + 22018, + 22019, + 22020, + 22021, + 22022, + 22023, + 22024, + 22025, + 22026, + 22027, + 22028, + 22029, + 22030, + 22031, + 22032, + 22033, + 22034, + 22035, + 22036, + 22037, + 22038, + 22039, + 22040, + 22041, + 22042, + 22043, + 22044, + 22045, + 22046, + 22047, + 22048, + 22049, + 22050, + 22051, + 22052, + 22053, + 22054, + 22055, + 22056, + 22057, + 22058, + 22059, + 22060, + 22061, + 22062, + 22063, + 22064, + 22065, + 22066, + 22067, + 22068, + 22069, + 22070, + 22071, + 22072, + 22073, + 22074, + 22075, + 22076, + 22077, + 22078, + 22079, + 22080, + 22081, + 22082, + 22083, + 22084, + 22085, + 22086, + 22087, + 22088, + 22089, + 22090, + 22091, + 22092, + 22093, + 22094, + 22095, + 22096, + 22097, + 22098, + 22099, + 22100, + 22101, + 22102, + 22103, + 22104, + 22105, + 22106, + 22107, + 22108, + 22109, + 22110, + 22111, + 22112, + 22113, + 22114, + 22115, + 22116, + 22117, + 22118, + 22119, + 22120, + 22121, + 22122, + 22123, + 22124, + 22125, + 22126, + 22127, + 22128, + 22129, + 22130, + 22131, + 22132, + 22133, + 22134, + 22135, + 22136, + 22137, + 22138, + 22139, + 22140, + 22141, + 22142, + 22143, + 22144, + 22145, + 22146, + 22147, + 22148, + 22149, + 22150, + 22151, + 22152, + 22153, + 22154, + 22155, + 22156, + 22157, + 22158, + 22159, + 22160, + 22161, + 22162, + 22163, + 22164, + 22165, + 22166, + 22167, + 22168, + 22169, + 22170, + 22171, + 22172, + 22173, + 22174, + 22175, + 22176, + 22177, + 22178, + 22179, + 22180, + 22181, + 22182, + 22183, + 22184, + 22185, + 22186, + 22187, + 22188, + 22189, + 22190, + 22191, + 22192, + 22193, + 22194, + 22195, + 22196, + 22197, + 22198, + 22199, + 22200, + 22201, + 22202, + 22203, + 22204, + 22205, + 22206, + 22207, + 22208, + 22209, + 22210, + 22211, + 22212, + 22213, + 22214, + 22215, + 22216, + 22217, + 22218, + 22219, + 22220, + 22221, + 22222, + 22223, + 22224, + 22225, + 22226, + 22227, + 22228, + 22229, + 22230, + 22231, + 22232, + 22233, + 22234, + 22235, + 22236, + 22237, + 22238, + 22239, + 22240, + 22241, + 22242, + 22243, + 22244, + 22245, + 22246, + 22247, + 22248, + 22249, + 22250, + 22251, + 22252, + 22253, + 22254, + 22255, + 22256, + 22257, + 22258, + 22259, + 22260, + 22261, + 22262, + 22263, + 22264, + 22265, + 22266, + 22267, + 22268, + 22269, + 22270, + 22271, + 22272, + 22273, + 22274, + 22275, + 22276, + 22277, + 22278, + 22279, + 22280, + 22281, + 22282, + 22283, + 22284, + 22285, + 22286, + 22287, + 22288, + 22289, + 22290, + 22291, + 22292, + 22293, + 22294, + 22295, + 22296, + 22297, + 22298, + 22299, + 22300, + 22301, + 22302, + 22303, + 22304, + 22305, + 22306, + 22307, + 22308, + 22309, + 22310, + 22311, + 22312, + 22313, + 22314, + 22315, + 22316, + 22317, + 22318, + 22319, + 22320, + 22321, + 22322, + 22323, + 22324, + 22325, + 22326, + 22327, + 22328, + 22329, + 22330, + 22331, + 22332, + 22333, + 22334, + 22335, + 22336, + 22337, + 22338, + 22339, + 22340, + 22341, + 22342, + 22343, + 22344, + 22345, + 22346, + 22347, + 22348, + 22349, + 22350, + 22351, + 22352, + 22353, + 22354, + 22355, + 22356, + 22357, + 22358, + 22359, + 22360, + 22361, + 22362, + 22363, + 22364, + 22365, + 22366, + 22367, + 22368, + 22369, + 22370, + 22371, + 22372, + 22373, + 22374, + 22375, + 22376, + 22377, + 22378, + 22379, + 22380, + 22381, + 22382, + 22383, + 22384, + 22385, + 22386, + 22387, + 22388, + 22389, + 22390, + 22391, + 22392, + 22393, + 22394, + 22395, + 22396, + 22397, + 22398, + 22399, + 22400, + 22401, + 22402, + 22403, + 22404, + 22405, + 22406, + 22407, + 22408, + 22409, + 22410, + 22411, + 22412, + 22413, + 22414, + 22415, + 22416, + 22417, + 22418, + 22419, + 22420, + 22421, + 22422, + 22423, + 22424, + 22425, + 22426, + 22427, + 22428, + 22429, + 22430, + 22431, + 22432, + 22433, + 22434, + 22435, + 22436, + 22437, + 22438, + 22439, + 22440, + 22441, + 22442, + 22443, + 22444, + 22445, + 22446, + 22447, + 22448, + 22449, + 22450, + 22451, + 22452, + 22453, + 22454, + 22455, + 22456, + 22457, + 22458, + 22459, + 22460, + 22461, + 22462, + 22463, + 22464, + 22465, + 22466, + 22467, + 22468, + 22469, + 22470, + 22471, + 22472, + 22473, + 22474, + 22475, + 22476, + 22477, + 22478, + 22479, + 22480, + 22481, + 22482, + 22483, + 22484, + 22485, + 22486, + 22487, + 22488, + 22489, + 22490, + 22491, + 22492, + 22493, + 22494, + 22495, + 22496, + 22497, + 22498, + 22499, + 22500, + 22501, + 22502, + 22503, + 22504, + 22505, + 22506, + 22507, + 22508, + 22509, + 22510, + 22511, + 22512, + 22513, + 22514, + 22515, + 22516, + 22517, + 22518, + 22519, + 22520, + 22521, + 22522, + 22523, + 22524, + 22525, + 22526, + 22527, + 22528, + 22529, + 22530, + 22531, + 22532, + 22533, + 22534, + 22535, + 22536, + 22537, + 22538, + 22539, + 22540, + 22541, + 22542, + 22543, + 22544, + 22545, + 22546, + 22547, + 22548, + 22549, + 22550, + 22551, + 22552, + 22553, + 22554, + 22555, + 22556, + 22557, + 22558, + 22559, + 22560, + 22561, + 22562, + 22563, + 22564, + 22565, + 22566, + 22567, + 22568, + 22569, + 22570, + 22571, + 22572, + 22573, + 22574, + 22575, + 22576, + 22577, + 22578, + 22579, + 22580, + 22581, + 22582, + 22583, + 22584, + 22585, + 22586, + 22587, + 22588, + 22589, + 22590, + 22591, + 22592, + 22593, + 22594, + 22595, + 22596, + 22597, + 22598, + 22599, + 22600, + 22601, + 22602, + 22603, + 22604, + 22605, + 22606, + 22607, + 22608, + 22609, + 22610, + 22611, + 22612, + 22613, + 22614, + 22615, + 22616, + 22617, + 22618, + 22619, + 22620, + 22621, + 22622, + 22623, + 22624, + 22625, + 22626, + 22627, + 22628, + 22629, + 22630, + 22631, + 22632, + 22633, + 22634, + 22635, + 22636, + 22637, + 22638, + 22639, + 22640, + 22641, + 22642, + 22643, + 22644, + 22645, + 22646, + 22647, + 22648, + 22649, + 22650, + 22651, + 22652, + 22653, + 22654, + 22655, + 22656, + 22657, + 22658, + 22659, + 22660, + 22661, + 22662, + 22663, + 22664, + 22665, + 22666, + 22667, + 22668, + 22669, + 22670, + 22671, + 22672, + 22673, + 22674, + 22675, + 22676, + 22677, + 22678, + 22679, + 22680, + 22681, + 22682, + 22683, + 22684, + 22685, + 22686, + 22687, + 22688, + 22689, + 22690, + 22691, + 22692, + 22693, + 22694, + 22695, + 22696, + 22697, + 22698, + 22699, + 22700, + 22701, + 22702, + 22703, + 22704, + 22705, + 22706, + 22707, + 22708, + 22709, + 22710, + 22711, + 22712, + 22713, + 22714, + 22715, + 22716, + 22717, + 22718, + 22719, + 22720, + 22721, + 22722, + 22723, + 22724, + 22725, + 22726, + 22727, + 22728, + 22729, + 22730, + 22731, + 22732, + 22733, + 22734, + 22735, + 22736, + 22737, + 22738, + 22739, + 22740, + 22741, + 22742, + 22743, + 22744, + 22745, + 22746, + 22747, + 22748, + 22749, + 22750, + 22751, + 22752, + 22753, + 22754, + 22755, + 22756, + 22757, + 22758, + 22759, + 22760, + 22761, + 22762, + 22763, + 22764, + 22765, + 22766, + 22767, + 22768, + 22769, + 22770, + 22771, + 22772, + 22773, + 22774, + 22775, + 22776, + 22777, + 22778, + 22779, + 22780, + 22781, + 22782, + 22783, + 22784, + 22785, + 22786, + 22787, + 22788, + 22789, + 22790, + 22791, + 22792, + 22793, + 22794, + 22795, + 22796, + 22797, + 22798, + 22799, + 22800, + 22801, + 22802, + 22803, + 22804, + 22805, + 22806, + 22807, + 22808, + 22809, + 22810, + 22811, + 22812, + 22813, + 22814, + 22815, + 22816, + 22817, + 22818, + 22819, + 22820, + 22821, + 22822, + 22823, + 22824, + 22825, + 22826, + 22827, + 22828, + 22829, + 22830, + 22831, + 22832, + 22833, + 22834, + 22835, + 22836, + 22837, + 22838, + 22839, + 22840, + 22841, + 22842, + 22843, + 22844, + 22845, + 22846, + 22847, + 22848, + 22849, + 22850, + 22851, + 22852, + 22853, + 22854, + 22855, + 22856, + 22857, + 22858, + 22859, + 22860, + 22861, + 22862, + 22863, + 22864, + 22865, + 22866, + 22867, + 22868, + 22869, + 22870, + 22871, + 22872, + 22873, + 22874, + 22875, + 22876, + 22877, + 22878, + 22879, + 22880, + 22881, + 22882, + 22883, + 22884, + 22885, + 22886, + 22887, + 22888, + 22889, + 22890, + 22891, + 22892, + 22893, + 22894, + 22895, + 22896, + 22897, + 22898, + 22899, + 22900, + 22901, + 22902, + 22903, + 22904, + 22905, + 22906, + 22907, + 22908, + 22909, + 22910, + 22911, + 22912, + 22913, + 22914, + 22915, + 22916, + 22917, + 22918, + 22919, + 22920, + 22921, + 22922, + 22923, + 22924, + 22925, + 22926, + 22927, + 22928, + 22929, + 22930, + 22931, + 22932, + 22933, + 22934, + 22935, + 22936, + 22937, + 22938, + 22939, + 22940, + 22941, + 22942, + 22943, + 22944, + 22945, + 22946, + 22947, + 22948, + 22949, + 22950, + 22951, + 22952, + 22953, + 22954, + 22955, + 22956, + 22957, + 22958, + 22959, + 22960, + 22961, + 22962, + 22963, + 22964, + 22965, + 22966, + 22967, + 22968, + 22969, + 22970, + 22971, + 22972, + 22973, + 22974, + 22975, + 22976, + 22977, + 22978, + 22979, + 22980, + 22981, + 22982, + 22983, + 22984, + 22985, + 22986, + 22987, + 22988, + 22989, + 22990, + 22991, + 22992, + 22993, + 22994, + 22995, + 22996, + 22997, + 22998, + 22999, + 23000, + 23001, + 23002, + 23003, + 23004, + 23005, + 23006, + 23007, + 23008, + 23009, + 23010, + 23011, + 23012, + 23013, + 23014, + 23015, + 23016, + 23017, + 23018, + 23019, + 23020, + 23021, + 23022, + 23023, + 23024, + 23025, + 23026, + 23027, + 23028, + 23029, + 23030, + 23031, + 23032, + 23033, + 23034, + 23035, + 23036, + 23037, + 23038, + 23039, + 23040, + 23041, + 23042, + 23043, + 23044, + 23045, + 23046, + 23047, + 23048, + 23049, + 23050, + 23051, + 23052, + 23053, + 23054, + 23055, + 23056, + 23057, + 23058, + 23059, + 23060, + 23061, + 23062, + 23063, + 23064, + 23065, + 23066, + 23067, + 23068, + 23069, + 23070, + 23071, + 23072, + 23073, + 23074, + 23075, + 23076, + 23077, + 23078, + 23079, + 23080, + 23081, + 23082, + 23083, + 23084, + 23085, + 23086, + 23087, + 23088, + 23089, + 23090, + 23091, + 23092, + 23093, + 23094, + 23095, + 23096, + 23097, + 23098, + 23099, + 23100, + 23101, + 23102, + 23103, + 23104, + 23105, + 23106, + 23107, + 23108, + 23109, + 23110, + 23111, + 23112, + 23113, + 23114, + 23115, + 23116, + 23117, + 23118, + 23119, + 23120, + 23121, + 23122, + 23123, + 23124, + 23125, + 23126, + 23127, + 23128, + 23129, + 23130, + 23131, + 23132, + 23133, + 23134, + 23135, + 23136, + 23137, + 23138, + 23139, + 23140, + 23141, + 23142, + 23143, + 23144, + 23145, + 23146, + 23147, + 23148, + 23149, + 23150, + 23151, + 23152, + 23153, + 23154, + 23155, + 23156, + 23157, + 23158, + 23159, + 23160, + 23161, + 23162, + 23163, + 23164, + 23165, + 23166, + 23167, + 23168, + 23169, + 23170, + 23171, + 23172, + 23173, + 23174, + 23175, + 23176, + 23177, + 23178, + 23179, + 23180, + 23181, + 23182, + 23183, + 23184, + 23185, + 23186, + 23187, + 23188, + 23189, + 23190, + 23191, + 23192, + 23193, + 23194, + 23195, + 23196, + 23197, + 23198, + 23199, + 23200, + 23201, + 23202, + 23203, + 23204, + 23205, + 23206, + 23207, + 23208, + 23209, + 23210, + 23211, + 23212, + 23213, + 23214, + 23215, + 23216, + 23217, + 23218, + 23219, + 23220, + 23221, + 23222, + 23223, + 23224, + 23225, + 23226, + 23227, + 23228, + 23229, + 23230, + 23231, + 23232, + 23233, + 23234, + 23235, + 23236, + 23237, + 23238, + 23239, + 23240, + 23241, + 23242, + 23243, + 23244, + 23245, + 23246, + 23247, + 23248, + 23249, + 23250, + 23251, + 23252, + 23253, + 23254, + 23255, + 23256, + 23257, + 23258, + 23259, + 23260, + 23261, + 23262, + 23263, + 23264, + 23265, + 23266, + 23267, + 23268, + 23269, + 23270, + 23271, + 23272, + 23273, + 23274, + 23275, + 23276, + 23277, + 23278, + 23279, + 23280, + 23281, + 23282, + 23283, + 23284, + 23285, + 23286, + 23287, + 23288, + 23289, + 23290, + 23291, + 23292, + 23293, + 23294, + 23295, + 23296, + 23297, + 23298, + 23299, + 23300, + 23301, + 23302, + 23303, + 23304, + 23305, + 23306, + 23307, + 23308, + 23309, + 23310, + 23311, + 23312, + 23313, + 23314, + 23315, + 23316, + 23317, + 23318, + 23319, + 23320, + 23321, + 23322, + 23323, + 23324, + 23325, + 23326, + 23327, + 23328, + 23329, + 23330, + 23331, + 23332, + 23333, + 23334, + 23335, + 23336, + 23337, + 23338, + 23339, + 23340, + 23341, + 23342, + 23343, + 23344, + 23345, + 23346, + 23347, + 23348, + 23349, + 23350, + 23351, + 23352, + 23353, + 23354, + 23355, + 23356, + 23357, + 23358, + 23359, + 23360, + 23361, + 23362, + 23363, + 23364, + 23365, + 23366, + 23367, + 23368, + 23369, + 23370, + 23371, + 23372, + 23373, + 23374, + 23375, + 23376, + 23377, + 23378, + 23379, + 23380, + 23381, + 23382, + 23383, + 23384, + 23385, + 23386, + 23387, + 23388, + 23389, + 23390, + 23391, + 23392, + 23393, + 23394, + 23395, + 23396, + 23397, + 23398, + 23399, + 23400, + 23401, + 23402, + 23403, + 23404, + 23405, + 23406, + 23407, + 23408, + 23409, + 23410, + 23411, + 23412, + 23413, + 23414, + 23415, + 23416, + 23417, + 23418, + 23419, + 23420, + 23421, + 23422, + 23423, + 23424, + 23425, + 23426, + 23427, + 23428, + 23429, + 23430, + 23431, + 23432, + 23433, + 23434, + 23435, + 23436, + 23437, + 23438, + 23439, + 23440, + 23441, + 23442, + 23443, + 23444, + 23445, + 23446, + 23447, + 23448, + 23449, + 23450, + 23451, + 23452, + 23453, + 23454, + 23455, + 23456, + 23457, + 23458, + 23459, + 23460, + 23461, + 23462, + 23463, + 23464, + 23465, + 23466, + 23467, + 23468, + 23469, + 23470, + 23471, + 23472, + 23473, + 23474, + 23475, + 23476, + 23477, + 23478, + 23479, + 23480, + 23481, + 23482, + 23483, + 23484, + 23485, + 23486, + 23487, + 23488, + 23489, + 23490, + 23491, + 23492, + 23493, + 23494, + 23495, + 23496, + 23497, + 23498, + 23499, + 23500, + 23501, + 23502, + 23503, + 23504, + 23505, + 23506, + 23507, + 23508, + 23509, + 23510, + 23511, + 23512, + 23513, + 23514, + 23515, + 23516, + 23517, + 23518, + 23519, + 23520, + 23521, + 23522, + 23523, + 23524, + 23525, + 23526, + 23527, + 23528, + 23529, + 23530, + 23531, + 23532, + 23533, + 23534, + 23535, + 23536, + 23537, + 23538, + 23539, + 23540, + 23541, + 23542, + 23543, + 23544, + 23545, + 23546, + 23547, + 23548, + 23549, + 23550, + 23551, + 23552, + 23553, + 23554, + 23555, + 23556, + 23557, + 23558, + 23559, + 23560, + 23561, + 23562, + 23563, + 23564, + 23565, + 23566, + 23567, + 23568, + 23569, + 23570, + 23571, + 23572, + 23573, + 23574, + 23575, + 23576, + 23577, + 23578, + 23579, + 23580, + 23581, + 23582, + 23583, + 23584, + 23585, + 23586, + 23587, + 23588, + 23589, + 23590, + 23591, + 23592, + 23593, + 23594, + 23595, + 23596, + 23597, + 23598, + 23599, + 23600, + 23601, + 23602, + 23603, + 23604, + 23605, + 23606, + 23607, + 23608, + 23609, + 23610, + 23611, + 23612, + 23613, + 23614, + 23615, + 23616, + 23617, + 23618, + 23619, + 23620, + 23621, + 23622, + 23623, + 23624, + 23625, + 23626, + 23627, + 23628, + 23629, + 23630, + 23631, + 23632, + 23633, + 23634, + 23635, + 23636, + 23637, + 23638, + 23639, + 23640, + 23641, + 23642, + 23643, + 23644, + 23645, + 23646, + 23647, + 23648, + 23649, + 23650, + 23651, + 23652, + 23653, + 23654, + 23655, + 23656, + 23657, + 23658, + 23659, + 23660, + 23661, + 23662, + 23663, + 23664, + 23665, + 23666, + 23667, + 23668, + 23669, + 23670, + 23671, + 23672, + 23673, + 23674, + 23675, + 23676, + 23677, + 23678, + 23679, + 23680, + 23681, + 23682, + 23683, + 23684, + 23685, + 23686, + 23687, + 23688, + 23689, + 23690, + 23691, + 23692, + 23693, + 23694, + 23695, + 23696, + 23697, + 23698, + 23699, + 23700, + 23701, + 23702, + 23703, + 23704, + 23705, + 23706, + 23707, + 23708, + 23709, + 23710, + 23711, + 23712, + 23713, + 23714, + 23715, + 23716, + 23717, + 23718, + 23719, + 23720, + 23721, + 23722, + 23723, + 23724, + 23725, + 23726, + 23727, + 23728, + 23729, + 23730, + 23731, + 23732, + 23733, + 23734, + 23735, + 23736, + 23737, + 23738, + 23739, + 23740, + 23741, + 23742, + 23743, + 23744, + 23745, + 23746, + 23747, + 23748, + 23749, + 23750, + 23751, + 23752, + 23753, + 23754, + 23755, + 23756, + 23757, + 23758, + 23759, + 23760, + 23761, + 23762, + 23763, + 23764, + 23765, + 23766, + 23767, + 23768, + 23769, + 23770, + 23771, + 23772, + 23773, + 23774, + 23775, + 23776, + 23777, + 23778, + 23779, + 23780, + 23781, + 23782, + 23783, + 23784, + 23785, + 23786, + 23787, + 23788, + 23789, + 23790, + 23791, + 23792, + 23793, + 23794, + 23795, + 23796, + 23797, + 23798, + 23799, + 23800, + 23801, + 23802, + 23803, + 23804, + 23805, + 23806, + 23807, + 23808, + 23809, + 23810, + 23811, + 23812, + 23813, + 23814, + 23815, + 23816, + 23817, + 23818, + 23819, + 23820, + 23821, + 23822, + 23823, + 23824, + 23825, + 23826, + 23827, + 23828, + 23829, + 23830, + 23831, + 23832, + 23833, + 23834, + 23835, + 23836, + 23837, + 23838, + 23839, + 23840, + 23841, + 23842, + 23843, + 23844, + 23845, + 23846, + 23847, + 23848, + 23849, + 23850, + 23851, + 23852, + 23853, + 23854, + 23855, + 23856, + 23857, + 23858, + 23859, + 23860, + 23861, + 23862, + 23863, + 23864, + 23865, + 23866, + 23867, + 23868, + 23869, + 23870, + 23871, + 23872, + 23873, + 23874, + 23875, + 23876, + 23877, + 23878, + 23879, + 23880, + 23881, + 23882, + 23883, + 23884, + 23885, + 23886, + 23887, + 23888, + 23889, + 23890, + 23891, + 23892, + 23893, + 23894, + 23895, + 23896, + 23897, + 23898, + 23899, + 23900, + 23901, + 23902, + 23903, + 23904, + 23905, + 23906, + 23907, + 23908, + 23909, + 23910, + 23911, + 23912, + 23913, + 23914, + 23915, + 23916, + 23917, + 23918, + 23919, + 23920, + 23921, + 23922, + 23923, + 23924, + 23925, + 23926, + 23927, + 23928, + 23929, + 23930, + 23931, + 23932, + 23933, + 23934, + 23935, + 23936, + 23937, + 23938, + 23939, + 23940, + 23941, + 23942, + 23943, + 23944, + 23945, + 23946, + 23947, + 23948, + 23949, + 23950, + 23951, + 23952, + 23953, + 23954, + 23955, + 23956, + 23957, + 23958, + 23959, + 23960, + 23961, + 23962, + 23963, + 23964, + 23965, + 23966, + 23967, + 23968, + 23969, + 23970, + 23971, + 23972, + 23973, + 23974, + 23975, + 23976, + 23977, + 23978, + 23979, + 23980, + 23981, + 23982, + 23983, + 23984, + 23985, + 23986, + 23987, + 23988, + 23989, + 23990, + 23991, + 23992, + 23993, + 23994, + 23995, + 23996, + 23997, + 23998, + 23999, + 24000, + 24001, + 24002, + 24003, + 24004, + 24005, + 24006, + 24007, + 24008, + 24009, + 24010, + 24011, + 24012, + 24013, + 24014, + 24015, + 24016, + 24017, + 24018, + 24019, + 24020, + 24021, + 24022, + 24023, + 24024, + 24025, + 24026, + 24027, + 24028, + 24029, + 24030, + 24031, + 24032, + 24033, + 24034, + 24035, + 24036, + 24037, + 24038, + 24039, + 24040, + 24041, + 24042, + 24043, + 24044, + 24045, + 24046, + 24047, + 24048, + 24049, + 24050, + 24051, + 24052, + 24053, + 24054, + 24055, + 24056, + 24057, + 24058, + 24059, + 24060, + 24061, + 24062, + 24063, + 24064, + 24065, + 24066, + 24067, + 24068, + 24069, + 24070, + 24071, + 24072, + 24073, + 24074, + 24075, + 24076, + 24077, + 24078, + 24079, + 24080, + 24081, + 24082, + 24083, + 24084, + 24085, + 24086, + 24087, + 24088, + 24089, + 24090, + 24091, + 24092, + 24093, + 24094, + 24095, + 24096, + 24097, + 24098, + 24099, + 24100, + 24101, + 24102, + 24103, + 24104, + 24105, + 24106, + 24107, + 24108, + 24109, + 24110, + 24111, + 24112, + 24113, + 24114, + 24115, + 24116, + 24117, + 24118, + 24119, + 24120, + 24121, + 24122, + 24123, + 24124, + 24125, + 24126, + 24127, + 24128, + 24129, + 24130, + 24131, + 24132, + 24133, + 24134, + 24135, + 24136, + 24137, + 24138, + 24139, + 24140, + 24141, + 24142, + 24143, + 24144, + 24145, + 24146, + 24147, + 24148, + 24149, + 24150, + 24151, + 24152, + 24153, + 24154, + 24155, + 24156, + 24157, + 24158, + 24159, + 24160, + 24161, + 24162, + 24163, + 24164, + 24165, + 24166, + 24167, + 24168, + 24169, + 24170, + 24171, + 24172, + 24173, + 24174, + 24175, + 24176, + 24177, + 24178, + 24179, + 24180, + 24181, + 24182, + 24183, + 24184, + 24185, + 24186, + 24187, + 24188, + 24189, + 24190, + 24191, + 24192, + 24193, + 24194, + 24195, + 24196, + 24197, + 24198, + 24199, + 24200, + 24201, + 24202, + 24203, + 24204, + 24205, + 24206, + 24207, + 24208, + 24209, + 24210, + 24211, + 24212, + 24213, + 24214, + 24215, + 24216, + 24217, + 24218, + 24219, + 24220, + 24221, + 24222, + 24223, + 24224, + 24225, + 24226, + 24227, + 24228, + 24229, + 24230, + 24231, + 24232, + 24233, + 24234, + 24235, + 24236, + 24237, + 24238, + 24239, + 24240, + 24241, + 24242, + 24243, + 24244, + 24245, + 24246, + 24247, + 24248, + 24249, + 24250, + 24251, + 24252, + 24253, + 24254, + 24255, + 24256, + 24257, + 24258, + 24259, + 24260, + 24261, + 24262, + 24263, + 24264, + 24265, + 24266, + 24267, + 24268, + 24269, + 24270, + 24271, + 24272, + 24273, + 24274, + 24275, + 24276, + 24277, + 24278, + 24279, + 24280, + 24281, + 24282, + 24283, + 24284, + 24285, + 24286, + 24287, + 24288, + 24289, + 24290, + 24291, + 24292, + 24293, + 24294, + 24295, + 24296, + 24297, + 24298, + 24299, + 24300, + 24301, + 24302, + 24303, + 24304, + 24305, + 24306, + 24307, + 24308, + 24309, + 24310, + 24311, + 24312, + 24313, + 24314, + 24315, + 24316, + 24317, + 24318, + 24319, + 24320, + 24321, + 24322, + 24323, + 24324, + 24325, + 24326, + 24327, + 24328, + 24329, + 24330, + 24331, + 24332, + 24333, + 24334, + 24335, + 24336, + 24337, + 24338, + 24339, + 24340, + 24341, + 24342, + 24343, + 24344, + 24345, + 24346, + 24347, + 24348, + 24349, + 24350, + 24351, + 24352, + 24353, + 24354, + 24355, + 24356, + 24357, + 24358, + 24359, + 24360, + 24361, + 24362, + 24363, + 24364, + 24365, + 24366, + 24367, + 24368, + 24369, + 24370, + 24371, + 24372, + 24373, + 24374, + 24375, + 24376, + 24377, + 24378, + 24379, + 24380, + 24381, + 24382, + 24383, + 24384, + 24385, + 24386, + 24387, + 24388, + 24389, + 24390, + 24391, + 24392, + 24393, + 24394, + 24395, + 24396, + 24397, + 24398, + 24399, + 24400, + 24401, + 24402, + 24403, + 24404, + 24405, + 24406, + 24407, + 24408, + 24409, + 24410, + 24411, + 24412, + 24413, + 24414, + 24415, + 24416, + 24417, + 24418, + 24419, + 24420, + 24421, + 24422, + 24423, + 24424, + 24425, + 24426, + 24427, + 24428, + 24429, + 24430, + 24431, + 24432, + 24433, + 24434, + 24435, + 24436, + 24437, + 24438, + 24439, + 24440, + 24441, + 24442, + 24443, + 24444, + 24445, + 24446, + 24447, + 24448, + 24449, + 24450, + 24451, + 24452, + 24453, + 24454, + 24455, + 24456, + 24457, + 24458, + 24459, + 24460, + 24461, + 24462, + 24463, + 24464, + 24465, + 24466, + 24467, + 24468, + 24469, + 24470, + 24471, + 24472, + 24473, + 24474, + 24475, + 24476, + 24477, + 24478, + 24479, + 24480, + 24481, + 24482, + 24483, + 24484, + 24485, + 24486, + 24487, + 24488, + 24489, + 24490, + 24491, + 24492, + 24493, + 24494, + 24495, + 24496, + 24497, + 24498, + 24499, + 24500, + 24501, + 24502, + 24503, + 24504, + 24505, + 24506, + 24507, + 24508, + 24509, + 24510, + 24511, + 24512, + 24513, + 24514, + 24515, + 24516, + 24517, + 24518, + 24519, + 24520, + 24521, + 24522, + 24523, + 24524, + 24525, + 24526, + 24527, + 24528, + 24529, + 24530, + 24531, + 24532, + 24533, + 24534, + 24535, + 24536, + 24537, + 24538, + 24539, + 24540, + 24541, + 24542, + 24543, + 24544, + 24545, + 24546, + 24547, + 24548, + 24549, + 24550, + 24551, + 24552, + 24553, + 24554, + 24555, + 24556, + 24557, + 24558, + 24559, + 24560, + 24561, + 24562, + 24563, + 24564, + 24565, + 24566, + 24567, + 24568, + 24569, + 24570, + 24571, + 24572, + 24573, + 24574, + 24575, + 24576, + 24577, + 24578, + 24579, + 24580, + 24581, + 24582, + 24583, + 24584, + 24585, + 24586, + 24587, + 24588, + 24589, + 24590, + 24591, + 24592, + 24593, + 24594, + 24595, + 24596, + 24597, + 24598, + 24599, + 24600, + 24601, + 24602, + 24603, + 24604, + 24605, + 24606, + 24607, + 24608, + 24609, + 24610, + 24611, + 24612, + 24613, + 24614, + 24615, + 24616, + 24617, + 24618, + 24619, + 24620, + 24621, + 24622, + 24623, + 24624, + 24625, + 24626, + 24627, + 24628, + 24629, + 24630, + 24631, + 24632, + 24633, + 24634, + 24635, + 24636, + 24637, + 24638, + 24639, + 24640, + 24641, + 24642, + 24643, + 24644, + 24645, + 24646, + 24647, + 24648, + 24649, + 24650, + 24651, + 24652, + 24653, + 24654, + 24655, + 24656, + 24657, + 24658, + 24659, + 24660, + 24661, + 24662, + 24663, + 24664, + 24665, + 24666, + 24667, + 24668, + 24669, + 24670, + 24671, + 24672, + 24673, + 24674, + 24675, + 24676, + 24677, + 24678, + 24679, + 24680, + 24681, + 24682, + 24683, + 24684, + 24685, + 24686, + 24687, + 24688, + 24689, + 24690, + 24691, + 24692, + 24693, + 24694, + 24695, + 24696, + 24697, + 24698, + 24699, + 24700, + 24701, + 24702, + 24703, + 24704, + 24705, + 24706, + 24707, + 24708, + 24709, + 24710, + 24711, + 24712, + 24713, + 24714, + 24715, + 24716, + 24717, + 24718, + 24719, + 24720, + 24721, + 24722, + 24723, + 24724, + 24725, + 24726, + 24727, + 24728, + 24729, + 24730, + 24731, + 24732, + 24733, + 24734, + 24735, + 24736, + 24737, + 24738, + 24739, + 24740, + 24741, + 24742, + 24743, + 24744, + 24745, + 24746, + 24747, + 24748, + 24749, + 24750, + 24751, + 24752, + 24753, + 24754, + 24755, + 24756, + 24757, + 24758, + 24759, + 24760, + 24761, + 24762, + 24763, + 24764, + 24765, + 24766, + 24767, + 24768, + 24769, + 24770, + 24771, + 24772, + 24773, + 24774, + 24775, + 24776, + 24777, + 24778, + 24779, + 24780, + 24781, + 24782, + 24783, + 24784, + 24785, + 24786, + 24787, + 24788, + 24789, + 24790, + 24791, + 24792, + 24793, + 24794, + 24795, + 24796, + 24797, + 24798, + 24799, + 24800, + 24801, + 24802, + 24803, + 24804, + 24805, + 24806, + 24807, + 24808, + 24809, + 24810, + 24811, + 24812, + 24813, + 24814, + 24815, + 24816, + 24817, + 24818, + 24819, + 24820, + 24821, + 24822, + 24823, + 24824, + 24825, + 24826, + 24827, + 24828, + 24829, + 24830, + 24831, + 24832, + 24833, + 24834, + 24835, + 24836, + 24837, + 24838, + 24839, + 24840, + 24841, + 24842, + 24843, + 24844, + 24845, + 24846, + 24847, + 24848, + 24849, + 24850, + 24851, + 24852, + 24853, + 24854, + 24855, + 24856, + 24857, + 24858, + 24859, + 24860, + 24861, + 24862, + 24863, + 24864, + 24865, + 24866, + 24867, + 24868, + 24869, + 24870, + 24871, + 24872, + 24873, + 24874, + 24875, + 24876, + 24877, + 24878, + 24879, + 24880, + 24881, + 24882, + 24883, + 24884, + 24885, + 24886, + 24887, + 24888, + 24889, + 24890, + 24891, + 24892, + 24893, + 24894, + 24895, + 24896, + 24897, + 24898, + 24899, + 24900, + 24901, + 24902, + 24903, + 24904, + 24905, + 24906, + 24907, + 24908, + 24909, + 24910, + 24911, + 24912, + 24913, + 24914, + 24915, + 24916, + 24917, + 24918, + 24919, + 24920, + 24921, + 24922, + 24923, + 24924, + 24925, + 24926, + 24927, + 24928, + 24929, + 24930, + 24931, + 24932, + 24933, + 24934, + 24935, + 24936, + 24937, + 24938, + 24939, + 24940, + 24941, + 24942, + 24943, + 24944, + 24945, + 24946, + 24947, + 24948, + 24949, + 24950, + 24951, + 24952, + 24953, + 24954, + 24955, + 24956, + 24957, + 24958, + 24959, + 24960, + 24961, + 24962, + 24963, + 24964, + 24965, + 24966, + 24967, + 24968, + 24969, + 24970, + 24971, + 24972, + 24973, + 24974, + 24975, + 24976, + 24977, + 24978, + 24979, + 24980, + 24981, + 24982, + 24983, + 24984, + 24985, + 24986, + 24987, + 24988, + 24989, + 24990, + 24991, + 24992, + 24993, + 24994, + 24995, + 24996, + 24997, + 24998, + 24999, + 25000, + 25001, + 25002, + 25003, + 25004, + 25005, + 25006, + 25007, + 25008, + 25009, + 25010, + 25011, + 25012, + 25013, + 25014, + 25015, + 25016, + 25017, + 25018, + 25019, + 25020, + 25021, + 25022, + 25023, + 25024, + 25025, + 25026, + 25027, + 25028, + 25029, + 25030, + 25031, + 25032, + 25033, + 25034, + 25035, + 25036, + 25037, + 25038, + 25039, + 25040, + 25041, + 25042, + 25043, + 25044, + 25045, + 25046, + 25047, + 25048, + 25049, + 25050, + 25051, + 25052, + 25053, + 25054, + 25055, + 25056, + 25057, + 25058, + 25059, + 25060, + 25061, + 25062, + 25063, + 25064, + 25065, + 25066, + 25067, + 25068, + 25069, + 25070, + 25071, + 25072, + 25073, + 25074, + 25075, + 25076, + 25077, + 25078, + 25079, + 25080, + 25081, + 25082, + 25083, + 25084, + 25085, + 25086, + 25087, + 25088, + 25089, + 25090, + 25091, + 25092, + 25093, + 25094, + 25095, + 25096, + 25097, + 25098, + 25099, + 25100, + 25101, + 25102, + 25103, + 25104, + 25105, + 25106, + 25107, + 25108, + 25109, + 25110, + 25111, + 25112, + 25113, + 25114, + 25115, + 25116, + 25117, + 25118, + 25119, + 25120, + 25121, + 25122, + 25123, + 25124, + 25125, + 25126, + 25127, + 25128, + 25129, + 25130, + 25131, + 25132, + 25133, + 25134, + 25135, + 25136, + 25137, + 25138, + 25139, + 25140, + 25141, + 25142, + 25143, + 25144, + 25145, + 25146, + 25147, + 25148, + 25149, + 25150, + 25151, + 25152, + 25153, + 25154, + 25155, + 25156, + 25157, + 25158, + 25159, + 25160, + 25161, + 25162, + 25163, + 25164, + 25165, + 25166, + 25167, + 25168, + 25169, + 25170, + 25171, + 25172, + 25173, + 25174, + 25175, + 25176, + 25177, + 25178, + 25179, + 25180, + 25181, + 25182, + 25183, + 25184, + 25185, + 25186, + 25187, + 25188, + 25189, + 25190, + 25191, + 25192, + 25193, + 25194, + 25195, + 25196, + 25197, + 25198, + 25199, + 25200, + 25201, + 25202, + 25203, + 25204, + 25205, + 25206, + 25207, + 25208, + 25209, + 25210, + 25211, + 25212, + 25213, + 25214, + 25215, + 25216, + 25217, + 25218, + 25219, + 25220, + 25221, + 25222, + 25223, + 25224, + 25225, + 25226, + 25227, + 25228, + 25229, + 25230, + 25231, + 25232, + 25233, + 25234, + 25235, + 25236, + 25237, + 25238, + 25239, + 25240, + 25241, + 25242, + 25243, + 25244, + 25245, + 25246, + 25247, + 25248, + 25249, + 25250, + 25251, + 25252, + 25253, + 25254, + 25255, + 25256, + 25257, + 25258, + 25259, + 25260, + 25261, + 25262, + 25263, + 25264, + 25265, + 25266, + 25267, + 25268, + 25269, + 25270, + 25271, + 25272, + 25273, + 25274, + 25275, + 25276, + 25277, + 25278, + 25279, + 25280, + 25281, + 25282, + 25283, + 25284, + 25285, + 25286, + 25287, + 25288, + 25289, + 25290, + 25291, + 25292, + 25293, + 25294, + 25295, + 25296, + 25297, + 25298, + 25299, + 25300, + 25301, + 25302, + 25303, + 25304, + 25305, + 25306, + 25307, + 25308, + 25309, + 25310, + 25311, + 25312, + 25313, + 25314, + 25315, + 25316, + 25317, + 25318, + 25319, + 25320, + 25321, + 25322, + 25323, + 25324, + 25325, + 25326, + 25327, + 25328, + 25329, + 25330, + 25331, + 25332, + 25333, + 25334, + 25335, + 25336, + 25337, + 25338, + 25339, + 25340, + 25341, + 25342, + 25343, + 25344, + 25345, + 25346, + 25347, + 25348, + 25349, + 25350, + 25351, + 25352, + 25353, + 25354, + 25355, + 25356, + 25357, + 25358, + 25359, + 25360, + 25361, + 25362, + 25363, + 25364, + 25365, + 25366, + 25367, + 25368, + 25369, + 25370, + 25371, + 25372, + 25373, + 25374, + 25375, + 25376, + 25377, + 25378, + 25379, + 25380, + 25381, + 25382, + 25383, + 25384, + 25385, + 25386, + 25387, + 25388, + 25389, + 25390, + 25391, + 25392, + 25393, + 25394, + 25395, + 25396, + 25397, + 25398, + 25399, + 25400, + 25401, + 25402, + 25403, + 25404, + 25405, + 25406, + 25407, + 25408, + 25409, + 25410, + 25411, + 25412, + 25413, + 25414, + 25415, + 25416, + 25417, + 25418, + 25419, + 25420, + 25421, + 25422, + 25423, + 25424, + 25425, + 25426, + 25427, + 25428, + 25429, + 25430, + 25431, + 25432, + 25433, + 25434, + 25435, + 25436, + 25437, + 25438, + 25439, + 25440, + 25441, + 25442, + 25443, + 25444, + 25445, + 25446, + 25447, + 25448, + 25449, + 25450, + 25451, + 25452, + 25453, + 25454, + 25455, + 25456, + 25457, + 25458, + 25459, + 25460, + 25461, + 25462, + 25463, + 25464, + 25465, + 25466, + 25467, + 25468, + 25469, + 25470, + 25471, + 25472, + 25473, + 25474, + 25475, + 25476, + 25477, + 25478, + 25479, + 25480, + 25481, + 25482, + 25483, + 25484, + 25485, + 25486, + 25487, + 25488, + 25489, + 25490, + 25491, + 25492, + 25493, + 25494, + 25495, + 25496, + 25497, + 25498, + 25499, + 25500, + 25501, + 25502, + 25503, + 25504, + 25505, + 25506, + 25507, + 25508, + 25509, + 25510, + 25511, + 25512, + 25513, + 25514, + 25515, + 25516, + 25517, + 25518, + 25519, + 25520, + 25521, + 25522, + 25523, + 25524, + 25525, + 25526, + 25527, + 25528, + 25529, + 25530, + 25531, + 25532, + 25533, + 25534, + 25535, + 25536, + 25537, + 25538, + 25539, + 25540, + 25541, + 25542, + 25543, + 25544, + 25545, + 25546, + 25547, + 25548, + 25549, + 25550, + 25551, + 25552, + 25553, + 25554, + 25555, + 25556, + 25557, + 25558, + 25559, + 25560, + 25561, + 25562, + 25563, + 25564, + 25565, + 25566, + 25567, + 25568, + 25569, + 25570, + 25571, + 25572, + 25573, + 25574, + 25575, + 25576, + 25577, + 25578, + 25579, + 25580, + 25581, + 25582, + 25583, + 25584, + 25585, + 25586, + 25587, + 25588, + 25589, + 25590, + 25591, + 25592, + 25593, + 25594, + 25595, + 25596, + 25597, + 25598, + 25599, + 25600, + 25601, + 25602, + 25603, + 25604, + 25605, + 25606, + 25607, + 25608, + 25609, + 25610, + 25611, + 25612, + 25613, + 25614, + 25615, + 25616, + 25617, + 25618, + 25619, + 25620, + 25621, + 25622, + 25623, + 25624, + 25625, + 25626, + 25627, + 25628, + 25629, + 25630, + 25631, + 25632, + 25633, + 25634, + 25635, + 25636, + 25637, + 25638, + 25639, + 25640, + 25641, + 25642, + 25643, + 25644, + 25645, + 25646, + 25647, + 25648, + 25649, + 25650, + 25651, + 25652, + 25653, + 25654, + 25655, + 25656, + 25657, + 25658, + 25659, + 25660, + 25661, + 25662, + 25663, + 25664, + 25665, + 25666, + 25667, + 25668, + 25669, + 25670, + 25671, + 25672, + 25673, + 25674, + 25675, + 25676, + 25677, + 25678, + 25679, + 25680, + 25681, + 25682, + 25683, + 25684, + 25685, + 25686, + 25687, + 25688, + 25689, + 25690, + 25691, + 25692, + 25693, + 25694, + 25695, + 25696, + 25697, + 25698, + 25699, + 25700, + 25701, + 25702, + 25703, + 25704, + 25705, + 25706, + 25707, + 25708, + 25709, + 25710, + 25711, + 25712, + 25713, + 25714, + 25715, + 25716, + 25717, + 25718, + 25719, + 25720, + 25721, + 25722, + 25723, + 25724, + 25725, + 25726, + 25727, + 25728, + 25729, + 25730, + 25731, + 25732, + 25733, + 25734, + 25735, + 25736, + 25737, + 25738, + 25739, + 25740, + 25741, + 25742, + 25743, + 25744, + 25745, + 25746, + 25747, + 25748, + 25749, + 25750, + 25751, + 25752, + 25753, + 25754, + 25755, + 25756, + 25757, + 25758, + 25759, + 25760, + 25761, + 25762, + 25763, + 25764, + 25765, + 25766, + 25767, + 25768, + 25769, + 25770, + 25771, + 25772, + 25773, + 25774, + 25775, + 25776, + 25777, + 25778, + 25779, + 25780, + 25781, + 25782, + 25783, + 25784, + 25785, + 25786, + 25787, + 25788, + 25789, + 25790, + 25791, + 25792, + 25793, + 25794, + 25795, + 25796, + 25797, + 25798, + 25799, + 25800, + 25801, + 25802, + 25803, + 25804, + 25805, + 25806, + 25807, + 25808, + 25809, + 25810, + 25811, + 25812, + 25813, + 25814, + 25815, + 25816, + 25817, + 25818, + 25819, + 25820, + 25821, + 25822, + 25823, + 25824, + 25825, + 25826, + 25827, + 25828, + 25829, + 25830, + 25831, + 25832, + 25833, + 25834, + 25835, + 25836, + 25837, + 25838, + 25839, + 25840, + 25841, + 25842, + 25843, + 25844, + 25845, + 25846, + 25847, + 25848, + 25849, + 25850, + 25851, + 25852, + 25853, + 25854, + 25855, + 25856, + 25857, + 25858, + 25859, + 25860, + 25861, + 25862, + 25863, + 25864, + 25865, + 25866, + 25867, + 25868, + 25869, + 25870, + 25871, + 25872, + 25873, + 25874, + 25875, + 25876, + 25877, + 25878, + 25879, + 25880, + 25881, + 25882, + 25883, + 25884, + 25885, + 25886, + 25887, + 25888, + 25889, + 25890, + 25891, + 25892, + 25893, + 25894, + 25895, + 25896, + 25897, + 25898, + 25899, + 25900, + 25901, + 25902, + 25903, + 25904, + 25905, + 25906, + 25907, + 25908, + 25909, + 25910, + 25911, + 25912, + 25913, + 25914, + 25915, + 25916, + 25917, + 25918, + 25919, + 25920, + 25921, + 25922, + 25923, + 25924, + 25925, + 25926, + 25927, + 25928, + 25929, + 25930, + 25931, + 25932, + 25933, + 25934, + 25935, + 25936, + 25937, + 25938, + 25939, + 25940, + 25941, + 25942, + 25943, + 25944, + 25945, + 25946, + 25947, + 25948, + 25949, + 25950, + 25951, + 25952, + 25953, + 25954, + 25955, + 25956, + 25957, + 25958, + 25959, + 25960, + 25961, + 25962, + 25963, + 25964, + 25965, + 25966, + 25967, + 25968, + 25969, + 25970, + 25971, + 25972, + 25973, + 25974, + 25975, + 25976, + 25977, + 25978, + 25979, + 25980, + 25981, + 25982, + 25983, + 25984, + 25985, + 25986, + 25987, + 25988, + 25989, + 25990, + 25991, + 25992, + 25993, + 25994, + 25995, + 25996, + 25997, + 25998, + 25999, + 26000, + 26001, + 26002, + 26003, + 26004, + 26005, + 26006, + 26007, + 26008, + 26009, + 26010, + 26011, + 26012, + 26013, + 26014, + 26015, + 26016, + 26017, + 26018, + 26019, + 26020, + 26021, + 26022, + 26023, + 26024, + 26025, + 26026, + 26027, + 26028, + 26029, + 26030, + 26031, + 26032, + 26033, + 26034, + 26035, + 26036, + 26037, + 26038, + 26039, + 26040, + 26041, + 26042, + 26043, + 26044, + 26045, + 26046, + 26047, + 26048, + 26049, + 26050, + 26051, + 26052, + 26053, + 26054, + 26055, + 26056, + 26057, + 26058, + 26059, + 26060, + 26061, + 26062, + 26063, + 26064, + 26065, + 26066, + 26067, + 26068, + 26069, + 26070, + 26071, + 26072, + 26073, + 26074, + 26075, + 26076, + 26077, + 26078, + 26079, + 26080, + 26081, + 26082, + 26083, + 26084, + 26085, + 26086, + 26087, + 26088, + 26089, + 26090, + 26091, + 26092, + 26093, + 26094, + 26095, + 26096, + 26097, + 26098, + 26099, + 26100, + 26101, + 26102, + 26103, + 26104, + 26105, + 26106, + 26107, + 26108, + 26109, + 26110, + 26111, + 26112, + 26113, + 26114, + 26115, + 26116, + 26117, + 26118, + 26119, + 26120, + 26121, + 26122, + 26123, + 26124, + 26125, + 26126, + 26127, + 26128, + 26129, + 26130, + 26131, + 26132, + 26133, + 26134, + 26135, + 26136, + 26137, + 26138, + 26139, + 26140, + 26141, + 26142, + 26143, + 26144, + 26145, + 26146, + 26147, + 26148, + 26149, + 26150, + 26151, + 26152, + 26153, + 26154, + 26155, + 26156, + 26157, + 26158, + 26159, + 26160, + 26161, + 26162, + 26163, + 26164, + 26165, + 26166, + 26167, + 26168, + 26169, + 26170, + 26171, + 26172, + 26173, + 26174, + 26175, + 26176, + 26177, + 26178, + 26179, + 26180, + 26181, + 26182, + 26183, + 26184, + 26185, + 26186, + 26187, + 26188, + 26189, + 26190, + 26191, + 26192, + 26193, + 26194, + 26195, + 26196, + 26197, + 26198, + 26199, + 26200, + 26201, + 26202, + 26203, + 26204, + 26205, + 26206, + 26207, + 26208, + 26209, + 26210, + 26211, + 26212, + 26213, + 26214, + 26215, + 26216, + 26217, + 26218, + 26219, + 26220, + 26221, + 26222, + 26223, + 26224, + 26225, + 26226, + 26227, + 26228, + 26229, + 26230, + 26231, + 26232, + 26233, + 26234, + 26235, + 26236, + 26237, + 26238, + 26239, + 26240, + 26241, + 26242, + 26243, + 26244, + 26245, + 26246, + 26247, + 26248, + 26249, + 26250, + 26251, + 26252, + 26253, + 26254, + 26255, + 26256, + 26257, + 26258, + 26259, + 26260, + 26261, + 26262, + 26263, + 26264, + 26265, + 26266, + 26267, + 26268, + 26269, + 26270, + 26271, + 26272, + 26273, + 26274, + 26275, + 26276, + 26277, + 26278, + 26279, + 26280, + 26281, + 26282, + 26283, + 26284, + 26285, + 26286, + 26287, + 26288, + 26289, + 26290, + 26291, + 26292, + 26293, + 26294, + 26295, + 26296, + 26297, + 26298, + 26299, + 26300, + 26301, + 26302, + 26303, + 26304, + 26305, + 26306, + 26307, + 26308, + 26309, + 26310, + 26311, + 26312, + 26313, + 26314, + 26315, + 26316, + 26317, + 26318, + 26319, + 26320, + 26321, + 26322, + 26323, + 26324, + 26325, + 26326, + 26327, + 26328, + 26329, + 26330, + 26331, + 26332, + 26333, + 26334, + 26335, + 26336, + 26337, + 26338, + 26339, + 26340, + 26341, + 26342, + 26343, + 26344, + 26345, + 26346, + 26347, + 26348, + 26349, + 26350, + 26351, + 26352, + 26353, + 26354, + 26355, + 26356, + 26357, + 26358, + 26359, + 26360, + 26361, + 26362, + 26363, + 26364, + 26365, + 26366, + 26367, + 26368, + 26369, + 26370, + 26371, + 26372, + 26373, + 26374, + 26375, + 26376, + 26377, + 26378, + 26379, + 26380, + 26381, + 26382, + 26383, + 26384, + 26385, + 26386, + 26387, + 26388, + 26389, + 26390, + 26391, + 26392, + 26393, + 26394, + 26395, + 26396, + 26397, + 26398, + 26399, + 26400, + 26401, + 26402, + 26403, + 26404, + 26405, + 26406, + 26407, + 26408, + 26409, + 26410, + 26411, + 26412, + 26413, + 26414, + 26415, + 26416, + 26417, + 26418, + 26419, + 26420, + 26421, + 26422, + 26423, + 26424, + 26425, + 26426, + 26427, + 26428, + 26429, + 26430, + 26431, + 26432, + 26433, + 26434, + 26435, + 26436, + 26437, + 26438, + 26439, + 26440, + 26441, + 26442, + 26443, + 26444, + 26445, + 26446, + 26447, + 26448, + 26449, + 26450, + 26451, + 26452, + 26453, + 26454, + 26455, + 26456, + 26457, + 26458, + 26459, + 26460, + 26461, + 26462, + 26463, + 26464, + 26465, + 26466, + 26467, + 26468, + 26469, + 26470, + 26471, + 26472, + 26473, + 26474, + 26475, + 26476, + 26477, + 26478, + 26479, + 26480, + 26481, + 26482, + 26483, + 26484, + 26485, + 26486, + 26487, + 26488, + 26489, + 26490, + 26491, + 26492, + 26493, + 26494, + 26495, + 26496, + 26497, + 26498, + 26499, + 26500, + 26501, + 26502, + 26503, + 26504, + 26505, + 26506, + 26507, + 26508, + 26509, + 26510, + 26511, + 26512, + 26513, + 26514, + 26515, + 26516, + 26517, + 26518, + 26519, + 26520, + 26521, + 26522, + 26523, + 26524, + 26525, + 26526, + 26527, + 26528, + 26529, + 26530, + 26531, + 26532, + 26533, + 26534, + 26535, + 26536, + 26537, + 26538, + 26539, + 26540, + 26541, + 26542, + 26543, + 26544, + 26545, + 26546, + 26547, + 26548, + 26549, + 26550, + 26551, + 26552, + 26553, + 26554, + 26555, + 26556, + 26557, + 26558, + 26559, + 26560, + 26561, + 26562, + 26563, + 26564, + 26565, + 26566, + 26567, + 26568, + 26569, + 26570, + 26571, + 26572, + 26573, + 26574, + 26575, + 26576, + 26577, + 26578, + 26579, + 26580, + 26581, + 26582, + 26583, + 26584, + 26585, + 26586, + 26587, + 26588, + 26589, + 26590, + 26591, + 26592, + 26593, + 26594, + 26595, + 26596, + 26597, + 26598, + 26599, + 26600, + 26601, + 26602, + 26603, + 26604, + 26605, + 26606, + 26607, + 26608, + 26609, + 26610, + 26611, + 26612, + 26613, + 26614, + 26615, + 26616, + 26617, + 26618, + 26619, + 26620, + 26621, + 26622, + 26623, + 26624, + 26625, + 26626, + 26627, + 26628, + 26629, + 26630, + 26631, + 26632, + 26633, + 26634, + 26635, + 26636, + 26637, + 26638, + 26639, + 26640, + 26641, + 26642, + 26643, + 26644, + 26645, + 26646, + 26647, + 26648, + 26649, + 26650, + 26651, + 26652, + 26653, + 26654, + 26655, + 26656, + 26657, + 26658, + 26659, + 26660, + 26661, + 26662, + 26663, + 26664, + 26665, + 26666, + 26667, + 26668, + 26669, + 26670, + 26671, + 26672, + 26673, + 26674, + 26675, + 26676, + 26677, + 26678, + 26679, + 26680, + 26681, + 26682, + 26683, + 26684, + 26685, + 26686, + 26687, + 26688, + 26689, + 26690, + 26691, + 26692, + 26693, + 26694, + 26695, + 26696, + 26697, + 26698, + 26699, + 26700, + 26701, + 26702, + 26703, + 26704, + 26705, + 26706, + 26707, + 26708, + 26709, + 26710, + 26711, + 26712, + 26713, + 26714, + 26715, + 26716, + 26717, + 26718, + 26719, + 26720, + 26721, + 26722, + 26723, + 26724, + 26725, + 26726, + 26727, + 26728, + 26729, + 26730, + 26731, + 26732, + 26733, + 26734, + 26735, + 26736, + 26737, + 26738, + 26739, + 26740, + 26741, + 26742, + 26743, + 26744, + 26745, + 26746, + 26747, + 26748, + 26749, + 26750, + 26751, + 26752, + 26753, + 26754, + 26755, + 26756, + 26757, + 26758, + 26759, + 26760, + 26761, + 26762, + 26763, + 26764, + 26765, + 26766, + 26767, + 26768, + 26769, + 26770, + 26771, + 26772, + 26773, + 26774, + 26775, + 26776, + 26777, + 26778, + 26779, + 26780, + 26781, + 26782, + 26783, + 26784, + 26785, + 26786, + 26787, + 26788, + 26789, + 26790, + 26791, + 26792, + 26793, + 26794, + 26795, + 26796, + 26797, + 26798, + 26799, + 26800, + 26801, + 26802, + 26803, + 26804, + 26805, + 26806, + 26807, + 26808, + 26809, + 26810, + 26811, + 26812, + 26813, + 26814, + 26815, + 26816, + 26817, + 26818, + 26819, + 26820, + 26821, + 26822, + 26823, + 26824, + 26825, + 26826, + 26827, + 26828, + 26829, + 26830, + 26831, + 26832, + 26833, + 26834, + 26835, + 26836, + 26837, + 26838, + 26839, + 26840, + 26841, + 26842, + 26843, + 26844, + 26845, + 26846, + 26847, + 26848, + 26849, + 26850, + 26851, + 26852, + 26853, + 26854, + 26855, + 26856, + 26857, + 26858, + 26859, + 26860, + 26861, + 26862, + 26863, + 26864, + 26865, + 26866, + 26867, + 26868, + 26869, + 26870, + 26871, + 26872, + 26873, + 26874, + 26875, + 26876, + 26877, + 26878, + 26879, + 26880, + 26881, + 26882, + 26883, + 26884, + 26885, + 26886, + 26887, + 26888, + 26889, + 26890, + 26891, + 26892, + 26893, + 26894, + 26895, + 26896, + 26897, + 26898, + 26899, + 26900, + 26901, + 26902, + 26903, + 26904, + 26905, + 26906, + 26907, + 26908, + 26909, + 26910, + 26911, + 26912, + 26913, + 26914, + 26915, + 26916, + 26917, + 26918, + 26919, + 26920, + 26921, + 26922, + 26923, + 26924, + 26925, + 26926, + 26927, + 26928, + 26929, + 26930, + 26931, + 26932, + 26933, + 26934, + 26935, + 26936, + 26937, + 26938, + 26939, + 26940, + 26941, + 26942, + 26943, + 26944, + 26945, + 26946, + 26947, + 26948, + 26949, + 26950, + 26951, + 26952, + 26953, + 26954, + 26955, + 26956, + 26957, + 26958, + 26959, + 26960, + 26961, + 26962, + 26963, + 26964, + 26965, + 26966, + 26967, + 26968, + 26969, + 26970, + 26971, + 26972, + 26973, + 26974, + 26975, + 26976, + 26977, + 26978, + 26979, + 26980, + 26981, + 26982, + 26983, + 26984, + 26985, + 26986, + 26987, + 26988, + 26989, + 26990, + 26991, + 26992, + 26993, + 26994, + 26995, + 26996, + 26997, + 26998, + 26999, + 27000, + 27001, + 27002, + 27003, + 27004, + 27005, + 27006, + 27007, + 27008, + 27009, + 27010, + 27011, + 27012, + 27013, + 27014, + 27015, + 27016, + 27017, + 27018, + 27019, + 27020, + 27021, + 27022, + 27023, + 27024, + 27025, + 27026, + 27027, + 27028, + 27029, + 27030, + 27031, + 27032, + 27033, + 27034, + 27035, + 27036, + 27037, + 27038, + 27039, + 27040, + 27041, + 27042, + 27043, + 27044, + 27045, + 27046, + 27047, + 27048, + 27049, + 27050, + 27051, + 27052, + 27053, + 27054, + 27055, + 27056, + 27057, + 27058, + 27059, + 27060, + 27061, + 27062, + 27063, + 27064, + 27065, + 27066, + 27067, + 27068, + 27069, + 27070, + 27071, + 27072, + 27073, + 27074, + 27075, + 27076, + 27077, + 27078, + 27079, + 27080, + 27081, + 27082, + 27083, + 27084, + 27085, + 27086, + 27087, + 27088, + 27089, + 27090, + 27091, + 27092, + 27093, + 27094, + 27095, + 27096, + 27097, + 27098, + 27099, + 27100, + 27101, + 27102, + 27103, + 27104, + 27105, + 27106, + 27107, + 27108, + 27109, + 27110, + 27111, + 27112, + 27113, + 27114, + 27115, + 27116, + 27117, + 27118, + 27119, + 27120, + 27121, + 27122, + 27123, + 27124, + 27125, + 27126, + 27127, + 27128, + 27129, + 27130, + 27131, + 27132, + 27133, + 27134, + 27135, + 27136, + 27137, + 27138, + 27139, + 27140, + 27141, + 27142, + 27143, + 27144, + 27145, + 27146, + 27147, + 27148, + 27149, + 27150, + 27151, + 27152, + 27153, + 27154, + 27155, + 27156, + 27157, + 27158, + 27159, + 27160, + 27161, + 27162, + 27163, + 27164, + 27165, + 27166, + 27167, + 27168, + 27169, + 27170, + 27171, + 27172, + 27173, + 27174, + 27175, + 27176, + 27177, + 27178, + 27179, + 27180, + 27181, + 27182, + 27183, + 27184, + 27185, + 27186, + 27187, + 27188, + 27189, + 27190, + 27191, + 27192, + 27193, + 27194, + 27195, + 27196, + 27197, + 27198, + 27199, + 27200, + 27201, + 27202, + 27203, + 27204, + 27205, + 27206, + 27207, + 27208, + 27209, + 27210, + 27211, + 27212, + 27213, + 27214, + 27215, + 27216, + 27217, + 27218, + 27219, + 27220, + 27221, + 27222, + 27223, + 27224, + 27225, + 27226, + 27227, + 27228, + 27229, + 27230, + 27231, + 27232, + 27233, + 27234, + 27235, + 27236, + 27237, + 27238, + 27239, + 27240, + 27241, + 27242, + 27243, + 27244, + 27245, + 27246, + 27247, + 27248, + 27249, + 27250, + 27251, + 27252, + 27253, + 27254, + 27255, + 27256, + 27257, + 27258, + 27259, + 27260, + 27261, + 27262, + 27263, + 27264, + 27265, + 27266, + 27267, + 27268, + 27269, + 27270, + 27271, + 27272, + 27273, + 27274, + 27275, + 27276, + 27277, + 27278, + 27279, + 27280, + 27281, + 27282, + 27283, + 27284, + 27285, + 27286, + 27287, + 27288, + 27289, + 27290, + 27291, + 27292, + 27293, + 27294, + 27295, + 27296, + 27297, + 27298, + 27299, + 27300, + 27301, + 27302, + 27303, + 27304, + 27305, + 27306, + 27307, + 27308, + 27309, + 27310, + 27311, + 27312, + 27313, + 27314, + 27315, + 27316, + 27317, + 27318, + 27319, + 27320, + 27321, + 27322, + 27323, + 27324, + 27325, + 27326, + 27327, + 27328, + 27329, + 27330, + 27331, + 27332, + 27333, + 27334, + 27335, + 27336, + 27337, + 27338, + 27339, + 27340, + 27341, + 27342, + 27343, + 27344, + 27345, + 27346, + 27347, + 27348, + 27349, + 27350, + 27351, + 27352, + 27353, + 27354, + 27355, + 27356, + 27357, + 27358, + 27359, + 27360, + 27361, + 27362, + 27363, + 27364, + 27365, + 27366, + 27367, + 27368, + 27369, + 27370, + 27371, + 27372, + 27373, + 27374, + 27375, + 27376, + 27377, + 27378, + 27379, + 27380, + 27381, + 27382, + 27383, + 27384, + 27385, + 27386, + 27387, + 27388, + 27389, + 27390, + 27391, + 27392, + 27393, + 27394, + 27395, + 27396, + 27397, + 27398, + 27399, + 27400, + 27401, + 27402, + 27403, + 27404, + 27405, + 27406, + 27407, + 27408, + 27409, + 27410, + 27411, + 27412, + 27413, + 27414, + 27415, + 27416, + 27417, + 27418, + 27419, + 27420, + 27421, + 27422, + 27423, + 27424, + 27425, + 27426, + 27427, + 27428, + 27429, + 27430, + 27431, + 27432, + 27433, + 27434, + 27435, + 27436, + 27437, + 27438, + 27439, + 27440, + 27441, + 27442, + 27443, + 27444, + 27445, + 27446, + 27447, + 27448, + 27449, + 27450, + 27451, + 27452, + 27453, + 27454, + 27455, + 27456, + 27457, + 27458, + 27459, + 27460, + 27461, + 27462, + 27463, + 27464, + 27465, + 27466, + 27467, + 27468, + 27469, + 27470, + 27471, + 27472, + 27473, + 27474, + 27475, + 27476, + 27477, + 27478, + 27479, + 27480, + 27481, + 27482, + 27483, + 27484, + 27485, + 27486, + 27487, + 27488, + 27489, + 27490, + 27491, + 27492, + 27493, + 27494, + 27495, + 27496, + 27497, + 27498, + 27499, + 27500, + 27501, + 27502, + 27503, + 27504, + 27505, + 27506, + 27507, + 27508, + 27509, + 27510, + 27511, + 27512, + 27513, + 27514, + 27515, + 27516, + 27517, + 27518, + 27519, + 27520, + 27521, + 27522, + 27523, + 27524, + 27525, + 27526, + 27527, + 27528, + 27529, + 27530, + 27531, + 27532, + 27533, + 27534, + 27535, + 27536, + 27537, + 27538, + 27539, + 27540, + 27541, + 27542, + 27543, + 27544, + 27545, + 27546, + 27547, + 27548, + 27549, + 27550, + 27551, + 27552, + 27553, + 27554, + 27555, + 27556, + 27557, + 27558, + 27559, + 27560, + 27561, + 27562, + 27563, + 27564, + 27565, + 27566, + 27567, + 27568, + 27569, + 27570, + 27571, + 27572, + 27573, + 27574, + 27575, + 27576, + 27577, + 27578, + 27579, + 27580, + 27581, + 27582, + 27583, + 27584, + 27585, + 27586, + 27587, + 27588, + 27589, + 27590, + 27591, + 27592, + 27593, + 27594, + 27595, + 27596, + 27597, + 27598, + 27599, + 27600, + 27601, + 27602, + 27603, + 27604, + 27605, + 27606, + 27607, + 27608, + 27609, + 27610, + 27611, + 27612, + 27613, + 27614, + 27615, + 27616, + 27617, + 27618, + 27619, + 27620, + 27621, + 27622, + 27623, + 27624, + 27625, + 27626, + 27627, + 27628, + 27629, + 27630, + 27631, + 27632, + 27633, + 27634, + 27635, + 27636, + 27637, + 27638, + 27639, + 27640, + 27641, + 27642, + 27643, + 27644, + 27645, + 27646, + 27647, + 27648, + 27649, + 27650, + 27651, + 27652, + 27653, + 27654, + 27655, + 27656, + 27657, + 27658, + 27659, + 27660, + 27661, + 27662, + 27663, + 27664, + 27665, + 27666, + 27667, + 27668, + 27669, + 27670, + 27671, + 27672, + 27673, + 27674, + 27675, + 27676, + 27677, + 27678, + 27679, + 27680, + 27681, + 27682, + 27683, + 27684, + 27685, + 27686, + 27687, + 27688, + 27689, + 27690, + 27691, + 27692, + 27693, + 27694, + 27695, + 27696, + 27697, + 27698, + 27699, + 27700, + 27701, + 27702, + 27703, + 27704, + 27705, + 27706, + 27707, + 27708, + 27709, + 27710, + 27711, + 27712, + 27713, + 27714, + 27715, + 27716, + 27717, + 27718, + 27719, + 27720, + 27721, + 27722, + 27723, + 27724, + 27725, + 27726, + 27727, + 27728, + 27729, + 27730, + 27731, + 27732, + 27733, + 27734, + 27735, + 27736, + 27737, + 27738, + 27739, + 27740, + 27741, + 27742, + 27743, + 27744, + 27745, + 27746, + 27747, + 27748, + 27749, + 27750, + 27751, + 27752, + 27753, + 27754, + 27755, + 27756, + 27757, + 27758, + 27759, + 27760, + 27761, + 27762, + 27763, + 27764, + 27765, + 27766, + 27767, + 27768, + 27769, + 27770, + 27771, + 27772, + 27773, + 27774, + 27775, + 27776, + 27777, + 27778, + 27779, + 27780, + 27781, + 27782, + 27783, + 27784, + 27785, + 27786, + 27787, + 27788, + 27789, + 27790, + 27791, + 27792, + 27793, + 27794, + 27795, + 27796, + 27797, + 27798, + 27799, + 27800, + 27801, + 27802, + 27803, + 27804, + 27805, + 27806, + 27807, + 27808, + 27809, + 27810, + 27811, + 27812, + 27813, + 27814, + 27815, + 27816, + 27817, + 27818, + 27819, + 27820, + 27821, + 27822, + 27823, + 27824, + 27825, + 27826, + 27827, + 27828, + 27829, + 27830, + 27831, + 27832, + 27833, + 27834, + 27835, + 27836, + 27837, + 27838, + 27839, + 27840, + 27841, + 27842, + 27843, + 27844, + 27845, + 27846, + 27847, + 27848, + 27849, + 27850, + 27851, + 27852, + 27853, + 27854, + 27855, + 27856, + 27857, + 27858, + 27859, + 27860, + 27861, + 27862, + 27863, + 27864, + 27865, + 27866, + 27867, + 27868, + 27869, + 27870, + 27871, + 27872, + 27873, + 27874, + 27875, + 27876, + 27877, + 27878, + 27879, + 27880, + 27881, + 27882, + 27883, + 27884, + 27885, + 27886, + 27887, + 27888, + 27889, + 27890, + 27891, + 27892, + 27893, + 27894, + 27895, + 27896, + 27897, + 27898, + 27899, + 27900, + 27901, + 27902, + 27903, + 27904, + 27905, + 27906, + 27907, + 27908, + 27909, + 27910, + 27911, + 27912, + 27913, + 27914, + 27915, + 27916, + 27917, + 27918, + 27919, + 27920, + 27921, + 27922, + 27923, + 27924, + 27925, + 27926, + 27927, + 27928, + 27929, + 27930, + 27931, + 27932, + 27933, + 27934, + 27935, + 27936, + 27937, + 27938, + 27939, + 27940, + 27941, + 27942, + 27943, + 27944, + 27945, + 27946, + 27947, + 27948, + 27949, + 27950, + 27951, + 27952, + 27953, + 27954, + 27955, + 27956, + 27957, + 27958, + 27959, + 27960, + 27961, + 27962, + 27963, + 27964, + 27965, + 27966, + 27967, + 27968, + 27969, + 27970, + 27971, + 27972, + 27973, + 27974, + 27975, + 27976, + 27977, + 27978, + 27979, + 27980, + 27981, + 27982, + 27983, + 27984, + 27985, + 27986, + 27987, + 27988, + 27989, + 27990, + 27991, + 27992, + 27993, + 27994, + 27995, + 27996, + 27997, + 27998, + 27999, + 28000, + 28001, + 28002, + 28003, + 28004, + 28005, + 28006, + 28007, + 28008, + 28009, + 28010, + 28011, + 28012, + 28013, + 28014, + 28015, + 28016, + 28017, + 28018, + 28019, + 28020, + 28021, + 28022, + 28023, + 28024, + 28025, + 28026, + 28027, + 28028, + 28029, + 28030, + 28031, + 28032, + 28033, + 28034, + 28035, + 28036, + 28037, + 28038, + 28039, + 28040, + 28041, + 28042, + 28043, + 28044, + 28045, + 28046, + 28047, + 28048, + 28049, + 28050, + 28051, + 28052, + 28053, + 28054, + 28055, + 28056, + 28057, + 28058, + 28059, + 28060, + 28061, + 28062, + 28063, + 28064, + 28065, + 28066, + 28067, + 28068, + 28069, + 28070, + 28071, + 28072, + 28073, + 28074, + 28075, + 28076, + 28077, + 28078, + 28079, + 28080, + 28081, + 28082, + 28083, + 28084, + 28085, + 28086, + 28087, + 28088, + 28089, + 28090, + 28091, + 28092, + 28093, + 28094, + 28095, + 28096, + 28097, + 28098, + 28099, + 28100, + 28101, + 28102, + 28103, + 28104, + 28105, + 28106, + 28107, + 28108, + 28109, + 28110, + 28111, + 28112, + 28113, + 28114, + 28115, + 28116, + 28117, + 28118, + 28119, + 28120, + 28121, + 28122, + 28123, + 28124, + 28125, + 28126, + 28127, + 28128, + 28129, + 28130, + 28131, + 28132, + 28133, + 28134, + 28135, + 28136, + 28137, + 28138, + 28139, + 28140, + 28141, + 28142, + 28143, + 28144, + 28145, + 28146, + 28147, + 28148, + 28149, + 28150, + 28151, + 28152, + 28153, + 28154, + 28155, + 28156, + 28157, + 28158, + 28159, + 28160, + 28161, + 28162, + 28163, + 28164, + 28165, + 28166, + 28167, + 28168, + 28169, + 28170, + 28171, + 28172, + 28173, + 28174, + 28175, + 28176, + 28177, + 28178, + 28179, + 28180, + 28181, + 28182, + 28183, + 28184, + 28185, + 28186, + 28187, + 28188, + 28189, + 28190, + 28191, + 28192, + 28193, + 28194, + 28195, + 28196, + 28197, + 28198, + 28199, + 28200, + 28201, + 28202, + 28203, + 28204, + 28205, + 28206, + 28207, + 28208, + 28209, + 28210, + 28211, + 28212, + 28213, + 28214, + 28215, + 28216, + 28217, + 28218, + 28219, + 28220, + 28221, + 28222, + 28223, + 28224, + 28225, + 28226, + 28227, + 28228, + 28229, + 28230, + 28231, + 28232, + 28233, + 28234, + 28235, + 28236, + 28237, + 28238, + 28239, + 28240, + 28241, + 28242, + 28243, + 28244, + 28245, + 28246, + 28247, + 28248, + 28249, + 28250, + 28251, + 28252, + 28253, + 28254, + 28255, + 28256, + 28257, + 28258, + 28259, + 28260, + 28261, + 28262, + 28263, + 28264, + 28265, + 28266, + 28267, + 28268, + 28269, + 28270, + 28271, + 28272, + 28273, + 28274, + 28275, + 28276, + 28277, + 28278, + 28279, + 28280, + 28281, + 28282, + 28283, + 28284, + 28285, + 28286, + 28287, + 28288, + 28289, + 28290, + 28291, + 28292, + 28293, + 28294, + 28295, + 28296, + 28297, + 28298, + 28299, + 28300, + 28301, + 28302, + 28303, + 28304, + 28305, + 28306, + 28307, + 28308, + 28309, + 28310, + 28311, + 28312, + 28313, + 28314, + 28315, + 28316, + 28317, + 28318, + 28319, + 28320, + 28321, + 28322, + 28323, + 28324, + 28325, + 28326, + 28327, + 28328, + 28329, + 28330, + 28331, + 28332, + 28333, + 28334, + 28335, + 28336, + 28337, + 28338, + 28339, + 28340, + 28341, + 28342, + 28343, + 28344, + 28345, + 28346, + 28347, + 28348, + 28349, + 28350, + 28351, + 28352, + 28353, + 28354, + 28355, + 28356, + 28357, + 28358, + 28359, + 28360, + 28361, + 28362, + 28363, + 28364, + 28365, + 28366, + 28367, + 28368, + 28369, + 28370, + 28371, + 28372, + 28373, + 28374, + 28375, + 28376, + 28377, + 28378, + 28379, + 28380, + 28381, + 28382, + 28383, + 28384, + 28385, + 28386, + 28387, + 28388, + 28389, + 28390, + 28391, + 28392, + 28393, + 28394, + 28395, + 28396, + 28397, + 28398, + 28399, + 28400, + 28401, + 28402, + 28403, + 28404, + 28405, + 28406, + 28407, + 28408, + 28409, + 28410, + 28411, + 28412, + 28413, + 28414, + 28415, + 28416, + 28417, + 28418, + 28419, + 28420, + 28421, + 28422, + 28423, + 28424, + 28425, + 28426, + 28427, + 28428, + 28429, + 28430, + 28431, + 28432, + 28433, + 28434, + 28435, + 28436, + 28437, + 28438, + 28439, + 28440, + 28441, + 28442, + 28443, + 28444, + 28445, + 28446, + 28447, + 28448, + 28449, + 28450, + 28451, + 28452, + 28453, + 28454, + 28455, + 28456, + 28457, + 28458, + 28459, + 28460, + 28461, + 28462, + 28463, + 28464, + 28465, + 28466, + 28467, + 28468, + 28469, + 28470, + 28471, + 28472, + 28473, + 28474, + 28475, + 28476, + 28477, + 28478, + 28479, + 28480, + 28481, + 28482, + 28483, + 28484, + 28485, + 28486, + 28487, + 28488, + 28489, + 28490, + 28491, + 28492, + 28493, + 28494, + 28495, + 28496, + 28497, + 28498, + 28499, + 28500, + 28501, + 28502, + 28503, + 28504, + 28505, + 28506, + 28507, + 28508, + 28509, + 28510, + 28511, + 28512, + 28513, + 28514, + 28515, + 28516, + 28517, + 28518, + 28519, + 28520, + 28521, + 28522, + 28523, + 28524, + 28525, + 28526, + 28527, + 28528, + 28529, + 28530, + 28531, + 28532, + 28533, + 28534, + 28535, + 28536, + 28537, + 28538, + 28539, + 28540, + 28541, + 28542, + 28543, + 28544, + 28545, + 28546, + 28547, + 28548, + 28549, + 28550, + 28551, + 28552, + 28553, + 28554, + 28555, + 28556, + 28557, + 28558, + 28559, + 28560, + 28561, + 28562, + 28563, + 28564, + 28565, + 28566, + 28567, + 28568, + 28569, + 28570, + 28571, + 28572, + 28573, + 28574, + 28575, + 28576, + 28577, + 28578, + 28579, + 28580, + 28581, + 28582, + 28583, + 28584, + 28585, + 28586, + 28587, + 28588, + 28589, + 28590, + 28591, + 28592, + 28593, + 28594, + 28595, + 28596, + 28597, + 28598, + 28599, + 28600, + 28601, + 28602, + 28603, + 28604, + 28605, + 28606, + 28607, + 28608, + 28609, + 28610, + 28611, + 28612, + 28613, + 28614, + 28615, + 28616, + 28617, + 28618, + 28619, + 28620, + 28621, + 28622, + 28623, + 28624, + 28625, + 28626, + 28627, + 28628, + 28629, + 28630, + 28631, + 28632, + 28633, + 28634, + 28635, + 28636, + 28637, + 28638, + 28639, + 28640, + 28641, + 28642, + 28643, + 28644, + 28645, + 28646, + 28647, + 28648, + 28649, + 28650, + 28651, + 28652, + 28653, + 28654, + 28655, + 28656, + 28657, + 28658, + 28659, + 28660, + 28661, + 28662, + 28663, + 28664, + 28665, + 28666, + 28667, + 28668, + 28669, + 28670, + 28671, + 28672, + 28673, + 28674, + 28675, + 28676, + 28677, + 28678, + 28679, + 28680, + 28681, + 28682, + 28683, + 28684, + 28685, + 28686, + 28687, + 28688, + 28689, + 28690, + 28691, + 28692, + 28693, + 28694, + 28695, + 28696, + 28697, + 28698, + 28699, + 28700, + 28701, + 28702, + 28703, + 28704, + 28705, + 28706, + 28707, + 28708, + 28709, + 28710, + 28711, + 28712, + 28713, + 28714, + 28715, + 28716, + 28717, + 28718, + 28719, + 28720, + 28721, + 28722, + 28723, + 28724, + 28725, + 28726, + 28727, + 28728, + 28729, + 28730, + 28731, + 28732, + 28733, + 28734, + 28735, + 28736, + 28737, + 28738, + 28739, + 28740, + 28741, + 28742, + 28743, + 28744, + 28745, + 28746, + 28747, + 28748, + 28749, + 28750, + 28751, + 28752, + 28753, + 28754, + 28755, + 28756, + 28757, + 28758, + 28759, + 28760, + 28761, + 28762, + 28763, + 28764, + 28765, + 28766, + 28767, + 28768, + 28769, + 28770, + 28771, + 28772, + 28773, + 28774, + 28775, + 28776, + 28777, + 28778, + 28779, + 28780, + 28781, + 28782, + 28783, + 28784, + 28785, + 28786, + 28787, + 28788, + 28789, + 28790, + 28791, + 28792, + 28793, + 28794, + 28795, + 28796, + 28797, + 28798, + 28799, + 28800, + 28801, + 28802, + 28803, + 28804, + 28805, + 28806, + 28807, + 28808, + 28809, + 28810, + 28811, + 28812, + 28813, + 28814, + 28815, + 28816, + 28817, + 28818, + 28819, + 28820, + 28821, + 28822, + 28823, + 28824, + 28825, + 28826, + 28827, + 28828, + 28829, + 28830, + 28831, + 28832, + 28833, + 28834, + 28835, + 28836, + 28837, + 28838, + 28839, + 28840, + 28841, + 28842, + 28843, + 28844, + 28845, + 28846, + 28847, + 28848, + 28849, + 28850, + 28851, + 28852, + 28853, + 28854, + 28855, + 28856, + 28857, + 28858, + 28859, + 28860, + 28861, + 28862, + 28863, + 28864, + 28865, + 28866, + 28867, + 28868, + 28869, + 28870, + 28871, + 28872, + 28873, + 28874, + 28875, + 28876, + 28877, + 28878, + 28879, + 28880, + 28881, + 28882, + 28883, + 28884, + 28885, + 28886, + 28887, + 28888, + 28889, + 28890, + 28891, + 28892, + 28893, + 28894, + 28895, + 28896, + 28897, + 28898, + 28899, + 28900, + 28901, + 28902, + 28903, + 28904, + 28905, + 28906, + 28907, + 28908, + 28909, + 28910, + 28911, + 28912, + 28913, + 28914, + 28915, + 28916, + 28917, + 28918, + 28919, + 28920, + 28921, + 28922, + 28923, + 28924, + 28925, + 28926, + 28927, + 28928, + 28929, + 28930, + 28931, + 28932, + 28933, + 28934, + 28935, + 28936, + 28937, + 28938, + 28939, + 28940, + 28941, + 28942, + 28943, + 28944, + 28945, + 28946, + 28947, + 28948, + 28949, + 28950, + 28951, + 28952, + 28953, + 28954, + 28955, + 28956, + 28957, + 28958, + 28959, + 28960, + 28961, + 28962, + 28963, + 28964, + 28965, + 28966, + 28967, + 28968, + 28969, + 28970, + 28971, + 28972, + 28973, + 28974, + 28975, + 28976, + 28977, + 28978, + 28979, + 28980, + 28981, + 28982, + 28983, + 28984, + 28985, + 28986, + 28987, + 28988, + 28989, + 28990, + 28991, + 28992, + 28993, + 28994, + 28995, + 28996, + 28997, + 28998, + 28999, + 29000, + 29001, + 29002, + 29003, + 29004, + 29005, + 29006, + 29007, + 29008, + 29009, + 29010, + 29011, + 29012, + 29013, + 29014, + 29015, + 29016, + 29017, + 29018, + 29019, + 29020, + 29021, + 29022, + 29023, + 29024, + 29025, + 29026, + 29027, + 29028, + 29029, + 29030, + 29031, + 29032, + 29033, + 29034, + 29035, + 29036, + 29037, + 29038, + 29039, + 29040, + 29041, + 29042, + 29043, + 29044, + 29045, + 29046, + 29047, + 29048, + 29049, + 29050, + 29051, + 29052, + 29053, + 29054, + 29055, + 29056, + 29057, + 29058, + 29059, + 29060, + 29061, + 29062, + 29063, + 29064, + 29065, + 29066, + 29067, + 29068, + 29069, + 29070, + 29071, + 29072, + 29073, + 29074, + 29075, + 29076, + 29077, + 29078, + 29079, + 29080, + 29081, + 29082, + 29083, + 29084, + 29085, + 29086, + 29087, + 29088, + 29089, + 29090, + 29091, + 29092, + 29093, + 29094, + 29095, + 29096, + 29097, + 29098, + 29099, + 29100, + 29101, + 29102, + 29103, + 29104, + 29105, + 29106, + 29107, + 29108, + 29109, + 29110, + 29111, + 29112, + 29113, + 29114, + 29115, + 29116, + 29117, + 29118, + 29119, + 29120, + 29121, + 29122, + 29123, + 29124, + 29125, + 29126, + 29127, + 29128, + 29129, + 29130, + 29131, + 29132, + 29133, + 29134, + 29135, + 29136, + 29137, + 29138, + 29139, + 29140, + 29141, + 29142, + 29143, + 29144, + 29145, + 29146, + 29147, + 29148, + 29149, + 29150, + 29151, + 29152, + 29153, + 29154, + 29155, + 29156, + 29157, + 29158, + 29159, + 29160, + 29161, + 29162, + 29163, + 29164, + 29165, + 29166, + 29167, + 29168, + 29169, + 29170, + 29171, + 29172, + 29173, + 29174, + 29175, + 29176, + 29177, + 29178, + 29179, + 29180, + 29181, + 29182, + 29183, + 29184, + 29185, + 29186, + 29187, + 29188, + 29189, + 29190, + 29191, + 29192, + 29193, + 29194, + 29195, + 29196, + 29197, + 29198, + 29199, + 29200, + 29201, + 29202, + 29203, + 29204, + 29205, + 29206, + 29207, + 29208, + 29209, + 29210, + 29211, + 29212, + 29213, + 29214, + 29215, + 29216, + 29217, + 29218, + 29219, + 29220, + 29221, + 29222, + 29223, + 29224, + 29225, + 29226, + 29227, + 29228, + 29229, + 29230, + 29231, + 29232, + 29233, + 29234, + 29235, + 29236, + 29237, + 29238, + 29239, + 29240, + 29241, + 29242, + 29243, + 29244, + 29245, + 29246, + 29247, + 29248, + 29249, + 29250, + 29251, + 29252, + 29253, + 29254, + 29255, + 29256, + 29257, + 29258, + 29259, + 29260, + 29261, + 29262, + 29263, + 29264, + 29265, + 29266, + 29267, + 29268, + 29269, + 29270, + 29271, + 29272, + 29273, + 29274, + 29275, + 29276, + 29277, + 29278, + 29279, + 29280, + 29281, + 29282, + 29283, + 29284, + 29285, + 29286, + 29287, + 29288, + 29289, + 29290, + 29291, + 29292, + 29293, + 29294, + 29295, + 29296, + 29297, + 29298, + 29299, + 29300, + 29301, + 29302, + 29303, + 29304, + 29305, + 29306, + 29307, + 29308, + 29309, + 29310, + 29311, + 29312, + 29313, + 29314, + 29315, + 29316, + 29317, + 29318, + 29319, + 29320, + 29321, + 29322, + 29323, + 29324, + 29325, + 29326, + 29327, + 29328, + 29329, + 29330, + 29331, + 29332, + 29333, + 29334, + 29335, + 29336, + 29337, + 29338, + 29339, + 29340, + 29341, + 29342, + 29343, + 29344, + 29345, + 29346, + 29347, + 29348, + 29349, + 29350, + 29351, + 29352, + 29353, + 29354, + 29355, + 29356, + 29357, + 29358, + 29359, + 29360, + 29361, + 29362, + 29363, + 29364, + 29365, + 29366, + 29367, + 29368, + 29369, + 29370, + 29371, + 29372, + 29373, + 29374, + 29375, + 29376, + 29377, + 29378, + 29379, + 29380, + 29381, + 29382, + 29383, + 29384, + 29385, + 29386, + 29387, + 29388, + 29389, + 29390, + 29391, + 29392, + 29393, + 29394, + 29395, + 29396, + 29397, + 29398, + 29399, + 29400, + 29401, + 29402, + 29403, + 29404, + 29405, + 29406, + 29407, + 29408, + 29409, + 29410, + 29411, + 29412, + 29413, + 29414, + 29415, + 29416, + 29417, + 29418, + 29419, + 29420, + 29421, + 29422, + 29423, + 29424, + 29425, + 29426, + 29427, + 29428, + 29429, + 29430, + 29431, + 29432, + 29433, + 29434, + 29435, + 29436, + 29437, + 29438, + 29439, + 29440, + 29441, + 29442, + 29443, + 29444, + 29445, + 29446, + 29447, + 29448, + 29449, + 29450, + 29451, + 29452, + 29453, + 29454, + 29455, + 29456, + 29457, + 29458, + 29459, + 29460, + 29461, + 29462, + 29463, + 29464, + 29465, + 29466, + 29467, + 29468, + 29469, + 29470, + 29471, + 29472, + 29473, + 29474, + 29475, + 29476, + 29477, + 29478, + 29479, + 29480, + 29481, + 29482, + 29483, + 29484, + 29485, + 29486, + 29487, + 29488, + 29489, + 29490, + 29491, + 29492, + 29493, + 29494, + 29495, + 29496, + 29497, + 29498, + 29499, + 29500, + 29501, + 29502, + 29503, + 29504, + 29505, + 29506, + 29507, + 29508, + 29509, + 29510, + 29511, + 29512, + 29513, + 29514, + 29515, + 29516, + 29517, + 29518, + 29519, + 29520, + 29521, + 29522, + 29523, + 29524, + 29525, + 29526, + 29527, + 29528, + 29529, + 29530, + 29531, + 29532, + 29533, + 29534, + 29535, + 29536, + 29537, + 29538, + 29539, + 29540, + 29541, + 29542, + 29543, + 29544, + 29545, + 29546, + 29547, + 29548, + 29549, + 29550, + 29551, + 29552, + 29553, + 29554, + 29555, + 29556, + 29557, + 29558, + 29559, + 29560, + 29561, + 29562, + 29563, + 29564, + 29565, + 29566, + 29567, + 29568, + 29569, + 29570, + 29571, + 29572, + 29573, + 29574, + 29575, + 29576, + 29577, + 29578, + 29579, + 29580, + 29581, + 29582, + 29583, + 29584, + 29585, + 29586, + 29587, + 29588, + 29589, + 29590, + 29591, + 29592, + 29593, + 29594, + 29595, + 29596, + 29597, + 29598, + 29599, + 29600, + 29601, + 29602, + 29603, + 29604, + 29605, + 29606, + 29607, + 29608, + 29609, + 29610, + 29611, + 29612, + 29613, + 29614, + 29615, + 29616, + 29617, + 29618, + 29619, + 29620, + 29621, + 29622, + 29623, + 29624, + 29625, + 29626, + 29627, + 29628, + 29629, + 29630, + 29631, + 29632, + 29633, + 29634, + 29635, + 29636, + 29637, + 29638, + 29639, + 29640, + 29641, + 29642, + 29643, + 29644, + 29645, + 29646, + 29647, + 29648, + 29649, + 29650, + 29651, + 29652, + 29653, + 29654, + 29655, + 29656, + 29657, + 29658, + 29659, + 29660, + 29661, + 29662, + 29663, + 29664, + 29665, + 29666, + 29667, + 29668, + 29669, + 29670, + 29671, + 29672, + 29673, + 29674, + 29675, + 29676, + 29677, + 29678, + 29679, + 29680, + 29681, + 29682, + 29683, + 29684, + 29685, + 29686, + 29687, + 29688, + 29689, + 29690, + 29691, + 29692, + 29693, + 29694, + 29695, + 29696, + 29697, + 29698, + 29699, + 29700, + 29701, + 29702, + 29703, + 29704, + 29705, + 29706, + 29707, + 29708, + 29709, + 29710, + 29711, + 29712, + 29713, + 29714, + 29715, + 29716, + 29717, + 29718, + 29719, + 29720, + 29721, + 29722, + 29723, + 29724, + 29725, + 29726, + 29727, + 29728, + 29729, + 29730, + 29731, + 29732, + 29733, + 29734, + 29735, + 29736, + 29737, + 29738, + 29739, + 29740, + 29741, + 29742, + 29743, + 29744, + 29745, + 29746, + 29747, + 29748, + 29749, + 29750, + 29751, + 29752, + 29753, + 29754, + 29755, + 29756, + 29757, + 29758, + 29759, + 29760, + 29761, + 29762, + 29763, + 29764, + 29765, + 29766, + 29767, + 29768, + 29769, + 29770, + 29771, + 29772, + 29773, + 29774, + 29775, + 29776, + 29777, + 29778, + 29779, + 29780, + 29781, + 29782, + 29783, + 29784, + 29785, + 29786, + 29787, + 29788, + 29789, + 29790, + 29791, + 29792, + 29793, + 29794, + 29795, + 29796, + 29797, + 29798, + 29799, + 29800, + 29801, + 29802, + 29803, + 29804, + 29805, + 29806, + 29807, + 29808, + 29809, + 29810, + 29811, + 29812, + 29813, + 29814, + 29815, + 29816, + 29817, + 29818, + 29819, + 29820, + 29821, + 29822, + 29823, + 29824, + 29825, + 29826, + 29827, + 29828, + 29829, + 29830, + 29831, + 29832, + 29833, + 29834, + 29835, + 29836, + 29837, + 29838, + 29839, + 29840, + 29841, + 29842, + 29843, + 29844, + 29845, + 29846, + 29847, + 29848, + 29849, + 29850, + 29851, + 29852, + 29853, + 29854, + 29855, + 29856, + 29857, + 29858, + 29859, + 29860, + 29861, + 29862, + 29863, + 29864, + 29865, + 29866, + 29867, + 29868, + 29869, + 29870, + 29871, + 29872, + 29873, + 29874, + 29875, + 29876, + 29877, + 29878, + 29879, + 29880, + 29881, + 29882, + 29883, + 29884, + 29885, + 29886, + 29887, + 29888, + 29889, + 29890, + 29891, + 29892, + 29893, + 29894, + 29895, + 29896, + 29897, + 29898, + 29899, + 29900, + 29901, + 29902, + 29903, + 29904, + 29905, + 29906, + 29907, + 29908, + 29909, + 29910, + 29911, + 29912, + 29913, + 29914, + 29915, + 29916, + 29917, + 29918, + 29919, + 29920, + 29921, + 29922, + 29923, + 29924, + 29925, + 29926, + 29927, + 29928, + 29929, + 29930, + 29931, + 29932, + 29933, + 29934, + 29935, + 29936, + 29937, + 29938, + 29939, + 29940, + 29941, + 29942, + 29943, + 29944, + 29945, + 29946, + 29947, + 29948, + 29949, + 29950, + 29951, + 29952, + 29953, + 29954, + 29955, + 29956, + 29957, + 29958, + 29959, + 29960, + 29961, + 29962, + 29963, + 29964, + 29965, + 29966, + 29967, + 29968, + 29969, + 29970, + 29971, + 29972, + 29973, + 29974, + 29975, + 29976, + 29977, + 29978, + 29979, + 29980, + 29981, + 29982, + 29983, + 29984, + 29985, + 29986, + 29987, + 29988, + 29989, + 29990, + 29991, + 29992, + 29993, + 29994, + 29995, + 29996, + 29997, + 29998, + 29999, + 30000, + 30001, + 30002, + 30003, + 30004, + 30005, + 30006, + 30007, + 30008, + 30009, + 30010, + 30011, + 30012, + 30013, + 30014, + 30015, + 30016, + 30017, + 30018, + 30019, + 30020, + 30021, + 30022, + 30023, + 30024, + 30025, + 30026, + 30027, + 30028, + 30029, + 30030, + 30031, + 30032, + 30033, + 30034, + 30035, + 30036, + 30037, + 30038, + 30039, + 30040, + 30041, + 30042, + 30043, + 30044, + 30045, + 30046, + 30047, + 30048, + 30049, + 30050, + 30051, + 30052, + 30053, + 30054, + 30055, + 30056, + 30057, + 30058, + 30059, + 30060, + 30061, + 30062, + 30063, + 30064, + 30065, + 30066, + 30067, + 30068, + 30069, + 30070, + 30071, + 30072, + 30073, + 30074, + 30075, + 30076, + 30077, + 30078, + 30079, + 30080, + 30081, + 30082, + 30083, + 30084, + 30085, + 30086, + 30087, + 30088, + 30089, + 30090, + 30091, + 30092, + 30093, + 30094, + 30095, + 30096, + 30097, + 30098, + 30099, + 30100, + 30101, + 30102, + 30103, + 30104, + 30105, + 30106, + 30107, + 30108, + 30109, + 30110, + 30111, + 30112, + 30113, + 30114, + 30115, + 30116, + 30117, + 30118, + 30119, + 30120, + 30121, + 30122, + 30123, + 30124, + 30125, + 30126, + 30127, + 30128, + 30129, + 30130, + 30131, + 30132, + 30133, + 30134, + 30135, + 30136, + 30137, + 30138, + 30139, + 30140, + 30141, + 30142, + 30143, + 30144, + 30145, + 30146, + 30147, + 30148, + 30149, + 30150, + 30151, + 30152, + 30153, + 30154, + 30155, + 30156, + 30157, + 30158, + 30159, + 30160, + 30161, + 30162, + 30163, + 30164, + 30165, + 30166, + 30167, + 30168, + 30169, + 30170, + 30171, + 30172, + 30173, + 30174, + 30175, + 30176, + 30177, + 30178, + 30179, + 30180, + 30181, + 30182, + 30183, + 30184, + 30185, + 30186, + 30187, + 30188, + 30189, + 30190, + 30191, + 30192, + 30193, + 30194, + 30195, + 30196, + 30197, + 30198, + 30199, + 30200, + 30201, + 30202, + 30203, + 30204, + 30205, + 30206, + 30207, + 30208, + 30209, + 30210, + 30211, + 30212, + 30213, + 30214, + 30215, + 30216, + 30217, + 30218, + 30219, + 30220, + 30221, + 30222, + 30223, + 30224, + 30225, + 30226, + 30227, + 30228, + 30229, + 30230, + 30231, + 30232, + 30233, + 30234, + 30235, + 30236, + 30237, + 30238, + 30239, + 30240, + 30241, + 30242, + 30243, + 30244, + 30245, + 30246, + 30247, + 30248, + 30249, + 30250, + 30251, + 30252, + 30253, + 30254, + 30255, + 30256, + 30257, + 30258, + 30259, + 30260, + 30261, + 30262, + 30263, + 30264, + 30265, + 30266, + 30267, + 30268, + 30269, + 30270, + 30271, + 30272, + 30273, + 30274, + 30275, + 30276, + 30277, + 30278, + 30279, + 30280, + 30281, + 30282, + 30283, + 30284, + 30285, + 30286, + 30287, + 30288, + 30289, + 30290, + 30291, + 30292, + 30293, + 30294, + 30295, + 30296, + 30297, + 30298, + 30299, + 30300, + 30301, + 30302, + 30303, + 30304, + 30305, + 30306, + 30307, + 30308, + 30309, + 30310, + 30311, + 30312, + 30313, + 30314, + 30315, + 30316, + 30317, + 30318, + 30319, + 30320, + 30321, + 30322, + 30323, + 30324, + 30325, + 30326, + 30327, + 30328, + 30329, + 30330, + 30331, + 30332, + 30333, + 30334, + 30335, + 30336, + 30337, + 30338, + 30339, + 30340, + 30341, + 30342, + 30343, + 30344, + 30345, + 30346, + 30347, + 30348, + 30349, + 30350, + 30351, + 30352, + 30353, + 30354, + 30355, + 30356, + 30357, + 30358, + 30359, + 30360, + 30361, + 30362, + 30363, + 30364, + 30365, + 30366, + 30367, + 30368, + 30369, + 30370, + 30371, + 30372, + 30373, + 30374, + 30375, + 30376, + 30377, + 30378, + 30379, + 30380, + 30381, + 30382, + 30383, + 30384, + 30385, + 30386, + 30387, + 30388, + 30389, + 30390, + 30391, + 30392, + 30393, + 30394, + 30395, + 30396, + 30397, + 30398, + 30399, + 30400, + 30401, + 30402, + 30403, + 30404, + 30405, + 30406, + 30407, + 30408, + 30409, + 30410, + 30411, + 30412, + 30413, + 30414, + 30415, + 30416, + 30417, + 30418, + 30419, + 30420, + 30421, + 30422, + 30423, + 30424, + 30425, + 30426, + 30427, + 30428, + 30429, + 30430, + 30431, + 30432, + 30433, + 30434, + 30435, + 30436, + 30437, + 30438, + 30439, + 30440, + 30441, + 30442, + 30443, + 30444, + 30445, + 30446, + 30447, + 30448, + 30449, + 30450, + 30451, + 30452, + 30453, + 30454, + 30455, + 30456, + 30457, + 30458, + 30459, + 30460, + 30461, + 30462, + 30463, + 30464, + 30465, + 30466, + 30467, + 30468, + 30469, + 30470, + 30471, + 30472, + 30473, + 30474, + 30475, + 30476, + 30477, + 30478, + 30479, + 30480, + 30481, + 30482, + 30483, + 30484, + 30485, + 30486, + 30487, + 30488, + 30489, + 30490, + 30491, + 30492, + 30493, + 30494, + 30495, + 30496, + 30497, + 30498, + 30499, + 30500, + 30501, + 30502, + 30503, + 30504, + 30505, + 30506, + 30507, + 30508, + 30509, + 30510, + 30511, + 30512, + 30513, + 30514, + 30515, + 30516, + 30517, + 30518, + 30519, + 30520, + 30521, + 30522, + 30523, + 30524, + 30525, + 30526, + 30527, + 30528, + 30529, + 30530, + 30531, + 30532, + 30533, + 30534, + 30535, + 30536, + 30537, + 30538, + 30539, + 30540, + 30541, + 30542, + 30543, + 30544, + 30545, + 30546, + 30547, + 30548, + 30549, + 30550, + 30551, + 30552, + 30553, + 30554, + 30555, + 30556, + 30557, + 30558, + 30559, + 30560, + 30561, + 30562, + 30563, + 30564, + 30565, + 30566, + 30567, + 30568, + 30569, + 30570, + 30571, + 30572, + 30573, + 30574, + 30575, + 30576, + 30577, + 30578, + 30579, + 30580, + 30581, + 30582, + 30583, + 30584, + 30585, + 30586, + 30587, + 30588, + 30589, + 30590, + 30591, + 30592, + 30593, + 30594, + 30595, + 30596, + 30597, + 30598, + 30599, + 30600, + 30601, + 30602, + 30603, + 30604, + 30605, + 30606, + 30607, + 30608, + 30609, + 30610, + 30611, + 30612, + 30613, + 30614, + 30615, + 30616, + 30617, + 30618, + 30619, + 30620, + 30621, + 30622, + 30623, + 30624, + 30625, + 30626, + 30627, + 30628, + 30629, + 30630, + 30631, + 30632, + 30633, + 30634, + 30635, + 30636, + 30637, + 30638, + 30639, + 30640, + 30641, + 30642, + 30643, + 30644, + 30645, + 30646, + 30647, + 30648, + 30649, + 30650, + 30651, + 30652, + 30653, + 30654, + 30655, + 30656, + 30657, + 30658, + 30659, + 30660, + 30661, + 30662, + 30663, + 30664, + 30665, + 30666, + 30667, + 30668, + 30669, + 30670, + 30671, + 30672, + 30673, + 30674, + 30675, + 30676, + 30677, + 30678, + 30679, + 30680, + 30681, + 30682, + 30683, + 30684, + 30685, + 30686, + 30687, + 30688, + 30689, + 30690, + 30691, + 30692, + 30693, + 30694, + 30695, + 30696, + 30697, + 30698, + 30699, + 30700, + 30701, + 30702, + 30703, + 30704, + 30705, + 30706, + 30707, + 30708, + 30709, + 30710, + 30711, + 30712, + 30713, + 30714, + 30715, + 30716, + 30717, + 30718, + 30719, + 30720, + 30721, + 30722, + 30723, + 30724, + 30725, + 30726, + 30727, + 30728, + 30729, + 30730, + 30731, + 30732, + 30733, + 30734, + 30735, + 30736, + 30737, + 30738, + 30739, + 30740, + 30741, + 30742, + 30743, + 30744, + 30745, + 30746, + 30747, + 30748, + 30749, + 30750, + 30751, + 30752, + 30753, + 30754, + 30755, + 30756, + 30757, + 30758, + 30759, + 30760, + 30761, + 30762, + 30763, + 30764, + 30765, + 30766, + 30767, + 30768, + 30769, + 30770, + 30771, + 30772, + 30773, + 30774, + 30775, + 30776, + 30777, + 30778, + 30779, + 30780, + 30781, + 30782, + 30783, + 30784, + 30785, + 30786, + 30787, + 30788, + 30789, + 30790, + 30791, + 30792, + 30793, + 30794, + 30795, + 30796, + 30797, + 30798, + 30799, + 30800, + 30801, + 30802, + 30803, + 30804, + 30805, + 30806, + 30807, + 30808, + 30809, + 30810, + 30811, + 30812, + 30813, + 30814, + 30815, + 30816, + 30817, + 30818, + 30819, + 30820, + 30821, + 30822, + 30823, + 30824, + 30825, + 30826, + 30827, + 30828, + 30829, + 30830, + 30831, + 30832, + 30833, + 30834, + 30835, + 30836, + 30837, + 30838, + 30839, + 30840, + 30841, + 30842, + 30843, + 30844, + 30845, + 30846, + 30847, + 30848, + 30849, + 30850, + 30851, + 30852, + 30853, + 30854, + 30855, + 30856, + 30857, + 30858, + 30859, + 30860, + 30861, + 30862, + 30863, + 30864, + 30865, + 30866, + 30867, + 30868, + 30869, + 30870, + 30871, + 30872, + 30873, + 30874, + 30875, + 30876, + 30877, + 30878, + 30879, + 30880, + 30881, + 30882, + 30883, + 30884, + 30885, + 30886, + 30887, + 30888, + 30889, + 30890, + 30891, + 30892, + 30893, + 30894, + 30895, + 30896, + 30897, + 30898, + 30899, + 30900, + 30901, + 30902, + 30903, + 30904, + 30905, + 30906, + 30907, + 30908, + 30909, + 30910, + 30911, + 30912, + 30913, + 30914, + 30915, + 30916, + 30917, + 30918, + 30919, + 30920, + 30921, + 30922, + 30923, + 30924, + 30925, + 30926, + 30927, + 30928, + 30929, + 30930, + 30931, + 30932, + 30933, + 30934, + 30935, + 30936, + 30937, + 30938, + 30939, + 30940, + 30941, + 30942, + 30943, + 30944, + 30945, + 30946, + 30947, + 30948, + 30949, + 30950, + 30951, + 30952, + 30953, + 30954, + 30955, + 30956, + 30957, + 30958, + 30959, + 30960, + 30961, + 30962, + 30963, + 30964, + 30965, + 30966, + 30967, + 30968, + 30969, + 30970, + 30971, + 30972, + 30973, + 30974, + 30975, + 30976, + 30977, + 30978, + 30979, + 30980, + 30981, + 30982, + 30983, + 30984, + 30985, + 30986, + 30987, + 30988, + 30989, + 30990, + 30991, + 30992, + 30993, + 30994, + 30995, + 30996, + 30997, + 30998, + 30999, + 31000, + 31001, + 31002, + 31003, + 31004, + 31005, + 31006, + 31007, + 31008, + 31009, + 31010, + 31011, + 31012, + 31013, + 31014, + 31015, + 31016, + 31017, + 31018, + 31019, + 31020, + 31021, + 31022, + 31023, + 31024, + 31025, + 31026, + 31027, + 31028, + 31029, + 31030, + 31031, + 31032, + 31033, + 31034, + 31035, + 31036, + 31037, + 31038, + 31039, + 31040, + 31041, + 31042, + 31043, + 31044, + 31045, + 31046, + 31047, + 31048, + 31049, + 31050, + 31051, + 31052, + 31053, + 31054, + 31055, + 31056, + 31057, + 31058, + 31059, + 31060, + 31061, + 31062, + 31063, + 31064, + 31065, + 31066, + 31067, + 31068, + 31069, + 31070, + 31071, + 31072, + 31073, + 31074, + 31075, + 31076, + 31077, + 31078, + 31079, + 31080, + 31081, + 31082, + 31083, + 31084, + 31085, + 31086, + 31087, + 31088, + 31089, + 31090, + 31091, + 31092, + 31093, + 31094, + 31095, + 31096, + 31097, + 31098, + 31099, + 31100, + 31101, + 31102, + 31103, + 31104, + 31105, + 31106, + 31107, + 31108, + 31109, + 31110, + 31111, + 31112, + 31113, + 31114, + 31115, + 31116, + 31117, + 31118, + 31119, + 31120, + 31121, + 31122, + 31123, + 31124, + 31125, + 31126, + 31127, + 31128, + 31129, + 31130, + 31131, + 31132, + 31133, + 31134, + 31135, + 31136, + 31137, + 31138, + 31139, + 31140, + 31141, + 31142, + 31143, + 31144, + 31145, + 31146, + 31147, + 31148, + 31149, + 31150, + 31151, + 31152, + 31153, + 31154, + 31155, + 31156, + 31157, + 31158, + 31159, + 31160, + 31161, + 31162, + 31163, + 31164, + 31165, + 31166, + 31167, + 31168, + 31169, + 31170, + 31171, + 31172, + 31173, + 31174, + 31175, + 31176, + 31177, + 31178, + 31179, + 31180, + 31181, + 31182, + 31183, + 31184, + 31185, + 31186, + 31187, + 31188, + 31189, + 31190, + 31191, + 31192, + 31193, + 31194, + 31195, + 31196, + 31197, + 31198, + 31199, + 31200, + 31201, + 31202, + 31203, + 31204, + 31205, + 31206, + 31207, + 31208, + 31209, + 31210, + 31211, + 31212, + 31213, + 31214, + 31215, + 31216, + 31217, + 31218, + 31219, + 31220, + 31221, + 31222, + 31223, + 31224, + 31225, + 31226, + 31227, + 31228, + 31229, + 31230, + 31231, + 31232, + 31233, + 31234, + 31235, + 31236, + 31237, + 31238, + 31239, + 31240, + 31241, + 31242, + 31243, + 31244, + 31245, + 31246, + 31247, + 31248, + 31249, + 31250, + 31251, + 31252, + 31253, + 31254, + 31255, + 31256, + 31257, + 31258, + 31259, + 31260, + 31261, + 31262, + 31263, + 31264, + 31265, + 31266, + 31267, + 31268, + 31269, + 31270, + 31271, + 31272, + 31273, + 31274, + 31275, + 31276, + 31277, + 31278, + 31279, + 31280, + 31281, + 31282, + 31283, + 31284, + 31285, + 31286, + 31287, + 31288, + 31289, + 31290, + 31291, + 31292, + 31293, + 31294, + 31295, + 31296, + 31297, + 31298, + 31299, + 31300, + 31301, + 31302, + 31303, + 31304, + 31305, + 31306, + 31307, + 31308, + 31309, + 31310, + 31311, + 31312, + 31313, + 31314, + 31315, + 31316, + 31317, + 31318, + 31319, + 31320, + 31321, + 31322, + 31323, + 31324, + 31325, + 31326, + 31327, + 31328, + 31329, + 31330, + 31331, + 31332, + 31333, + 31334, + 31335, + 31336, + 31337, + 31338, + 31339, + 31340, + 31341, + 31342, + 31343, + 31344, + 31345, + 31346, + 31347, + 31348, + 31349, + 31350, + 31351, + 31352, + 31353, + 31354, + 31355, + 31356, + 31357, + 31358, + 31359, + 31360, + 31361, + 31362, + 31363, + 31364, + 31365, + 31366, + 31367, + 31368, + 31369, + 31370, + 31371, + 31372, + 31373, + 31374, + 31375, + 31376, + 31377, + 31378, + 31379, + 31380, + 31381, + 31382, + 31383, + 31384, + 31385, + 31386, + 31387, + 31388, + 31389, + 31390, + 31391, + 31392, + 31393, + 31394, + 31395, + 31396, + 31397, + 31398, + 31399, + 31400, + 31401, + 31402, + 31403, + 31404, + 31405, + 31406, + 31407, + 31408, + 31409, + 31410, + 31411, + 31412, + 31413, + 31414, + 31415, + 31416, + 31417, + 31418, + 31419, + 31420, + 31421, + 31422, + 31423, + 31424, + 31425, + 31426, + 31427, + 31428, + 31429, + 31430, + 31431, + 31432, + 31433, + 31434, + 31435, + 31436, + 31437, + 31438, + 31439, + 31440, + 31441, + 31442, + 31443, + 31444, + 31445, + 31446, + 31447, + 31448, + 31449, + 31450, + 31451, + 31452, + 31453, + 31454, + 31455, + 31456, + 31457, + 31458, + 31459, + 31460, + 31461, + 31462, + 31463, + 31464, + 31465, + 31466, + 31467, + 31468, + 31469, + 31470, + 31471, + 31472, + 31473, + 31474, + 31475, + 31476, + 31477, + 31478, + 31479, + 31480, + 31481, + 31482, + 31483, + 31484, + 31485, + 31486, + 31487, + 31488, + 31489, + 31490, + 31491, + 31492, + 31493, + 31494, + 31495, + 31496, + 31497, + 31498, + 31499, + 31500, + 31501, + 31502, + 31503, + 31504, + 31505, + 31506, + 31507, + 31508, + 31509, + 31510, + 31511, + 31512, + 31513, + 31514, + 31515, + 31516, + 31517, + 31518, + 31519, + 31520, + 31521, + 31522, + 31523, + 31524, + 31525, + 31526, + 31527, + 31528, + 31529, + 31530, + 31531, + 31532, + 31533, + 31534, + 31535, + 31536, + 31537, + 31538, + 31539, + 31540, + 31541, + 31542, + 31543, + 31544, + 31545, + 31546, + 31547, + 31548, + 31549, + 31550, + 31551, + 31552, + 31553, + 31554, + 31555, + 31556, + 31557, + 31558, + 31559, + 31560, + 31561, + 31562, + 31563, + 31564, + 31565, + 31566, + 31567, + 31568, + 31569, + 31570, + 31571, + 31572, + 31573, + 31574, + 31575, + 31576, + 31577, + 31578, + 31579, + 31580, + 31581, + 31582, + 31583, + 31584, + 31585, + 31586, + 31587, + 31588, + 31589, + 31590, + 31591, + 31592, + 31593, + 31594, + 31595, + 31596, + 31597, + 31598, + 31599, + 31600, + 31601, + 31602, + 31603, + 31604, + 31605, + 31606, + 31607, + 31608, + 31609, + 31610, + 31611, + 31612, + 31613, + 31614, + 31615, + 31616, + 31617, + 31618, + 31619, + 31620, + 31621, + 31622, + 31623, + 31624, + 31625, + 31626, + 31627, + 31628, + 31629, + 31630, + 31631, + 31632, + 31633, + 31634, + 31635, + 31636, + 31637, + 31638, + 31639, + 31640, + 31641, + 31642, + 31643, + 31644, + 31645, + 31646, + 31647, + 31648, + 31649, + 31650, + 31651, + 31652, + 31653, + 31654, + 31655, + 31656, + 31657, + 31658, + 31659, + 31660, + 31661, + 31662, + 31663, + 31664, + 31665, + 31666, + 31667, + 31668, + 31669, + 31670, + 31671, + 31672, + 31673, + 31674, + 31675, + 31676, + 31677, + 31678, + 31679, + 31680, + 31681, + 31682, + 31683, + 31684, + 31685, + 31686, + 31687, + 31688, + 31689, + 31690, + 31691, + 31692, + 31693, + 31694, + 31695, + 31696, + 31697, + 31698, + 31699, + 31700, + 31701, + 31702, + 31703, + 31704, + 31705, + 31706, + 31707, + 31708, + 31709, + 31710, + 31711, + 31712, + 31713, + 31714, + 31715, + 31716, + 31717, + 31718, + 31719, + 31720, + 31721, + 31722, + 31723, + 31724, + 31725, + 31726, + 31727, + 31728, + 31729, + 31730, + 31731, + 31732, + 31733, + 31734, + 31735, + 31736, + 31737, + 31738, + 31739, + 31740, + 31741, + 31742, + 31743, + 31744, + 31745, + 31746, + 31747, + 31748, + 31749, + 31750, + 31751, + 31752, + 31753, + 31754, + 31755, + 31756, + 31757, + 31758, + 31759, + 31760, + 31761, + 31762, + 31763, + 31764, + 31765, + 31766, + 31767, + 31768, + 31769, + 31770, + 31771, + 31772, + 31773, + 31774, + 31775, + 31776, + 31777, + 31778, + 31779, + 31780, + 31781, + 31782, + 31783, + 31784, + 31785, + 31786, + 31787, + 31788, + 31789, + 31790, + 31791, + 31792, + 31793, + 31794, + 31795, + 31796, + 31797, + 31798, + 31799, + 31800, + 31801, + 31802, + 31803, + 31804, + 31805, + 31806, + 31807, + 31808, + 31809, + 31810, + 31811, + 31812, + 31813, + 31814, + 31815, + 31816, + 31817, + 31818, + 31819, + 31820, + 31821, + 31822, + 31823, + 31824, + 31825, + 31826, + 31827, + 31828, + 31829, + 31830, + 31831, + 31832, + 31833, + 31834, + 31835, + 31836, + 31837, + 31838, + 31839, + 31840, + 31841, + 31842, + 31843, + 31844, + 31845, + 31846, + 31847, + 31848, + 31849, + 31850, + 31851, + 31852, + 31853, + 31854, + 31855, + 31856, + 31857, + 31858, + 31859, + 31860, + 31861, + 31862, + 31863, + 31864, + 31865, + 31866, + 31867, + 31868, + 31869, + 31870, + 31871, + 31872, + 31873, + 31874, + 31875, + 31876, + 31877, + 31878, + 31879, + 31880, + 31881, + 31882, + 31883, + 31884, + 31885, + 31886, + 31887, + 31888, + 31889, + 31890, + 31891, + 31892, + 31893, + 31894, + 31895, + 31896, + 31897, + 31898, + 31899, + 31900, + 31901, + 31902, + 31903, + 31904, + 31905, + 31906, + 31907, + 31908, + 31909, + 31910, + 31911, + 31912, + 31913, + 31914, + 31915, + 31916, + 31917, + 31918, + 31919, + 31920, + 31921, + 31922, + 31923, + 31924, + 31925, + 31926, + 31927, + 31928, + 31929, + 31930, + 31931, + 31932, + 31933, + 31934, + 31935, + 31936, + 31937, + 31938, + 31939, + 31940, + 31941, + 31942, + 31943, + 31944, + 31945, + 31946, + 31947, + 31948, + 31949, + 31950, + 31951, + 31952, + 31953, + 31954, + 31955, + 31956, + 31957, + 31958, + 31959, + 31960, + 31961, + 31962, + 31963, + 31964, + 31965, + 31966, + 31967, + 31968, + 31969, + 31970, + 31971, + 31972, + 31973, + 31974, + 31975, + 31976, + 31977, + 31978, + 31979, + 31980, + 31981, + 31982, + 31983, + 31984, + 31985, + 31986, + 31987, + 31988, + 31989, + 31990, + 31991, + 31992, + 31993, + 31994, + 31995, + 31996, + 31997, + 31998, + 31999, + 32000, + 32001, + 32002, + 32003, + 32004, + 32005, + 32006, + 32007, + 32008, + 32009, + 32010, + 32011, + 32012, + 32013, + 32014, + 32015, + 32016, + 32017, + 32018, + 32019, + 32020, + 32021, + 32022, + 32023, + 32024, + 32025, + 32026, + 32027, + 32028, + 32029, + 32030, + 32031, + 32032, + 32033, + 32034, + 32035, + 32036, + 32037, + 32038, + 32039, + 32040, + 32041, + 32042, + 32043, + 32044, + 32045, + 32046, + 32047, + 32048, + 32049, + 32050, + 32051, + 32052, + 32053, + 32054, + 32055, + 32056, + 32057, + 32058, + 32059, + 32060, + 32061, + 32062, + 32063, + 32064, + 32065, + 32066, + 32067, + 32068, + 32069, + 32070, + 32071, + 32072, + 32073, + 32074, + 32075, + 32076, + 32077, + 32078, + 32079, + 32080, + 32081, + 32082, + 32083, + 32084, + 32085, + 32086, + 32087, + 32088, + 32089, + 32090, + 32091, + 32092, + 32093, + 32094, + 32095, + 32096, + 32097, + 32098, + 32099, + 32100, + 32101, + 32102, + 32103, + 32104, + 32105, + 32106, + 32107, + 32108, + 32109, + 32110, + 32111, + 32112, + 32113, + 32114, + 32115, + 32116, + 32117, + 32118, + 32119, + 32120, + 32121, + 32122, + 32123, + 32124, + 32125, + 32126, + 32127, + 32128, + 32129, + 32130, + 32131, + 32132, + 32133, + 32134, + 32135, + 32136, + 32137, + 32138, + 32139, + 32140, + 32141, + 32142, + 32143, + 32144, + 32145, + 32146, + 32147, + 32148, + 32149, + 32150, + 32151, + 32152, + 32153, + 32154, + 32155, + 32156, + 32157, + 32158, + 32159, + 32160, + 32161, + 32162, + 32163, + 32164, + 32165, + 32166, + 32167, + 32168, + 32169, + 32170, + 32171, + 32172, + 32173, + 32174, + 32175, + 32176, + 32177, + 32178, + 32179, + 32180, + 32181, + 32182, + 32183, + 32184, + 32185, + 32186, + 32187, + 32188, + 32189, + 32190, + 32191, + 32192, + 32193, + 32194, + 32195, + 32196, + 32197, + 32198, + 32199, + 32200, + 32201, + 32202, + 32203, + 32204, + 32205, + 32206, + 32207, + 32208, + 32209, + 32210, + 32211, + 32212, + 32213, + 32214, + 32215, + 32216, + 32217, + 32218, + 32219, + 32220, + 32221, + 32222, + 32223, + 32224, + 32225, + 32226, + 32227, + 32228, + 32229, + 32230, + 32231, + 32232, + 32233, + 32234, + 32235, + 32236, + 32237, + 32238, + 32239, + 32240, + 32241, + 32242, + 32243, + 32244, + 32245, + 32246, + 32247, + 32248, + 32249, + 32250, + 32251, + 32252, + 32253, + 32254, + 32255, + 32256, + 32257, + 32258, + 32259, + 32260, + 32261, + 32262, + 32263, + 32264, + 32265, + 32266, + 32267, + 32268, + 32269, + 32270, + 32271, + 32272, + 32273, + 32274, + 32275, + 32276, + 32277, + 32278, + 32279, + 32280, + 32281, + 32282, + 32283, + 32284, + 32285, + 32286, + 32287, + 32288, + 32289, + 32290, + 32291, + 32292, + 32293, + 32294, + 32295, + 32296, + 32297, + 32298, + 32299, + 32300, + 32301, + 32302, + 32303, + 32304, + 32305, + 32306, + 32307, + 32308, + 32309, + 32310, + 32311, + 32312, + 32313, + 32314, + 32315, + 32316, + 32317, + 32318, + 32319, + 32320, + 32321, + 32322, + 32323, + 32324, + 32325, + 32326, + 32327, + 32328, + 32329, + 32330, + 32331, + 32332, + 32333, + 32334, + 32335, + 32336, + 32337, + 32338, + 32339, + 32340, + 32341, + 32342, + 32343, + 32344, + 32345, + 32346, + 32347, + 32348, + 32349, + 32350, + 32351, + 32352, + 32353, + 32354, + 32355, + 32356, + 32357, + 32358, + 32359, + 32360, + 32361, + 32362, + 32363, + 32364, + 32365, + 32366, + 32367, + 32368, + 32369, + 32370, + 32371, + 32372, + 32373, + 32374, + 32375, + 32376, + 32377, + 32378, + 32379, + 32380, + 32381, + 32382, + 32383, + 32384, + 32385, + 32386, + 32387, + 32388, + 32389, + 32390, + 32391, + 32392, + 32393, + 32394, + 32395, + 32396, + 32397, + 32398, + 32399, + 32400, + 32401, + 32402, + 32403, + 32404, + 32405, + 32406, + 32407, + 32408, + 32409, + 32410, + 32411, + 32412, + 32413, + 32414, + 32415, + 32416, + 32417, + 32418, + 32419, + 32420, + 32421, + 32422, + 32423, + 32424, + 32425, + 32426, + 32427, + 32428, + 32429, + 32430, + 32431, + 32432, + 32433, + 32434, + 32435, + 32436, + 32437, + 32438, + 32439, + 32440, + 32441, + 32442, + 32443, + 32444, + 32445, + 32446, + 32447, + 32448, + 32449, + 32450, + 32451, + 32452, + 32453, + 32454, + 32455, + 32456, + 32457, + 32458, + 32459, + 32460, + 32461, + 32462, + 32463, + 32464, + 32465, + 32466, + 32467, + 32468, + 32469, + 32470, + 32471, + 32472, + 32473, + 32474, + 32475, + 32476, + 32477, + 32478, + 32479, + 32480, + 32481, + 32482, + 32483, + 32484, + 32485, + 32486, + 32487, + 32488, + 32489, + 32490, + 32491, + 32492, + 32493, + 32494, + 32495, + 32496, + 32497, + 32498, + 32499, + 32500, + 32501, + 32502, + 32503, + 32504, + 32505, + 32506, + 32507, + 32508, + 32509, + 32510, + 32511, + 32512, + 32513, + 32514, + 32515, + 32516, + 32517, + 32518, + 32519, + 32520, + 32521, + 32522, + 32523, + 32524, + 32525, + 32526, + 32527, + 32528, + 32529, + 32530, + 32531, + 32532, + 32533, + 32534, + 32535, + 32536, + 32537, + 32538, + 32539, + 32540, + 32541, + 32542, + 32543, + 32544, + 32545, + 32546, + 32547, + 32548, + 32549, + 32550, + 32551, + 32552, + 32553, + 32554, + 32555, + 32556, + 32557, + 32558, + 32559, + 32560, + 32561, + 32562, + 32563, + 32564, + 32565, + 32566, + 32567, + 32568, + 32569, + 32570, + 32571, + 32572, + 32573, + 32574, + 32575, + 32576, + 32577, + 32578, + 32579, + 32580, + 32581, + 32582, + 32583, + 32584, + 32585, + 32586, + 32587, + 32588, + 32589, + 32590, + 32591, + 32592, + 32593, + 32594, + 32595, + 32596, + 32597, + 32598, + 32599, + 32600, + 32601, + 32602, + 32603, + 32604, + 32605, + 32606, + 32607, + 32608, + 32609, + 32610, + 32611, + 32612, + 32613, + 32614, + 32615, + 32616, + 32617, + 32618, + 32619, + 32620, + 32621, + 32622, + 32623, + 32624, + 32625, + 32626, + 32627, + 32628, + 32629, + 32630, + 32631, + 32632, + 32633, + 32634, + 32635, + 32636, + 32637, + 32638, + 32639, + 32640, + 32641, + 32642, + 32643, + 32644, + 32645, + 32646, + 32647, + 32648, + 32649, + 32650, + 32651, + 32652, + 32653, + 32654, + 32655, + 32656, + 32657, + 32658, + 32659, + 32660, + 32661, + 32662, + 32663, + 32664, + 32665, + 32666, + 32667, + 32668, + 32669, + 32670, + 32671, + 32672, + 32673, + 32674, + 32675, + 32676, + 32677, + 32678, + 32679, + 32680, + 32681, + 32682, + 32683, + 32684, + 32685, + 32686, + 32687, + 32688, + 32689, + 32690, + 32691, + 32692, + 32693, + 32694, + 32695, + 32696, + 32697, + 32698, + 32699, + 32700, + 32701, + 32702, + 32703, + 32704, + 32705, + 32706, + 32707, + 32708, + 32709, + 32710, + 32711, + 32712, + 32713, + 32714, + 32715, + 32716, + 32717, + 32718, + 32719, + 32720, + 32721, + 32722, + 32723, + 32724, + 32725, + 32726, + 32727, + 32728, + 32729, + 32730, + 32731, + 32732, + 32733, + 32734, + 32735, + 32736, + 32737, + 32738, + 32739, + 32740, + 32741, + 32742, + 32743, + 32744, + 32745, + 32746, + 32747, + 32748, + 32749, + 32750, + 32751, + 32752, + 32753, + 32754, + 32755, + 32756, + 32757, + 32758, + 32759, + 32760, + 32761, + 32762, + 32763, + 32764, + 32765, + 32766, + 32767, + 32768, + 32769, + 32770, + 32771, + 32772, + 32773, + 32774, + 32775, + 32776, + 32777, + 32778, + 32779, + 32780, + 32781, + 32782, + 32783, + 32784, + 32785, + 32786, + 32787, + 32788, + 32789, + 32790, + 32791, + 32792, + 32793, + 32794, + 32795, + 32796, + 32797, + 32798, + 32799, + 32800, + 32801, + 32802, + 32803, + 32804, + 32805, + 32806, + 32807, + 32808, + 32809, + 32810, + 32811, + 32812, + 32813, + 32814, + 32815, + 32816, + 32817, + 32818, + 32819, + 32820, + 32821, + 32822, + 32823, + 32824, + 32825, + 32826, + 32827, + 32828, + 32829, + 32830, + 32831, + 32832, + 32833, + 32834, + 32835, + 32836, + 32837, + 32838, + 32839, + 32840, + 32841, + 32842, + 32843, + 32844, + 32845, + 32846, + 32847, + 32848, + 32849, + 32850, + 32851, + 32852, + 32853, + 32854, + 32855, + 32856, + 32857, + 32858, + 32859, + 32860, + 32861, + 32862, + 32863, + 32864, + 32865, + 32866, + 32867, + 32868, + 32869, + 32870, + 32871, + 32872, + 32873, + 32874, + 32875, + 32876, + 32877, + 32878, + 32879, + 32880, + 32881, + 32882, + 32883, + 32884, + 32885, + 32886, + 32887, + 32888, + 32889, + 32890, + 32891, + 32892, + 32893, + 32894, + 32895, + 32896, + 32897, + 32898, + 32899, + 32900, + 32901, + 32902, + 32903, + 32904, + 32905, + 32906, + 32907, + 32908, + 32909, + 32910, + 32911, + 32912, + 32913, + 32914, + 32915, + 32916, + 32917, + 32918, + 32919, + 32920, + 32921, + 32922, + 32923, + 32924, + 32925, + 32926, + 32927, + 32928, + 32929, + 32930, + 32931, + 32932, + 32933, + 32934, + 32935, + 32936, + 32937, + 32938, + 32939, + 32940, + 32941, + 32942, + 32943, + 32944, + 32945, + 32946, + 32947, + 32948, + 32949, + 32950, + 32951, + 32952, + 32953, + 32954, + 32955, + 32956, + 32957, + 32958, + 32959, + 32960, + 32961, + 32962, + 32963, + 32964, + 32965, + 32966, + 32967, + 32968, + 32969, + 32970, + 32971, + 32972, + 32973, + 32974, + 32975, + 32976, + 32977, + 32978, + 32979, + 32980, + 32981, + 32982, + 32983, + 32984, + 32985, + 32986, + 32987, + 32988, + 32989, + 32990, + 32991, + 32992, + 32993, + 32994, + 32995, + 32996, + 32997, + 32998, + 32999, + 33000, + 33001, + 33002, + 33003, + 33004, + 33005, + 33006, + 33007, + 33008, + 33009, + 33010, + 33011, + 33012, + 33013, + 33014, + 33015, + 33016, + 33017, + 33018, + 33019, + 33020, + 33021, + 33022, + 33023, + 33024, + 33025, + 33026, + 33027, + 33028, + 33029, + 33030, + 33031, + 33032, + 33033, + 33034, + 33035, + 33036, + 33037, + 33038, + 33039, + 33040, + 33041, + 33042, + 33043, + 33044, + 33045, + 33046, + 33047, + 33048, + 33049, + 33050, + 33051, + 33052, + 33053, + 33054, + 33055, + 33056, + 33057, + 33058, + 33059, + 33060, + 33061, + 33062, + 33063, + 33064, + 33065, + 33066, + 33067, + 33068, + 33069, + 33070, + 33071, + 33072, + 33073, + 33074, + 33075, + 33076, + 33077, + 33078, + 33079, + 33080, + 33081, + 33082, + 33083, + 33084, + 33085, + 33086, + 33087, + 33088, + 33089, + 33090, + 33091, + 33092, + 33093, + 33094, + 33095, + 33096, + 33097, + 33098, + 33099, + 33100, + 33101, + 33102, + 33103, + 33104, + 33105, + 33106, + 33107, + 33108, + 33109, + 33110, + 33111, + 33112, + 33113, + 33114, + 33115, + 33116, + 33117, + 33118, + 33119, + 33120, + 33121, + 33122, + 33123, + 33124, + 33125, + 33126, + 33127, + 33128, + 33129, + 33130, + 33131, + 33132, + 33133, + 33134, + 33135, + 33136, + 33137, + 33138, + 33139, + 33140, + 33141, + 33142, + 33143, + 33144, + 33145, + 33146, + 33147, + 33148, + 33149, + 33150, + 33151, + 33152, + 33153, + 33154, + 33155, + 33156, + 33157, + 33158, + 33159, + 33160, + 33161, + 33162, + 33163, + 33164, + 33165, + 33166, + 33167, + 33168, + 33169, + 33170, + 33171, + 33172, + 33173, + 33174, + 33175, + 33176, + 33177, + 33178, + 33179, + 33180, + 33181, + 33182, + 33183, + 33184, + 33185, + 33186, + 33187, + 33188, + 33189, + 33190, + 33191, + 33192, + 33193, + 33194, + 33195, + 33196, + 33197, + 33198, + 33199, + 33200, + 33201, + 33202, + 33203, + 33204, + 33205, + 33206, + 33207, + 33208, + 33209, + 33210, + 33211, + 33212, + 33213, + 33214, + 33215, + 33216, + 33217, + 33218, + 33219, + 33220, + 33221, + 33222, + 33223, + 33224, + 33225, + 33226, + 33227, + 33228, + 33229, + 33230, + 33231, + 33232, + 33233, + 33234, + 33235, + 33236, + 33237, + 33238, + 33239, + 33240, + 33241, + 33242, + 33243, + 33244, + 33245, + 33246, + 33247, + 33248, + 33249, + 33250, + 33251, + 33252, + 33253, + 33254, + 33255, + 33256, + 33257, + 33258, + 33259, + 33260, + 33261, + 33262, + 33263, + 33264, + 33265, + 33266, + 33267, + 33268, + 33269, + 33270, + 33271, + 33272, + 33273, + 33274, + 33275, + 33276, + 33277, + 33278, + 33279, + 33280, + 33281, + 33282, + 33283, + 33284, + 33285, + 33286, + 33287, + 33288, + 33289, + 33290, + 33291, + 33292, + 33293, + 33294, + 33295, + 33296, + 33297, + 33298, + 33299, + 33300, + 33301, + 33302, + 33303, + 33304, + 33305, + 33306, + 33307, + 33308, + 33309, + 33310, + 33311, + 33312, + 33313, + 33314, + 33315, + 33316, + 33317, + 33318, + 33319, + 33320, + 33321, + 33322, + 33323, + 33324, + 33325, + 33326, + 33327, + 33328, + 33329, + 33330, + 33331, + 33332, + 33333, + 33334, + 33335, + 33336, + 33337, + 33338, + 33339, + 33340, + 33341, + 33342, + 33343, + 33344, + 33345, + 33346, + 33347, + 33348, + 33349, + 33350, + 33351, + 33352, + 33353, + 33354, + 33355, + 33356, + 33357, + 33358, + 33359, + 33360, + 33361, + 33362, + 33363, + 33364, + 33365, + 33366, + 33367, + 33368, + 33369, + 33370, + 33371, + 33372, + 33373, + 33374, + 33375, + 33376, + 33377, + 33378, + 33379, + 33380, + 33381, + 33382, + 33383, + 33384, + 33385, + 33386, + 33387, + 33388, + 33389, + 33390, + 33391, + 33392, + 33393, + 33394, + 33395, + 33396, + 33397, + 33398, + 33399, + 33400, + 33401, + 33402, + 33403, + 33404, + 33405, + 33406, + 33407, + 33408, + 33409, + 33410, + 33411, + 33412, + 33413, + 33414, + 33415, + 33416, + 33417, + 33418, + 33419, + 33420, + 33421, + 33422, + 33423, + 33424, + 33425, + 33426, + 33427, + 33428, + 33429, + 33430, + 33431, + 33432, + 33433, + 33434, + 33435, + 33436, + 33437, + 33438, + 33439, + 33440, + 33441, + 33442, + 33443, + 33444, + 33445, + 33446, + 33447, + 33448, + 33449, + 33450, + 33451, + 33452, + 33453, + 33454, + 33455, + 33456, + 33457, + 33458, + 33459, + 33460, + 33461, + 33462, + 33463, + 33464, + 33465, + 33466, + 33467, + 33468, + 33469, + 33470, + 33471, + 33472, + 33473, + 33474, + 33475, + 33476, + 33477, + 33478, + 33479, + 33480, + 33481, + 33482, + 33483, + 33484, + 33485, + 33486, + 33487, + 33488, + 33489, + 33490, + 33491, + 33492, + 33493, + 33494, + 33495, + 33496, + 33497, + 33498, + 33499, + 33500, + 33501, + 33502, + 33503, + 33504, + 33505, + 33506, + 33507, + 33508, + 33509, + 33510, + 33511, + 33512, + 33513, + 33514, + 33515, + 33516, + 33517, + 33518, + 33519, + 33520, + 33521, + 33522, + 33523, + 33524, + 33525, + 33526, + 33527, + 33528, + 33529, + 33530, + 33531, + 33532, + 33533, + 33534, + 33535, + 33536, + 33537, + 33538, + 33539, + 33540, + 33541, + 33542, + 33543, + 33544, + 33545, + 33546, + 33547, + 33548, + 33549, + 33550, + 33551, + 33552, + 33553, + 33554, + 33555, + 33556, + 33557, + 33558, + 33559, + 33560, + 33561, + 33562, + 33563, + 33564, + 33565, + 33566, + 33567, + 33568, + 33569, + 33570, + 33571, + 33572, + 33573, + 33574, + 33575, + 33576, + 33577, + 33578, + 33579, + 33580, + 33581, + 33582, + 33583, + 33584, + 33585, + 33586, + 33587, + 33588, + 33589, + 33590, + 33591, + 33592, + 33593, + 33594, + 33595, + 33596, + 33597, + 33598, + 33599, + 33600, + 33601, + 33602, + 33603, + 33604, + 33605, + 33606, + 33607, + 33608, + 33609, + 33610, + 33611, + 33612, + 33613, + 33614, + 33615, + 33616, + 33617, + 33618, + 33619, + 33620, + 33621, + 33622, + 33623, + 33624, + 33625, + 33626, + 33627, + 33628, + 33629, + 33630, + 33631, + 33632, + 33633, + 33634, + 33635, + 33636, + 33637, + 33638, + 33639, + 33640, + 33641, + 33642, + 33643, + 33644, + 33645, + 33646, + 33647, + 33648, + 33649, + 33650, + 33651, + 33652, + 33653, + 33654, + 33655, + 33656, + 33657, + 33658, + 33659, + 33660, + 33661, + 33662, + 33663, + 33664, + 33665, + 33666, + 33667, + 33668, + 33669, + 33670, + 33671, + 33672, + 33673, + 33674, + 33675, + 33676, + 33677, + 33678, + 33679, + 33680, + 33681, + 33682, + 33683, + 33684, + 33685, + 33686, + 33687, + 33688, + 33689, + 33690, + 33691, + 33692, + 33693, + 33694, + 33695, + 33696, + 33697, + 33698, + 33699, + 33700, + 33701, + 33702, + 33703, + 33704, + 33705, + 33706, + 33707, + 33708, + 33709, + 33710, + 33711, + 33712, + 33713, + 33714, + 33715, + 33716, + 33717, + 33718, + 33719, + 33720, + 33721, + 33722, + 33723, + 33724, + 33725, + 33726, + 33727, + 33728, + 33729, + 33730, + 33731, + 33732, + 33733, + 33734, + 33735, + 33736, + 33737, + 33738, + 33739, + 33740, + 33741, + 33742, + 33743, + 33744, + 33745, + 33746, + 33747, + 33748, + 33749, + 33750, + 33751, + 33752, + 33753, + 33754, + 33755, + 33756, + 33757, + 33758, + 33759, + 33760, + 33761, + 33762, + 33763, + 33764, + 33765, + 33766, + 33767, + 33768, + 33769, + 33770, + 33771, + 33772, + 33773, + 33774, + 33775, + 33776, + 33777, + 33778, + 33779, + 33780, + 33781, + 33782, + 33783, + 33784, + 33785, + 33786, + 33787, + 33788, + 33789, + 33790, + 33791, + 33792, + 33793, + 33794, + 33795, + 33796, + 33797, + 33798, + 33799, + 33800, + 33801, + 33802, + 33803, + 33804, + 33805, + 33806, + 33807, + 33808, + 33809, + 33810, + 33811, + 33812, + 33813, + 33814, + 33815, + 33816, + 33817, + 33818, + 33819, + 33820, + 33821, + 33822, + 33823, + 33824, + 33825, + 33826, + 33827, + 33828, + 33829, + 33830, + 33831, + 33832, + 33833, + 33834, + 33835, + 33836, + 33837, + 33838, + 33839, + 33840, + 33841, + 33842, + 33843, + 33844, + 33845, + 33846, + 33847, + 33848, + 33849, + 33850, + 33851, + 33852, + 33853, + 33854, + 33855, + 33856, + 33857, + 33858, + 33859, + 33860, + 33861, + 33862, + 33863, + 33864, + 33865, + 33866, + 33867, + 33868, + 33869, + 33870, + 33871, + 33872, + 33873, + 33874, + 33875, + 33876, + 33877, + 33878, + 33879, + 33880, + 33881, + 33882, + 33883, + 33884, + 33885, + 33886, + 33887, + 33888, + 33889, + 33890, + 33891, + 33892, + 33893, + 33894, + 33895, + 33896, + 33897, + 33898, + 33899, + 33900, + 33901, + 33902, + 33903, + 33904, + 33905, + 33906, + 33907, + 33908, + 33909, + 33910, + 33911, + 33912, + 33913, + 33914, + 33915, + 33916, + 33917, + 33918, + 33919, + 33920, + 33921, + 33922, + 33923, + 33924, + 33925, + 33926, + 33927, + 33928, + 33929, + 33930, + 33931, + 33932, + 33933, + 33934, + 33935, + 33936, + 33937, + 33938, + 33939, + 33940, + 33941, + 33942, + 33943, + 33944, + 33945, + 33946, + 33947, + 33948, + 33949, + 33950, + 33951, + 33952, + 33953, + 33954, + 33955, + 33956, + 33957, + 33958, + 33959, + 33960, + 33961, + 33962, + 33963, + 33964, + 33965, + 33966, + 33967, + 33968, + 33969, + 33970, + 33971, + 33972, + 33973, + 33974, + 33975, + 33976, + 33977, + 33978, + 33979, + 33980, + 33981, + 33982, + 33983, + 33984, + 33985, + 33986, + 33987, + 33988, + 33989, + 33990, + 33991, + 33992, + 33993, + 33994, + 33995, + 33996, + 33997, + 33998, + 33999, + 34000, + 34001, + 34002, + 34003, + 34004, + 34005, + 34006, + 34007, + 34008, + 34009, + 34010, + 34011, + 34012, + 34013, + 34014, + 34015, + 34016, + 34017, + 34018, + 34019, + 34020, + 34021, + 34022, + 34023, + 34024, + 34025, + 34026, + 34027, + 34028, + 34029, + 34030, + 34031, + 34032, + 34033, + 34034, + 34035, + 34036, + 34037, + 34038, + 34039, + 34040, + 34041, + 34042, + 34043, + 34044, + 34045, + 34046, + 34047, + 34048, + 34049, + 34050, + 34051, + 34052, + 34053, + 34054, + 34055, + 34056, + 34057, + 34058, + 34059, + 34060, + 34061, + 34062, + 34063, + 34064, + 34065, + 34066, + 34067, + 34068, + 34069, + 34070, + 34071, + 34072, + 34073, + 34074, + 34075, + 34076, + 34077, + 34078, + 34079, + 34080, + 34081, + 34082, + 34083, + 34084, + 34085, + 34086, + 34087, + 34088, + 34089, + 34090, + 34091, + 34092, + 34093, + 34094, + 34095, + 34096, + 34097, + 34098, + 34099, + 34100, + 34101, + 34102, + 34103, + 34104, + 34105, + 34106, + 34107, + 34108, + 34109, + 34110, + 34111, + 34112, + 34113, + 34114, + 34115, + 34116, + 34117, + 34118, + 34119, + 34120, + 34121, + 34122, + 34123, + 34124, + 34125, + 34126, + 34127, + 34128, + 34129, + 34130, + 34131, + 34132, + 34133, + 34134, + 34135, + 34136, + 34137, + 34138, + 34139, + 34140, + 34141, + 34142, + 34143, + 34144, + 34145, + 34146, + 34147, + 34148, + 34149, + 34150, + 34151, + 34152, + 34153, + 34154, + 34155, + 34156, + 34157, + 34158, + 34159, + 34160, + 34161, + 34162, + 34163, + 34164, + 34165, + 34166, + 34167, + 34168, + 34169, + 34170, + 34171, + 34172, + 34173, + 34174, + 34175, + 34176, + 34177, + 34178, + 34179, + 34180, + 34181, + 34182, + 34183, + 34184, + 34185, + 34186, + 34187, + 34188, + 34189, + 34190, + 34191, + 34192, + 34193, + 34194, + 34195, + 34196, + 34197, + 34198, + 34199, + 34200, + 34201, + 34202, + 34203, + 34204, + 34205, + 34206, + 34207, + 34208, + 34209, + 34210, + 34211, + 34212, + 34213, + 34214, + 34215, + 34216, + 34217, + 34218, + 34219, + 34220, + 34221, + 34222, + 34223, + 34224, + 34225, + 34226, + 34227, + 34228, + 34229, + 34230, + 34231, + 34232, + 34233, + 34234, + 34235, + 34236, + 34237, + 34238, + 34239, + 34240, + 34241, + 34242, + 34243, + 34244, + 34245, + 34246, + 34247, + 34248, + 34249, + 34250, + 34251, + 34252, + 34253, + 34254, + 34255, + 34256, + 34257, + 34258, + 34259, + 34260, + 34261, + 34262, + 34263, + 34264, + 34265, + 34266, + 34267, + 34268, + 34269, + 34270, + 34271, + 34272, + 34273, + 34274, + 34275, + 34276, + 34277, + 34278, + 34279, + 34280, + 34281, + 34282, + 34283, + 34284, + 34285, + 34286, + 34287, + 34288, + 34289, + 34290, + 34291, + 34292, + 34293, + 34294, + 34295, + 34296, + 34297, + 34298, + 34299, + 34300, + 34301, + 34302, + 34303, + 34304, + 34305, + 34306, + 34307, + 34308, + 34309, + 34310, + 34311, + 34312, + 34313, + 34314, + 34315, + 34316, + 34317, + 34318, + 34319, + 34320, + 34321, + 34322, + 34323, + 34324, + 34325, + 34326, + 34327, + 34328, + 34329, + 34330, + 34331, + 34332, + 34333, + 34334, + 34335, + 34336, + 34337, + 34338, + 34339, + 34340, + 34341, + 34342, + 34343, + 34344, + 34345, + 34346, + 34347, + 34348, + 34349, + 34350, + 34351, + 34352, + 34353, + 34354, + 34355, + 34356, + 34357, + 34358, + 34359, + 34360, + 34361, + 34362, + 34363, + 34364, + 34365, + 34366, + 34367, + 34368, + 34369, + 34370, + 34371, + 34372, + 34373, + 34374, + 34375, + 34376, + 34377, + 34378, + 34379, + 34380, + 34381, + 34382, + 34383, + 34384, + 34385, + 34386, + 34387, + 34388, + 34389, + 34390, + 34391, + 34392, + 34393, + 34394, + 34395, + 34396, + 34397, + 34398, + 34399, + 34400, + 34401, + 34402, + 34403, + 34404, + 34405, + 34406, + 34407, + 34408, + 34409, + 34410, + 34411, + 34412, + 34413, + 34414, + 34415, + 34416, + 34417, + 34418, + 34419, + 34420, + 34421, + 34422, + 34423, + 34424, + 34425, + 34426, + 34427, + 34428, + 34429, + 34430, + 34431, + 34432, + 34433, + 34434, + 34435, + 34436, + 34437, + 34438, + 34439, + 34440, + 34441, + 34442, + 34443, + 34444, + 34445, + 34446, + 34447, + 34448, + 34449, + 34450, + 34451, + 34452, + 34453, + 34454, + 34455, + 34456, + 34457, + 34458, + 34459, + 34460, + 34461, + 34462, + 34463, + 34464, + 34465, + 34466, + 34467, + 34468, + 34469, + 34470, + 34471, + 34472, + 34473, + 34474, + 34475, + 34476, + 34477, + 34478, + 34479, + 34480, + 34481, + 34482, + 34483, + 34484, + 34485, + 34486, + 34487, + 34488, + 34489, + 34490, + 34491, + 34492, + 34493, + 34494, + 34495, + 34496, + 34497, + 34498, + 34499, + 34500, + 34501, + 34502, + 34503, + 34504, + 34505, + 34506, + 34507, + 34508, + 34509, + 34510, + 34511, + 34512, + 34513, + 34514, + 34515, + 34516, + 34517, + 34518, + 34519, + 34520, + 34521, + 34522, + 34523, + 34524, + 34525, + 34526, + 34527, + 34528, + 34529, + 34530, + 34531, + 34532, + 34533, + 34534, + 34535, + 34536, + 34537, + 34538, + 34539, + 34540, + 34541, + 34542, + 34543, + 34544, + 34545, + 34546, + 34547, + 34548, + 34549, + 34550, + 34551, + 34552, + 34553, + 34554, + 34555, + 34556, + 34557, + 34558, + 34559, + 34560, + 34561, + 34562, + 34563, + 34564, + 34565, + 34566, + 34567, + 34568, + 34569, + 34570, + 34571, + 34572, + 34573, + 34574, + 34575, + 34576, + 34577, + 34578, + 34579, + 34580, + 34581, + 34582, + 34583, + 34584, + 34585, + 34586, + 34587, + 34588, + 34589, + 34590, + 34591, + 34592, + 34593, + 34594, + 34595, + 34596, + 34597, + 34598, + 34599, + 34600, + 34601, + 34602, + 34603, + 34604, + 34605, + 34606, + 34607, + 34608, + 34609, + 34610, + 34611, + 34612, + 34613, + 34614, + 34615, + 34616, + 34617, + 34618, + 34619, + 34620, + 34621, + 34622, + 34623, + 34624, + 34625, + 34626, + 34627, + 34628, + 34629, + 34630, + 34631, + 34632, + 34633, + 34634, + 34635, + 34636, + 34637, + 34638, + 34639, + 34640, + 34641, + 34642, + 34643, + 34644, + 34645, + 34646, + 34647, + 34648, + 34649, + 34650, + 34651, + 34652, + 34653, + 34654, + 34655, + 34656, + 34657, + 34658, + 34659, + 34660, + 34661, + 34662, + 34663, + 34664, + 34665, + 34666, + 34667, + 34668, + 34669, + 34670, + 34671, + 34672, + 34673, + 34674, + 34675, + 34676, + 34677, + 34678, + 34679, + 34680, + 34681, + 34682, + 34683, + 34684, + 34685, + 34686, + 34687, + 34688, + 34689, + 34690, + 34691, + 34692, + 34693, + 34694, + 34695, + 34696, + 34697, + 34698, + 34699, + 34700, + 34701, + 34702, + 34703, + 34704, + 34705, + 34706, + 34707, + 34708, + 34709, + 34710, + 34711, + 34712, + 34713, + 34714, + 34715, + 34716, + 34717, + 34718, + 34719, + 34720, + 34721, + 34722, + 34723, + 34724, + 34725, + 34726, + 34727, + 34728, + 34729, + 34730, + 34731, + 34732, + 34733, + 34734, + 34735, + 34736, + 34737, + 34738, + 34739, + 34740, + 34741, + 34742, + 34743, + 34744, + 34745, + 34746, + 34747, + 34748, + 34749, + 34750, + 34751, + 34752, + 34753, + 34754, + 34755, + 34756, + 34757, + 34758, + 34759, + 34760, + 34761, + 34762, + 34763, + 34764, + 34765, + 34766, + 34767, + 34768, + 34769, + 34770, + 34771, + 34772, + 34773, + 34774, + 34775, + 34776, + 34777, + 34778, + 34779, + 34780, + 34781, + 34782, + 34783, + 34784, + 34785, + 34786, + 34787, + 34788, + 34789, + 34790, + 34791, + 34792, + 34793, + 34794, + 34795, + 34796, + 34797, + 34798, + 34799, + 34800, + 34801, + 34802, + 34803, + 34804, + 34805, + 34806, + 34807, + 34808, + 34809, + 34810, + 34811, + 34812, + 34813, + 34814, + 34815, + 34816, + 34817, + 34818, + 34819, + 34820, + 34821, + 34822, + 34823, + 34824, + 34825, + 34826, + 34827, + 34828, + 34829, + 34830, + 34831, + 34832, + 34833, + 34834, + 34835, + 34836, + 34837, + 34838, + 34839, + 34840, + 34841, + 34842, + 34843, + 34844, + 34845, + 34846, + 34847, + 34848, + 34849, + 34850, + 34851, + 34852, + 34853, + 34854, + 34855, + 34856, + 34857, + 34858, + 34859, + 34860, + 34861, + 34862, + 34863, + 34864, + 34865, + 34866, + 34867, + 34868, + 34869, + 34870, + 34871, + 34872, + 34873, + 34874, + 34875, + 34876, + 34877, + 34878, + 34879, + 34880, + 34881, + 34882, + 34883, + 34884, + 34885, + 34886, + 34887, + 34888, + 34889, + 34890, + 34891, + 34892, + 34893, + 34894, + 34895, + 34896, + 34897, + 34898, + 34899, + 34900, + 34901, + 34902, + 34903, + 34904, + 34905, + 34906, + 34907, + 34908, + 34909, + 34910, + 34911, + 34912, + 34913, + 34914, + 34915, + 34916, + 34917, + 34918, + 34919, + 34920, + 34921, + 34922, + 34923, + 34924, + 34925, + 34926, + 34927, + 34928, + 34929, + 34930, + 34931, + 34932, + 34933, + 34934, + 34935, + 34936, + 34937, + 34938, + 34939, + 34940, + 34941, + 34942, + 34943, + 34944, + 34945, + 34946, + 34947, + 34948, + 34949, + 34950, + 34951, + 34952, + 34953, + 34954, + 34955, + 34956, + 34957, + 34958, + 34959, + 34960, + 34961, + 34962, + 34963, + 34964, + 34965, + 34966, + 34967, + 34968, + 34969, + 34970, + 34971, + 34972, + 34973, + 34974, + 34975, + 34976, + 34977, + 34978, + 34979, + 34980, + 34981, + 34982, + 34983, + 34984, + 34985, + 34986, + 34987, + 34988, + 34989, + 34990, + 34991, + 34992, + 34993, + 34994, + 34995, + 34996, + 34997, + 34998, + 34999, + 35000, + 35001, + 35002, + 35003, + 35004, + 35005, + 35006, + 35007, + 35008, + 35009, + 35010, + 35011, + 35012, + 35013, + 35014, + 35015, + 35016, + 35017, + 35018, + 35019, + 35020, + 35021, + 35022, + 35023, + 35024, + 35025, + 35026, + 35027, + 35028, + 35029, + 35030, + 35031, + 35032, + 35033, + 35034, + 35035, + 35036, + 35037, + 35038, + 35039, + 35040, + 35041, + 35042, + 35043, + 35044, + 35045, + 35046, + 35047, + 35048, + 35049, + 35050, + 35051, + 35052, + 35053, + 35054, + 35055, + 35056, + 35057, + 35058, + 35059, + 35060, + 35061, + 35062, + 35063, + 35064, + 35065, + 35066, + 35067, + 35068, + 35069, + 35070, + 35071, + 35072, + 35073, + 35074, + 35075, + 35076, + 35077, + 35078, + 35079, + 35080, + 35081, + 35082, + 35083, + 35084, + 35085, + 35086, + 35087, + 35088, + 35089, + 35090, + 35091, + 35092, + 35093, + 35094, + 35095, + 35096, + 35097, + 35098, + 35099, + 35100, + 35101, + 35102, + 35103, + 35104, + 35105, + 35106, + 35107, + 35108, + 35109, + 35110, + 35111, + 35112, + 35113, + 35114, + 35115, + 35116, + 35117, + 35118, + 35119, + 35120, + 35121, + 35122, + 35123, + 35124, + 35125, + 35126, + 35127, + 35128, + 35129, + 35130, + 35131, + 35132, + 35133, + 35134, + 35135, + 35136, + 35137, + 35138, + 35139, + 35140, + 35141, + 35142, + 35143, + 35144, + 35145, + 35146, + 35147, + 35148, + 35149, + 35150, + 35151, + 35152, + 35153, + 35154, + 35155, + 35156, + 35157, + 35158, + 35159, + 35160, + 35161, + 35162, + 35163, + 35164, + 35165, + 35166, + 35167, + 35168, + 35169, + 35170, + 35171, + 35172, + 35173, + 35174, + 35175, + 35176, + 35177, + 35178, + 35179, + 35180, + 35181, + 35182, + 35183, + 35184, + 35185, + 35186, + 35187, + 35188, + 35189, + 35190, + 35191, + 35192, + 35193, + 35194, + 35195, + 35196, + 35197, + 35198, + 35199, + 35200, + 35201, + 35202, + 35203, + 35204, + 35205, + 35206, + 35207, + 35208, + 35209, + 35210, + 35211, + 35212, + 35213, + 35214, + 35215, + 35216, + 35217, + 35218, + 35219, + 35220, + 35221, + 35222, + 35223, + 35224, + 35225, + 35226, + 35227, + 35228, + 35229, + 35230, + 35231, + 35232, + 35233, + 35234, + 35235, + 35236, + 35237, + 35238, + 35239, + 35240, + 35241, + 35242, + 35243, + 35244, + 35245, + 35246, + 35247, + 35248, + 35249, + 35250, + 35251, + 35252, + 35253, + 35254, + 35255, + 35256, + 35257, + 35258, + 35259, + 35260, + 35261, + 35262, + 35263, + 35264, + 35265, + 35266, + 35267, + 35268, + 35269, + 35270, + 35271, + 35272, + 35273, + 35274, + 35275, + 35276, + 35277, + 35278, + 35279, + 35280, + 35281, + 35282, + 35283, + 35284, + 35285, + 35286, + 35287, + 35288, + 35289, + 35290, + 35291, + 35292, + 35293, + 35294, + 35295, + 35296, + 35297, + 35298, + 35299, + 35300, + 35301, + 35302, + 35303, + 35304, + 35305, + 35306, + 35307, + 35308, + 35309, + 35310, + 35311, + 35312, + 35313, + 35314, + 35315, + 35316, + 35317, + 35318, + 35319, + 35320, + 35321, + 35322, + 35323, + 35324, + 35325, + 35326, + 35327, + 35328, + 35329, + 35330, + 35331, + 35332, + 35333, + 35334, + 35335, + 35336, + 35337, + 35338, + 35339, + 35340, + 35341, + 35342, + 35343, + 35344, + 35345, + 35346, + 35347, + 35348, + 35349, + 35350, + 35351, + 35352, + 35353, + 35354, + 35355, + 35356, + 35357, + 35358, + 35359, + 35360, + 35361, + 35362, + 35363, + 35364, + 35365, + 35366, + 35367, + 35368, + 35369, + 35370, + 35371, + 35372, + 35373, + 35374, + 35375, + 35376, + 35377, + 35378, + 35379, + 35380, + 35381, + 35382, + 35383, + 35384, + 35385, + 35386, + 35387, + 35388, + 35389, + 35390, + 35391, + 35392, + 35393, + 35394, + 35395, + 35396, + 35397, + 35398, + 35399, + 35400, + 35401, + 35402, + 35403, + 35404, + 35405, + 35406, + 35407, + 35408, + 35409, + 35410, + 35411, + 35412, + 35413, + 35414, + 35415, + 35416, + 35417, + 35418, + 35419, + 35420, + 35421, + 35422, + 35423, + 35424, + 35425, + 35426, + 35427, + 35428, + 35429, + 35430, + 35431, + 35432, + 35433, + 35434, + 35435, + 35436, + 35437, + 35438, + 35439, + 35440, + 35441, + 35442, + 35443, + 35444, + 35445, + 35446, + 35447, + 35448, + 35449, + 35450, + 35451, + 35452, + 35453, + 35454, + 35455, + 35456, + 35457, + 35458, + 35459, + 35460, + 35461, + 35462, + 35463, + 35464, + 35465, + 35466, + 35467, + 35468, + 35469, + 35470, + 35471, + 35472, + 35473, + 35474, + 35475, + 35476, + 35477, + 35478, + 35479, + 35480, + 35481, + 35482, + 35483, + 35484, + 35485, + 35486, + 35487, + 35488, + 35489, + 35490, + 35491, + 35492, + 35493, + 35494, + 35495, + 35496, + 35497, + 35498, + 35499, + 35500, + 35501, + 35502, + 35503, + 35504, + 35505, + 35506, + 35507, + 35508, + 35509, + 35510, + 35511, + 35512, + 35513, + 35514, + 35515, + 35516, + 35517, + 35518, + 35519, + 35520, + 35521, + 35522, + 35523, + 35524, + 35525, + 35526, + 35527, + 35528, + 35529, + 35530, + 35531, + 35532, + 35533, + 35534, + 35535, + 35536, + 35537, + 35538, + 35539, + 35540, + 35541, + 35542, + 35543, + 35544, + 35545, + 35546, + 35547, + 35548, + 35549, + 35550, + 35551, + 35552, + 35553, + 35554, + 35555, + 35556, + 35557, + 35558, + 35559, + 35560, + 35561, + 35562, + 35563, + 35564, + 35565, + 35566, + 35567, + 35568, + 35569, + 35570, + 35571, + 35572, + 35573, + 35574, + 35575, + 35576, + 35577, + 35578, + 35579, + 35580, + 35581, + 35582, + 35583, + 35584, + 35585, + 35586, + 35587, + 35588, + 35589, + 35590, + 35591, + 35592, + 35593, + 35594, + 35595, + 35596, + 35597, + 35598, + 35599, + 35600, + 35601, + 35602, + 35603, + 35604, + 35605, + 35606, + 35607, + 35608, + 35609, + 35610, + 35611, + 35612, + 35613, + 35614, + 35615, + 35616, + 35617, + 35618, + 35619, + 35620, + 35621, + 35622, + 35623, + 35624, + 35625, + 35626, + 35627, + 35628, + 35629, + 35630, + 35631, + 35632, + 35633, + 35634, + 35635, + 35636, + 35637, + 35638, + 35639, + 35640, + 35641, + 35642, + 35643, + 35644, + 35645, + 35646, + 35647, + 35648, + 35649, + 35650, + 35651, + 35652, + 35653, + 35654, + 35655, + 35656, + 35657, + 35658, + 35659, + 35660, + 35661, + 35662, + 35663, + 35664, + 35665, + 35666, + 35667, + 35668, + 35669, + 35670, + 35671, + 35672, + 35673, + 35674, + 35675, + 35676, + 35677, + 35678, + 35679, + 35680, + 35681, + 35682, + 35683, + 35684, + 35685, + 35686, + 35687, + 35688, + 35689, + 35690, + 35691, + 35692, + 35693, + 35694, + 35695, + 35696, + 35697, + 35698, + 35699, + 35700, + 35701, + 35702, + 35703, + 35704, + 35705, + 35706, + 35707, + 35708, + 35709, + 35710, + 35711, + 35712, + 35713, + 35714, + 35715, + 35716, + 35717, + 35718, + 35719, + 35720, + 35721, + 35722, + 35723, + 35724, + 35725, + 35726, + 35727, + 35728, + 35729, + 35730, + 35731, + 35732, + 35733, + 35734, + 35735, + 35736, + 35737, + 35738, + 35739, + 35740, + 35741, + 35742, + 35743, + 35744, + 35745, + 35746, + 35747, + 35748, + 35749, + 35750, + 35751, + 35752, + 35753, + 35754, + 35755, + 35756, + 35757, + 35758, + 35759, + 35760, + 35761, + 35762, + 35763, + 35764, + 35765, + 35766, + 35767, + 35768, + 35769, + 35770, + 35771, + 35772, + 35773, + 35774, + 35775, + 35776, + 35777, + 35778, + 35779, + 35780, + 35781, + 35782, + 35783, + 35784, + 35785, + 35786, + 35787, + 35788, + 35789, + 35790, + 35791, + 35792, + 35793, + 35794, + 35795, + 35796, + 35797, + 35798, + 35799, + 35800, + 35801, + 35802, + 35803, + 35804, + 35805, + 35806, + 35807, + 35808, + 35809, + 35810, + 35811, + 35812, + 35813, + 35814, + 35815, + 35816, + 35817, + 35818, + 35819, + 35820, + 35821, + 35822, + 35823, + 35824, + 35825, + 35826, + 35827, + 35828, + 35829, + 35830, + 35831, + 35832, + 35833, + 35834, + 35835, + 35836, + 35837, + 35838, + 35839, + 35840, + 35841, + 35842, + 35843, + 35844, + 35845, + 35846, + 35847, + 35848, + 35849, + 35850, + 35851, + 35852, + 35853, + 35854, + 35855, + 35856, + 35857, + 35858, + 35859, + 35860, + 35861, + 35862, + 35863, + 35864, + 35865, + 35866, + 35867, + 35868, + 35869, + 35870, + 35871, + 35872, + 35873, + 35874, + 35875, + 35876, + 35877, + 35878, + 35879, + 35880, + 35881, + 35882, + 35883, + 35884, + 35885, + 35886, + 35887, + 35888, + 35889, + 35890, + 35891, + 35892, + 35893, + 35894, + 35895, + 35896, + 35897, + 35898, + 35899, + 35900, + 35901, + 35902, + 35903, + 35904, + 35905, + 35906, + 35907, + 35908, + 35909, + 35910, + 35911, + 35912, + 35913, + 35914, + 35915, + 35916, + 35917, + 35918, + 35919, + 35920, + 35921, + 35922, + 35923, + 35924, + 35925, + 35926, + 35927, + 35928, + 35929, + 35930, + 35931, + 35932, + 35933, + 35934, + 35935, + 35936, + 35937, + 35938, + 35939, + 35940, + 35941, + 35942, + 35943, + 35944, + 35945, + 35946, + 35947, + 35948, + 35949, + 35950, + 35951, + 35952, + 35953, + 35954, + 35955, + 35956, + 35957, + 35958, + 35959, + 35960, + 35961, + 35962, + 35963, + 35964, + 35965, + 35966, + 35967, + 35968, + 35969, + 35970, + 35971, + 35972, + 35973, + 35974, + 35975, + 35976, + 35977, + 35978, + 35979, + 35980, + 35981, + 35982, + 35983, + 35984, + 35985, + 35986, + 35987, + 35988, + 35989, + 35990, + 35991, + 35992, + 35993, + 35994, + 35995, + 35996, + 35997, + 35998, + 35999, + 36000, + 36001, + 36002, + 36003, + 36004, + 36005, + 36006, + 36007, + 36008, + 36009, + 36010, + 36011, + 36012, + 36013, + 36014, + 36015, + 36016, + 36017, + 36018, + 36019, + 36020, + 36021, + 36022, + 36023, + 36024, + 36025, + 36026, + 36027, + 36028, + 36029, + 36030, + 36031, + 36032, + 36033, + 36034, + 36035, + 36036, + 36037, + 36038, + 36039, + 36040, + 36041, + 36042, + 36043, + 36044, + 36045, + 36046, + 36047, + 36048, + 36049, + 36050, + 36051, + 36052, + 36053, + 36054, + 36055, + 36056, + 36057, + 36058, + 36059, + 36060, + 36061, + 36062, + 36063, + 36064, + 36065, + 36066, + 36067, + 36068, + 36069, + 36070, + 36071, + 36072, + 36073, + 36074, + 36075, + 36076, + 36077, + 36078, + 36079, + 36080, + 36081, + 36082, + 36083, + 36084, + 36085, + 36086, + 36087, + 36088, + 36089, + 36090, + 36091, + 36092, + 36093, + 36094, + 36095, + 36096, + 36097, + 36098, + 36099, + 36100, + 36101, + 36102, + 36103, + 36104, + 36105, + 36106, + 36107, + 36108, + 36109, + 36110, + 36111, + 36112, + 36113, + 36114, + 36115, + 36116, + 36117, + 36118, + 36119, + 36120, + 36121, + 36122, + 36123, + 36124, + 36125, + 36126, + 36127, + 36128, + 36129, + 36130, + 36131, + 36132, + 36133, + 36134, + 36135, + 36136, + 36137, + 36138, + 36139, + 36140, + 36141, + 36142, + 36143, + 36144, + 36145, + 36146, + 36147, + 36148, + 36149, + 36150, + 36151, + 36152, + 36153, + 36154, + 36155, + 36156, + 36157, + 36158, + 36159, + 36160, + 36161, + 36162, + 36163, + 36164, + 36165, + 36166, + 36167, + 36168, + 36169, + 36170, + 36171, + 36172, + 36173, + 36174, + 36175, + 36176, + 36177, + 36178, + 36179, + 36180, + 36181, + 36182, + 36183, + 36184, + 36185, + 36186, + 36187, + 36188, + 36189, + 36190, + 36191, + 36192, + 36193, + 36194, + 36195, + 36196, + 36197, + 36198, + 36199, + 36200, + 36201, + 36202, + 36203, + 36204, + 36205, + 36206, + 36207, + 36208, + 36209, + 36210, + 36211, + 36212, + 36213, + 36214, + 36215, + 36216, + 36217, + 36218, + 36219, + 36220, + 36221, + 36222, + 36223, + 36224, + 36225, + 36226, + 36227, + 36228, + 36229, + 36230, + 36231, + 36232, + 36233, + 36234, + 36235, + 36236, + 36237, + 36238, + 36239, + 36240, + 36241, + 36242, + 36243, + 36244, + 36245, + 36246, + 36247, + 36248, + 36249, + 36250, + 36251, + 36252, + 36253, + 36254, + 36255, + 36256, + 36257, + 36258, + 36259, + 36260, + 36261, + 36262, + 36263, + 36264, + 36265, + 36266, + 36267, + 36268, + 36269, + 36270, + 36271, + 36272, + 36273, + 36274, + 36275, + 36276, + 36277, + 36278, + 36279, + 36280, + 36281, + 36282, + 36283, + 36284, + 36285, + 36286, + 36287, + 36288, + 36289, + 36290, + 36291, + 36292, + 36293, + 36294, + 36295, + 36296, + 36297, + 36298, + 36299, + 36300, + 36301, + 36302, + 36303, + 36304, + 36305, + 36306, + 36307, + 36308, + 36309, + 36310, + 36311, + 36312, + 36313, + 36314, + 36315, + 36316, + 36317, + 36318, + 36319, + 36320, + 36321, + 36322, + 36323, + 36324, + 36325, + 36326, + 36327, + 36328, + 36329, + 36330, + 36331, + 36332, + 36333, + 36334, + 36335, + 36336, + 36337, + 36338, + 36339, + 36340, + 36341, + 36342, + 36343, + 36344, + 36345, + 36346, + 36347, + 36348, + 36349, + 36350, + 36351, + 36352, + 36353, + 36354, + 36355, + 36356, + 36357, + 36358, + 36359, + 36360, + 36361, + 36362, + 36363, + 36364, + 36365, + 36366, + 36367, + 36368, + 36369, + 36370, + 36371, + 36372, + 36373, + 36374, + 36375, + 36376, + 36377, + 36378, + 36379, + 36380, + 36381, + 36382, + 36383, + 36384, + 36385, + 36386, + 36387, + 36388, + 36389, + 36390, + 36391, + 36392, + 36393, + 36394, + 36395, + 36396, + 36397, + 36398, + 36399, + 36400, + 36401, + 36402, + 36403, + 36404, + 36405, + 36406, + 36407, + 36408, + 36409, + 36410, + 36411, + 36412, + 36413, + 36414, + 36415, + 36416, + 36417, + 36418, + 36419, + 36420, + 36421, + 36422, + 36423, + 36424, + 36425, + 36426, + 36427, + 36428, + 36429, + 36430, + 36431, + 36432, + 36433, + 36434, + 36435, + 36436, + 36437, + 36438, + 36439, + 36440, + 36441, + 36442, + 36443, + 36444, + 36445, + 36446, + 36447, + 36448, + 36449, + 36450, + 36451, + 36452, + 36453, + 36454, + 36455, + 36456, + 36457, + 36458, + 36459, + 36460, + 36461, + 36462, + 36463, + 36464, + 36465, + 36466, + 36467, + 36468, + 36469, + 36470, + 36471, + 36472, + 36473, + 36474, + 36475, + 36476, + 36477, + 36478, + 36479, + 36480, + 36481, + 36482, + 36483, + 36484, + 36485, + 36486, + 36487, + 36488, + 36489, + 36490, + 36491, + 36492, + 36493, + 36494, + 36495, + 36496, + 36497, + 36498, + 36499, + 36500, + 36501, + 36502, + 36503, + 36504, + 36505, + 36506, + 36507, + 36508, + 36509, + 36510, + 36511, + 36512, + 36513, + 36514, + 36515, + 36516, + 36517, + 36518, + 36519, + 36520, + 36521, + 36522, + 36523, + 36524, + 36525, + 36526, + 36527, + 36528, + 36529, + 36530, + 36531, + 36532, + 36533, + 36534, + 36535, + 36536, + 36537, + 36538, + 36539, + 36540, + 36541, + 36542, + 36543, + 36544, + 36545, + 36546, + 36547, + 36548, + 36549, + 36550, + 36551, + 36552, + 36553, + 36554, + 36555, + 36556, + 36557, + 36558, + 36559, + 36560, + 36561, + 36562, + 36563, + 36564, + 36565, + 36566, + 36567, + 36568, + 36569, + 36570, + 36571, + 36572, + 36573, + 36574, + 36575, + 36576, + 36577, + 36578, + 36579, + 36580, + 36581, + 36582, + 36583, + 36584, + 36585, + 36586, + 36587, + 36588, + 36589, + 36590, + 36591, + 36592, + 36593, + 36594, + 36595, + 36596, + 36597, + 36598, + 36599, + 36600, + 36601, + 36602, + 36603, + 36604, + 36605, + 36606, + 36607, + 36608, + 36609, + 36610, + 36611, + 36612, + 36613, + 36614, + 36615, + 36616, + 36617, + 36618, + 36619, + 36620, + 36621, + 36622, + 36623, + 36624, + 36625, + 36626, + 36627, + 36628, + 36629, + 36630, + 36631, + 36632, + 36633, + 36634, + 36635, + 36636, + 36637, + 36638, + 36639, + 36640, + 36641, + 36642, + 36643, + 36644, + 36645, + 36646, + 36647, + 36648, + 36649, + 36650, + 36651, + 36652, + 36653, + 36654, + 36655, + 36656, + 36657, + 36658, + 36659, + 36660, + 36661, + 36662, + 36663, + 36664, + 36665, + 36666, + 36667, + 36668, + 36669, + 36670, + 36671, + 36672, + 36673, + 36674, + 36675, + 36676, + 36677, + 36678, + 36679, + 36680, + 36681, + 36682, + 36683, + 36684, + 36685, + 36686, + 36687, + 36688, + 36689, + 36690, + 36691, + 36692, + 36693, + 36694, + 36695, + 36696, + 36697, + 36698, + 36699, + 36700, + 36701, + 36702, + 36703, + 36704, + 36705, + 36706, + 36707, + 36708, + 36709, + 36710, + 36711, + 36712, + 36713, + 36714, + 36715, + 36716, + 36717, + 36718, + 36719, + 36720, + 36721, + 36722, + 36723, + 36724, + 36725, + 36726, + 36727, + 36728, + 36729, + 36730, + 36731, + 36732, + 36733, + 36734, + 36735, + 36736, + 36737, + 36738, + 36739, + 36740, + 36741, + 36742, + 36743, + 36744, + 36745, + 36746, + 36747, + 36748, + 36749, + 36750, + 36751, + 36752, + 36753, + 36754, + 36755, + 36756, + 36757, + 36758, + 36759, + 36760, + 36761, + 36762, + 36763, + 36764, + 36765, + 36766, + 36767, + 36768, + 36769, + 36770, + 36771, + 36772, + 36773, + 36774, + 36775, + 36776, + 36777, + 36778, + 36779, + 36780, + 36781, + 36782, + 36783, + 36784, + 36785, + 36786, + 36787, + 36788, + 36789, + 36790, + 36791, + 36792, + 36793, + 36794, + 36795, + 36796, + 36797, + 36798, + 36799, + 36800, + 36801, + 36802, + 36803, + 36804, + 36805, + 36806, + 36807, + 36808, + 36809, + 36810, + 36811, + 36812, + 36813, + 36814, + 36815, + 36816, + 36817, + 36818, + 36819, + 36820, + 36821, + 36822, + 36823, + 36824, + 36825, + 36826, + 36827, + 36828, + 36829, + 36830, + 36831, + 36832, + 36833, + 36834, + 36835, + 36836, + 36837, + 36838, + 36839, + 36840, + 36841, + 36842, + 36843, + 36844, + 36845, + 36846, + 36847, + 36848, + 36849, + 36850, + 36851, + 36852, + 36853, + 36854, + 36855, + 36856, + 36857, + 36858, + 36859, + 36860, + 36861, + 36862, + 36863, + 36864, + 36865, + 36866, + 36867, + 36868, + 36869, + 36870, + 36871, + 36872, + 36873, + 36874, + 36875, + 36876, + 36877, + 36878, + 36879, + 36880, + 36881, + 36882, + 36883, + 36884, + 36885, + 36886, + 36887, + 36888, + 36889, + 36890, + 36891, + 36892, + 36893, + 36894, + 36895, + 36896, + 36897, + 36898, + 36899, + 36900, + 36901, + 36902, + 36903, + 36904, + 36905, + 36906, + 36907, + 36908, + 36909, + 36910, + 36911, + 36912, + 36913, + 36914, + 36915, + 36916, + 36917, + 36918, + 36919, + 36920, + 36921, + 36922, + 36923, + 36924, + 36925, + 36926, + 36927, + 36928, + 36929, + 36930, + 36931, + 36932, + 36933, + 36934, + 36935, + 36936, + 36937, + 36938, + 36939, + 36940, + 36941, + 36942, + 36943, + 36944, + 36945, + 36946, + 36947, + 36948, + 36949, + 36950, + 36951, + 36952, + 36953, + 36954, + 36955, + 36956, + 36957, + 36958, + 36959, + 36960, + 36961, + 36962, + 36963, + 36964, + 36965, + 36966, + 36967, + 36968, + 36969, + 36970, + 36971, + 36972, + 36973, + 36974, + 36975, + 36976, + 36977, + 36978, + 36979, + 36980, + 36981, + 36982, + 36983, + 36984, + 36985, + 36986, + 36987, + 36988, + 36989, + 36990, + 36991, + 36992, + 36993, + 36994, + 36995, + 36996, + 36997, + 36998, + 36999, + 37000, + 37001, + 37002, + 37003, + 37004, + 37005, + 37006, + 37007, + 37008, + 37009, + 37010, + 37011, + 37012, + 37013, + 37014, + 37015, + 37016, + 37017, + 37018, + 37019, + 37020, + 37021, + 37022, + 37023, + 37024, + 37025, + 37026, + 37027, + 37028, + 37029, + 37030, + 37031, + 37032, + 37033, + 37034, + 37035, + 37036, + 37037, + 37038, + 37039, + 37040, + 37041, + 37042, + 37043, + 37044, + 37045, + 37046, + 37047, + 37048, + 37049, + 37050, + 37051, + 37052, + 37053, + 37054, + 37055, + 37056, + 37057, + 37058, + 37059, + 37060, + 37061, + 37062, + 37063, + 37064, + 37065, + 37066, + 37067, + 37068, + 37069, + 37070, + 37071, + 37072, + 37073, + 37074, + 37075, + 37076, + 37077, + 37078, + 37079, + 37080, + 37081, + 37082, + 37083, + 37084, + 37085, + 37086, + 37087, + 37088, + 37089, + 37090, + 37091, + 37092, + 37093, + 37094, + 37095, + 37096, + 37097, + 37098, + 37099, + 37100, + 37101, + 37102, + 37103, + 37104, + 37105, + 37106, + 37107, + 37108, + 37109, + 37110, + 37111, + 37112, + 37113, + 37114, + 37115, + 37116, + 37117, + 37118, + 37119, + 37120, + 37121, + 37122, + 37123, + 37124, + 37125, + 37126, + 37127, + 37128, + 37129, + 37130, + 37131, + 37132, + 37133, + 37134, + 37135, + 37136, + 37137, + 37138, + 37139, + 37140, + 37141, + 37142, + 37143, + 37144, + 37145, + 37146, + 37147, + 37148, + 37149, + 37150, + 37151, + 37152, + 37153, + 37154, + 37155, + 37156, + 37157, + 37158, + 37159, + 37160, + 37161, + 37162, + 37163, + 37164, + 37165, + 37166, + 37167, + 37168, + 37169, + 37170, + 37171, + 37172, + 37173, + 37174, + 37175, + 37176, + 37177, + 37178, + 37179, + 37180, + 37181, + 37182, + 37183, + 37184, + 37185, + 37186, + 37187, + 37188, + 37189, + 37190, + 37191, + 37192, + 37193, + 37194, + 37195, + 37196, + 37197, + 37198, + 37199, + 37200, + 37201, + 37202, + 37203, + 37204, + 37205, + 37206, + 37207, + 37208, + 37209, + 37210, + 37211, + 37212, + 37213, + 37214, + 37215, + 37216, + 37217, + 37218, + 37219, + 37220, + 37221, + 37222, + 37223, + 37224, + 37225, + 37226, + 37227, + 37228, + 37229, + 37230, + 37231, + 37232, + 37233, + 37234, + 37235, + 37236, + 37237, + 37238, + 37239, + 37240, + 37241, + 37242, + 37243, + 37244, + 37245, + 37246, + 37247, + 37248, + 37249, + 37250, + 37251, + 37252, + 37253, + 37254, + 37255, + 37256, + 37257, + 37258, + 37259, + 37260, + 37261, + 37262, + 37263, + 37264, + 37265, + 37266, + 37267, + 37268, + 37269, + 37270, + 37271, + 37272, + 37273, + 37274, + 37275, + 37276, + 37277, + 37278, + 37279, + 37280, + 37281, + 37282, + 37283, + 37284, + 37285, + 37286, + 37287, + 37288, + 37289, + 37290, + 37291, + 37292, + 37293, + 37294, + 37295, + 37296, + 37297, + 37298, + 37299, + 37300, + 37301, + 37302, + 37303, + 37304, + 37305, + 37306, + 37307, + 37308, + 37309, + 37310, + 37311, + 37312, + 37313, + 37314, + 37315, + 37316, + 37317, + 37318, + 37319, + 37320, + 37321, + 37322, + 37323, + 37324, + 37325, + 37326, + 37327, + 37328, + 37329, + 37330, + 37331, + 37332, + 37333, + 37334, + 37335, + 37336, + 37337, + 37338, + 37339, + 37340, + 37341, + 37342, + 37343, + 37344, + 37345, + 37346, + 37347, + 37348, + 37349, + 37350, + 37351, + 37352, + 37353, + 37354, + 37355, + 37356, + 37357, + 37358, + 37359, + 37360, + 37361, + 37362, + 37363, + 37364, + 37365, + 37366, + 37367, + 37368, + 37369, + 37370, + 37371, + 37372, + 37373, + 37374, + 37375, + 37376, + 37377, + 37378, + 37379, + 37380, + 37381, + 37382, + 37383, + 37384, + 37385, + 37386, + 37387, + 37388, + 37389, + 37390, + 37391, + 37392, + 37393, + 37394, + 37395, + 37396, + 37397, + 37398, + 37399, + 37400, + 37401, + 37402, + 37403, + 37404, + 37405, + 37406, + 37407, + 37408, + 37409, + 37410, + 37411, + 37412, + 37413, + 37414, + 37415, + 37416, + 37417, + 37418, + 37419, + 37420, + 37421, + 37422, + 37423, + 37424, + 37425, + 37426, + 37427, + 37428, + 37429, + 37430, + 37431, + 37432, + 37433, + 37434, + 37435, + 37436, + 37437, + 37438, + 37439, + 37440, + 37441, + 37442, + 37443, + 37444, + 37445, + 37446, + 37447, + 37448, + 37449, + 37450, + 37451, + 37452, + 37453, + 37454, + 37455, + 37456, + 37457, + 37458, + 37459, + 37460, + 37461, + 37462, + 37463, + 37464, + 37465, + 37466, + 37467, + 37468, + 37469, + 37470, + 37471, + 37472, + 37473, + 37474, + 37475, + 37476, + 37477, + 37478, + 37479, + 37480, + 37481, + 37482, + 37483, + 37484, + 37485, + 37486, + 37487, + 37488, + 37489, + 37490, + 37491, + 37492, + 37493, + 37494, + 37495, + 37496, + 37497, + 37498, + 37499, + 37500, + 37501, + 37502, + 37503, + 37504, + 37505, + 37506, + 37507, + 37508, + 37509, + 37510, + 37511, + 37512, + 37513, + 37514, + 37515, + 37516, + 37517, + 37518, + 37519, + 37520, + 37521, + 37522, + 37523, + 37524, + 37525, + 37526, + 37527, + 37528, + 37529, + 37530, + 37531, + 37532, + 37533, + 37534, + 37535, + 37536, + 37537, + 37538, + 37539, + 37540, + 37541, + 37542, + 37543, + 37544, + 37545, + 37546, + 37547, + 37548, + 37549, + 37550, + 37551, + 37552, + 37553, + 37554, + 37555, + 37556, + 37557, + 37558, + 37559, + 37560, + 37561, + 37562, + 37563, + 37564, + 37565, + 37566, + 37567, + 37568, + 37569, + 37570, + 37571, + 37572, + 37573, + 37574, + 37575, + 37576, + 37577, + 37578, + 37579, + 37580, + 37581, + 37582, + 37583, + 37584, + 37585, + 37586, + 37587, + 37588, + 37589, + 37590, + 37591, + 37592, + 37593, + 37594, + 37595, + 37596, + 37597, + 37598, + 37599, + 37600, + 37601, + 37602, + 37603, + 37604, + 37605, + 37606, + 37607, + 37608, + 37609, + 37610, + 37611, + 37612, + 37613, + 37614, + 37615, + 37616, + 37617, + 37618, + 37619, + 37620, + 37621, + 37622, + 37623, + 37624, + 37625, + 37626, + 37627, + 37628, + 37629, + 37630, + 37631, + 37632, + 37633, + 37634, + 37635, + 37636, + 37637, + 37638, + 37639, + 37640, + 37641, + 37642, + 37643, + 37644, + 37645, + 37646, + 37647, + 37648, + 37649, + 37650, + 37651, + 37652, + 37653, + 37654, + 37655, + 37656, + 37657, + 37658, + 37659, + 37660, + 37661, + 37662, + 37663, + 37664, + 37665, + 37666, + 37667, + 37668, + 37669, + 37670, + 37671, + 37672, + 37673, + 37674, + 37675, + 37676, + 37677, + 37678, + 37679, + 37680, + 37681, + 37682, + 37683, + 37684, + 37685, + 37686, + 37687, + 37688, + 37689, + 37690, + 37691, + 37692, + 37693, + 37694, + 37695, + 37696, + 37697, + 37698, + 37699, + 37700, + 37701, + 37702, + 37703, + 37704, + 37705, + 37706, + 37707, + 37708, + 37709, + 37710, + 37711, + 37712, + 37713, + 37714, + 37715, + 37716, + 37717, + 37718, + 37719, + 37720, + 37721, + 37722, + 37723, + 37724, + 37725, + 37726, + 37727, + 37728, + 37729, + 37730, + 37731, + 37732, + 37733, + 37734, + 37735, + 37736, + 37737, + 37738, + 37739, + 37740, + 37741, + 37742, + 37743, + 37744, + 37745, + 37746, + 37747, + 37748, + 37749, + 37750, + 37751, + 37752, + 37753, + 37754, + 37755, + 37756, + 37757, + 37758, + 37759, + 37760, + 37761, + 37762, + 37763, + 37764, + 37765, + 37766, + 37767, + 37768, + 37769, + 37770, + 37771, + 37772, + 37773, + 37774, + 37775, + 37776, + 37777, + 37778, + 37779, + 37780, + 37781, + 37782, + 37783, + 37784, + 37785, + 37786, + 37787, + 37788, + 37789, + 37790, + 37791, + 37792, + 37793, + 37794, + 37795, + 37796, + 37797, + 37798, + 37799, + 37800, + 37801, + 37802, + 37803, + 37804, + 37805, + 37806, + 37807, + 37808, + 37809, + 37810, + 37811, + 37812, + 37813, + 37814, + 37815, + 37816, + 37817, + 37818, + 37819, + 37820, + 37821, + 37822, + 37823, + 37824, + 37825, + 37826, + 37827, + 37828, + 37829, + 37830, + 37831, + 37832, + 37833, + 37834, + 37835, + 37836, + 37837, + 37838, + 37839, + 37840, + 37841, + 37842, + 37843, + 37844, + 37845, + 37846, + 37847, + 37848, + 37849, + 37850, + 37851, + 37852, + 37853, + 37854, + 37855, + 37856, + 37857, + 37858, + 37859, + 37860, + 37861, + 37862, + 37863, + 37864, + 37865, + 37866, + 37867, + 37868, + 37869, + 37870, + 37871, + 37872, + 37873, + 37874, + 37875, + 37876, + 37877, + 37878, + 37879, + 37880, + 37881, + 37882, + 37883, + 37884, + 37885, + 37886, + 37887, + 37888, + 37889, + 37890, + 37891, + 37892, + 37893, + 37894, + 37895, + 37896, + 37897, + 37898, + 37899, + 37900, + 37901, + 37902, + 37903, + 37904, + 37905, + 37906, + 37907, + 37908, + 37909, + 37910, + 37911, + 37912, + 37913, + 37914, + 37915, + 37916, + 37917, + 37918, + 37919, + 37920, + 37921, + 37922, + 37923, + 37924, + 37925, + 37926, + 37927, + 37928, + 37929, + 37930, + 37931, + 37932, + 37933, + 37934, + 37935, + 37936, + 37937, + 37938, + 37939, + 37940, + 37941, + 37942, + 37943, + 37944, + 37945, + 37946, + 37947, + 37948, + 37949, + 37950, + 37951, + 37952, + 37953, + 37954, + 37955, + 37956, + 37957, + 37958, + 37959, + 37960, + 37961, + 37962, + 37963, + 37964, + 37965, + 37966, + 37967, + 37968, + 37969, + 37970, + 37971, + 37972, + 37973, + 37974, + 37975, + 37976, + 37977, + 37978, + 37979, + 37980, + 37981, + 37982, + 37983, + 37984, + 37985, + 37986, + 37987, + 37988, + 37989, + 37990, + 37991, + 37992, + 37993, + 37994, + 37995, + 37996, + 37997, + 37998, + 37999, + 38000, + 38001, + 38002, + 38003, + 38004, + 38005, + 38006, + 38007, + 38008, + 38009, + 38010, + 38011, + 38012, + 38013, + 38014, + 38015, + 38016, + 38017, + 38018, + 38019, + 38020, + 38021, + 38022, + 38023, + 38024, + 38025, + 38026, + 38027, + 38028, + 38029, + 38030, + 38031, + 38032, + 38033, + 38034, + 38035, + 38036, + 38037, + 38038, + 38039, + 38040, + 38041, + 38042, + 38043, + 38044, + 38045, + 38046, + 38047, + 38048, + 38049, + 38050, + 38051, + 38052, + 38053, + 38054, + 38055, + 38056, + 38057, + 38058, + 38059, + 38060, + 38061, + 38062, + 38063, + 38064, + 38065, + 38066, + 38067, + 38068, + 38069, + 38070, + 38071, + 38072, + 38073, + 38074, + 38075, + 38076, + 38077, + 38078, + 38079, + 38080, + 38081, + 38082, + 38083, + 38084, + 38085, + 38086, + 38087, + 38088, + 38089, + 38090, + 38091, + 38092, + 38093, + 38094, + 38095, + 38096, + 38097, + 38098, + 38099, + 38100, + 38101, + 38102, + 38103, + 38104, + 38105, + 38106, + 38107, + 38108, + 38109, + 38110, + 38111, + 38112, + 38113, + 38114, + 38115, + 38116, + 38117, + 38118, + 38119, + 38120, + 38121, + 38122, + 38123, + 38124, + 38125, + 38126, + 38127, + 38128, + 38129, + 38130, + 38131, + 38132, + 38133, + 38134, + 38135, + 38136, + 38137, + 38138, + 38139, + 38140, + 38141, + 38142, + 38143, + 38144, + 38145, + 38146, + 38147, + 38148, + 38149, + 38150, + 38151, + 38152, + 38153, + 38154, + 38155, + 38156, + 38157, + 38158, + 38159, + 38160, + 38161, + 38162, + 38163, + 38164, + 38165, + 38166, + 38167, + 38168, + 38169, + 38170, + 38171, + 38172, + 38173, + 38174, + 38175, + 38176, + 38177, + 38178, + 38179, + 38180, + 38181, + 38182, + 38183, + 38184, + 38185, + 38186, + 38187, + 38188, + 38189, + 38190, + 38191, + 38192, + 38193, + 38194, + 38195, + 38196, + 38197, + 38198, + 38199, + 38200, + 38201, + 38202, + 38203, + 38204, + 38205, + 38206, + 38207, + 38208, + 38209, + 38210, + 38211, + 38212, + 38213, + 38214, + 38215, + 38216, + 38217, + 38218, + 38219, + 38220, + 38221, + 38222, + 38223, + 38224, + 38225, + 38226, + 38227, + 38228, + 38229, + 38230, + 38231, + 38232, + 38233, + 38234, + 38235, + 38236, + 38237, + 38238, + 38239, + 38240, + 38241, + 38242, + 38243, + 38244, + 38245, + 38246, + 38247, + 38248, + 38249, + 38250, + 38251, + 38252, + 38253, + 38254, + 38255, + 38256, + 38257, + 38258, + 38259, + 38260, + 38261, + 38262, + 38263, + 38264, + 38265, + 38266, + 38267, + 38268, + 38269, + 38270, + 38271, + 38272, + 38273, + 38274, + 38275, + 38276, + 38277, + 38278, + 38279, + 38280, + 38281, + 38282, + 38283, + 38284, + 38285, + 38286, + 38287, + 38288, + 38289, + 38290, + 38291, + 38292, + 38293, + 38294, + 38295, + 38296, + 38297, + 38298, + 38299, + 38300, + 38301, + 38302, + 38303, + 38304, + 38305, + 38306, + 38307, + 38308, + 38309, + 38310, + 38311, + 38312, + 38313, + 38314, + 38315, + 38316, + 38317, + 38318, + 38319, + 38320, + 38321, + 38322, + 38323, + 38324, + 38325, + 38326, + 38327, + 38328, + 38329, + 38330, + 38331, + 38332, + 38333, + 38334, + 38335, + 38336, + 38337, + 38338, + 38339, + 38340, + 38341, + 38342, + 38343, + 38344, + 38345, + 38346, + 38347, + 38348, + 38349, + 38350, + 38351, + 38352, + 38353, + 38354, + 38355, + 38356, + 38357, + 38358, + 38359, + 38360, + 38361, + 38362, + 38363, + 38364, + 38365, + 38366, + 38367, + 38368, + 38369, + 38370, + 38371, + 38372, + 38373, + 38374, + 38375, + 38376, + 38377, + 38378, + 38379, + 38380, + 38381, + 38382, + 38383, + 38384, + 38385, + 38386, + 38387, + 38388, + 38389, + 38390, + 38391, + 38392, + 38393, + 38394, + 38395, + 38396, + 38397, + 38398, + 38399, + 38400, + 38401, + 38402, + 38403, + 38404, + 38405, + 38406, + 38407, + 38408, + 38409, + 38410, + 38411, + 38412, + 38413, + 38414, + 38415, + 38416, + 38417, + 38418, + 38419, + 38420, + 38421, + 38422, + 38423, + 38424, + 38425, + 38426, + 38427, + 38428, + 38429, + 38430, + 38431, + 38432, + 38433, + 38434, + 38435, + 38436, + 38437, + 38438, + 38439, + 38440, + 38441, + 38442, + 38443, + 38444, + 38445, + 38446, + 38447, + 38448, + 38449, + 38450, + 38451, + 38452, + 38453, + 38454, + 38455, + 38456, + 38457, + 38458, + 38459, + 38460, + 38461, + 38462, + 38463, + 38464, + 38465, + 38466, + 38467, + 38468, + 38469, + 38470, + 38471, + 38472, + 38473, + 38474, + 38475, + 38476, + 38477, + 38478, + 38479, + 38480, + 38481, + 38482, + 38483, + 38484, + 38485, + 38486, + 38487, + 38488, + 38489, + 38490, + 38491, + 38492, + 38493, + 38494, + 38495, + 38496, + 38497, + 38498, + 38499, + 38500, + 38501, + 38502, + 38503, + 38504, + 38505, + 38506, + 38507, + 38508, + 38509, + 38510, + 38511, + 38512, + 38513, + 38514, + 38515, + 38516, + 38517, + 38518, + 38519, + 38520, + 38521, + 38522, + 38523, + 38524, + 38525, + 38526, + 38527, + 38528, + 38529, + 38530, + 38531, + 38532, + 38533, + 38534, + 38535, + 38536, + 38537, + 38538, + 38539, + 38540, + 38541, + 38542, + 38543, + 38544, + 38545, + 38546, + 38547, + 38548, + 38549, + 38550, + 38551, + 38552, + 38553, + 38554, + 38555, + 38556, + 38557, + 38558, + 38559, + 38560, + 38561, + 38562, + 38563, + 38564, + 38565, + 38566, + 38567, + 38568, + 38569, + 38570, + 38571, + 38572, + 38573, + 38574, + 38575, + 38576, + 38577, + 38578, + 38579, + 38580, + 38581, + 38582, + 38583, + 38584, + 38585, + 38586, + 38587, + 38588, + 38589, + 38590, + 38591, + 38592, + 38593, + 38594, + 38595, + 38596, + 38597, + 38598, + 38599, + 38600, + 38601, + 38602, + 38603, + 38604, + 38605, + 38606, + 38607, + 38608, + 38609, + 38610, + 38611, + 38612, + 38613, + 38614, + 38615, + 38616, + 38617, + 38618, + 38619, + 38620, + 38621, + 38622, + 38623, + 38624, + 38625, + 38626, + 38627, + 38628, + 38629, + 38630, + 38631, + 38632, + 38633, + 38634, + 38635, + 38636, + 38637, + 38638, + 38639, + 38640, + 38641, + 38642, + 38643, + 38644, + 38645, + 38646, + 38647, + 38648, + 38649, + 38650, + 38651, + 38652, + 38653, + 38654, + 38655, + 38656, + 38657, + 38658, + 38659, + 38660, + 38661, + 38662, + 38663, + 38664, + 38665, + 38666, + 38667, + 38668, + 38669, + 38670, + 38671, + 38672, + 38673, + 38674, + 38675, + 38676, + 38677, + 38678, + 38679, + 38680, + 38681, + 38682, + 38683, + 38684, + 38685, + 38686, + 38687, + 38688, + 38689, + 38690, + 38691, + 38692, + 38693, + 38694, + 38695, + 38696, + 38697, + 38698, + 38699, + 38700, + 38701, + 38702, + 38703, + 38704, + 38705, + 38706, + 38707, + 38708, + 38709, + 38710, + 38711, + 38712, + 38713, + 38714, + 38715, + 38716, + 38717, + 38718, + 38719, + 38720, + 38721, + 38722, + 38723, + 38724, + 38725, + 38726, + 38727, + 38728, + 38729, + 38730, + 38731, + 38732, + 38733, + 38734, + 38735, + 38736, + 38737, + 38738, + 38739, + 38740, + 38741, + 38742, + 38743, + 38744, + 38745, + 38746, + 38747, + 38748, + 38749, + 38750, + 38751, + 38752, + 38753, + 38754, + 38755, + 38756, + 38757, + 38758, + 38759, + 38760, + 38761, + 38762, + 38763, + 38764, + 38765, + 38766, + 38767, + 38768, + 38769, + 38770, + 38771, + 38772, + 38773, + 38774, + 38775, + 38776, + 38777, + 38778, + 38779, + 38780, + 38781, + 38782, + 38783, + 38784, + 38785, + 38786, + 38787, + 38788, + 38789, + 38790, + 38791, + 38792, + 38793, + 38794, + 38795, + 38796, + 38797, + 38798, + 38799, + 38800, + 38801, + 38802, + 38803, + 38804, + 38805, + 38806, + 38807, + 38808, + 38809, + 38810, + 38811, + 38812, + 38813, + 38814, + 38815, + 38816, + 38817, + 38818, + 38819, + 38820, + 38821, + 38822, + 38823, + 38824, + 38825, + 38826, + 38827, + 38828, + 38829, + 38830, + 38831, + 38832, + 38833, + 38834, + 38835, + 38836, + 38837, + 38838, + 38839, + 38840, + 38841, + 38842, + 38843, + 38844, + 38845, + 38846, + 38847, + 38848, + 38849, + 38850, + 38851, + 38852, + 38853, + 38854, + 38855, + 38856, + 38857, + 38858, + 38859, + 38860, + 38861, + 38862, + 38863, + 38864, + 38865, + 38866, + 38867, + 38868, + 38869, + 38870, + 38871, + 38872, + 38873, + 38874, + 38875, + 38876, + 38877, + 38878, + 38879, + 38880, + 38881, + 38882, + 38883, + 38884, + 38885, + 38886, + 38887, + 38888, + 38889, + 38890, + 38891, + 38892, + 38893, + 38894, + 38895, + 38896, + 38897, + 38898, + 38899, + 38900, + 38901, + 38902, + 38903, + 38904, + 38905, + 38906, + 38907, + 38908, + 38909, + 38910, + 38911, + 38912, + 38913, + 38914, + 38915, + 38916, + 38917, + 38918, + 38919, + 38920, + 38921, + 38922, + 38923, + 38924, + 38925, + 38926, + 38927, + 38928, + 38929, + 38930, + 38931, + 38932, + 38933, + 38934, + 38935, + 38936, + 38937, + 38938, + 38939, + 38940, + 38941, + 38942, + 38943, + 38944, + 38945, + 38946, + 38947, + 38948, + 38949, + 38950, + 38951, + 38952, + 38953, + 38954, + 38955, + 38956, + 38957, + 38958, + 38959, + 38960, + 38961, + 38962, + 38963, + 38964, + 38965, + 38966, + 38967, + 38968, + 38969, + 38970, + 38971, + 38972, + 38973, + 38974, + 38975, + 38976, + 38977, + 38978, + 38979, + 38980, + 38981, + 38982, + 38983, + 38984, + 38985, + 38986, + 38987, + 38988, + 38989, + 38990, + 38991, + 38992, + 38993, + 38994, + 38995, + 38996, + 38997, + 38998, + 38999, + 39000, + 39001, + 39002, + 39003, + 39004, + 39005, + 39006, + 39007, + 39008, + 39009, + 39010, + 39011, + 39012, + 39013, + 39014, + 39015, + 39016, + 39017, + 39018, + 39019, + 39020, + 39021, + 39022, + 39023, + 39024, + 39025, + 39026, + 39027, + 39028, + 39029, + 39030, + 39031, + 39032, + 39033, + 39034, + 39035, + 39036, + 39037, + 39038, + 39039, + 39040, + 39041, + 39042, + 39043, + 39044, + 39045, + 39046, + 39047, + 39048, + 39049, + 39050, + 39051, + 39052, + 39053, + 39054, + 39055, + 39056, + 39057, + 39058, + 39059, + 39060, + 39061, + 39062, + 39063, + 39064, + 39065, + 39066, + 39067, + 39068, + 39069, + 39070, + 39071, + 39072, + 39073, + 39074, + 39075, + 39076, + 39077, + 39078, + 39079, + 39080, + 39081, + 39082, + 39083, + 39084, + 39085, + 39086, + 39087, + 39088, + 39089, + 39090, + 39091, + 39092, + 39093, + 39094, + 39095, + 39096, + 39097, + 39098, + 39099, + 39100, + 39101, + 39102, + 39103, + 39104, + 39105, + 39106, + 39107, + 39108, + 39109, + 39110, + 39111, + 39112, + 39113, + 39114, + 39115, + 39116, + 39117, + 39118, + 39119, + 39120, + 39121, + 39122, + 39123, + 39124, + 39125, + 39126, + 39127, + 39128, + 39129, + 39130, + 39131, + 39132, + 39133, + 39134, + 39135, + 39136, + 39137, + 39138, + 39139, + 39140, + 39141, + 39142, + 39143, + 39144, + 39145, + 39146, + 39147, + 39148, + 39149, + 39150, + 39151, + 39152, + 39153, + 39154, + 39155, + 39156, + 39157, + 39158, + 39159, + 39160, + 39161, + 39162, + 39163, + 39164, + 39165, + 39166, + 39167, + 39168, + 39169, + 39170, + 39171, + 39172, + 39173, + 39174, + 39175, + 39176, + 39177, + 39178, + 39179, + 39180, + 39181, + 39182, + 39183, + 39184, + 39185, + 39186, + 39187, + 39188, + 39189, + 39190, + 39191, + 39192, + 39193, + 39194, + 39195, + 39196, + 39197, + 39198, + 39199, + 39200, + 39201, + 39202, + 39203, + 39204, + 39205, + 39206, + 39207, + 39208, + 39209, + 39210, + 39211, + 39212, + 39213, + 39214, + 39215, + 39216, + 39217, + 39218, + 39219, + 39220, + 39221, + 39222, + 39223, + 39224, + 39225, + 39226, + 39227, + 39228, + 39229, + 39230, + 39231, + 39232, + 39233, + 39234, + 39235, + 39236, + 39237, + 39238, + 39239, + 39240, + 39241, + 39242, + 39243, + 39244, + 39245, + 39246, + 39247, + 39248, + 39249, + 39250, + 39251, + 39252, + 39253, + 39254, + 39255, + 39256, + 39257, + 39258, + 39259, + 39260, + 39261, + 39262, + 39263, + 39264, + 39265, + 39266, + 39267, + 39268, + 39269, + 39270, + 39271, + 39272, + 39273, + 39274, + 39275, + 39276, + 39277, + 39278, + 39279, + 39280, + 39281, + 39282, + 39283, + 39284, + 39285, + 39286, + 39287, + 39288, + 39289, + 39290, + 39291, + 39292, + 39293, + 39294, + 39295, + 39296, + 39297, + 39298, + 39299, + 39300, + 39301, + 39302, + 39303, + 39304, + 39305, + 39306, + 39307, + 39308, + 39309, + 39310, + 39311, + 39312, + 39313, + 39314, + 39315, + 39316, + 39317, + 39318, + 39319, + 39320, + 39321, + 39322, + 39323, + 39324, + 39325, + 39326, + 39327, + 39328, + 39329, + 39330, + 39331, + 39332, + 39333, + 39334, + 39335, + 39336, + 39337, + 39338, + 39339, + 39340, + 39341, + 39342, + 39343, + 39344, + 39345, + 39346, + 39347, + 39348, + 39349, + 39350, + 39351, + 39352, + 39353, + 39354, + 39355, + 39356, + 39357, + 39358, + 39359, + 39360, + 39361, + 39362, + 39363, + 39364, + 39365, + 39366, + 39367, + 39368, + 39369, + 39370, + 39371, + 39372, + 39373, + 39374, + 39375, + 39376, + 39377, + 39378, + 39379, + 39380, + 39381, + 39382, + 39383, + 39384, + 39385, + 39386, + 39387, + 39388, + 39389, + 39390, + 39391, + 39392, + 39393, + 39394, + 39395, + 39396, + 39397, + 39398, + 39399, + 39400, + 39401, + 39402, + 39403, + 39404, + 39405, + 39406, + 39407, + 39408, + 39409, + 39410, + 39411, + 39412, + 39413, + 39414, + 39415, + 39416, + 39417, + 39418, + 39419, + 39420, + 39421, + 39422, + 39423, + 39424, + 39425, + 39426, + 39427, + 39428, + 39429, + 39430, + 39431, + 39432, + 39433, + 39434, + 39435, + 39436, + 39437, + 39438, + 39439, + 39440, + 39441, + 39442, + 39443, + 39444, + 39445, + 39446, + 39447, + 39448, + 39449, + 39450, + 39451, + 39452, + 39453, + 39454, + 39455, + 39456, + 39457, + 39458, + 39459, + 39460, + 39461, + 39462, + 39463, + 39464, + 39465, + 39466, + 39467, + 39468, + 39469, + 39470, + 39471, + 39472, + 39473, + 39474, + 39475, + 39476, + 39477, + 39478, + 39479, + 39480, + 39481, + 39482, + 39483, + 39484, + 39485, + 39486, + 39487, + 39488, + 39489, + 39490, + 39491, + 39492, + 39493, + 39494, + 39495, + 39496, + 39497, + 39498, + 39499, + 39500, + 39501, + 39502, + 39503, + 39504, + 39505, + 39506, + 39507, + 39508, + 39509, + 39510, + 39511, + 39512, + 39513, + 39514, + 39515, + 39516, + 39517, + 39518, + 39519, + 39520, + 39521, + 39522, + 39523, + 39524, + 39525, + 39526, + 39527, + 39528, + 39529, + 39530, + 39531, + 39532, + 39533, + 39534, + 39535, + 39536, + 39537, + 39538, + 39539, + 39540, + 39541, + 39542, + 39543, + 39544, + 39545, + 39546, + 39547, + 39548, + 39549, + 39550, + 39551, + 39552, + 39553, + 39554, + 39555, + 39556, + 39557, + 39558, + 39559, + 39560, + 39561, + 39562, + 39563, + 39564, + 39565, + 39566, + 39567, + 39568, + 39569, + 39570, + 39571, + 39572, + 39573, + 39574, + 39575, + 39576, + 39577, + 39578, + 39579, + 39580, + 39581, + 39582, + 39583, + 39584, + 39585, + 39586, + 39587, + 39588, + 39589, + 39590, + 39591, + 39592, + 39593, + 39594, + 39595, + 39596, + 39597, + 39598, + 39599, + 39600, + 39601, + 39602, + 39603, + 39604, + 39605, + 39606, + 39607, + 39608, + 39609, + 39610, + 39611, + 39612, + 39613, + 39614, + 39615, + 39616, + 39617, + 39618, + 39619, + 39620, + 39621, + 39622, + 39623, + 39624, + 39625, + 39626, + 39627, + 39628, + 39629, + 39630, + 39631, + 39632, + 39633, + 39634, + 39635, + 39636, + 39637, + 39638, + 39639, + 39640, + 39641, + 39642, + 39643, + 39644, + 39645, + 39646, + 39647, + 39648, + 39649, + 39650, + 39651, + 39652, + 39653, + 39654, + 39655, + 39656, + 39657, + 39658, + 39659, + 39660, + 39661, + 39662, + 39663, + 39664, + 39665, + 39666, + 39667, + 39668, + 39669, + 39670, + 39671, + 39672, + 39673, + 39674, + 39675, + 39676, + 39677, + 39678, + 39679, + 39680, + 39681, + 39682, + 39683, + 39684, + 39685, + 39686, + 39687, + 39688, + 39689, + 39690, + 39691, + 39692, + 39693, + 39694, + 39695, + 39696, + 39697, + 39698, + 39699, + 39700, + 39701, + 39702, + 39703, + 39704, + 39705, + 39706, + 39707, + 39708, + 39709, + 39710, + 39711, + 39712, + 39713, + 39714, + 39715, + 39716, + 39717, + 39718, + 39719, + 39720, + 39721, + 39722, + 39723, + 39724, + 39725, + 39726, + 39727, + 39728, + 39729, + 39730, + 39731, + 39732, + 39733, + 39734, + 39735, + 39736, + 39737, + 39738, + 39739, + 39740, + 39741, + 39742, + 39743, + 39744, + 39745, + 39746, + 39747, + 39748, + 39749, + 39750, + 39751, + 39752, + 39753, + 39754, + 39755, + 39756, + 39757, + 39758, + 39759, + 39760, + 39761, + 39762, + 39763, + 39764, + 39765, + 39766, + 39767, + 39768, + 39769, + 39770, + 39771, + 39772, + 39773, + 39774, + 39775, + 39776, + 39777, + 39778, + 39779, + 39780, + 39781, + 39782, + 39783, + 39784, + 39785, + 39786, + 39787, + 39788, + 39789, + 39790, + 39791, + 39792, + 39793, + 39794, + 39795, + 39796, + 39797, + 39798, + 39799, + 39800, + 39801, + 39802, + 39803, + 39804, + 39805, + 39806, + 39807, + 39808, + 39809, + 39810, + 39811, + 39812, + 39813, + 39814, + 39815, + 39816, + 39817, + 39818, + 39819, + 39820, + 39821, + 39822, + 39823, + 39824, + 39825, + 39826, + 39827, + 39828, + 39829, + 39830, + 39831, + 39832, + 39833, + 39834, + 39835, + 39836, + 39837, + 39838, + 39839, + 39840, + 39841, + 39842, + 39843, + 39844, + 39845, + 39846, + 39847, + 39848, + 39849, + 39850, + 39851, + 39852, + 39853, + 39854, + 39855, + 39856, + 39857, + 39858, + 39859, + 39860, + 39861, + 39862, + 39863, + 39864, + 39865, + 39866, + 39867, + 39868, + 39869, + 39870, + 39871, + 39872, + 39873, + 39874, + 39875, + 39876, + 39877, + 39878, + 39879, + 39880, + 39881, + 39882, + 39883, + 39884, + 39885, + 39886, + 39887, + 39888, + 39889, + 39890, + 39891, + 39892, + 39893, + 39894, + 39895, + 39896, + 39897, + 39898, + 39899, + 39900, + 39901, + 39902, + 39903, + 39904, + 39905, + 39906, + 39907, + 39908, + 39909, + 39910, + 39911, + 39912, + 39913, + 39914, + 39915, + 39916, + 39917, + 39918, + 39919, + 39920, + 39921, + 39922, + 39923, + 39924, + 39925, + 39926, + 39927, + 39928, + 39929, + 39930, + 39931, + 39932, + 39933, + 39934, + 39935, + 39936, + 39937, + 39938, + 39939, + 39940, + 39941, + 39942, + 39943, + 39944, + 39945, + 39946, + 39947, + 39948, + 39949, + 39950, + 39951, + 39952, + 39953, + 39954, + 39955, + 39956, + 39957, + 39958, + 39959, + 39960, + 39961, + 39962, + 39963, + 39964, + 39965, + 39966, + 39967, + 39968, + 39969, + 39970, + 39971, + 39972, + 39973, + 39974, + 39975, + 39976, + 39977, + 39978, + 39979, + 39980, + 39981, + 39982, + 39983, + 39984, + 39985, + 39986, + 39987, + 39988, + 39989, + 39990, + 39991, + 39992, + 39993, + 39994, + 39995, + 39996, + 39997, + 39998, + 39999, + 40000, + 40001, + 40002, + 40003, + 40004, + 40005, + 40006, + 40007, + 40008, + 40009, + 40010, + 40011, + 40012, + 40013, + 40014, + 40015, + 40016, + 40017, + 40018, + 40019, + 40020, + 40021, + 40022, + 40023, + 40024, + 40025, + 40026, + 40027, + 40028, + 40029, + 40030, + 40031, + 40032, + 40033, + 40034, + 40035, + 40036, + 40037, + 40038, + 40039, + 40040, + 40041, + 40042, + 40043, + 40044, + 40045, + 40046, + 40047, + 40048, + 40049, + 40050, + 40051, + 40052, + 40053, + 40054, + 40055, + 40056, + 40057, + 40058, + 40059, + 40060, + 40061, + 40062, + 40063, + 40064, + 40065, + 40066, + 40067, + 40068, + 40069, + 40070, + 40071, + 40072, + 40073, + 40074, + 40075, + 40076, + 40077, + 40078, + 40079, + 40080, + 40081, + 40082, + 40083, + 40084, + 40085, + 40086, + 40087, + 40088, + 40089, + 40090, + 40091, + 40092, + 40093, + 40094, + 40095, + 40096, + 40097, + 40098, + 40099, + 40100, + 40101, + 40102, + 40103, + 40104, + 40105, + 40106, + 40107, + 40108, + 40109, + 40110, + 40111, + 40112, + 40113, + 40114, + 40115, + 40116, + 40117, + 40118, + 40119, + 40120, + 40121, + 40122, + 40123, + 40124, + 40125, + 40126, + 40127, + 40128, + 40129, + 40130, + 40131, + 40132, + 40133, + 40134, + 40135, + 40136, + 40137, + 40138, + 40139, + 40140, + 40141, + 40142, + 40143, + 40144, + 40145, + 40146, + 40147, + 40148, + 40149, + 40150, + 40151, + 40152, + 40153, + 40154, + 40155, + 40156, + 40157, + 40158, + 40159, + 40160, + 40161, + 40162, + 40163, + 40164, + 40165, + 40166, + 40167, + 40168, + 40169, + 40170, + 40171, + 40172, + 40173, + 40174, + 40175, + 40176, + 40177, + 40178, + 40179, + 40180, + 40181, + 40182, + 40183, + 40184, + 40185, + 40186, + 40187, + 40188, + 40189, + 40190, + 40191, + 40192, + 40193, + 40194, + 40195, + 40196, + 40197, + 40198, + 40199, + 40200, + 40201, + 40202, + 40203, + 40204, + 40205, + 40206, + 40207, + 40208, + 40209, + 40210, + 40211, + 40212, + 40213, + 40214, + 40215, + 40216, + 40217, + 40218, + 40219, + 40220, + 40221, + 40222, + 40223, + 40224, + 40225, + 40226, + 40227, + 40228, + 40229, + 40230, + 40231, + 40232, + 40233, + 40234, + 40235, + 40236, + 40237, + 40238, + 40239, + 40240, + 40241, + 40242, + 40243, + 40244, + 40245, + 40246, + 40247, + 40248, + 40249, + 40250, + 40251, + 40252, + 40253, + 40254, + 40255, + 40256, + 40257, + 40258, + 40259, + 40260, + 40261, + 40262, + 40263, + 40264, + 40265, + 40266, + 40267, + 40268, + 40269, + 40270, + 40271, + 40272, + 40273, + 40274, + 40275, + 40276, + 40277, + 40278, + 40279, + 40280, + 40281, + 40282, + 40283, + 40284, + 40285, + 40286, + 40287, + 40288, + 40289, + 40290, + 40291, + 40292, + 40293, + 40294, + 40295, + 40296, + 40297, + 40298, + 40299, + 40300, + 40301, + 40302, + 40303, + 40304, + 40305, + 40306, + 40307, + 40308, + 40309, + 40310, + 40311, + 40312, + 40313, + 40314, + 40315, + 40316, + 40317, + 40318, + 40319, + 40320, + 40321, + 40322, + 40323, + 40324, + 40325, + 40326, + 40327, + 40328, + 40329, + 40330, + 40331, + 40332, + 40333, + 40334, + 40335, + 40336, + 40337, + 40338, + 40339, + 40340, + 40341, + 40342, + 40343, + 40344, + 40345, + 40346, + 40347, + 40348, + 40349, + 40350, + 40351, + 40352, + 40353, + 40354, + 40355, + 40356, + 40357, + 40358, + 40359, + 40360, + 40361, + 40362, + 40363, + 40364, + 40365, + 40366, + 40367, + 40368, + 40369, + 40370, + 40371, + 40372, + 40373, + 40374, + 40375, + 40376, + 40377, + 40378, + 40379, + 40380, + 40381, + 40382, + 40383, + 40384, + 40385, + 40386, + 40387, + 40388, + 40389, + 40390, + 40391, + 40392, + 40393, + 40394, + 40395, + 40396, + 40397, + 40398, + 40399, + 40400, + 40401, + 40402, + 40403, + 40404, + 40405, + 40406, + 40407, + 40408, + 40409, + 40410, + 40411, + 40412, + 40413, + 40414, + 40415, + 40416, + 40417, + 40418, + 40419, + 40420, + 40421, + 40422, + 40423, + 40424, + 40425, + 40426, + 40427, + 40428, + 40429, + 40430, + 40431, + 40432, + 40433, + 40434, + 40435, + 40436, + 40437, + 40438, + 40439, + 40440, + 40441, + 40442, + 40443, + 40444, + 40445, + 40446, + 40447, + 40448, + 40449, + 40450, + 40451, + 40452, + 40453, + 40454, + 40455, + 40456, + 40457, + 40458, + 40459, + 40460, + 40461, + 40462, + 40463, + 40464, + 40465, + 40466, + 40467, + 40468, + 40469, + 40470, + 40471, + 40472, + 40473, + 40474, + 40475, + 40476, + 40477, + 40478, + 40479, + 40480, + 40481, + 40482, + 40483, + 40484, + 40485, + 40486, + 40487, + 40488, + 40489, + 40490, + 40491, + 40492, + 40493, + 40494, + 40495, + 40496, + 40497, + 40498, + 40499, + 40500, + 40501, + 40502, + 40503, + 40504, + 40505, + 40506, + 40507, + 40508, + 40509, + 40510, + 40511, + 40512, + 40513, + 40514, + 40515, + 40516, + 40517, + 40518, + 40519, + 40520, + 40521, + 40522, + 40523, + 40524, + 40525, + 40526, + 40527, + 40528, + 40529, + 40530, + 40531, + 40532, + 40533, + 40534, + 40535, + 40536, + 40537, + 40538, + 40539, + 40540, + 40541, + 40542, + 40543, + 40544, + 40545, + 40546, + 40547, + 40548, + 40549, + 40550, + 40551, + 40552, + 40553, + 40554, + 40555, + 40556, + 40557, + 40558, + 40559, + 40560, + 40561, + 40562, + 40563, + 40564, + 40565, + 40566, + 40567, + 40568, + 40569, + 40570, + 40571, + 40572, + 40573, + 40574, + 40575, + 40576, + 40577, + 40578, + 40579, + 40580, + 40581, + 40582, + 40583, + 40584, + 40585, + 40586, + 40587, + 40588, + 40589, + 40590, + 40591, + 40592, + 40593, + 40594, + 40595, + 40596, + 40597, + 40598, + 40599, + 40600, + 40601, + 40602, + 40603, + 40604, + 40605, + 40606, + 40607, + 40608, + 40609, + 40610, + 40611, + 40612, + 40613, + 40614, + 40615, + 40616, + 40617, + 40618, + 40619, + 40620, + 40621, + 40622, + 40623, + 40624, + 40625, + 40626, + 40627, + 40628, + 40629, + 40630, + 40631, + 40632, + 40633, + 40634, + 40635, + 40636, + 40637, + 40638, + 40639, + 40640, + 40641, + 40642, + 40643, + 40644, + 40645, + 40646, + 40647, + 40648, + 40649, + 40650, + 40651, + 40652, + 40653, + 40654, + 40655, + 40656, + 40657, + 40658, + 40659, + 40660, + 40661, + 40662, + 40663, + 40664, + 40665, + 40666, + 40667, + 40668, + 40669, + 40670, + 40671, + 40672, + 40673, + 40674, + 40675, + 40676, + 40677, + 40678, + 40679, + 40680, + 40681, + 40682, + 40683, + 40684, + 40685, + 40686, + 40687, + 40688, + 40689, + 40690, + 40691, + 40692, + 40693, + 40694, + 40695, + 40696, + 40697, + 40698, + 40699, + 40700, + 40701, + 40702, + 40703, + 40704, + 40705, + 40706, + 40707, + 40708, + 40709, + 40710, + 40711, + 40712, + 40713, + 40714, + 40715, + 40716, + 40717, + 40718, + 40719, + 40720, + 40721, + 40722, + 40723, + 40724, + 40725, + 40726, + 40727, + 40728, + 40729, + 40730, + 40731, + 40732, + 40733, + 40734, + 40735, + 40736, + 40737, + 40738, + 40739, + 40740, + 40741, + 40742, + 40743, + 40744, + 40745, + 40746, + 40747, + 40748, + 40749, + 40750, + 40751, + 40752, + 40753, + 40754, + 40755, + 40756, + 40757, + 40758, + 40759, + 40760, + 40761, + 40762, + 40763, + 40764, + 40765, + 40766, + 40767, + 40768, + 40769, + 40770, + 40771, + 40772, + 40773, + 40774, + 40775, + 40776, + 40777, + 40778, + 40779, + 40780, + 40781, + 40782, + 40783, + 40784, + 40785, + 40786, + 40787, + 40788, + 40789, + 40790, + 40791, + 40792, + 40793, + 40794, + 40795, + 40796, + 40797, + 40798, + 40799, + 40800, + 40801, + 40802, + 40803, + 40804, + 40805, + 40806, + 40807, + 40808, + 40809, + 40810, + 40811, + 40812, + 40813, + 40814, + 40815, + 40816, + 40817, + 40818, + 40819, + 40820, + 40821, + 40822, + 40823, + 40824, + 40825, + 40826, + 40827, + 40828, + 40829, + 40830, + 40831, + 40832, + 40833, + 40834, + 40835, + 40836, + 40837, + 40838, + 40839, + 40840, + 40841, + 40842, + 40843, + 40844, + 40845, + 40846, + 40847, + 40848, + 40849, + 40850, + 40851, + 40852, + 40853, + 40854, + 40855, + 40856, + 40857, + 40858, + 40859, + 40860, + 40861, + 40862, + 40863, + 40864, + 40865, + 40866, + 40867, + 40868, + 40869, + 40870, + 40871, + 40872, + 40873, + 40874, + 40875, + 40876, + 40877, + 40878, + 40879, + 40880, + 40881, + 40882, + 40883, + 40884, + 40885, + 40886, + 40887, + 40888, + 40889, + 40890, + 40891, + 40892, + 40893, + 40894, + 40895, + 40896, + 40897, + 40898, + 40899, + 40900, + 40901, + 40902, + 40903, + 40904, + 40905, + 40906, + 40907, + 40908, + 40960, + 40961, + 40962, + 40963, + 40964, + 40965, + 40966, + 40967, + 40968, + 40969, + 40970, + 40971, + 40972, + 40973, + 40974, + 40975, + 40976, + 40977, + 40978, + 40979, + 40980, + 40981, + 40982, + 40983, + 40984, + 40985, + 40986, + 40987, + 40988, + 40989, + 40990, + 40991, + 40992, + 40993, + 40994, + 40995, + 40996, + 40997, + 40998, + 40999, + 41000, + 41001, + 41002, + 41003, + 41004, + 41005, + 41006, + 41007, + 41008, + 41009, + 41010, + 41011, + 41012, + 41013, + 41014, + 41015, + 41016, + 41017, + 41018, + 41019, + 41020, + 41021, + 41022, + 41023, + 41024, + 41025, + 41026, + 41027, + 41028, + 41029, + 41030, + 41031, + 41032, + 41033, + 41034, + 41035, + 41036, + 41037, + 41038, + 41039, + 41040, + 41041, + 41042, + 41043, + 41044, + 41045, + 41046, + 41047, + 41048, + 41049, + 41050, + 41051, + 41052, + 41053, + 41054, + 41055, + 41056, + 41057, + 41058, + 41059, + 41060, + 41061, + 41062, + 41063, + 41064, + 41065, + 41066, + 41067, + 41068, + 41069, + 41070, + 41071, + 41072, + 41073, + 41074, + 41075, + 41076, + 41077, + 41078, + 41079, + 41080, + 41081, + 41082, + 41083, + 41084, + 41085, + 41086, + 41087, + 41088, + 41089, + 41090, + 41091, + 41092, + 41093, + 41094, + 41095, + 41096, + 41097, + 41098, + 41099, + 41100, + 41101, + 41102, + 41103, + 41104, + 41105, + 41106, + 41107, + 41108, + 41109, + 41110, + 41111, + 41112, + 41113, + 41114, + 41115, + 41116, + 41117, + 41118, + 41119, + 41120, + 41121, + 41122, + 41123, + 41124, + 41125, + 41126, + 41127, + 41128, + 41129, + 41130, + 41131, + 41132, + 41133, + 41134, + 41135, + 41136, + 41137, + 41138, + 41139, + 41140, + 41141, + 41142, + 41143, + 41144, + 41145, + 41146, + 41147, + 41148, + 41149, + 41150, + 41151, + 41152, + 41153, + 41154, + 41155, + 41156, + 41157, + 41158, + 41159, + 41160, + 41161, + 41162, + 41163, + 41164, + 41165, + 41166, + 41167, + 41168, + 41169, + 41170, + 41171, + 41172, + 41173, + 41174, + 41175, + 41176, + 41177, + 41178, + 41179, + 41180, + 41181, + 41182, + 41183, + 41184, + 41185, + 41186, + 41187, + 41188, + 41189, + 41190, + 41191, + 41192, + 41193, + 41194, + 41195, + 41196, + 41197, + 41198, + 41199, + 41200, + 41201, + 41202, + 41203, + 41204, + 41205, + 41206, + 41207, + 41208, + 41209, + 41210, + 41211, + 41212, + 41213, + 41214, + 41215, + 41216, + 41217, + 41218, + 41219, + 41220, + 41221, + 41222, + 41223, + 41224, + 41225, + 41226, + 41227, + 41228, + 41229, + 41230, + 41231, + 41232, + 41233, + 41234, + 41235, + 41236, + 41237, + 41238, + 41239, + 41240, + 41241, + 41242, + 41243, + 41244, + 41245, + 41246, + 41247, + 41248, + 41249, + 41250, + 41251, + 41252, + 41253, + 41254, + 41255, + 41256, + 41257, + 41258, + 41259, + 41260, + 41261, + 41262, + 41263, + 41264, + 41265, + 41266, + 41267, + 41268, + 41269, + 41270, + 41271, + 41272, + 41273, + 41274, + 41275, + 41276, + 41277, + 41278, + 41279, + 41280, + 41281, + 41282, + 41283, + 41284, + 41285, + 41286, + 41287, + 41288, + 41289, + 41290, + 41291, + 41292, + 41293, + 41294, + 41295, + 41296, + 41297, + 41298, + 41299, + 41300, + 41301, + 41302, + 41303, + 41304, + 41305, + 41306, + 41307, + 41308, + 41309, + 41310, + 41311, + 41312, + 41313, + 41314, + 41315, + 41316, + 41317, + 41318, + 41319, + 41320, + 41321, + 41322, + 41323, + 41324, + 41325, + 41326, + 41327, + 41328, + 41329, + 41330, + 41331, + 41332, + 41333, + 41334, + 41335, + 41336, + 41337, + 41338, + 41339, + 41340, + 41341, + 41342, + 41343, + 41344, + 41345, + 41346, + 41347, + 41348, + 41349, + 41350, + 41351, + 41352, + 41353, + 41354, + 41355, + 41356, + 41357, + 41358, + 41359, + 41360, + 41361, + 41362, + 41363, + 41364, + 41365, + 41366, + 41367, + 41368, + 41369, + 41370, + 41371, + 41372, + 41373, + 41374, + 41375, + 41376, + 41377, + 41378, + 41379, + 41380, + 41381, + 41382, + 41383, + 41384, + 41385, + 41386, + 41387, + 41388, + 41389, + 41390, + 41391, + 41392, + 41393, + 41394, + 41395, + 41396, + 41397, + 41398, + 41399, + 41400, + 41401, + 41402, + 41403, + 41404, + 41405, + 41406, + 41407, + 41408, + 41409, + 41410, + 41411, + 41412, + 41413, + 41414, + 41415, + 41416, + 41417, + 41418, + 41419, + 41420, + 41421, + 41422, + 41423, + 41424, + 41425, + 41426, + 41427, + 41428, + 41429, + 41430, + 41431, + 41432, + 41433, + 41434, + 41435, + 41436, + 41437, + 41438, + 41439, + 41440, + 41441, + 41442, + 41443, + 41444, + 41445, + 41446, + 41447, + 41448, + 41449, + 41450, + 41451, + 41452, + 41453, + 41454, + 41455, + 41456, + 41457, + 41458, + 41459, + 41460, + 41461, + 41462, + 41463, + 41464, + 41465, + 41466, + 41467, + 41468, + 41469, + 41470, + 41471, + 41472, + 41473, + 41474, + 41475, + 41476, + 41477, + 41478, + 41479, + 41480, + 41481, + 41482, + 41483, + 41484, + 41485, + 41486, + 41487, + 41488, + 41489, + 41490, + 41491, + 41492, + 41493, + 41494, + 41495, + 41496, + 41497, + 41498, + 41499, + 41500, + 41501, + 41502, + 41503, + 41504, + 41505, + 41506, + 41507, + 41508, + 41509, + 41510, + 41511, + 41512, + 41513, + 41514, + 41515, + 41516, + 41517, + 41518, + 41519, + 41520, + 41521, + 41522, + 41523, + 41524, + 41525, + 41526, + 41527, + 41528, + 41529, + 41530, + 41531, + 41532, + 41533, + 41534, + 41535, + 41536, + 41537, + 41538, + 41539, + 41540, + 41541, + 41542, + 41543, + 41544, + 41545, + 41546, + 41547, + 41548, + 41549, + 41550, + 41551, + 41552, + 41553, + 41554, + 41555, + 41556, + 41557, + 41558, + 41559, + 41560, + 41561, + 41562, + 41563, + 41564, + 41565, + 41566, + 41567, + 41568, + 41569, + 41570, + 41571, + 41572, + 41573, + 41574, + 41575, + 41576, + 41577, + 41578, + 41579, + 41580, + 41581, + 41582, + 41583, + 41584, + 41585, + 41586, + 41587, + 41588, + 41589, + 41590, + 41591, + 41592, + 41593, + 41594, + 41595, + 41596, + 41597, + 41598, + 41599, + 41600, + 41601, + 41602, + 41603, + 41604, + 41605, + 41606, + 41607, + 41608, + 41609, + 41610, + 41611, + 41612, + 41613, + 41614, + 41615, + 41616, + 41617, + 41618, + 41619, + 41620, + 41621, + 41622, + 41623, + 41624, + 41625, + 41626, + 41627, + 41628, + 41629, + 41630, + 41631, + 41632, + 41633, + 41634, + 41635, + 41636, + 41637, + 41638, + 41639, + 41640, + 41641, + 41642, + 41643, + 41644, + 41645, + 41646, + 41647, + 41648, + 41649, + 41650, + 41651, + 41652, + 41653, + 41654, + 41655, + 41656, + 41657, + 41658, + 41659, + 41660, + 41661, + 41662, + 41663, + 41664, + 41665, + 41666, + 41667, + 41668, + 41669, + 41670, + 41671, + 41672, + 41673, + 41674, + 41675, + 41676, + 41677, + 41678, + 41679, + 41680, + 41681, + 41682, + 41683, + 41684, + 41685, + 41686, + 41687, + 41688, + 41689, + 41690, + 41691, + 41692, + 41693, + 41694, + 41695, + 41696, + 41697, + 41698, + 41699, + 41700, + 41701, + 41702, + 41703, + 41704, + 41705, + 41706, + 41707, + 41708, + 41709, + 41710, + 41711, + 41712, + 41713, + 41714, + 41715, + 41716, + 41717, + 41718, + 41719, + 41720, + 41721, + 41722, + 41723, + 41724, + 41725, + 41726, + 41727, + 41728, + 41729, + 41730, + 41731, + 41732, + 41733, + 41734, + 41735, + 41736, + 41737, + 41738, + 41739, + 41740, + 41741, + 41742, + 41743, + 41744, + 41745, + 41746, + 41747, + 41748, + 41749, + 41750, + 41751, + 41752, + 41753, + 41754, + 41755, + 41756, + 41757, + 41758, + 41759, + 41760, + 41761, + 41762, + 41763, + 41764, + 41765, + 41766, + 41767, + 41768, + 41769, + 41770, + 41771, + 41772, + 41773, + 41774, + 41775, + 41776, + 41777, + 41778, + 41779, + 41780, + 41781, + 41782, + 41783, + 41784, + 41785, + 41786, + 41787, + 41788, + 41789, + 41790, + 41791, + 41792, + 41793, + 41794, + 41795, + 41796, + 41797, + 41798, + 41799, + 41800, + 41801, + 41802, + 41803, + 41804, + 41805, + 41806, + 41807, + 41808, + 41809, + 41810, + 41811, + 41812, + 41813, + 41814, + 41815, + 41816, + 41817, + 41818, + 41819, + 41820, + 41821, + 41822, + 41823, + 41824, + 41825, + 41826, + 41827, + 41828, + 41829, + 41830, + 41831, + 41832, + 41833, + 41834, + 41835, + 41836, + 41837, + 41838, + 41839, + 41840, + 41841, + 41842, + 41843, + 41844, + 41845, + 41846, + 41847, + 41848, + 41849, + 41850, + 41851, + 41852, + 41853, + 41854, + 41855, + 41856, + 41857, + 41858, + 41859, + 41860, + 41861, + 41862, + 41863, + 41864, + 41865, + 41866, + 41867, + 41868, + 41869, + 41870, + 41871, + 41872, + 41873, + 41874, + 41875, + 41876, + 41877, + 41878, + 41879, + 41880, + 41881, + 41882, + 41883, + 41884, + 41885, + 41886, + 41887, + 41888, + 41889, + 41890, + 41891, + 41892, + 41893, + 41894, + 41895, + 41896, + 41897, + 41898, + 41899, + 41900, + 41901, + 41902, + 41903, + 41904, + 41905, + 41906, + 41907, + 41908, + 41909, + 41910, + 41911, + 41912, + 41913, + 41914, + 41915, + 41916, + 41917, + 41918, + 41919, + 41920, + 41921, + 41922, + 41923, + 41924, + 41925, + 41926, + 41927, + 41928, + 41929, + 41930, + 41931, + 41932, + 41933, + 41934, + 41935, + 41936, + 41937, + 41938, + 41939, + 41940, + 41941, + 41942, + 41943, + 41944, + 41945, + 41946, + 41947, + 41948, + 41949, + 41950, + 41951, + 41952, + 41953, + 41954, + 41955, + 41956, + 41957, + 41958, + 41959, + 41960, + 41961, + 41962, + 41963, + 41964, + 41965, + 41966, + 41967, + 41968, + 41969, + 41970, + 41971, + 41972, + 41973, + 41974, + 41975, + 41976, + 41977, + 41978, + 41979, + 41980, + 41981, + 41982, + 41983, + 41984, + 41985, + 41986, + 41987, + 41988, + 41989, + 41990, + 41991, + 41992, + 41993, + 41994, + 41995, + 41996, + 41997, + 41998, + 41999, + 42000, + 42001, + 42002, + 42003, + 42004, + 42005, + 42006, + 42007, + 42008, + 42009, + 42010, + 42011, + 42012, + 42013, + 42014, + 42015, + 42016, + 42017, + 42018, + 42019, + 42020, + 42021, + 42022, + 42023, + 42024, + 42025, + 42026, + 42027, + 42028, + 42029, + 42030, + 42031, + 42032, + 42033, + 42034, + 42035, + 42036, + 42037, + 42038, + 42039, + 42040, + 42041, + 42042, + 42043, + 42044, + 42045, + 42046, + 42047, + 42048, + 42049, + 42050, + 42051, + 42052, + 42053, + 42054, + 42055, + 42056, + 42057, + 42058, + 42059, + 42060, + 42061, + 42062, + 42063, + 42064, + 42065, + 42066, + 42067, + 42068, + 42069, + 42070, + 42071, + 42072, + 42073, + 42074, + 42075, + 42076, + 42077, + 42078, + 42079, + 42080, + 42081, + 42082, + 42083, + 42084, + 42085, + 42086, + 42087, + 42088, + 42089, + 42090, + 42091, + 42092, + 42093, + 42094, + 42095, + 42096, + 42097, + 42098, + 42099, + 42100, + 42101, + 42102, + 42103, + 42104, + 42105, + 42106, + 42107, + 42108, + 42109, + 42110, + 42111, + 42112, + 42113, + 42114, + 42115, + 42116, + 42117, + 42118, + 42119, + 42120, + 42121, + 42122, + 42123, + 42124, + 42192, + 42193, + 42194, + 42195, + 42196, + 42197, + 42198, + 42199, + 42200, + 42201, + 42202, + 42203, + 42204, + 42205, + 42206, + 42207, + 42208, + 42209, + 42210, + 42211, + 42212, + 42213, + 42214, + 42215, + 42216, + 42217, + 42218, + 42219, + 42220, + 42221, + 42222, + 42223, + 42224, + 42225, + 42226, + 42227, + 42228, + 42229, + 42230, + 42231, + 42232, + 42233, + 42234, + 42235, + 42236, + 42237, + 42240, + 42241, + 42242, + 42243, + 42244, + 42245, + 42246, + 42247, + 42248, + 42249, + 42250, + 42251, + 42252, + 42253, + 42254, + 42255, + 42256, + 42257, + 42258, + 42259, + 42260, + 42261, + 42262, + 42263, + 42264, + 42265, + 42266, + 42267, + 42268, + 42269, + 42270, + 42271, + 42272, + 42273, + 42274, + 42275, + 42276, + 42277, + 42278, + 42279, + 42280, + 42281, + 42282, + 42283, + 42284, + 42285, + 42286, + 42287, + 42288, + 42289, + 42290, + 42291, + 42292, + 42293, + 42294, + 42295, + 42296, + 42297, + 42298, + 42299, + 42300, + 42301, + 42302, + 42303, + 42304, + 42305, + 42306, + 42307, + 42308, + 42309, + 42310, + 42311, + 42312, + 42313, + 42314, + 42315, + 42316, + 42317, + 42318, + 42319, + 42320, + 42321, + 42322, + 42323, + 42324, + 42325, + 42326, + 42327, + 42328, + 42329, + 42330, + 42331, + 42332, + 42333, + 42334, + 42335, + 42336, + 42337, + 42338, + 42339, + 42340, + 42341, + 42342, + 42343, + 42344, + 42345, + 42346, + 42347, + 42348, + 42349, + 42350, + 42351, + 42352, + 42353, + 42354, + 42355, + 42356, + 42357, + 42358, + 42359, + 42360, + 42361, + 42362, + 42363, + 42364, + 42365, + 42366, + 42367, + 42368, + 42369, + 42370, + 42371, + 42372, + 42373, + 42374, + 42375, + 42376, + 42377, + 42378, + 42379, + 42380, + 42381, + 42382, + 42383, + 42384, + 42385, + 42386, + 42387, + 42388, + 42389, + 42390, + 42391, + 42392, + 42393, + 42394, + 42395, + 42396, + 42397, + 42398, + 42399, + 42400, + 42401, + 42402, + 42403, + 42404, + 42405, + 42406, + 42407, + 42408, + 42409, + 42410, + 42411, + 42412, + 42413, + 42414, + 42415, + 42416, + 42417, + 42418, + 42419, + 42420, + 42421, + 42422, + 42423, + 42424, + 42425, + 42426, + 42427, + 42428, + 42429, + 42430, + 42431, + 42432, + 42433, + 42434, + 42435, + 42436, + 42437, + 42438, + 42439, + 42440, + 42441, + 42442, + 42443, + 42444, + 42445, + 42446, + 42447, + 42448, + 42449, + 42450, + 42451, + 42452, + 42453, + 42454, + 42455, + 42456, + 42457, + 42458, + 42459, + 42460, + 42461, + 42462, + 42463, + 42464, + 42465, + 42466, + 42467, + 42468, + 42469, + 42470, + 42471, + 42472, + 42473, + 42474, + 42475, + 42476, + 42477, + 42478, + 42479, + 42480, + 42481, + 42482, + 42483, + 42484, + 42485, + 42486, + 42487, + 42488, + 42489, + 42490, + 42491, + 42492, + 42493, + 42494, + 42495, + 42496, + 42497, + 42498, + 42499, + 42500, + 42501, + 42502, + 42503, + 42504, + 42505, + 42506, + 42507, + 42508, + 42512, + 42513, + 42514, + 42515, + 42516, + 42517, + 42518, + 42519, + 42520, + 42521, + 42522, + 42523, + 42524, + 42525, + 42526, + 42527, + 42538, + 42539, + 42560, + 42561, + 42562, + 42563, + 42564, + 42565, + 42566, + 42567, + 42568, + 42569, + 42570, + 42571, + 42572, + 42573, + 42574, + 42575, + 42576, + 42577, + 42578, + 42579, + 42580, + 42581, + 42582, + 42583, + 42584, + 42585, + 42586, + 42587, + 42588, + 42589, + 42590, + 42591, + 42592, + 42593, + 42594, + 42595, + 42596, + 42597, + 42598, + 42599, + 42600, + 42601, + 42602, + 42603, + 42604, + 42605, + 42606, + 42623, + 42624, + 42625, + 42626, + 42627, + 42628, + 42629, + 42630, + 42631, + 42632, + 42633, + 42634, + 42635, + 42636, + 42637, + 42638, + 42639, + 42640, + 42641, + 42642, + 42643, + 42644, + 42645, + 42646, + 42647, + 42656, + 42657, + 42658, + 42659, + 42660, + 42661, + 42662, + 42663, + 42664, + 42665, + 42666, + 42667, + 42668, + 42669, + 42670, + 42671, + 42672, + 42673, + 42674, + 42675, + 42676, + 42677, + 42678, + 42679, + 42680, + 42681, + 42682, + 42683, + 42684, + 42685, + 42686, + 42687, + 42688, + 42689, + 42690, + 42691, + 42692, + 42693, + 42694, + 42695, + 42696, + 42697, + 42698, + 42699, + 42700, + 42701, + 42702, + 42703, + 42704, + 42705, + 42706, + 42707, + 42708, + 42709, + 42710, + 42711, + 42712, + 42713, + 42714, + 42715, + 42716, + 42717, + 42718, + 42719, + 42720, + 42721, + 42722, + 42723, + 42724, + 42725, + 42726, + 42727, + 42728, + 42729, + 42730, + 42731, + 42732, + 42733, + 42734, + 42735, + 42775, + 42776, + 42777, + 42778, + 42779, + 42780, + 42781, + 42782, + 42783, + 42786, + 42787, + 42788, + 42789, + 42790, + 42791, + 42792, + 42793, + 42794, + 42795, + 42796, + 42797, + 42798, + 42799, + 42800, + 42801, + 42802, + 42803, + 42804, + 42805, + 42806, + 42807, + 42808, + 42809, + 42810, + 42811, + 42812, + 42813, + 42814, + 42815, + 42816, + 42817, + 42818, + 42819, + 42820, + 42821, + 42822, + 42823, + 42824, + 42825, + 42826, + 42827, + 42828, + 42829, + 42830, + 42831, + 42832, + 42833, + 42834, + 42835, + 42836, + 42837, + 42838, + 42839, + 42840, + 42841, + 42842, + 42843, + 42844, + 42845, + 42846, + 42847, + 42848, + 42849, + 42850, + 42851, + 42852, + 42853, + 42854, + 42855, + 42856, + 42857, + 42858, + 42859, + 42860, + 42861, + 42862, + 42863, + 42864, + 42865, + 42866, + 42867, + 42868, + 42869, + 42870, + 42871, + 42872, + 42873, + 42874, + 42875, + 42876, + 42877, + 42878, + 42879, + 42880, + 42881, + 42882, + 42883, + 42884, + 42885, + 42886, + 42887, + 42888, + 42891, + 42892, + 42893, + 42894, + 42896, + 42897, + 42898, + 42899, + 42912, + 42913, + 42914, + 42915, + 42916, + 42917, + 42918, + 42919, + 42920, + 42921, + 42922, + 43000, + 43001, + 43002, + 43003, + 43004, + 43005, + 43006, + 43007, + 43008, + 43009, + 43011, + 43012, + 43013, + 43015, + 43016, + 43017, + 43018, + 43020, + 43021, + 43022, + 43023, + 43024, + 43025, + 43026, + 43027, + 43028, + 43029, + 43030, + 43031, + 43032, + 43033, + 43034, + 43035, + 43036, + 43037, + 43038, + 43039, + 43040, + 43041, + 43042, + 43072, + 43073, + 43074, + 43075, + 43076, + 43077, + 43078, + 43079, + 43080, + 43081, + 43082, + 43083, + 43084, + 43085, + 43086, + 43087, + 43088, + 43089, + 43090, + 43091, + 43092, + 43093, + 43094, + 43095, + 43096, + 43097, + 43098, + 43099, + 43100, + 43101, + 43102, + 43103, + 43104, + 43105, + 43106, + 43107, + 43108, + 43109, + 43110, + 43111, + 43112, + 43113, + 43114, + 43115, + 43116, + 43117, + 43118, + 43119, + 43120, + 43121, + 43122, + 43123, + 43138, + 43139, + 43140, + 43141, + 43142, + 43143, + 43144, + 43145, + 43146, + 43147, + 43148, + 43149, + 43150, + 43151, + 43152, + 43153, + 43154, + 43155, + 43156, + 43157, + 43158, + 43159, + 43160, + 43161, + 43162, + 43163, + 43164, + 43165, + 43166, + 43167, + 43168, + 43169, + 43170, + 43171, + 43172, + 43173, + 43174, + 43175, + 43176, + 43177, + 43178, + 43179, + 43180, + 43181, + 43182, + 43183, + 43184, + 43185, + 43186, + 43187, + 43250, + 43251, + 43252, + 43253, + 43254, + 43255, + 43259, + 43274, + 43275, + 43276, + 43277, + 43278, + 43279, + 43280, + 43281, + 43282, + 43283, + 43284, + 43285, + 43286, + 43287, + 43288, + 43289, + 43290, + 43291, + 43292, + 43293, + 43294, + 43295, + 43296, + 43297, + 43298, + 43299, + 43300, + 43301, + 43312, + 43313, + 43314, + 43315, + 43316, + 43317, + 43318, + 43319, + 43320, + 43321, + 43322, + 43323, + 43324, + 43325, + 43326, + 43327, + 43328, + 43329, + 43330, + 43331, + 43332, + 43333, + 43334, + 43360, + 43361, + 43362, + 43363, + 43364, + 43365, + 43366, + 43367, + 43368, + 43369, + 43370, + 43371, + 43372, + 43373, + 43374, + 43375, + 43376, + 43377, + 43378, + 43379, + 43380, + 43381, + 43382, + 43383, + 43384, + 43385, + 43386, + 43387, + 43388, + 43396, + 43397, + 43398, + 43399, + 43400, + 43401, + 43402, + 43403, + 43404, + 43405, + 43406, + 43407, + 43408, + 43409, + 43410, + 43411, + 43412, + 43413, + 43414, + 43415, + 43416, + 43417, + 43418, + 43419, + 43420, + 43421, + 43422, + 43423, + 43424, + 43425, + 43426, + 43427, + 43428, + 43429, + 43430, + 43431, + 43432, + 43433, + 43434, + 43435, + 43436, + 43437, + 43438, + 43439, + 43440, + 43441, + 43442, + 43471, + 43520, + 43521, + 43522, + 43523, + 43524, + 43525, + 43526, + 43527, + 43528, + 43529, + 43530, + 43531, + 43532, + 43533, + 43534, + 43535, + 43536, + 43537, + 43538, + 43539, + 43540, + 43541, + 43542, + 43543, + 43544, + 43545, + 43546, + 43547, + 43548, + 43549, + 43550, + 43551, + 43552, + 43553, + 43554, + 43555, + 43556, + 43557, + 43558, + 43559, + 43560, + 43584, + 43585, + 43586, + 43588, + 43589, + 43590, + 43591, + 43592, + 43593, + 43594, + 43595, + 43616, + 43617, + 43618, + 43619, + 43620, + 43621, + 43622, + 43623, + 43624, + 43625, + 43626, + 43627, + 43628, + 43629, + 43630, + 43631, + 43632, + 43633, + 43634, + 43635, + 43636, + 43637, + 43638, + 43642, + 43648, + 43649, + 43650, + 43651, + 43652, + 43653, + 43654, + 43655, + 43656, + 43657, + 43658, + 43659, + 43660, + 43661, + 43662, + 43663, + 43664, + 43665, + 43666, + 43667, + 43668, + 43669, + 43670, + 43671, + 43672, + 43673, + 43674, + 43675, + 43676, + 43677, + 43678, + 43679, + 43680, + 43681, + 43682, + 43683, + 43684, + 43685, + 43686, + 43687, + 43688, + 43689, + 43690, + 43691, + 43692, + 43693, + 43694, + 43695, + 43697, + 43701, + 43702, + 43705, + 43706, + 43707, + 43708, + 43709, + 43712, + 43714, + 43739, + 43740, + 43741, + 43744, + 43745, + 43746, + 43747, + 43748, + 43749, + 43750, + 43751, + 43752, + 43753, + 43754, + 43762, + 43763, + 43764, + 43777, + 43778, + 43779, + 43780, + 43781, + 43782, + 43785, + 43786, + 43787, + 43788, + 43789, + 43790, + 43793, + 43794, + 43795, + 43796, + 43797, + 43798, + 43808, + 43809, + 43810, + 43811, + 43812, + 43813, + 43814, + 43816, + 43817, + 43818, + 43819, + 43820, + 43821, + 43822, + 43968, + 43969, + 43970, + 43971, + 43972, + 43973, + 43974, + 43975, + 43976, + 43977, + 43978, + 43979, + 43980, + 43981, + 43982, + 43983, + 43984, + 43985, + 43986, + 43987, + 43988, + 43989, + 43990, + 43991, + 43992, + 43993, + 43994, + 43995, + 43996, + 43997, + 43998, + 43999, + 44000, + 44001, + 44002, + 44032, + 44033, + 44034, + 44035, + 44036, + 44037, + 44038, + 44039, + 44040, + 44041, + 44042, + 44043, + 44044, + 44045, + 44046, + 44047, + 44048, + 44049, + 44050, + 44051, + 44052, + 44053, + 44054, + 44055, + 44056, + 44057, + 44058, + 44059, + 44060, + 44061, + 44062, + 44063, + 44064, + 44065, + 44066, + 44067, + 44068, + 44069, + 44070, + 44071, + 44072, + 44073, + 44074, + 44075, + 44076, + 44077, + 44078, + 44079, + 44080, + 44081, + 44082, + 44083, + 44084, + 44085, + 44086, + 44087, + 44088, + 44089, + 44090, + 44091, + 44092, + 44093, + 44094, + 44095, + 44096, + 44097, + 44098, + 44099, + 44100, + 44101, + 44102, + 44103, + 44104, + 44105, + 44106, + 44107, + 44108, + 44109, + 44110, + 44111, + 44112, + 44113, + 44114, + 44115, + 44116, + 44117, + 44118, + 44119, + 44120, + 44121, + 44122, + 44123, + 44124, + 44125, + 44126, + 44127, + 44128, + 44129, + 44130, + 44131, + 44132, + 44133, + 44134, + 44135, + 44136, + 44137, + 44138, + 44139, + 44140, + 44141, + 44142, + 44143, + 44144, + 44145, + 44146, + 44147, + 44148, + 44149, + 44150, + 44151, + 44152, + 44153, + 44154, + 44155, + 44156, + 44157, + 44158, + 44159, + 44160, + 44161, + 44162, + 44163, + 44164, + 44165, + 44166, + 44167, + 44168, + 44169, + 44170, + 44171, + 44172, + 44173, + 44174, + 44175, + 44176, + 44177, + 44178, + 44179, + 44180, + 44181, + 44182, + 44183, + 44184, + 44185, + 44186, + 44187, + 44188, + 44189, + 44190, + 44191, + 44192, + 44193, + 44194, + 44195, + 44196, + 44197, + 44198, + 44199, + 44200, + 44201, + 44202, + 44203, + 44204, + 44205, + 44206, + 44207, + 44208, + 44209, + 44210, + 44211, + 44212, + 44213, + 44214, + 44215, + 44216, + 44217, + 44218, + 44219, + 44220, + 44221, + 44222, + 44223, + 44224, + 44225, + 44226, + 44227, + 44228, + 44229, + 44230, + 44231, + 44232, + 44233, + 44234, + 44235, + 44236, + 44237, + 44238, + 44239, + 44240, + 44241, + 44242, + 44243, + 44244, + 44245, + 44246, + 44247, + 44248, + 44249, + 44250, + 44251, + 44252, + 44253, + 44254, + 44255, + 44256, + 44257, + 44258, + 44259, + 44260, + 44261, + 44262, + 44263, + 44264, + 44265, + 44266, + 44267, + 44268, + 44269, + 44270, + 44271, + 44272, + 44273, + 44274, + 44275, + 44276, + 44277, + 44278, + 44279, + 44280, + 44281, + 44282, + 44283, + 44284, + 44285, + 44286, + 44287, + 44288, + 44289, + 44290, + 44291, + 44292, + 44293, + 44294, + 44295, + 44296, + 44297, + 44298, + 44299, + 44300, + 44301, + 44302, + 44303, + 44304, + 44305, + 44306, + 44307, + 44308, + 44309, + 44310, + 44311, + 44312, + 44313, + 44314, + 44315, + 44316, + 44317, + 44318, + 44319, + 44320, + 44321, + 44322, + 44323, + 44324, + 44325, + 44326, + 44327, + 44328, + 44329, + 44330, + 44331, + 44332, + 44333, + 44334, + 44335, + 44336, + 44337, + 44338, + 44339, + 44340, + 44341, + 44342, + 44343, + 44344, + 44345, + 44346, + 44347, + 44348, + 44349, + 44350, + 44351, + 44352, + 44353, + 44354, + 44355, + 44356, + 44357, + 44358, + 44359, + 44360, + 44361, + 44362, + 44363, + 44364, + 44365, + 44366, + 44367, + 44368, + 44369, + 44370, + 44371, + 44372, + 44373, + 44374, + 44375, + 44376, + 44377, + 44378, + 44379, + 44380, + 44381, + 44382, + 44383, + 44384, + 44385, + 44386, + 44387, + 44388, + 44389, + 44390, + 44391, + 44392, + 44393, + 44394, + 44395, + 44396, + 44397, + 44398, + 44399, + 44400, + 44401, + 44402, + 44403, + 44404, + 44405, + 44406, + 44407, + 44408, + 44409, + 44410, + 44411, + 44412, + 44413, + 44414, + 44415, + 44416, + 44417, + 44418, + 44419, + 44420, + 44421, + 44422, + 44423, + 44424, + 44425, + 44426, + 44427, + 44428, + 44429, + 44430, + 44431, + 44432, + 44433, + 44434, + 44435, + 44436, + 44437, + 44438, + 44439, + 44440, + 44441, + 44442, + 44443, + 44444, + 44445, + 44446, + 44447, + 44448, + 44449, + 44450, + 44451, + 44452, + 44453, + 44454, + 44455, + 44456, + 44457, + 44458, + 44459, + 44460, + 44461, + 44462, + 44463, + 44464, + 44465, + 44466, + 44467, + 44468, + 44469, + 44470, + 44471, + 44472, + 44473, + 44474, + 44475, + 44476, + 44477, + 44478, + 44479, + 44480, + 44481, + 44482, + 44483, + 44484, + 44485, + 44486, + 44487, + 44488, + 44489, + 44490, + 44491, + 44492, + 44493, + 44494, + 44495, + 44496, + 44497, + 44498, + 44499, + 44500, + 44501, + 44502, + 44503, + 44504, + 44505, + 44506, + 44507, + 44508, + 44509, + 44510, + 44511, + 44512, + 44513, + 44514, + 44515, + 44516, + 44517, + 44518, + 44519, + 44520, + 44521, + 44522, + 44523, + 44524, + 44525, + 44526, + 44527, + 44528, + 44529, + 44530, + 44531, + 44532, + 44533, + 44534, + 44535, + 44536, + 44537, + 44538, + 44539, + 44540, + 44541, + 44542, + 44543, + 44544, + 44545, + 44546, + 44547, + 44548, + 44549, + 44550, + 44551, + 44552, + 44553, + 44554, + 44555, + 44556, + 44557, + 44558, + 44559, + 44560, + 44561, + 44562, + 44563, + 44564, + 44565, + 44566, + 44567, + 44568, + 44569, + 44570, + 44571, + 44572, + 44573, + 44574, + 44575, + 44576, + 44577, + 44578, + 44579, + 44580, + 44581, + 44582, + 44583, + 44584, + 44585, + 44586, + 44587, + 44588, + 44589, + 44590, + 44591, + 44592, + 44593, + 44594, + 44595, + 44596, + 44597, + 44598, + 44599, + 44600, + 44601, + 44602, + 44603, + 44604, + 44605, + 44606, + 44607, + 44608, + 44609, + 44610, + 44611, + 44612, + 44613, + 44614, + 44615, + 44616, + 44617, + 44618, + 44619, + 44620, + 44621, + 44622, + 44623, + 44624, + 44625, + 44626, + 44627, + 44628, + 44629, + 44630, + 44631, + 44632, + 44633, + 44634, + 44635, + 44636, + 44637, + 44638, + 44639, + 44640, + 44641, + 44642, + 44643, + 44644, + 44645, + 44646, + 44647, + 44648, + 44649, + 44650, + 44651, + 44652, + 44653, + 44654, + 44655, + 44656, + 44657, + 44658, + 44659, + 44660, + 44661, + 44662, + 44663, + 44664, + 44665, + 44666, + 44667, + 44668, + 44669, + 44670, + 44671, + 44672, + 44673, + 44674, + 44675, + 44676, + 44677, + 44678, + 44679, + 44680, + 44681, + 44682, + 44683, + 44684, + 44685, + 44686, + 44687, + 44688, + 44689, + 44690, + 44691, + 44692, + 44693, + 44694, + 44695, + 44696, + 44697, + 44698, + 44699, + 44700, + 44701, + 44702, + 44703, + 44704, + 44705, + 44706, + 44707, + 44708, + 44709, + 44710, + 44711, + 44712, + 44713, + 44714, + 44715, + 44716, + 44717, + 44718, + 44719, + 44720, + 44721, + 44722, + 44723, + 44724, + 44725, + 44726, + 44727, + 44728, + 44729, + 44730, + 44731, + 44732, + 44733, + 44734, + 44735, + 44736, + 44737, + 44738, + 44739, + 44740, + 44741, + 44742, + 44743, + 44744, + 44745, + 44746, + 44747, + 44748, + 44749, + 44750, + 44751, + 44752, + 44753, + 44754, + 44755, + 44756, + 44757, + 44758, + 44759, + 44760, + 44761, + 44762, + 44763, + 44764, + 44765, + 44766, + 44767, + 44768, + 44769, + 44770, + 44771, + 44772, + 44773, + 44774, + 44775, + 44776, + 44777, + 44778, + 44779, + 44780, + 44781, + 44782, + 44783, + 44784, + 44785, + 44786, + 44787, + 44788, + 44789, + 44790, + 44791, + 44792, + 44793, + 44794, + 44795, + 44796, + 44797, + 44798, + 44799, + 44800, + 44801, + 44802, + 44803, + 44804, + 44805, + 44806, + 44807, + 44808, + 44809, + 44810, + 44811, + 44812, + 44813, + 44814, + 44815, + 44816, + 44817, + 44818, + 44819, + 44820, + 44821, + 44822, + 44823, + 44824, + 44825, + 44826, + 44827, + 44828, + 44829, + 44830, + 44831, + 44832, + 44833, + 44834, + 44835, + 44836, + 44837, + 44838, + 44839, + 44840, + 44841, + 44842, + 44843, + 44844, + 44845, + 44846, + 44847, + 44848, + 44849, + 44850, + 44851, + 44852, + 44853, + 44854, + 44855, + 44856, + 44857, + 44858, + 44859, + 44860, + 44861, + 44862, + 44863, + 44864, + 44865, + 44866, + 44867, + 44868, + 44869, + 44870, + 44871, + 44872, + 44873, + 44874, + 44875, + 44876, + 44877, + 44878, + 44879, + 44880, + 44881, + 44882, + 44883, + 44884, + 44885, + 44886, + 44887, + 44888, + 44889, + 44890, + 44891, + 44892, + 44893, + 44894, + 44895, + 44896, + 44897, + 44898, + 44899, + 44900, + 44901, + 44902, + 44903, + 44904, + 44905, + 44906, + 44907, + 44908, + 44909, + 44910, + 44911, + 44912, + 44913, + 44914, + 44915, + 44916, + 44917, + 44918, + 44919, + 44920, + 44921, + 44922, + 44923, + 44924, + 44925, + 44926, + 44927, + 44928, + 44929, + 44930, + 44931, + 44932, + 44933, + 44934, + 44935, + 44936, + 44937, + 44938, + 44939, + 44940, + 44941, + 44942, + 44943, + 44944, + 44945, + 44946, + 44947, + 44948, + 44949, + 44950, + 44951, + 44952, + 44953, + 44954, + 44955, + 44956, + 44957, + 44958, + 44959, + 44960, + 44961, + 44962, + 44963, + 44964, + 44965, + 44966, + 44967, + 44968, + 44969, + 44970, + 44971, + 44972, + 44973, + 44974, + 44975, + 44976, + 44977, + 44978, + 44979, + 44980, + 44981, + 44982, + 44983, + 44984, + 44985, + 44986, + 44987, + 44988, + 44989, + 44990, + 44991, + 44992, + 44993, + 44994, + 44995, + 44996, + 44997, + 44998, + 44999, + 45000, + 45001, + 45002, + 45003, + 45004, + 45005, + 45006, + 45007, + 45008, + 45009, + 45010, + 45011, + 45012, + 45013, + 45014, + 45015, + 45016, + 45017, + 45018, + 45019, + 45020, + 45021, + 45022, + 45023, + 45024, + 45025, + 45026, + 45027, + 45028, + 45029, + 45030, + 45031, + 45032, + 45033, + 45034, + 45035, + 45036, + 45037, + 45038, + 45039, + 45040, + 45041, + 45042, + 45043, + 45044, + 45045, + 45046, + 45047, + 45048, + 45049, + 45050, + 45051, + 45052, + 45053, + 45054, + 45055, + 45056, + 45057, + 45058, + 45059, + 45060, + 45061, + 45062, + 45063, + 45064, + 45065, + 45066, + 45067, + 45068, + 45069, + 45070, + 45071, + 45072, + 45073, + 45074, + 45075, + 45076, + 45077, + 45078, + 45079, + 45080, + 45081, + 45082, + 45083, + 45084, + 45085, + 45086, + 45087, + 45088, + 45089, + 45090, + 45091, + 45092, + 45093, + 45094, + 45095, + 45096, + 45097, + 45098, + 45099, + 45100, + 45101, + 45102, + 45103, + 45104, + 45105, + 45106, + 45107, + 45108, + 45109, + 45110, + 45111, + 45112, + 45113, + 45114, + 45115, + 45116, + 45117, + 45118, + 45119, + 45120, + 45121, + 45122, + 45123, + 45124, + 45125, + 45126, + 45127, + 45128, + 45129, + 45130, + 45131, + 45132, + 45133, + 45134, + 45135, + 45136, + 45137, + 45138, + 45139, + 45140, + 45141, + 45142, + 45143, + 45144, + 45145, + 45146, + 45147, + 45148, + 45149, + 45150, + 45151, + 45152, + 45153, + 45154, + 45155, + 45156, + 45157, + 45158, + 45159, + 45160, + 45161, + 45162, + 45163, + 45164, + 45165, + 45166, + 45167, + 45168, + 45169, + 45170, + 45171, + 45172, + 45173, + 45174, + 45175, + 45176, + 45177, + 45178, + 45179, + 45180, + 45181, + 45182, + 45183, + 45184, + 45185, + 45186, + 45187, + 45188, + 45189, + 45190, + 45191, + 45192, + 45193, + 45194, + 45195, + 45196, + 45197, + 45198, + 45199, + 45200, + 45201, + 45202, + 45203, + 45204, + 45205, + 45206, + 45207, + 45208, + 45209, + 45210, + 45211, + 45212, + 45213, + 45214, + 45215, + 45216, + 45217, + 45218, + 45219, + 45220, + 45221, + 45222, + 45223, + 45224, + 45225, + 45226, + 45227, + 45228, + 45229, + 45230, + 45231, + 45232, + 45233, + 45234, + 45235, + 45236, + 45237, + 45238, + 45239, + 45240, + 45241, + 45242, + 45243, + 45244, + 45245, + 45246, + 45247, + 45248, + 45249, + 45250, + 45251, + 45252, + 45253, + 45254, + 45255, + 45256, + 45257, + 45258, + 45259, + 45260, + 45261, + 45262, + 45263, + 45264, + 45265, + 45266, + 45267, + 45268, + 45269, + 45270, + 45271, + 45272, + 45273, + 45274, + 45275, + 45276, + 45277, + 45278, + 45279, + 45280, + 45281, + 45282, + 45283, + 45284, + 45285, + 45286, + 45287, + 45288, + 45289, + 45290, + 45291, + 45292, + 45293, + 45294, + 45295, + 45296, + 45297, + 45298, + 45299, + 45300, + 45301, + 45302, + 45303, + 45304, + 45305, + 45306, + 45307, + 45308, + 45309, + 45310, + 45311, + 45312, + 45313, + 45314, + 45315, + 45316, + 45317, + 45318, + 45319, + 45320, + 45321, + 45322, + 45323, + 45324, + 45325, + 45326, + 45327, + 45328, + 45329, + 45330, + 45331, + 45332, + 45333, + 45334, + 45335, + 45336, + 45337, + 45338, + 45339, + 45340, + 45341, + 45342, + 45343, + 45344, + 45345, + 45346, + 45347, + 45348, + 45349, + 45350, + 45351, + 45352, + 45353, + 45354, + 45355, + 45356, + 45357, + 45358, + 45359, + 45360, + 45361, + 45362, + 45363, + 45364, + 45365, + 45366, + 45367, + 45368, + 45369, + 45370, + 45371, + 45372, + 45373, + 45374, + 45375, + 45376, + 45377, + 45378, + 45379, + 45380, + 45381, + 45382, + 45383, + 45384, + 45385, + 45386, + 45387, + 45388, + 45389, + 45390, + 45391, + 45392, + 45393, + 45394, + 45395, + 45396, + 45397, + 45398, + 45399, + 45400, + 45401, + 45402, + 45403, + 45404, + 45405, + 45406, + 45407, + 45408, + 45409, + 45410, + 45411, + 45412, + 45413, + 45414, + 45415, + 45416, + 45417, + 45418, + 45419, + 45420, + 45421, + 45422, + 45423, + 45424, + 45425, + 45426, + 45427, + 45428, + 45429, + 45430, + 45431, + 45432, + 45433, + 45434, + 45435, + 45436, + 45437, + 45438, + 45439, + 45440, + 45441, + 45442, + 45443, + 45444, + 45445, + 45446, + 45447, + 45448, + 45449, + 45450, + 45451, + 45452, + 45453, + 45454, + 45455, + 45456, + 45457, + 45458, + 45459, + 45460, + 45461, + 45462, + 45463, + 45464, + 45465, + 45466, + 45467, + 45468, + 45469, + 45470, + 45471, + 45472, + 45473, + 45474, + 45475, + 45476, + 45477, + 45478, + 45479, + 45480, + 45481, + 45482, + 45483, + 45484, + 45485, + 45486, + 45487, + 45488, + 45489, + 45490, + 45491, + 45492, + 45493, + 45494, + 45495, + 45496, + 45497, + 45498, + 45499, + 45500, + 45501, + 45502, + 45503, + 45504, + 45505, + 45506, + 45507, + 45508, + 45509, + 45510, + 45511, + 45512, + 45513, + 45514, + 45515, + 45516, + 45517, + 45518, + 45519, + 45520, + 45521, + 45522, + 45523, + 45524, + 45525, + 45526, + 45527, + 45528, + 45529, + 45530, + 45531, + 45532, + 45533, + 45534, + 45535, + 45536, + 45537, + 45538, + 45539, + 45540, + 45541, + 45542, + 45543, + 45544, + 45545, + 45546, + 45547, + 45548, + 45549, + 45550, + 45551, + 45552, + 45553, + 45554, + 45555, + 45556, + 45557, + 45558, + 45559, + 45560, + 45561, + 45562, + 45563, + 45564, + 45565, + 45566, + 45567, + 45568, + 45569, + 45570, + 45571, + 45572, + 45573, + 45574, + 45575, + 45576, + 45577, + 45578, + 45579, + 45580, + 45581, + 45582, + 45583, + 45584, + 45585, + 45586, + 45587, + 45588, + 45589, + 45590, + 45591, + 45592, + 45593, + 45594, + 45595, + 45596, + 45597, + 45598, + 45599, + 45600, + 45601, + 45602, + 45603, + 45604, + 45605, + 45606, + 45607, + 45608, + 45609, + 45610, + 45611, + 45612, + 45613, + 45614, + 45615, + 45616, + 45617, + 45618, + 45619, + 45620, + 45621, + 45622, + 45623, + 45624, + 45625, + 45626, + 45627, + 45628, + 45629, + 45630, + 45631, + 45632, + 45633, + 45634, + 45635, + 45636, + 45637, + 45638, + 45639, + 45640, + 45641, + 45642, + 45643, + 45644, + 45645, + 45646, + 45647, + 45648, + 45649, + 45650, + 45651, + 45652, + 45653, + 45654, + 45655, + 45656, + 45657, + 45658, + 45659, + 45660, + 45661, + 45662, + 45663, + 45664, + 45665, + 45666, + 45667, + 45668, + 45669, + 45670, + 45671, + 45672, + 45673, + 45674, + 45675, + 45676, + 45677, + 45678, + 45679, + 45680, + 45681, + 45682, + 45683, + 45684, + 45685, + 45686, + 45687, + 45688, + 45689, + 45690, + 45691, + 45692, + 45693, + 45694, + 45695, + 45696, + 45697, + 45698, + 45699, + 45700, + 45701, + 45702, + 45703, + 45704, + 45705, + 45706, + 45707, + 45708, + 45709, + 45710, + 45711, + 45712, + 45713, + 45714, + 45715, + 45716, + 45717, + 45718, + 45719, + 45720, + 45721, + 45722, + 45723, + 45724, + 45725, + 45726, + 45727, + 45728, + 45729, + 45730, + 45731, + 45732, + 45733, + 45734, + 45735, + 45736, + 45737, + 45738, + 45739, + 45740, + 45741, + 45742, + 45743, + 45744, + 45745, + 45746, + 45747, + 45748, + 45749, + 45750, + 45751, + 45752, + 45753, + 45754, + 45755, + 45756, + 45757, + 45758, + 45759, + 45760, + 45761, + 45762, + 45763, + 45764, + 45765, + 45766, + 45767, + 45768, + 45769, + 45770, + 45771, + 45772, + 45773, + 45774, + 45775, + 45776, + 45777, + 45778, + 45779, + 45780, + 45781, + 45782, + 45783, + 45784, + 45785, + 45786, + 45787, + 45788, + 45789, + 45790, + 45791, + 45792, + 45793, + 45794, + 45795, + 45796, + 45797, + 45798, + 45799, + 45800, + 45801, + 45802, + 45803, + 45804, + 45805, + 45806, + 45807, + 45808, + 45809, + 45810, + 45811, + 45812, + 45813, + 45814, + 45815, + 45816, + 45817, + 45818, + 45819, + 45820, + 45821, + 45822, + 45823, + 45824, + 45825, + 45826, + 45827, + 45828, + 45829, + 45830, + 45831, + 45832, + 45833, + 45834, + 45835, + 45836, + 45837, + 45838, + 45839, + 45840, + 45841, + 45842, + 45843, + 45844, + 45845, + 45846, + 45847, + 45848, + 45849, + 45850, + 45851, + 45852, + 45853, + 45854, + 45855, + 45856, + 45857, + 45858, + 45859, + 45860, + 45861, + 45862, + 45863, + 45864, + 45865, + 45866, + 45867, + 45868, + 45869, + 45870, + 45871, + 45872, + 45873, + 45874, + 45875, + 45876, + 45877, + 45878, + 45879, + 45880, + 45881, + 45882, + 45883, + 45884, + 45885, + 45886, + 45887, + 45888, + 45889, + 45890, + 45891, + 45892, + 45893, + 45894, + 45895, + 45896, + 45897, + 45898, + 45899, + 45900, + 45901, + 45902, + 45903, + 45904, + 45905, + 45906, + 45907, + 45908, + 45909, + 45910, + 45911, + 45912, + 45913, + 45914, + 45915, + 45916, + 45917, + 45918, + 45919, + 45920, + 45921, + 45922, + 45923, + 45924, + 45925, + 45926, + 45927, + 45928, + 45929, + 45930, + 45931, + 45932, + 45933, + 45934, + 45935, + 45936, + 45937, + 45938, + 45939, + 45940, + 45941, + 45942, + 45943, + 45944, + 45945, + 45946, + 45947, + 45948, + 45949, + 45950, + 45951, + 45952, + 45953, + 45954, + 45955, + 45956, + 45957, + 45958, + 45959, + 45960, + 45961, + 45962, + 45963, + 45964, + 45965, + 45966, + 45967, + 45968, + 45969, + 45970, + 45971, + 45972, + 45973, + 45974, + 45975, + 45976, + 45977, + 45978, + 45979, + 45980, + 45981, + 45982, + 45983, + 45984, + 45985, + 45986, + 45987, + 45988, + 45989, + 45990, + 45991, + 45992, + 45993, + 45994, + 45995, + 45996, + 45997, + 45998, + 45999, + 46000, + 46001, + 46002, + 46003, + 46004, + 46005, + 46006, + 46007, + 46008, + 46009, + 46010, + 46011, + 46012, + 46013, + 46014, + 46015, + 46016, + 46017, + 46018, + 46019, + 46020, + 46021, + 46022, + 46023, + 46024, + 46025, + 46026, + 46027, + 46028, + 46029, + 46030, + 46031, + 46032, + 46033, + 46034, + 46035, + 46036, + 46037, + 46038, + 46039, + 46040, + 46041, + 46042, + 46043, + 46044, + 46045, + 46046, + 46047, + 46048, + 46049, + 46050, + 46051, + 46052, + 46053, + 46054, + 46055, + 46056, + 46057, + 46058, + 46059, + 46060, + 46061, + 46062, + 46063, + 46064, + 46065, + 46066, + 46067, + 46068, + 46069, + 46070, + 46071, + 46072, + 46073, + 46074, + 46075, + 46076, + 46077, + 46078, + 46079, + 46080, + 46081, + 46082, + 46083, + 46084, + 46085, + 46086, + 46087, + 46088, + 46089, + 46090, + 46091, + 46092, + 46093, + 46094, + 46095, + 46096, + 46097, + 46098, + 46099, + 46100, + 46101, + 46102, + 46103, + 46104, + 46105, + 46106, + 46107, + 46108, + 46109, + 46110, + 46111, + 46112, + 46113, + 46114, + 46115, + 46116, + 46117, + 46118, + 46119, + 46120, + 46121, + 46122, + 46123, + 46124, + 46125, + 46126, + 46127, + 46128, + 46129, + 46130, + 46131, + 46132, + 46133, + 46134, + 46135, + 46136, + 46137, + 46138, + 46139, + 46140, + 46141, + 46142, + 46143, + 46144, + 46145, + 46146, + 46147, + 46148, + 46149, + 46150, + 46151, + 46152, + 46153, + 46154, + 46155, + 46156, + 46157, + 46158, + 46159, + 46160, + 46161, + 46162, + 46163, + 46164, + 46165, + 46166, + 46167, + 46168, + 46169, + 46170, + 46171, + 46172, + 46173, + 46174, + 46175, + 46176, + 46177, + 46178, + 46179, + 46180, + 46181, + 46182, + 46183, + 46184, + 46185, + 46186, + 46187, + 46188, + 46189, + 46190, + 46191, + 46192, + 46193, + 46194, + 46195, + 46196, + 46197, + 46198, + 46199, + 46200, + 46201, + 46202, + 46203, + 46204, + 46205, + 46206, + 46207, + 46208, + 46209, + 46210, + 46211, + 46212, + 46213, + 46214, + 46215, + 46216, + 46217, + 46218, + 46219, + 46220, + 46221, + 46222, + 46223, + 46224, + 46225, + 46226, + 46227, + 46228, + 46229, + 46230, + 46231, + 46232, + 46233, + 46234, + 46235, + 46236, + 46237, + 46238, + 46239, + 46240, + 46241, + 46242, + 46243, + 46244, + 46245, + 46246, + 46247, + 46248, + 46249, + 46250, + 46251, + 46252, + 46253, + 46254, + 46255, + 46256, + 46257, + 46258, + 46259, + 46260, + 46261, + 46262, + 46263, + 46264, + 46265, + 46266, + 46267, + 46268, + 46269, + 46270, + 46271, + 46272, + 46273, + 46274, + 46275, + 46276, + 46277, + 46278, + 46279, + 46280, + 46281, + 46282, + 46283, + 46284, + 46285, + 46286, + 46287, + 46288, + 46289, + 46290, + 46291, + 46292, + 46293, + 46294, + 46295, + 46296, + 46297, + 46298, + 46299, + 46300, + 46301, + 46302, + 46303, + 46304, + 46305, + 46306, + 46307, + 46308, + 46309, + 46310, + 46311, + 46312, + 46313, + 46314, + 46315, + 46316, + 46317, + 46318, + 46319, + 46320, + 46321, + 46322, + 46323, + 46324, + 46325, + 46326, + 46327, + 46328, + 46329, + 46330, + 46331, + 46332, + 46333, + 46334, + 46335, + 46336, + 46337, + 46338, + 46339, + 46340, + 46341, + 46342, + 46343, + 46344, + 46345, + 46346, + 46347, + 46348, + 46349, + 46350, + 46351, + 46352, + 46353, + 46354, + 46355, + 46356, + 46357, + 46358, + 46359, + 46360, + 46361, + 46362, + 46363, + 46364, + 46365, + 46366, + 46367, + 46368, + 46369, + 46370, + 46371, + 46372, + 46373, + 46374, + 46375, + 46376, + 46377, + 46378, + 46379, + 46380, + 46381, + 46382, + 46383, + 46384, + 46385, + 46386, + 46387, + 46388, + 46389, + 46390, + 46391, + 46392, + 46393, + 46394, + 46395, + 46396, + 46397, + 46398, + 46399, + 46400, + 46401, + 46402, + 46403, + 46404, + 46405, + 46406, + 46407, + 46408, + 46409, + 46410, + 46411, + 46412, + 46413, + 46414, + 46415, + 46416, + 46417, + 46418, + 46419, + 46420, + 46421, + 46422, + 46423, + 46424, + 46425, + 46426, + 46427, + 46428, + 46429, + 46430, + 46431, + 46432, + 46433, + 46434, + 46435, + 46436, + 46437, + 46438, + 46439, + 46440, + 46441, + 46442, + 46443, + 46444, + 46445, + 46446, + 46447, + 46448, + 46449, + 46450, + 46451, + 46452, + 46453, + 46454, + 46455, + 46456, + 46457, + 46458, + 46459, + 46460, + 46461, + 46462, + 46463, + 46464, + 46465, + 46466, + 46467, + 46468, + 46469, + 46470, + 46471, + 46472, + 46473, + 46474, + 46475, + 46476, + 46477, + 46478, + 46479, + 46480, + 46481, + 46482, + 46483, + 46484, + 46485, + 46486, + 46487, + 46488, + 46489, + 46490, + 46491, + 46492, + 46493, + 46494, + 46495, + 46496, + 46497, + 46498, + 46499, + 46500, + 46501, + 46502, + 46503, + 46504, + 46505, + 46506, + 46507, + 46508, + 46509, + 46510, + 46511, + 46512, + 46513, + 46514, + 46515, + 46516, + 46517, + 46518, + 46519, + 46520, + 46521, + 46522, + 46523, + 46524, + 46525, + 46526, + 46527, + 46528, + 46529, + 46530, + 46531, + 46532, + 46533, + 46534, + 46535, + 46536, + 46537, + 46538, + 46539, + 46540, + 46541, + 46542, + 46543, + 46544, + 46545, + 46546, + 46547, + 46548, + 46549, + 46550, + 46551, + 46552, + 46553, + 46554, + 46555, + 46556, + 46557, + 46558, + 46559, + 46560, + 46561, + 46562, + 46563, + 46564, + 46565, + 46566, + 46567, + 46568, + 46569, + 46570, + 46571, + 46572, + 46573, + 46574, + 46575, + 46576, + 46577, + 46578, + 46579, + 46580, + 46581, + 46582, + 46583, + 46584, + 46585, + 46586, + 46587, + 46588, + 46589, + 46590, + 46591, + 46592, + 46593, + 46594, + 46595, + 46596, + 46597, + 46598, + 46599, + 46600, + 46601, + 46602, + 46603, + 46604, + 46605, + 46606, + 46607, + 46608, + 46609, + 46610, + 46611, + 46612, + 46613, + 46614, + 46615, + 46616, + 46617, + 46618, + 46619, + 46620, + 46621, + 46622, + 46623, + 46624, + 46625, + 46626, + 46627, + 46628, + 46629, + 46630, + 46631, + 46632, + 46633, + 46634, + 46635, + 46636, + 46637, + 46638, + 46639, + 46640, + 46641, + 46642, + 46643, + 46644, + 46645, + 46646, + 46647, + 46648, + 46649, + 46650, + 46651, + 46652, + 46653, + 46654, + 46655, + 46656, + 46657, + 46658, + 46659, + 46660, + 46661, + 46662, + 46663, + 46664, + 46665, + 46666, + 46667, + 46668, + 46669, + 46670, + 46671, + 46672, + 46673, + 46674, + 46675, + 46676, + 46677, + 46678, + 46679, + 46680, + 46681, + 46682, + 46683, + 46684, + 46685, + 46686, + 46687, + 46688, + 46689, + 46690, + 46691, + 46692, + 46693, + 46694, + 46695, + 46696, + 46697, + 46698, + 46699, + 46700, + 46701, + 46702, + 46703, + 46704, + 46705, + 46706, + 46707, + 46708, + 46709, + 46710, + 46711, + 46712, + 46713, + 46714, + 46715, + 46716, + 46717, + 46718, + 46719, + 46720, + 46721, + 46722, + 46723, + 46724, + 46725, + 46726, + 46727, + 46728, + 46729, + 46730, + 46731, + 46732, + 46733, + 46734, + 46735, + 46736, + 46737, + 46738, + 46739, + 46740, + 46741, + 46742, + 46743, + 46744, + 46745, + 46746, + 46747, + 46748, + 46749, + 46750, + 46751, + 46752, + 46753, + 46754, + 46755, + 46756, + 46757, + 46758, + 46759, + 46760, + 46761, + 46762, + 46763, + 46764, + 46765, + 46766, + 46767, + 46768, + 46769, + 46770, + 46771, + 46772, + 46773, + 46774, + 46775, + 46776, + 46777, + 46778, + 46779, + 46780, + 46781, + 46782, + 46783, + 46784, + 46785, + 46786, + 46787, + 46788, + 46789, + 46790, + 46791, + 46792, + 46793, + 46794, + 46795, + 46796, + 46797, + 46798, + 46799, + 46800, + 46801, + 46802, + 46803, + 46804, + 46805, + 46806, + 46807, + 46808, + 46809, + 46810, + 46811, + 46812, + 46813, + 46814, + 46815, + 46816, + 46817, + 46818, + 46819, + 46820, + 46821, + 46822, + 46823, + 46824, + 46825, + 46826, + 46827, + 46828, + 46829, + 46830, + 46831, + 46832, + 46833, + 46834, + 46835, + 46836, + 46837, + 46838, + 46839, + 46840, + 46841, + 46842, + 46843, + 46844, + 46845, + 46846, + 46847, + 46848, + 46849, + 46850, + 46851, + 46852, + 46853, + 46854, + 46855, + 46856, + 46857, + 46858, + 46859, + 46860, + 46861, + 46862, + 46863, + 46864, + 46865, + 46866, + 46867, + 46868, + 46869, + 46870, + 46871, + 46872, + 46873, + 46874, + 46875, + 46876, + 46877, + 46878, + 46879, + 46880, + 46881, + 46882, + 46883, + 46884, + 46885, + 46886, + 46887, + 46888, + 46889, + 46890, + 46891, + 46892, + 46893, + 46894, + 46895, + 46896, + 46897, + 46898, + 46899, + 46900, + 46901, + 46902, + 46903, + 46904, + 46905, + 46906, + 46907, + 46908, + 46909, + 46910, + 46911, + 46912, + 46913, + 46914, + 46915, + 46916, + 46917, + 46918, + 46919, + 46920, + 46921, + 46922, + 46923, + 46924, + 46925, + 46926, + 46927, + 46928, + 46929, + 46930, + 46931, + 46932, + 46933, + 46934, + 46935, + 46936, + 46937, + 46938, + 46939, + 46940, + 46941, + 46942, + 46943, + 46944, + 46945, + 46946, + 46947, + 46948, + 46949, + 46950, + 46951, + 46952, + 46953, + 46954, + 46955, + 46956, + 46957, + 46958, + 46959, + 46960, + 46961, + 46962, + 46963, + 46964, + 46965, + 46966, + 46967, + 46968, + 46969, + 46970, + 46971, + 46972, + 46973, + 46974, + 46975, + 46976, + 46977, + 46978, + 46979, + 46980, + 46981, + 46982, + 46983, + 46984, + 46985, + 46986, + 46987, + 46988, + 46989, + 46990, + 46991, + 46992, + 46993, + 46994, + 46995, + 46996, + 46997, + 46998, + 46999, + 47000, + 47001, + 47002, + 47003, + 47004, + 47005, + 47006, + 47007, + 47008, + 47009, + 47010, + 47011, + 47012, + 47013, + 47014, + 47015, + 47016, + 47017, + 47018, + 47019, + 47020, + 47021, + 47022, + 47023, + 47024, + 47025, + 47026, + 47027, + 47028, + 47029, + 47030, + 47031, + 47032, + 47033, + 47034, + 47035, + 47036, + 47037, + 47038, + 47039, + 47040, + 47041, + 47042, + 47043, + 47044, + 47045, + 47046, + 47047, + 47048, + 47049, + 47050, + 47051, + 47052, + 47053, + 47054, + 47055, + 47056, + 47057, + 47058, + 47059, + 47060, + 47061, + 47062, + 47063, + 47064, + 47065, + 47066, + 47067, + 47068, + 47069, + 47070, + 47071, + 47072, + 47073, + 47074, + 47075, + 47076, + 47077, + 47078, + 47079, + 47080, + 47081, + 47082, + 47083, + 47084, + 47085, + 47086, + 47087, + 47088, + 47089, + 47090, + 47091, + 47092, + 47093, + 47094, + 47095, + 47096, + 47097, + 47098, + 47099, + 47100, + 47101, + 47102, + 47103, + 47104, + 47105, + 47106, + 47107, + 47108, + 47109, + 47110, + 47111, + 47112, + 47113, + 47114, + 47115, + 47116, + 47117, + 47118, + 47119, + 47120, + 47121, + 47122, + 47123, + 47124, + 47125, + 47126, + 47127, + 47128, + 47129, + 47130, + 47131, + 47132, + 47133, + 47134, + 47135, + 47136, + 47137, + 47138, + 47139, + 47140, + 47141, + 47142, + 47143, + 47144, + 47145, + 47146, + 47147, + 47148, + 47149, + 47150, + 47151, + 47152, + 47153, + 47154, + 47155, + 47156, + 47157, + 47158, + 47159, + 47160, + 47161, + 47162, + 47163, + 47164, + 47165, + 47166, + 47167, + 47168, + 47169, + 47170, + 47171, + 47172, + 47173, + 47174, + 47175, + 47176, + 47177, + 47178, + 47179, + 47180, + 47181, + 47182, + 47183, + 47184, + 47185, + 47186, + 47187, + 47188, + 47189, + 47190, + 47191, + 47192, + 47193, + 47194, + 47195, + 47196, + 47197, + 47198, + 47199, + 47200, + 47201, + 47202, + 47203, + 47204, + 47205, + 47206, + 47207, + 47208, + 47209, + 47210, + 47211, + 47212, + 47213, + 47214, + 47215, + 47216, + 47217, + 47218, + 47219, + 47220, + 47221, + 47222, + 47223, + 47224, + 47225, + 47226, + 47227, + 47228, + 47229, + 47230, + 47231, + 47232, + 47233, + 47234, + 47235, + 47236, + 47237, + 47238, + 47239, + 47240, + 47241, + 47242, + 47243, + 47244, + 47245, + 47246, + 47247, + 47248, + 47249, + 47250, + 47251, + 47252, + 47253, + 47254, + 47255, + 47256, + 47257, + 47258, + 47259, + 47260, + 47261, + 47262, + 47263, + 47264, + 47265, + 47266, + 47267, + 47268, + 47269, + 47270, + 47271, + 47272, + 47273, + 47274, + 47275, + 47276, + 47277, + 47278, + 47279, + 47280, + 47281, + 47282, + 47283, + 47284, + 47285, + 47286, + 47287, + 47288, + 47289, + 47290, + 47291, + 47292, + 47293, + 47294, + 47295, + 47296, + 47297, + 47298, + 47299, + 47300, + 47301, + 47302, + 47303, + 47304, + 47305, + 47306, + 47307, + 47308, + 47309, + 47310, + 47311, + 47312, + 47313, + 47314, + 47315, + 47316, + 47317, + 47318, + 47319, + 47320, + 47321, + 47322, + 47323, + 47324, + 47325, + 47326, + 47327, + 47328, + 47329, + 47330, + 47331, + 47332, + 47333, + 47334, + 47335, + 47336, + 47337, + 47338, + 47339, + 47340, + 47341, + 47342, + 47343, + 47344, + 47345, + 47346, + 47347, + 47348, + 47349, + 47350, + 47351, + 47352, + 47353, + 47354, + 47355, + 47356, + 47357, + 47358, + 47359, + 47360, + 47361, + 47362, + 47363, + 47364, + 47365, + 47366, + 47367, + 47368, + 47369, + 47370, + 47371, + 47372, + 47373, + 47374, + 47375, + 47376, + 47377, + 47378, + 47379, + 47380, + 47381, + 47382, + 47383, + 47384, + 47385, + 47386, + 47387, + 47388, + 47389, + 47390, + 47391, + 47392, + 47393, + 47394, + 47395, + 47396, + 47397, + 47398, + 47399, + 47400, + 47401, + 47402, + 47403, + 47404, + 47405, + 47406, + 47407, + 47408, + 47409, + 47410, + 47411, + 47412, + 47413, + 47414, + 47415, + 47416, + 47417, + 47418, + 47419, + 47420, + 47421, + 47422, + 47423, + 47424, + 47425, + 47426, + 47427, + 47428, + 47429, + 47430, + 47431, + 47432, + 47433, + 47434, + 47435, + 47436, + 47437, + 47438, + 47439, + 47440, + 47441, + 47442, + 47443, + 47444, + 47445, + 47446, + 47447, + 47448, + 47449, + 47450, + 47451, + 47452, + 47453, + 47454, + 47455, + 47456, + 47457, + 47458, + 47459, + 47460, + 47461, + 47462, + 47463, + 47464, + 47465, + 47466, + 47467, + 47468, + 47469, + 47470, + 47471, + 47472, + 47473, + 47474, + 47475, + 47476, + 47477, + 47478, + 47479, + 47480, + 47481, + 47482, + 47483, + 47484, + 47485, + 47486, + 47487, + 47488, + 47489, + 47490, + 47491, + 47492, + 47493, + 47494, + 47495, + 47496, + 47497, + 47498, + 47499, + 47500, + 47501, + 47502, + 47503, + 47504, + 47505, + 47506, + 47507, + 47508, + 47509, + 47510, + 47511, + 47512, + 47513, + 47514, + 47515, + 47516, + 47517, + 47518, + 47519, + 47520, + 47521, + 47522, + 47523, + 47524, + 47525, + 47526, + 47527, + 47528, + 47529, + 47530, + 47531, + 47532, + 47533, + 47534, + 47535, + 47536, + 47537, + 47538, + 47539, + 47540, + 47541, + 47542, + 47543, + 47544, + 47545, + 47546, + 47547, + 47548, + 47549, + 47550, + 47551, + 47552, + 47553, + 47554, + 47555, + 47556, + 47557, + 47558, + 47559, + 47560, + 47561, + 47562, + 47563, + 47564, + 47565, + 47566, + 47567, + 47568, + 47569, + 47570, + 47571, + 47572, + 47573, + 47574, + 47575, + 47576, + 47577, + 47578, + 47579, + 47580, + 47581, + 47582, + 47583, + 47584, + 47585, + 47586, + 47587, + 47588, + 47589, + 47590, + 47591, + 47592, + 47593, + 47594, + 47595, + 47596, + 47597, + 47598, + 47599, + 47600, + 47601, + 47602, + 47603, + 47604, + 47605, + 47606, + 47607, + 47608, + 47609, + 47610, + 47611, + 47612, + 47613, + 47614, + 47615, + 47616, + 47617, + 47618, + 47619, + 47620, + 47621, + 47622, + 47623, + 47624, + 47625, + 47626, + 47627, + 47628, + 47629, + 47630, + 47631, + 47632, + 47633, + 47634, + 47635, + 47636, + 47637, + 47638, + 47639, + 47640, + 47641, + 47642, + 47643, + 47644, + 47645, + 47646, + 47647, + 47648, + 47649, + 47650, + 47651, + 47652, + 47653, + 47654, + 47655, + 47656, + 47657, + 47658, + 47659, + 47660, + 47661, + 47662, + 47663, + 47664, + 47665, + 47666, + 47667, + 47668, + 47669, + 47670, + 47671, + 47672, + 47673, + 47674, + 47675, + 47676, + 47677, + 47678, + 47679, + 47680, + 47681, + 47682, + 47683, + 47684, + 47685, + 47686, + 47687, + 47688, + 47689, + 47690, + 47691, + 47692, + 47693, + 47694, + 47695, + 47696, + 47697, + 47698, + 47699, + 47700, + 47701, + 47702, + 47703, + 47704, + 47705, + 47706, + 47707, + 47708, + 47709, + 47710, + 47711, + 47712, + 47713, + 47714, + 47715, + 47716, + 47717, + 47718, + 47719, + 47720, + 47721, + 47722, + 47723, + 47724, + 47725, + 47726, + 47727, + 47728, + 47729, + 47730, + 47731, + 47732, + 47733, + 47734, + 47735, + 47736, + 47737, + 47738, + 47739, + 47740, + 47741, + 47742, + 47743, + 47744, + 47745, + 47746, + 47747, + 47748, + 47749, + 47750, + 47751, + 47752, + 47753, + 47754, + 47755, + 47756, + 47757, + 47758, + 47759, + 47760, + 47761, + 47762, + 47763, + 47764, + 47765, + 47766, + 47767, + 47768, + 47769, + 47770, + 47771, + 47772, + 47773, + 47774, + 47775, + 47776, + 47777, + 47778, + 47779, + 47780, + 47781, + 47782, + 47783, + 47784, + 47785, + 47786, + 47787, + 47788, + 47789, + 47790, + 47791, + 47792, + 47793, + 47794, + 47795, + 47796, + 47797, + 47798, + 47799, + 47800, + 47801, + 47802, + 47803, + 47804, + 47805, + 47806, + 47807, + 47808, + 47809, + 47810, + 47811, + 47812, + 47813, + 47814, + 47815, + 47816, + 47817, + 47818, + 47819, + 47820, + 47821, + 47822, + 47823, + 47824, + 47825, + 47826, + 47827, + 47828, + 47829, + 47830, + 47831, + 47832, + 47833, + 47834, + 47835, + 47836, + 47837, + 47838, + 47839, + 47840, + 47841, + 47842, + 47843, + 47844, + 47845, + 47846, + 47847, + 47848, + 47849, + 47850, + 47851, + 47852, + 47853, + 47854, + 47855, + 47856, + 47857, + 47858, + 47859, + 47860, + 47861, + 47862, + 47863, + 47864, + 47865, + 47866, + 47867, + 47868, + 47869, + 47870, + 47871, + 47872, + 47873, + 47874, + 47875, + 47876, + 47877, + 47878, + 47879, + 47880, + 47881, + 47882, + 47883, + 47884, + 47885, + 47886, + 47887, + 47888, + 47889, + 47890, + 47891, + 47892, + 47893, + 47894, + 47895, + 47896, + 47897, + 47898, + 47899, + 47900, + 47901, + 47902, + 47903, + 47904, + 47905, + 47906, + 47907, + 47908, + 47909, + 47910, + 47911, + 47912, + 47913, + 47914, + 47915, + 47916, + 47917, + 47918, + 47919, + 47920, + 47921, + 47922, + 47923, + 47924, + 47925, + 47926, + 47927, + 47928, + 47929, + 47930, + 47931, + 47932, + 47933, + 47934, + 47935, + 47936, + 47937, + 47938, + 47939, + 47940, + 47941, + 47942, + 47943, + 47944, + 47945, + 47946, + 47947, + 47948, + 47949, + 47950, + 47951, + 47952, + 47953, + 47954, + 47955, + 47956, + 47957, + 47958, + 47959, + 47960, + 47961, + 47962, + 47963, + 47964, + 47965, + 47966, + 47967, + 47968, + 47969, + 47970, + 47971, + 47972, + 47973, + 47974, + 47975, + 47976, + 47977, + 47978, + 47979, + 47980, + 47981, + 47982, + 47983, + 47984, + 47985, + 47986, + 47987, + 47988, + 47989, + 47990, + 47991, + 47992, + 47993, + 47994, + 47995, + 47996, + 47997, + 47998, + 47999, + 48000, + 48001, + 48002, + 48003, + 48004, + 48005, + 48006, + 48007, + 48008, + 48009, + 48010, + 48011, + 48012, + 48013, + 48014, + 48015, + 48016, + 48017, + 48018, + 48019, + 48020, + 48021, + 48022, + 48023, + 48024, + 48025, + 48026, + 48027, + 48028, + 48029, + 48030, + 48031, + 48032, + 48033, + 48034, + 48035, + 48036, + 48037, + 48038, + 48039, + 48040, + 48041, + 48042, + 48043, + 48044, + 48045, + 48046, + 48047, + 48048, + 48049, + 48050, + 48051, + 48052, + 48053, + 48054, + 48055, + 48056, + 48057, + 48058, + 48059, + 48060, + 48061, + 48062, + 48063, + 48064, + 48065, + 48066, + 48067, + 48068, + 48069, + 48070, + 48071, + 48072, + 48073, + 48074, + 48075, + 48076, + 48077, + 48078, + 48079, + 48080, + 48081, + 48082, + 48083, + 48084, + 48085, + 48086, + 48087, + 48088, + 48089, + 48090, + 48091, + 48092, + 48093, + 48094, + 48095, + 48096, + 48097, + 48098, + 48099, + 48100, + 48101, + 48102, + 48103, + 48104, + 48105, + 48106, + 48107, + 48108, + 48109, + 48110, + 48111, + 48112, + 48113, + 48114, + 48115, + 48116, + 48117, + 48118, + 48119, + 48120, + 48121, + 48122, + 48123, + 48124, + 48125, + 48126, + 48127, + 48128, + 48129, + 48130, + 48131, + 48132, + 48133, + 48134, + 48135, + 48136, + 48137, + 48138, + 48139, + 48140, + 48141, + 48142, + 48143, + 48144, + 48145, + 48146, + 48147, + 48148, + 48149, + 48150, + 48151, + 48152, + 48153, + 48154, + 48155, + 48156, + 48157, + 48158, + 48159, + 48160, + 48161, + 48162, + 48163, + 48164, + 48165, + 48166, + 48167, + 48168, + 48169, + 48170, + 48171, + 48172, + 48173, + 48174, + 48175, + 48176, + 48177, + 48178, + 48179, + 48180, + 48181, + 48182, + 48183, + 48184, + 48185, + 48186, + 48187, + 48188, + 48189, + 48190, + 48191, + 48192, + 48193, + 48194, + 48195, + 48196, + 48197, + 48198, + 48199, + 48200, + 48201, + 48202, + 48203, + 48204, + 48205, + 48206, + 48207, + 48208, + 48209, + 48210, + 48211, + 48212, + 48213, + 48214, + 48215, + 48216, + 48217, + 48218, + 48219, + 48220, + 48221, + 48222, + 48223, + 48224, + 48225, + 48226, + 48227, + 48228, + 48229, + 48230, + 48231, + 48232, + 48233, + 48234, + 48235, + 48236, + 48237, + 48238, + 48239, + 48240, + 48241, + 48242, + 48243, + 48244, + 48245, + 48246, + 48247, + 48248, + 48249, + 48250, + 48251, + 48252, + 48253, + 48254, + 48255, + 48256, + 48257, + 48258, + 48259, + 48260, + 48261, + 48262, + 48263, + 48264, + 48265, + 48266, + 48267, + 48268, + 48269, + 48270, + 48271, + 48272, + 48273, + 48274, + 48275, + 48276, + 48277, + 48278, + 48279, + 48280, + 48281, + 48282, + 48283, + 48284, + 48285, + 48286, + 48287, + 48288, + 48289, + 48290, + 48291, + 48292, + 48293, + 48294, + 48295, + 48296, + 48297, + 48298, + 48299, + 48300, + 48301, + 48302, + 48303, + 48304, + 48305, + 48306, + 48307, + 48308, + 48309, + 48310, + 48311, + 48312, + 48313, + 48314, + 48315, + 48316, + 48317, + 48318, + 48319, + 48320, + 48321, + 48322, + 48323, + 48324, + 48325, + 48326, + 48327, + 48328, + 48329, + 48330, + 48331, + 48332, + 48333, + 48334, + 48335, + 48336, + 48337, + 48338, + 48339, + 48340, + 48341, + 48342, + 48343, + 48344, + 48345, + 48346, + 48347, + 48348, + 48349, + 48350, + 48351, + 48352, + 48353, + 48354, + 48355, + 48356, + 48357, + 48358, + 48359, + 48360, + 48361, + 48362, + 48363, + 48364, + 48365, + 48366, + 48367, + 48368, + 48369, + 48370, + 48371, + 48372, + 48373, + 48374, + 48375, + 48376, + 48377, + 48378, + 48379, + 48380, + 48381, + 48382, + 48383, + 48384, + 48385, + 48386, + 48387, + 48388, + 48389, + 48390, + 48391, + 48392, + 48393, + 48394, + 48395, + 48396, + 48397, + 48398, + 48399, + 48400, + 48401, + 48402, + 48403, + 48404, + 48405, + 48406, + 48407, + 48408, + 48409, + 48410, + 48411, + 48412, + 48413, + 48414, + 48415, + 48416, + 48417, + 48418, + 48419, + 48420, + 48421, + 48422, + 48423, + 48424, + 48425, + 48426, + 48427, + 48428, + 48429, + 48430, + 48431, + 48432, + 48433, + 48434, + 48435, + 48436, + 48437, + 48438, + 48439, + 48440, + 48441, + 48442, + 48443, + 48444, + 48445, + 48446, + 48447, + 48448, + 48449, + 48450, + 48451, + 48452, + 48453, + 48454, + 48455, + 48456, + 48457, + 48458, + 48459, + 48460, + 48461, + 48462, + 48463, + 48464, + 48465, + 48466, + 48467, + 48468, + 48469, + 48470, + 48471, + 48472, + 48473, + 48474, + 48475, + 48476, + 48477, + 48478, + 48479, + 48480, + 48481, + 48482, + 48483, + 48484, + 48485, + 48486, + 48487, + 48488, + 48489, + 48490, + 48491, + 48492, + 48493, + 48494, + 48495, + 48496, + 48497, + 48498, + 48499, + 48500, + 48501, + 48502, + 48503, + 48504, + 48505, + 48506, + 48507, + 48508, + 48509, + 48510, + 48511, + 48512, + 48513, + 48514, + 48515, + 48516, + 48517, + 48518, + 48519, + 48520, + 48521, + 48522, + 48523, + 48524, + 48525, + 48526, + 48527, + 48528, + 48529, + 48530, + 48531, + 48532, + 48533, + 48534, + 48535, + 48536, + 48537, + 48538, + 48539, + 48540, + 48541, + 48542, + 48543, + 48544, + 48545, + 48546, + 48547, + 48548, + 48549, + 48550, + 48551, + 48552, + 48553, + 48554, + 48555, + 48556, + 48557, + 48558, + 48559, + 48560, + 48561, + 48562, + 48563, + 48564, + 48565, + 48566, + 48567, + 48568, + 48569, + 48570, + 48571, + 48572, + 48573, + 48574, + 48575, + 48576, + 48577, + 48578, + 48579, + 48580, + 48581, + 48582, + 48583, + 48584, + 48585, + 48586, + 48587, + 48588, + 48589, + 48590, + 48591, + 48592, + 48593, + 48594, + 48595, + 48596, + 48597, + 48598, + 48599, + 48600, + 48601, + 48602, + 48603, + 48604, + 48605, + 48606, + 48607, + 48608, + 48609, + 48610, + 48611, + 48612, + 48613, + 48614, + 48615, + 48616, + 48617, + 48618, + 48619, + 48620, + 48621, + 48622, + 48623, + 48624, + 48625, + 48626, + 48627, + 48628, + 48629, + 48630, + 48631, + 48632, + 48633, + 48634, + 48635, + 48636, + 48637, + 48638, + 48639, + 48640, + 48641, + 48642, + 48643, + 48644, + 48645, + 48646, + 48647, + 48648, + 48649, + 48650, + 48651, + 48652, + 48653, + 48654, + 48655, + 48656, + 48657, + 48658, + 48659, + 48660, + 48661, + 48662, + 48663, + 48664, + 48665, + 48666, + 48667, + 48668, + 48669, + 48670, + 48671, + 48672, + 48673, + 48674, + 48675, + 48676, + 48677, + 48678, + 48679, + 48680, + 48681, + 48682, + 48683, + 48684, + 48685, + 48686, + 48687, + 48688, + 48689, + 48690, + 48691, + 48692, + 48693, + 48694, + 48695, + 48696, + 48697, + 48698, + 48699, + 48700, + 48701, + 48702, + 48703, + 48704, + 48705, + 48706, + 48707, + 48708, + 48709, + 48710, + 48711, + 48712, + 48713, + 48714, + 48715, + 48716, + 48717, + 48718, + 48719, + 48720, + 48721, + 48722, + 48723, + 48724, + 48725, + 48726, + 48727, + 48728, + 48729, + 48730, + 48731, + 48732, + 48733, + 48734, + 48735, + 48736, + 48737, + 48738, + 48739, + 48740, + 48741, + 48742, + 48743, + 48744, + 48745, + 48746, + 48747, + 48748, + 48749, + 48750, + 48751, + 48752, + 48753, + 48754, + 48755, + 48756, + 48757, + 48758, + 48759, + 48760, + 48761, + 48762, + 48763, + 48764, + 48765, + 48766, + 48767, + 48768, + 48769, + 48770, + 48771, + 48772, + 48773, + 48774, + 48775, + 48776, + 48777, + 48778, + 48779, + 48780, + 48781, + 48782, + 48783, + 48784, + 48785, + 48786, + 48787, + 48788, + 48789, + 48790, + 48791, + 48792, + 48793, + 48794, + 48795, + 48796, + 48797, + 48798, + 48799, + 48800, + 48801, + 48802, + 48803, + 48804, + 48805, + 48806, + 48807, + 48808, + 48809, + 48810, + 48811, + 48812, + 48813, + 48814, + 48815, + 48816, + 48817, + 48818, + 48819, + 48820, + 48821, + 48822, + 48823, + 48824, + 48825, + 48826, + 48827, + 48828, + 48829, + 48830, + 48831, + 48832, + 48833, + 48834, + 48835, + 48836, + 48837, + 48838, + 48839, + 48840, + 48841, + 48842, + 48843, + 48844, + 48845, + 48846, + 48847, + 48848, + 48849, + 48850, + 48851, + 48852, + 48853, + 48854, + 48855, + 48856, + 48857, + 48858, + 48859, + 48860, + 48861, + 48862, + 48863, + 48864, + 48865, + 48866, + 48867, + 48868, + 48869, + 48870, + 48871, + 48872, + 48873, + 48874, + 48875, + 48876, + 48877, + 48878, + 48879, + 48880, + 48881, + 48882, + 48883, + 48884, + 48885, + 48886, + 48887, + 48888, + 48889, + 48890, + 48891, + 48892, + 48893, + 48894, + 48895, + 48896, + 48897, + 48898, + 48899, + 48900, + 48901, + 48902, + 48903, + 48904, + 48905, + 48906, + 48907, + 48908, + 48909, + 48910, + 48911, + 48912, + 48913, + 48914, + 48915, + 48916, + 48917, + 48918, + 48919, + 48920, + 48921, + 48922, + 48923, + 48924, + 48925, + 48926, + 48927, + 48928, + 48929, + 48930, + 48931, + 48932, + 48933, + 48934, + 48935, + 48936, + 48937, + 48938, + 48939, + 48940, + 48941, + 48942, + 48943, + 48944, + 48945, + 48946, + 48947, + 48948, + 48949, + 48950, + 48951, + 48952, + 48953, + 48954, + 48955, + 48956, + 48957, + 48958, + 48959, + 48960, + 48961, + 48962, + 48963, + 48964, + 48965, + 48966, + 48967, + 48968, + 48969, + 48970, + 48971, + 48972, + 48973, + 48974, + 48975, + 48976, + 48977, + 48978, + 48979, + 48980, + 48981, + 48982, + 48983, + 48984, + 48985, + 48986, + 48987, + 48988, + 48989, + 48990, + 48991, + 48992, + 48993, + 48994, + 48995, + 48996, + 48997, + 48998, + 48999, + 49000, + 49001, + 49002, + 49003, + 49004, + 49005, + 49006, + 49007, + 49008, + 49009, + 49010, + 49011, + 49012, + 49013, + 49014, + 49015, + 49016, + 49017, + 49018, + 49019, + 49020, + 49021, + 49022, + 49023, + 49024, + 49025, + 49026, + 49027, + 49028, + 49029, + 49030, + 49031, + 49032, + 49033, + 49034, + 49035, + 49036, + 49037, + 49038, + 49039, + 49040, + 49041, + 49042, + 49043, + 49044, + 49045, + 49046, + 49047, + 49048, + 49049, + 49050, + 49051, + 49052, + 49053, + 49054, + 49055, + 49056, + 49057, + 49058, + 49059, + 49060, + 49061, + 49062, + 49063, + 49064, + 49065, + 49066, + 49067, + 49068, + 49069, + 49070, + 49071, + 49072, + 49073, + 49074, + 49075, + 49076, + 49077, + 49078, + 49079, + 49080, + 49081, + 49082, + 49083, + 49084, + 49085, + 49086, + 49087, + 49088, + 49089, + 49090, + 49091, + 49092, + 49093, + 49094, + 49095, + 49096, + 49097, + 49098, + 49099, + 49100, + 49101, + 49102, + 49103, + 49104, + 49105, + 49106, + 49107, + 49108, + 49109, + 49110, + 49111, + 49112, + 49113, + 49114, + 49115, + 49116, + 49117, + 49118, + 49119, + 49120, + 49121, + 49122, + 49123, + 49124, + 49125, + 49126, + 49127, + 49128, + 49129, + 49130, + 49131, + 49132, + 49133, + 49134, + 49135, + 49136, + 49137, + 49138, + 49139, + 49140, + 49141, + 49142, + 49143, + 49144, + 49145, + 49146, + 49147, + 49148, + 49149, + 49150, + 49151, + 49152, + 49153, + 49154, + 49155, + 49156, + 49157, + 49158, + 49159, + 49160, + 49161, + 49162, + 49163, + 49164, + 49165, + 49166, + 49167, + 49168, + 49169, + 49170, + 49171, + 49172, + 49173, + 49174, + 49175, + 49176, + 49177, + 49178, + 49179, + 49180, + 49181, + 49182, + 49183, + 49184, + 49185, + 49186, + 49187, + 49188, + 49189, + 49190, + 49191, + 49192, + 49193, + 49194, + 49195, + 49196, + 49197, + 49198, + 49199, + 49200, + 49201, + 49202, + 49203, + 49204, + 49205, + 49206, + 49207, + 49208, + 49209, + 49210, + 49211, + 49212, + 49213, + 49214, + 49215, + 49216, + 49217, + 49218, + 49219, + 49220, + 49221, + 49222, + 49223, + 49224, + 49225, + 49226, + 49227, + 49228, + 49229, + 49230, + 49231, + 49232, + 49233, + 49234, + 49235, + 49236, + 49237, + 49238, + 49239, + 49240, + 49241, + 49242, + 49243, + 49244, + 49245, + 49246, + 49247, + 49248, + 49249, + 49250, + 49251, + 49252, + 49253, + 49254, + 49255, + 49256, + 49257, + 49258, + 49259, + 49260, + 49261, + 49262, + 49263, + 49264, + 49265, + 49266, + 49267, + 49268, + 49269, + 49270, + 49271, + 49272, + 49273, + 49274, + 49275, + 49276, + 49277, + 49278, + 49279, + 49280, + 49281, + 49282, + 49283, + 49284, + 49285, + 49286, + 49287, + 49288, + 49289, + 49290, + 49291, + 49292, + 49293, + 49294, + 49295, + 49296, + 49297, + 49298, + 49299, + 49300, + 49301, + 49302, + 49303, + 49304, + 49305, + 49306, + 49307, + 49308, + 49309, + 49310, + 49311, + 49312, + 49313, + 49314, + 49315, + 49316, + 49317, + 49318, + 49319, + 49320, + 49321, + 49322, + 49323, + 49324, + 49325, + 49326, + 49327, + 49328, + 49329, + 49330, + 49331, + 49332, + 49333, + 49334, + 49335, + 49336, + 49337, + 49338, + 49339, + 49340, + 49341, + 49342, + 49343, + 49344, + 49345, + 49346, + 49347, + 49348, + 49349, + 49350, + 49351, + 49352, + 49353, + 49354, + 49355, + 49356, + 49357, + 49358, + 49359, + 49360, + 49361, + 49362, + 49363, + 49364, + 49365, + 49366, + 49367, + 49368, + 49369, + 49370, + 49371, + 49372, + 49373, + 49374, + 49375, + 49376, + 49377, + 49378, + 49379, + 49380, + 49381, + 49382, + 49383, + 49384, + 49385, + 49386, + 49387, + 49388, + 49389, + 49390, + 49391, + 49392, + 49393, + 49394, + 49395, + 49396, + 49397, + 49398, + 49399, + 49400, + 49401, + 49402, + 49403, + 49404, + 49405, + 49406, + 49407, + 49408, + 49409, + 49410, + 49411, + 49412, + 49413, + 49414, + 49415, + 49416, + 49417, + 49418, + 49419, + 49420, + 49421, + 49422, + 49423, + 49424, + 49425, + 49426, + 49427, + 49428, + 49429, + 49430, + 49431, + 49432, + 49433, + 49434, + 49435, + 49436, + 49437, + 49438, + 49439, + 49440, + 49441, + 49442, + 49443, + 49444, + 49445, + 49446, + 49447, + 49448, + 49449, + 49450, + 49451, + 49452, + 49453, + 49454, + 49455, + 49456, + 49457, + 49458, + 49459, + 49460, + 49461, + 49462, + 49463, + 49464, + 49465, + 49466, + 49467, + 49468, + 49469, + 49470, + 49471, + 49472, + 49473, + 49474, + 49475, + 49476, + 49477, + 49478, + 49479, + 49480, + 49481, + 49482, + 49483, + 49484, + 49485, + 49486, + 49487, + 49488, + 49489, + 49490, + 49491, + 49492, + 49493, + 49494, + 49495, + 49496, + 49497, + 49498, + 49499, + 49500, + 49501, + 49502, + 49503, + 49504, + 49505, + 49506, + 49507, + 49508, + 49509, + 49510, + 49511, + 49512, + 49513, + 49514, + 49515, + 49516, + 49517, + 49518, + 49519, + 49520, + 49521, + 49522, + 49523, + 49524, + 49525, + 49526, + 49527, + 49528, + 49529, + 49530, + 49531, + 49532, + 49533, + 49534, + 49535, + 49536, + 49537, + 49538, + 49539, + 49540, + 49541, + 49542, + 49543, + 49544, + 49545, + 49546, + 49547, + 49548, + 49549, + 49550, + 49551, + 49552, + 49553, + 49554, + 49555, + 49556, + 49557, + 49558, + 49559, + 49560, + 49561, + 49562, + 49563, + 49564, + 49565, + 49566, + 49567, + 49568, + 49569, + 49570, + 49571, + 49572, + 49573, + 49574, + 49575, + 49576, + 49577, + 49578, + 49579, + 49580, + 49581, + 49582, + 49583, + 49584, + 49585, + 49586, + 49587, + 49588, + 49589, + 49590, + 49591, + 49592, + 49593, + 49594, + 49595, + 49596, + 49597, + 49598, + 49599, + 49600, + 49601, + 49602, + 49603, + 49604, + 49605, + 49606, + 49607, + 49608, + 49609, + 49610, + 49611, + 49612, + 49613, + 49614, + 49615, + 49616, + 49617, + 49618, + 49619, + 49620, + 49621, + 49622, + 49623, + 49624, + 49625, + 49626, + 49627, + 49628, + 49629, + 49630, + 49631, + 49632, + 49633, + 49634, + 49635, + 49636, + 49637, + 49638, + 49639, + 49640, + 49641, + 49642, + 49643, + 49644, + 49645, + 49646, + 49647, + 49648, + 49649, + 49650, + 49651, + 49652, + 49653, + 49654, + 49655, + 49656, + 49657, + 49658, + 49659, + 49660, + 49661, + 49662, + 49663, + 49664, + 49665, + 49666, + 49667, + 49668, + 49669, + 49670, + 49671, + 49672, + 49673, + 49674, + 49675, + 49676, + 49677, + 49678, + 49679, + 49680, + 49681, + 49682, + 49683, + 49684, + 49685, + 49686, + 49687, + 49688, + 49689, + 49690, + 49691, + 49692, + 49693, + 49694, + 49695, + 49696, + 49697, + 49698, + 49699, + 49700, + 49701, + 49702, + 49703, + 49704, + 49705, + 49706, + 49707, + 49708, + 49709, + 49710, + 49711, + 49712, + 49713, + 49714, + 49715, + 49716, + 49717, + 49718, + 49719, + 49720, + 49721, + 49722, + 49723, + 49724, + 49725, + 49726, + 49727, + 49728, + 49729, + 49730, + 49731, + 49732, + 49733, + 49734, + 49735, + 49736, + 49737, + 49738, + 49739, + 49740, + 49741, + 49742, + 49743, + 49744, + 49745, + 49746, + 49747, + 49748, + 49749, + 49750, + 49751, + 49752, + 49753, + 49754, + 49755, + 49756, + 49757, + 49758, + 49759, + 49760, + 49761, + 49762, + 49763, + 49764, + 49765, + 49766, + 49767, + 49768, + 49769, + 49770, + 49771, + 49772, + 49773, + 49774, + 49775, + 49776, + 49777, + 49778, + 49779, + 49780, + 49781, + 49782, + 49783, + 49784, + 49785, + 49786, + 49787, + 49788, + 49789, + 49790, + 49791, + 49792, + 49793, + 49794, + 49795, + 49796, + 49797, + 49798, + 49799, + 49800, + 49801, + 49802, + 49803, + 49804, + 49805, + 49806, + 49807, + 49808, + 49809, + 49810, + 49811, + 49812, + 49813, + 49814, + 49815, + 49816, + 49817, + 49818, + 49819, + 49820, + 49821, + 49822, + 49823, + 49824, + 49825, + 49826, + 49827, + 49828, + 49829, + 49830, + 49831, + 49832, + 49833, + 49834, + 49835, + 49836, + 49837, + 49838, + 49839, + 49840, + 49841, + 49842, + 49843, + 49844, + 49845, + 49846, + 49847, + 49848, + 49849, + 49850, + 49851, + 49852, + 49853, + 49854, + 49855, + 49856, + 49857, + 49858, + 49859, + 49860, + 49861, + 49862, + 49863, + 49864, + 49865, + 49866, + 49867, + 49868, + 49869, + 49870, + 49871, + 49872, + 49873, + 49874, + 49875, + 49876, + 49877, + 49878, + 49879, + 49880, + 49881, + 49882, + 49883, + 49884, + 49885, + 49886, + 49887, + 49888, + 49889, + 49890, + 49891, + 49892, + 49893, + 49894, + 49895, + 49896, + 49897, + 49898, + 49899, + 49900, + 49901, + 49902, + 49903, + 49904, + 49905, + 49906, + 49907, + 49908, + 49909, + 49910, + 49911, + 49912, + 49913, + 49914, + 49915, + 49916, + 49917, + 49918, + 49919, + 49920, + 49921, + 49922, + 49923, + 49924, + 49925, + 49926, + 49927, + 49928, + 49929, + 49930, + 49931, + 49932, + 49933, + 49934, + 49935, + 49936, + 49937, + 49938, + 49939, + 49940, + 49941, + 49942, + 49943, + 49944, + 49945, + 49946, + 49947, + 49948, + 49949, + 49950, + 49951, + 49952, + 49953, + 49954, + 49955, + 49956, + 49957, + 49958, + 49959, + 49960, + 49961, + 49962, + 49963, + 49964, + 49965, + 49966, + 49967, + 49968, + 49969, + 49970, + 49971, + 49972, + 49973, + 49974, + 49975, + 49976, + 49977, + 49978, + 49979, + 49980, + 49981, + 49982, + 49983, + 49984, + 49985, + 49986, + 49987, + 49988, + 49989, + 49990, + 49991, + 49992, + 49993, + 49994, + 49995, + 49996, + 49997, + 49998, + 49999, + 50000, + 50001, + 50002, + 50003, + 50004, + 50005, + 50006, + 50007, + 50008, + 50009, + 50010, + 50011, + 50012, + 50013, + 50014, + 50015, + 50016, + 50017, + 50018, + 50019, + 50020, + 50021, + 50022, + 50023, + 50024, + 50025, + 50026, + 50027, + 50028, + 50029, + 50030, + 50031, + 50032, + 50033, + 50034, + 50035, + 50036, + 50037, + 50038, + 50039, + 50040, + 50041, + 50042, + 50043, + 50044, + 50045, + 50046, + 50047, + 50048, + 50049, + 50050, + 50051, + 50052, + 50053, + 50054, + 50055, + 50056, + 50057, + 50058, + 50059, + 50060, + 50061, + 50062, + 50063, + 50064, + 50065, + 50066, + 50067, + 50068, + 50069, + 50070, + 50071, + 50072, + 50073, + 50074, + 50075, + 50076, + 50077, + 50078, + 50079, + 50080, + 50081, + 50082, + 50083, + 50084, + 50085, + 50086, + 50087, + 50088, + 50089, + 50090, + 50091, + 50092, + 50093, + 50094, + 50095, + 50096, + 50097, + 50098, + 50099, + 50100, + 50101, + 50102, + 50103, + 50104, + 50105, + 50106, + 50107, + 50108, + 50109, + 50110, + 50111, + 50112, + 50113, + 50114, + 50115, + 50116, + 50117, + 50118, + 50119, + 50120, + 50121, + 50122, + 50123, + 50124, + 50125, + 50126, + 50127, + 50128, + 50129, + 50130, + 50131, + 50132, + 50133, + 50134, + 50135, + 50136, + 50137, + 50138, + 50139, + 50140, + 50141, + 50142, + 50143, + 50144, + 50145, + 50146, + 50147, + 50148, + 50149, + 50150, + 50151, + 50152, + 50153, + 50154, + 50155, + 50156, + 50157, + 50158, + 50159, + 50160, + 50161, + 50162, + 50163, + 50164, + 50165, + 50166, + 50167, + 50168, + 50169, + 50170, + 50171, + 50172, + 50173, + 50174, + 50175, + 50176, + 50177, + 50178, + 50179, + 50180, + 50181, + 50182, + 50183, + 50184, + 50185, + 50186, + 50187, + 50188, + 50189, + 50190, + 50191, + 50192, + 50193, + 50194, + 50195, + 50196, + 50197, + 50198, + 50199, + 50200, + 50201, + 50202, + 50203, + 50204, + 50205, + 50206, + 50207, + 50208, + 50209, + 50210, + 50211, + 50212, + 50213, + 50214, + 50215, + 50216, + 50217, + 50218, + 50219, + 50220, + 50221, + 50222, + 50223, + 50224, + 50225, + 50226, + 50227, + 50228, + 50229, + 50230, + 50231, + 50232, + 50233, + 50234, + 50235, + 50236, + 50237, + 50238, + 50239, + 50240, + 50241, + 50242, + 50243, + 50244, + 50245, + 50246, + 50247, + 50248, + 50249, + 50250, + 50251, + 50252, + 50253, + 50254, + 50255, + 50256, + 50257, + 50258, + 50259, + 50260, + 50261, + 50262, + 50263, + 50264, + 50265, + 50266, + 50267, + 50268, + 50269, + 50270, + 50271, + 50272, + 50273, + 50274, + 50275, + 50276, + 50277, + 50278, + 50279, + 50280, + 50281, + 50282, + 50283, + 50284, + 50285, + 50286, + 50287, + 50288, + 50289, + 50290, + 50291, + 50292, + 50293, + 50294, + 50295, + 50296, + 50297, + 50298, + 50299, + 50300, + 50301, + 50302, + 50303, + 50304, + 50305, + 50306, + 50307, + 50308, + 50309, + 50310, + 50311, + 50312, + 50313, + 50314, + 50315, + 50316, + 50317, + 50318, + 50319, + 50320, + 50321, + 50322, + 50323, + 50324, + 50325, + 50326, + 50327, + 50328, + 50329, + 50330, + 50331, + 50332, + 50333, + 50334, + 50335, + 50336, + 50337, + 50338, + 50339, + 50340, + 50341, + 50342, + 50343, + 50344, + 50345, + 50346, + 50347, + 50348, + 50349, + 50350, + 50351, + 50352, + 50353, + 50354, + 50355, + 50356, + 50357, + 50358, + 50359, + 50360, + 50361, + 50362, + 50363, + 50364, + 50365, + 50366, + 50367, + 50368, + 50369, + 50370, + 50371, + 50372, + 50373, + 50374, + 50375, + 50376, + 50377, + 50378, + 50379, + 50380, + 50381, + 50382, + 50383, + 50384, + 50385, + 50386, + 50387, + 50388, + 50389, + 50390, + 50391, + 50392, + 50393, + 50394, + 50395, + 50396, + 50397, + 50398, + 50399, + 50400, + 50401, + 50402, + 50403, + 50404, + 50405, + 50406, + 50407, + 50408, + 50409, + 50410, + 50411, + 50412, + 50413, + 50414, + 50415, + 50416, + 50417, + 50418, + 50419, + 50420, + 50421, + 50422, + 50423, + 50424, + 50425, + 50426, + 50427, + 50428, + 50429, + 50430, + 50431, + 50432, + 50433, + 50434, + 50435, + 50436, + 50437, + 50438, + 50439, + 50440, + 50441, + 50442, + 50443, + 50444, + 50445, + 50446, + 50447, + 50448, + 50449, + 50450, + 50451, + 50452, + 50453, + 50454, + 50455, + 50456, + 50457, + 50458, + 50459, + 50460, + 50461, + 50462, + 50463, + 50464, + 50465, + 50466, + 50467, + 50468, + 50469, + 50470, + 50471, + 50472, + 50473, + 50474, + 50475, + 50476, + 50477, + 50478, + 50479, + 50480, + 50481, + 50482, + 50483, + 50484, + 50485, + 50486, + 50487, + 50488, + 50489, + 50490, + 50491, + 50492, + 50493, + 50494, + 50495, + 50496, + 50497, + 50498, + 50499, + 50500, + 50501, + 50502, + 50503, + 50504, + 50505, + 50506, + 50507, + 50508, + 50509, + 50510, + 50511, + 50512, + 50513, + 50514, + 50515, + 50516, + 50517, + 50518, + 50519, + 50520, + 50521, + 50522, + 50523, + 50524, + 50525, + 50526, + 50527, + 50528, + 50529, + 50530, + 50531, + 50532, + 50533, + 50534, + 50535, + 50536, + 50537, + 50538, + 50539, + 50540, + 50541, + 50542, + 50543, + 50544, + 50545, + 50546, + 50547, + 50548, + 50549, + 50550, + 50551, + 50552, + 50553, + 50554, + 50555, + 50556, + 50557, + 50558, + 50559, + 50560, + 50561, + 50562, + 50563, + 50564, + 50565, + 50566, + 50567, + 50568, + 50569, + 50570, + 50571, + 50572, + 50573, + 50574, + 50575, + 50576, + 50577, + 50578, + 50579, + 50580, + 50581, + 50582, + 50583, + 50584, + 50585, + 50586, + 50587, + 50588, + 50589, + 50590, + 50591, + 50592, + 50593, + 50594, + 50595, + 50596, + 50597, + 50598, + 50599, + 50600, + 50601, + 50602, + 50603, + 50604, + 50605, + 50606, + 50607, + 50608, + 50609, + 50610, + 50611, + 50612, + 50613, + 50614, + 50615, + 50616, + 50617, + 50618, + 50619, + 50620, + 50621, + 50622, + 50623, + 50624, + 50625, + 50626, + 50627, + 50628, + 50629, + 50630, + 50631, + 50632, + 50633, + 50634, + 50635, + 50636, + 50637, + 50638, + 50639, + 50640, + 50641, + 50642, + 50643, + 50644, + 50645, + 50646, + 50647, + 50648, + 50649, + 50650, + 50651, + 50652, + 50653, + 50654, + 50655, + 50656, + 50657, + 50658, + 50659, + 50660, + 50661, + 50662, + 50663, + 50664, + 50665, + 50666, + 50667, + 50668, + 50669, + 50670, + 50671, + 50672, + 50673, + 50674, + 50675, + 50676, + 50677, + 50678, + 50679, + 50680, + 50681, + 50682, + 50683, + 50684, + 50685, + 50686, + 50687, + 50688, + 50689, + 50690, + 50691, + 50692, + 50693, + 50694, + 50695, + 50696, + 50697, + 50698, + 50699, + 50700, + 50701, + 50702, + 50703, + 50704, + 50705, + 50706, + 50707, + 50708, + 50709, + 50710, + 50711, + 50712, + 50713, + 50714, + 50715, + 50716, + 50717, + 50718, + 50719, + 50720, + 50721, + 50722, + 50723, + 50724, + 50725, + 50726, + 50727, + 50728, + 50729, + 50730, + 50731, + 50732, + 50733, + 50734, + 50735, + 50736, + 50737, + 50738, + 50739, + 50740, + 50741, + 50742, + 50743, + 50744, + 50745, + 50746, + 50747, + 50748, + 50749, + 50750, + 50751, + 50752, + 50753, + 50754, + 50755, + 50756, + 50757, + 50758, + 50759, + 50760, + 50761, + 50762, + 50763, + 50764, + 50765, + 50766, + 50767, + 50768, + 50769, + 50770, + 50771, + 50772, + 50773, + 50774, + 50775, + 50776, + 50777, + 50778, + 50779, + 50780, + 50781, + 50782, + 50783, + 50784, + 50785, + 50786, + 50787, + 50788, + 50789, + 50790, + 50791, + 50792, + 50793, + 50794, + 50795, + 50796, + 50797, + 50798, + 50799, + 50800, + 50801, + 50802, + 50803, + 50804, + 50805, + 50806, + 50807, + 50808, + 50809, + 50810, + 50811, + 50812, + 50813, + 50814, + 50815, + 50816, + 50817, + 50818, + 50819, + 50820, + 50821, + 50822, + 50823, + 50824, + 50825, + 50826, + 50827, + 50828, + 50829, + 50830, + 50831, + 50832, + 50833, + 50834, + 50835, + 50836, + 50837, + 50838, + 50839, + 50840, + 50841, + 50842, + 50843, + 50844, + 50845, + 50846, + 50847, + 50848, + 50849, + 50850, + 50851, + 50852, + 50853, + 50854, + 50855, + 50856, + 50857, + 50858, + 50859, + 50860, + 50861, + 50862, + 50863, + 50864, + 50865, + 50866, + 50867, + 50868, + 50869, + 50870, + 50871, + 50872, + 50873, + 50874, + 50875, + 50876, + 50877, + 50878, + 50879, + 50880, + 50881, + 50882, + 50883, + 50884, + 50885, + 50886, + 50887, + 50888, + 50889, + 50890, + 50891, + 50892, + 50893, + 50894, + 50895, + 50896, + 50897, + 50898, + 50899, + 50900, + 50901, + 50902, + 50903, + 50904, + 50905, + 50906, + 50907, + 50908, + 50909, + 50910, + 50911, + 50912, + 50913, + 50914, + 50915, + 50916, + 50917, + 50918, + 50919, + 50920, + 50921, + 50922, + 50923, + 50924, + 50925, + 50926, + 50927, + 50928, + 50929, + 50930, + 50931, + 50932, + 50933, + 50934, + 50935, + 50936, + 50937, + 50938, + 50939, + 50940, + 50941, + 50942, + 50943, + 50944, + 50945, + 50946, + 50947, + 50948, + 50949, + 50950, + 50951, + 50952, + 50953, + 50954, + 50955, + 50956, + 50957, + 50958, + 50959, + 50960, + 50961, + 50962, + 50963, + 50964, + 50965, + 50966, + 50967, + 50968, + 50969, + 50970, + 50971, + 50972, + 50973, + 50974, + 50975, + 50976, + 50977, + 50978, + 50979, + 50980, + 50981, + 50982, + 50983, + 50984, + 50985, + 50986, + 50987, + 50988, + 50989, + 50990, + 50991, + 50992, + 50993, + 50994, + 50995, + 50996, + 50997, + 50998, + 50999, + 51000, + 51001, + 51002, + 51003, + 51004, + 51005, + 51006, + 51007, + 51008, + 51009, + 51010, + 51011, + 51012, + 51013, + 51014, + 51015, + 51016, + 51017, + 51018, + 51019, + 51020, + 51021, + 51022, + 51023, + 51024, + 51025, + 51026, + 51027, + 51028, + 51029, + 51030, + 51031, + 51032, + 51033, + 51034, + 51035, + 51036, + 51037, + 51038, + 51039, + 51040, + 51041, + 51042, + 51043, + 51044, + 51045, + 51046, + 51047, + 51048, + 51049, + 51050, + 51051, + 51052, + 51053, + 51054, + 51055, + 51056, + 51057, + 51058, + 51059, + 51060, + 51061, + 51062, + 51063, + 51064, + 51065, + 51066, + 51067, + 51068, + 51069, + 51070, + 51071, + 51072, + 51073, + 51074, + 51075, + 51076, + 51077, + 51078, + 51079, + 51080, + 51081, + 51082, + 51083, + 51084, + 51085, + 51086, + 51087, + 51088, + 51089, + 51090, + 51091, + 51092, + 51093, + 51094, + 51095, + 51096, + 51097, + 51098, + 51099, + 51100, + 51101, + 51102, + 51103, + 51104, + 51105, + 51106, + 51107, + 51108, + 51109, + 51110, + 51111, + 51112, + 51113, + 51114, + 51115, + 51116, + 51117, + 51118, + 51119, + 51120, + 51121, + 51122, + 51123, + 51124, + 51125, + 51126, + 51127, + 51128, + 51129, + 51130, + 51131, + 51132, + 51133, + 51134, + 51135, + 51136, + 51137, + 51138, + 51139, + 51140, + 51141, + 51142, + 51143, + 51144, + 51145, + 51146, + 51147, + 51148, + 51149, + 51150, + 51151, + 51152, + 51153, + 51154, + 51155, + 51156, + 51157, + 51158, + 51159, + 51160, + 51161, + 51162, + 51163, + 51164, + 51165, + 51166, + 51167, + 51168, + 51169, + 51170, + 51171, + 51172, + 51173, + 51174, + 51175, + 51176, + 51177, + 51178, + 51179, + 51180, + 51181, + 51182, + 51183, + 51184, + 51185, + 51186, + 51187, + 51188, + 51189, + 51190, + 51191, + 51192, + 51193, + 51194, + 51195, + 51196, + 51197, + 51198, + 51199, + 51200, + 51201, + 51202, + 51203, + 51204, + 51205, + 51206, + 51207, + 51208, + 51209, + 51210, + 51211, + 51212, + 51213, + 51214, + 51215, + 51216, + 51217, + 51218, + 51219, + 51220, + 51221, + 51222, + 51223, + 51224, + 51225, + 51226, + 51227, + 51228, + 51229, + 51230, + 51231, + 51232, + 51233, + 51234, + 51235, + 51236, + 51237, + 51238, + 51239, + 51240, + 51241, + 51242, + 51243, + 51244, + 51245, + 51246, + 51247, + 51248, + 51249, + 51250, + 51251, + 51252, + 51253, + 51254, + 51255, + 51256, + 51257, + 51258, + 51259, + 51260, + 51261, + 51262, + 51263, + 51264, + 51265, + 51266, + 51267, + 51268, + 51269, + 51270, + 51271, + 51272, + 51273, + 51274, + 51275, + 51276, + 51277, + 51278, + 51279, + 51280, + 51281, + 51282, + 51283, + 51284, + 51285, + 51286, + 51287, + 51288, + 51289, + 51290, + 51291, + 51292, + 51293, + 51294, + 51295, + 51296, + 51297, + 51298, + 51299, + 51300, + 51301, + 51302, + 51303, + 51304, + 51305, + 51306, + 51307, + 51308, + 51309, + 51310, + 51311, + 51312, + 51313, + 51314, + 51315, + 51316, + 51317, + 51318, + 51319, + 51320, + 51321, + 51322, + 51323, + 51324, + 51325, + 51326, + 51327, + 51328, + 51329, + 51330, + 51331, + 51332, + 51333, + 51334, + 51335, + 51336, + 51337, + 51338, + 51339, + 51340, + 51341, + 51342, + 51343, + 51344, + 51345, + 51346, + 51347, + 51348, + 51349, + 51350, + 51351, + 51352, + 51353, + 51354, + 51355, + 51356, + 51357, + 51358, + 51359, + 51360, + 51361, + 51362, + 51363, + 51364, + 51365, + 51366, + 51367, + 51368, + 51369, + 51370, + 51371, + 51372, + 51373, + 51374, + 51375, + 51376, + 51377, + 51378, + 51379, + 51380, + 51381, + 51382, + 51383, + 51384, + 51385, + 51386, + 51387, + 51388, + 51389, + 51390, + 51391, + 51392, + 51393, + 51394, + 51395, + 51396, + 51397, + 51398, + 51399, + 51400, + 51401, + 51402, + 51403, + 51404, + 51405, + 51406, + 51407, + 51408, + 51409, + 51410, + 51411, + 51412, + 51413, + 51414, + 51415, + 51416, + 51417, + 51418, + 51419, + 51420, + 51421, + 51422, + 51423, + 51424, + 51425, + 51426, + 51427, + 51428, + 51429, + 51430, + 51431, + 51432, + 51433, + 51434, + 51435, + 51436, + 51437, + 51438, + 51439, + 51440, + 51441, + 51442, + 51443, + 51444, + 51445, + 51446, + 51447, + 51448, + 51449, + 51450, + 51451, + 51452, + 51453, + 51454, + 51455, + 51456, + 51457, + 51458, + 51459, + 51460, + 51461, + 51462, + 51463, + 51464, + 51465, + 51466, + 51467, + 51468, + 51469, + 51470, + 51471, + 51472, + 51473, + 51474, + 51475, + 51476, + 51477, + 51478, + 51479, + 51480, + 51481, + 51482, + 51483, + 51484, + 51485, + 51486, + 51487, + 51488, + 51489, + 51490, + 51491, + 51492, + 51493, + 51494, + 51495, + 51496, + 51497, + 51498, + 51499, + 51500, + 51501, + 51502, + 51503, + 51504, + 51505, + 51506, + 51507, + 51508, + 51509, + 51510, + 51511, + 51512, + 51513, + 51514, + 51515, + 51516, + 51517, + 51518, + 51519, + 51520, + 51521, + 51522, + 51523, + 51524, + 51525, + 51526, + 51527, + 51528, + 51529, + 51530, + 51531, + 51532, + 51533, + 51534, + 51535, + 51536, + 51537, + 51538, + 51539, + 51540, + 51541, + 51542, + 51543, + 51544, + 51545, + 51546, + 51547, + 51548, + 51549, + 51550, + 51551, + 51552, + 51553, + 51554, + 51555, + 51556, + 51557, + 51558, + 51559, + 51560, + 51561, + 51562, + 51563, + 51564, + 51565, + 51566, + 51567, + 51568, + 51569, + 51570, + 51571, + 51572, + 51573, + 51574, + 51575, + 51576, + 51577, + 51578, + 51579, + 51580, + 51581, + 51582, + 51583, + 51584, + 51585, + 51586, + 51587, + 51588, + 51589, + 51590, + 51591, + 51592, + 51593, + 51594, + 51595, + 51596, + 51597, + 51598, + 51599, + 51600, + 51601, + 51602, + 51603, + 51604, + 51605, + 51606, + 51607, + 51608, + 51609, + 51610, + 51611, + 51612, + 51613, + 51614, + 51615, + 51616, + 51617, + 51618, + 51619, + 51620, + 51621, + 51622, + 51623, + 51624, + 51625, + 51626, + 51627, + 51628, + 51629, + 51630, + 51631, + 51632, + 51633, + 51634, + 51635, + 51636, + 51637, + 51638, + 51639, + 51640, + 51641, + 51642, + 51643, + 51644, + 51645, + 51646, + 51647, + 51648, + 51649, + 51650, + 51651, + 51652, + 51653, + 51654, + 51655, + 51656, + 51657, + 51658, + 51659, + 51660, + 51661, + 51662, + 51663, + 51664, + 51665, + 51666, + 51667, + 51668, + 51669, + 51670, + 51671, + 51672, + 51673, + 51674, + 51675, + 51676, + 51677, + 51678, + 51679, + 51680, + 51681, + 51682, + 51683, + 51684, + 51685, + 51686, + 51687, + 51688, + 51689, + 51690, + 51691, + 51692, + 51693, + 51694, + 51695, + 51696, + 51697, + 51698, + 51699, + 51700, + 51701, + 51702, + 51703, + 51704, + 51705, + 51706, + 51707, + 51708, + 51709, + 51710, + 51711, + 51712, + 51713, + 51714, + 51715, + 51716, + 51717, + 51718, + 51719, + 51720, + 51721, + 51722, + 51723, + 51724, + 51725, + 51726, + 51727, + 51728, + 51729, + 51730, + 51731, + 51732, + 51733, + 51734, + 51735, + 51736, + 51737, + 51738, + 51739, + 51740, + 51741, + 51742, + 51743, + 51744, + 51745, + 51746, + 51747, + 51748, + 51749, + 51750, + 51751, + 51752, + 51753, + 51754, + 51755, + 51756, + 51757, + 51758, + 51759, + 51760, + 51761, + 51762, + 51763, + 51764, + 51765, + 51766, + 51767, + 51768, + 51769, + 51770, + 51771, + 51772, + 51773, + 51774, + 51775, + 51776, + 51777, + 51778, + 51779, + 51780, + 51781, + 51782, + 51783, + 51784, + 51785, + 51786, + 51787, + 51788, + 51789, + 51790, + 51791, + 51792, + 51793, + 51794, + 51795, + 51796, + 51797, + 51798, + 51799, + 51800, + 51801, + 51802, + 51803, + 51804, + 51805, + 51806, + 51807, + 51808, + 51809, + 51810, + 51811, + 51812, + 51813, + 51814, + 51815, + 51816, + 51817, + 51818, + 51819, + 51820, + 51821, + 51822, + 51823, + 51824, + 51825, + 51826, + 51827, + 51828, + 51829, + 51830, + 51831, + 51832, + 51833, + 51834, + 51835, + 51836, + 51837, + 51838, + 51839, + 51840, + 51841, + 51842, + 51843, + 51844, + 51845, + 51846, + 51847, + 51848, + 51849, + 51850, + 51851, + 51852, + 51853, + 51854, + 51855, + 51856, + 51857, + 51858, + 51859, + 51860, + 51861, + 51862, + 51863, + 51864, + 51865, + 51866, + 51867, + 51868, + 51869, + 51870, + 51871, + 51872, + 51873, + 51874, + 51875, + 51876, + 51877, + 51878, + 51879, + 51880, + 51881, + 51882, + 51883, + 51884, + 51885, + 51886, + 51887, + 51888, + 51889, + 51890, + 51891, + 51892, + 51893, + 51894, + 51895, + 51896, + 51897, + 51898, + 51899, + 51900, + 51901, + 51902, + 51903, + 51904, + 51905, + 51906, + 51907, + 51908, + 51909, + 51910, + 51911, + 51912, + 51913, + 51914, + 51915, + 51916, + 51917, + 51918, + 51919, + 51920, + 51921, + 51922, + 51923, + 51924, + 51925, + 51926, + 51927, + 51928, + 51929, + 51930, + 51931, + 51932, + 51933, + 51934, + 51935, + 51936, + 51937, + 51938, + 51939, + 51940, + 51941, + 51942, + 51943, + 51944, + 51945, + 51946, + 51947, + 51948, + 51949, + 51950, + 51951, + 51952, + 51953, + 51954, + 51955, + 51956, + 51957, + 51958, + 51959, + 51960, + 51961, + 51962, + 51963, + 51964, + 51965, + 51966, + 51967, + 51968, + 51969, + 51970, + 51971, + 51972, + 51973, + 51974, + 51975, + 51976, + 51977, + 51978, + 51979, + 51980, + 51981, + 51982, + 51983, + 51984, + 51985, + 51986, + 51987, + 51988, + 51989, + 51990, + 51991, + 51992, + 51993, + 51994, + 51995, + 51996, + 51997, + 51998, + 51999, + 52000, + 52001, + 52002, + 52003, + 52004, + 52005, + 52006, + 52007, + 52008, + 52009, + 52010, + 52011, + 52012, + 52013, + 52014, + 52015, + 52016, + 52017, + 52018, + 52019, + 52020, + 52021, + 52022, + 52023, + 52024, + 52025, + 52026, + 52027, + 52028, + 52029, + 52030, + 52031, + 52032, + 52033, + 52034, + 52035, + 52036, + 52037, + 52038, + 52039, + 52040, + 52041, + 52042, + 52043, + 52044, + 52045, + 52046, + 52047, + 52048, + 52049, + 52050, + 52051, + 52052, + 52053, + 52054, + 52055, + 52056, + 52057, + 52058, + 52059, + 52060, + 52061, + 52062, + 52063, + 52064, + 52065, + 52066, + 52067, + 52068, + 52069, + 52070, + 52071, + 52072, + 52073, + 52074, + 52075, + 52076, + 52077, + 52078, + 52079, + 52080, + 52081, + 52082, + 52083, + 52084, + 52085, + 52086, + 52087, + 52088, + 52089, + 52090, + 52091, + 52092, + 52093, + 52094, + 52095, + 52096, + 52097, + 52098, + 52099, + 52100, + 52101, + 52102, + 52103, + 52104, + 52105, + 52106, + 52107, + 52108, + 52109, + 52110, + 52111, + 52112, + 52113, + 52114, + 52115, + 52116, + 52117, + 52118, + 52119, + 52120, + 52121, + 52122, + 52123, + 52124, + 52125, + 52126, + 52127, + 52128, + 52129, + 52130, + 52131, + 52132, + 52133, + 52134, + 52135, + 52136, + 52137, + 52138, + 52139, + 52140, + 52141, + 52142, + 52143, + 52144, + 52145, + 52146, + 52147, + 52148, + 52149, + 52150, + 52151, + 52152, + 52153, + 52154, + 52155, + 52156, + 52157, + 52158, + 52159, + 52160, + 52161, + 52162, + 52163, + 52164, + 52165, + 52166, + 52167, + 52168, + 52169, + 52170, + 52171, + 52172, + 52173, + 52174, + 52175, + 52176, + 52177, + 52178, + 52179, + 52180, + 52181, + 52182, + 52183, + 52184, + 52185, + 52186, + 52187, + 52188, + 52189, + 52190, + 52191, + 52192, + 52193, + 52194, + 52195, + 52196, + 52197, + 52198, + 52199, + 52200, + 52201, + 52202, + 52203, + 52204, + 52205, + 52206, + 52207, + 52208, + 52209, + 52210, + 52211, + 52212, + 52213, + 52214, + 52215, + 52216, + 52217, + 52218, + 52219, + 52220, + 52221, + 52222, + 52223, + 52224, + 52225, + 52226, + 52227, + 52228, + 52229, + 52230, + 52231, + 52232, + 52233, + 52234, + 52235, + 52236, + 52237, + 52238, + 52239, + 52240, + 52241, + 52242, + 52243, + 52244, + 52245, + 52246, + 52247, + 52248, + 52249, + 52250, + 52251, + 52252, + 52253, + 52254, + 52255, + 52256, + 52257, + 52258, + 52259, + 52260, + 52261, + 52262, + 52263, + 52264, + 52265, + 52266, + 52267, + 52268, + 52269, + 52270, + 52271, + 52272, + 52273, + 52274, + 52275, + 52276, + 52277, + 52278, + 52279, + 52280, + 52281, + 52282, + 52283, + 52284, + 52285, + 52286, + 52287, + 52288, + 52289, + 52290, + 52291, + 52292, + 52293, + 52294, + 52295, + 52296, + 52297, + 52298, + 52299, + 52300, + 52301, + 52302, + 52303, + 52304, + 52305, + 52306, + 52307, + 52308, + 52309, + 52310, + 52311, + 52312, + 52313, + 52314, + 52315, + 52316, + 52317, + 52318, + 52319, + 52320, + 52321, + 52322, + 52323, + 52324, + 52325, + 52326, + 52327, + 52328, + 52329, + 52330, + 52331, + 52332, + 52333, + 52334, + 52335, + 52336, + 52337, + 52338, + 52339, + 52340, + 52341, + 52342, + 52343, + 52344, + 52345, + 52346, + 52347, + 52348, + 52349, + 52350, + 52351, + 52352, + 52353, + 52354, + 52355, + 52356, + 52357, + 52358, + 52359, + 52360, + 52361, + 52362, + 52363, + 52364, + 52365, + 52366, + 52367, + 52368, + 52369, + 52370, + 52371, + 52372, + 52373, + 52374, + 52375, + 52376, + 52377, + 52378, + 52379, + 52380, + 52381, + 52382, + 52383, + 52384, + 52385, + 52386, + 52387, + 52388, + 52389, + 52390, + 52391, + 52392, + 52393, + 52394, + 52395, + 52396, + 52397, + 52398, + 52399, + 52400, + 52401, + 52402, + 52403, + 52404, + 52405, + 52406, + 52407, + 52408, + 52409, + 52410, + 52411, + 52412, + 52413, + 52414, + 52415, + 52416, + 52417, + 52418, + 52419, + 52420, + 52421, + 52422, + 52423, + 52424, + 52425, + 52426, + 52427, + 52428, + 52429, + 52430, + 52431, + 52432, + 52433, + 52434, + 52435, + 52436, + 52437, + 52438, + 52439, + 52440, + 52441, + 52442, + 52443, + 52444, + 52445, + 52446, + 52447, + 52448, + 52449, + 52450, + 52451, + 52452, + 52453, + 52454, + 52455, + 52456, + 52457, + 52458, + 52459, + 52460, + 52461, + 52462, + 52463, + 52464, + 52465, + 52466, + 52467, + 52468, + 52469, + 52470, + 52471, + 52472, + 52473, + 52474, + 52475, + 52476, + 52477, + 52478, + 52479, + 52480, + 52481, + 52482, + 52483, + 52484, + 52485, + 52486, + 52487, + 52488, + 52489, + 52490, + 52491, + 52492, + 52493, + 52494, + 52495, + 52496, + 52497, + 52498, + 52499, + 52500, + 52501, + 52502, + 52503, + 52504, + 52505, + 52506, + 52507, + 52508, + 52509, + 52510, + 52511, + 52512, + 52513, + 52514, + 52515, + 52516, + 52517, + 52518, + 52519, + 52520, + 52521, + 52522, + 52523, + 52524, + 52525, + 52526, + 52527, + 52528, + 52529, + 52530, + 52531, + 52532, + 52533, + 52534, + 52535, + 52536, + 52537, + 52538, + 52539, + 52540, + 52541, + 52542, + 52543, + 52544, + 52545, + 52546, + 52547, + 52548, + 52549, + 52550, + 52551, + 52552, + 52553, + 52554, + 52555, + 52556, + 52557, + 52558, + 52559, + 52560, + 52561, + 52562, + 52563, + 52564, + 52565, + 52566, + 52567, + 52568, + 52569, + 52570, + 52571, + 52572, + 52573, + 52574, + 52575, + 52576, + 52577, + 52578, + 52579, + 52580, + 52581, + 52582, + 52583, + 52584, + 52585, + 52586, + 52587, + 52588, + 52589, + 52590, + 52591, + 52592, + 52593, + 52594, + 52595, + 52596, + 52597, + 52598, + 52599, + 52600, + 52601, + 52602, + 52603, + 52604, + 52605, + 52606, + 52607, + 52608, + 52609, + 52610, + 52611, + 52612, + 52613, + 52614, + 52615, + 52616, + 52617, + 52618, + 52619, + 52620, + 52621, + 52622, + 52623, + 52624, + 52625, + 52626, + 52627, + 52628, + 52629, + 52630, + 52631, + 52632, + 52633, + 52634, + 52635, + 52636, + 52637, + 52638, + 52639, + 52640, + 52641, + 52642, + 52643, + 52644, + 52645, + 52646, + 52647, + 52648, + 52649, + 52650, + 52651, + 52652, + 52653, + 52654, + 52655, + 52656, + 52657, + 52658, + 52659, + 52660, + 52661, + 52662, + 52663, + 52664, + 52665, + 52666, + 52667, + 52668, + 52669, + 52670, + 52671, + 52672, + 52673, + 52674, + 52675, + 52676, + 52677, + 52678, + 52679, + 52680, + 52681, + 52682, + 52683, + 52684, + 52685, + 52686, + 52687, + 52688, + 52689, + 52690, + 52691, + 52692, + 52693, + 52694, + 52695, + 52696, + 52697, + 52698, + 52699, + 52700, + 52701, + 52702, + 52703, + 52704, + 52705, + 52706, + 52707, + 52708, + 52709, + 52710, + 52711, + 52712, + 52713, + 52714, + 52715, + 52716, + 52717, + 52718, + 52719, + 52720, + 52721, + 52722, + 52723, + 52724, + 52725, + 52726, + 52727, + 52728, + 52729, + 52730, + 52731, + 52732, + 52733, + 52734, + 52735, + 52736, + 52737, + 52738, + 52739, + 52740, + 52741, + 52742, + 52743, + 52744, + 52745, + 52746, + 52747, + 52748, + 52749, + 52750, + 52751, + 52752, + 52753, + 52754, + 52755, + 52756, + 52757, + 52758, + 52759, + 52760, + 52761, + 52762, + 52763, + 52764, + 52765, + 52766, + 52767, + 52768, + 52769, + 52770, + 52771, + 52772, + 52773, + 52774, + 52775, + 52776, + 52777, + 52778, + 52779, + 52780, + 52781, + 52782, + 52783, + 52784, + 52785, + 52786, + 52787, + 52788, + 52789, + 52790, + 52791, + 52792, + 52793, + 52794, + 52795, + 52796, + 52797, + 52798, + 52799, + 52800, + 52801, + 52802, + 52803, + 52804, + 52805, + 52806, + 52807, + 52808, + 52809, + 52810, + 52811, + 52812, + 52813, + 52814, + 52815, + 52816, + 52817, + 52818, + 52819, + 52820, + 52821, + 52822, + 52823, + 52824, + 52825, + 52826, + 52827, + 52828, + 52829, + 52830, + 52831, + 52832, + 52833, + 52834, + 52835, + 52836, + 52837, + 52838, + 52839, + 52840, + 52841, + 52842, + 52843, + 52844, + 52845, + 52846, + 52847, + 52848, + 52849, + 52850, + 52851, + 52852, + 52853, + 52854, + 52855, + 52856, + 52857, + 52858, + 52859, + 52860, + 52861, + 52862, + 52863, + 52864, + 52865, + 52866, + 52867, + 52868, + 52869, + 52870, + 52871, + 52872, + 52873, + 52874, + 52875, + 52876, + 52877, + 52878, + 52879, + 52880, + 52881, + 52882, + 52883, + 52884, + 52885, + 52886, + 52887, + 52888, + 52889, + 52890, + 52891, + 52892, + 52893, + 52894, + 52895, + 52896, + 52897, + 52898, + 52899, + 52900, + 52901, + 52902, + 52903, + 52904, + 52905, + 52906, + 52907, + 52908, + 52909, + 52910, + 52911, + 52912, + 52913, + 52914, + 52915, + 52916, + 52917, + 52918, + 52919, + 52920, + 52921, + 52922, + 52923, + 52924, + 52925, + 52926, + 52927, + 52928, + 52929, + 52930, + 52931, + 52932, + 52933, + 52934, + 52935, + 52936, + 52937, + 52938, + 52939, + 52940, + 52941, + 52942, + 52943, + 52944, + 52945, + 52946, + 52947, + 52948, + 52949, + 52950, + 52951, + 52952, + 52953, + 52954, + 52955, + 52956, + 52957, + 52958, + 52959, + 52960, + 52961, + 52962, + 52963, + 52964, + 52965, + 52966, + 52967, + 52968, + 52969, + 52970, + 52971, + 52972, + 52973, + 52974, + 52975, + 52976, + 52977, + 52978, + 52979, + 52980, + 52981, + 52982, + 52983, + 52984, + 52985, + 52986, + 52987, + 52988, + 52989, + 52990, + 52991, + 52992, + 52993, + 52994, + 52995, + 52996, + 52997, + 52998, + 52999, + 53000, + 53001, + 53002, + 53003, + 53004, + 53005, + 53006, + 53007, + 53008, + 53009, + 53010, + 53011, + 53012, + 53013, + 53014, + 53015, + 53016, + 53017, + 53018, + 53019, + 53020, + 53021, + 53022, + 53023, + 53024, + 53025, + 53026, + 53027, + 53028, + 53029, + 53030, + 53031, + 53032, + 53033, + 53034, + 53035, + 53036, + 53037, + 53038, + 53039, + 53040, + 53041, + 53042, + 53043, + 53044, + 53045, + 53046, + 53047, + 53048, + 53049, + 53050, + 53051, + 53052, + 53053, + 53054, + 53055, + 53056, + 53057, + 53058, + 53059, + 53060, + 53061, + 53062, + 53063, + 53064, + 53065, + 53066, + 53067, + 53068, + 53069, + 53070, + 53071, + 53072, + 53073, + 53074, + 53075, + 53076, + 53077, + 53078, + 53079, + 53080, + 53081, + 53082, + 53083, + 53084, + 53085, + 53086, + 53087, + 53088, + 53089, + 53090, + 53091, + 53092, + 53093, + 53094, + 53095, + 53096, + 53097, + 53098, + 53099, + 53100, + 53101, + 53102, + 53103, + 53104, + 53105, + 53106, + 53107, + 53108, + 53109, + 53110, + 53111, + 53112, + 53113, + 53114, + 53115, + 53116, + 53117, + 53118, + 53119, + 53120, + 53121, + 53122, + 53123, + 53124, + 53125, + 53126, + 53127, + 53128, + 53129, + 53130, + 53131, + 53132, + 53133, + 53134, + 53135, + 53136, + 53137, + 53138, + 53139, + 53140, + 53141, + 53142, + 53143, + 53144, + 53145, + 53146, + 53147, + 53148, + 53149, + 53150, + 53151, + 53152, + 53153, + 53154, + 53155, + 53156, + 53157, + 53158, + 53159, + 53160, + 53161, + 53162, + 53163, + 53164, + 53165, + 53166, + 53167, + 53168, + 53169, + 53170, + 53171, + 53172, + 53173, + 53174, + 53175, + 53176, + 53177, + 53178, + 53179, + 53180, + 53181, + 53182, + 53183, + 53184, + 53185, + 53186, + 53187, + 53188, + 53189, + 53190, + 53191, + 53192, + 53193, + 53194, + 53195, + 53196, + 53197, + 53198, + 53199, + 53200, + 53201, + 53202, + 53203, + 53204, + 53205, + 53206, + 53207, + 53208, + 53209, + 53210, + 53211, + 53212, + 53213, + 53214, + 53215, + 53216, + 53217, + 53218, + 53219, + 53220, + 53221, + 53222, + 53223, + 53224, + 53225, + 53226, + 53227, + 53228, + 53229, + 53230, + 53231, + 53232, + 53233, + 53234, + 53235, + 53236, + 53237, + 53238, + 53239, + 53240, + 53241, + 53242, + 53243, + 53244, + 53245, + 53246, + 53247, + 53248, + 53249, + 53250, + 53251, + 53252, + 53253, + 53254, + 53255, + 53256, + 53257, + 53258, + 53259, + 53260, + 53261, + 53262, + 53263, + 53264, + 53265, + 53266, + 53267, + 53268, + 53269, + 53270, + 53271, + 53272, + 53273, + 53274, + 53275, + 53276, + 53277, + 53278, + 53279, + 53280, + 53281, + 53282, + 53283, + 53284, + 53285, + 53286, + 53287, + 53288, + 53289, + 53290, + 53291, + 53292, + 53293, + 53294, + 53295, + 53296, + 53297, + 53298, + 53299, + 53300, + 53301, + 53302, + 53303, + 53304, + 53305, + 53306, + 53307, + 53308, + 53309, + 53310, + 53311, + 53312, + 53313, + 53314, + 53315, + 53316, + 53317, + 53318, + 53319, + 53320, + 53321, + 53322, + 53323, + 53324, + 53325, + 53326, + 53327, + 53328, + 53329, + 53330, + 53331, + 53332, + 53333, + 53334, + 53335, + 53336, + 53337, + 53338, + 53339, + 53340, + 53341, + 53342, + 53343, + 53344, + 53345, + 53346, + 53347, + 53348, + 53349, + 53350, + 53351, + 53352, + 53353, + 53354, + 53355, + 53356, + 53357, + 53358, + 53359, + 53360, + 53361, + 53362, + 53363, + 53364, + 53365, + 53366, + 53367, + 53368, + 53369, + 53370, + 53371, + 53372, + 53373, + 53374, + 53375, + 53376, + 53377, + 53378, + 53379, + 53380, + 53381, + 53382, + 53383, + 53384, + 53385, + 53386, + 53387, + 53388, + 53389, + 53390, + 53391, + 53392, + 53393, + 53394, + 53395, + 53396, + 53397, + 53398, + 53399, + 53400, + 53401, + 53402, + 53403, + 53404, + 53405, + 53406, + 53407, + 53408, + 53409, + 53410, + 53411, + 53412, + 53413, + 53414, + 53415, + 53416, + 53417, + 53418, + 53419, + 53420, + 53421, + 53422, + 53423, + 53424, + 53425, + 53426, + 53427, + 53428, + 53429, + 53430, + 53431, + 53432, + 53433, + 53434, + 53435, + 53436, + 53437, + 53438, + 53439, + 53440, + 53441, + 53442, + 53443, + 53444, + 53445, + 53446, + 53447, + 53448, + 53449, + 53450, + 53451, + 53452, + 53453, + 53454, + 53455, + 53456, + 53457, + 53458, + 53459, + 53460, + 53461, + 53462, + 53463, + 53464, + 53465, + 53466, + 53467, + 53468, + 53469, + 53470, + 53471, + 53472, + 53473, + 53474, + 53475, + 53476, + 53477, + 53478, + 53479, + 53480, + 53481, + 53482, + 53483, + 53484, + 53485, + 53486, + 53487, + 53488, + 53489, + 53490, + 53491, + 53492, + 53493, + 53494, + 53495, + 53496, + 53497, + 53498, + 53499, + 53500, + 53501, + 53502, + 53503, + 53504, + 53505, + 53506, + 53507, + 53508, + 53509, + 53510, + 53511, + 53512, + 53513, + 53514, + 53515, + 53516, + 53517, + 53518, + 53519, + 53520, + 53521, + 53522, + 53523, + 53524, + 53525, + 53526, + 53527, + 53528, + 53529, + 53530, + 53531, + 53532, + 53533, + 53534, + 53535, + 53536, + 53537, + 53538, + 53539, + 53540, + 53541, + 53542, + 53543, + 53544, + 53545, + 53546, + 53547, + 53548, + 53549, + 53550, + 53551, + 53552, + 53553, + 53554, + 53555, + 53556, + 53557, + 53558, + 53559, + 53560, + 53561, + 53562, + 53563, + 53564, + 53565, + 53566, + 53567, + 53568, + 53569, + 53570, + 53571, + 53572, + 53573, + 53574, + 53575, + 53576, + 53577, + 53578, + 53579, + 53580, + 53581, + 53582, + 53583, + 53584, + 53585, + 53586, + 53587, + 53588, + 53589, + 53590, + 53591, + 53592, + 53593, + 53594, + 53595, + 53596, + 53597, + 53598, + 53599, + 53600, + 53601, + 53602, + 53603, + 53604, + 53605, + 53606, + 53607, + 53608, + 53609, + 53610, + 53611, + 53612, + 53613, + 53614, + 53615, + 53616, + 53617, + 53618, + 53619, + 53620, + 53621, + 53622, + 53623, + 53624, + 53625, + 53626, + 53627, + 53628, + 53629, + 53630, + 53631, + 53632, + 53633, + 53634, + 53635, + 53636, + 53637, + 53638, + 53639, + 53640, + 53641, + 53642, + 53643, + 53644, + 53645, + 53646, + 53647, + 53648, + 53649, + 53650, + 53651, + 53652, + 53653, + 53654, + 53655, + 53656, + 53657, + 53658, + 53659, + 53660, + 53661, + 53662, + 53663, + 53664, + 53665, + 53666, + 53667, + 53668, + 53669, + 53670, + 53671, + 53672, + 53673, + 53674, + 53675, + 53676, + 53677, + 53678, + 53679, + 53680, + 53681, + 53682, + 53683, + 53684, + 53685, + 53686, + 53687, + 53688, + 53689, + 53690, + 53691, + 53692, + 53693, + 53694, + 53695, + 53696, + 53697, + 53698, + 53699, + 53700, + 53701, + 53702, + 53703, + 53704, + 53705, + 53706, + 53707, + 53708, + 53709, + 53710, + 53711, + 53712, + 53713, + 53714, + 53715, + 53716, + 53717, + 53718, + 53719, + 53720, + 53721, + 53722, + 53723, + 53724, + 53725, + 53726, + 53727, + 53728, + 53729, + 53730, + 53731, + 53732, + 53733, + 53734, + 53735, + 53736, + 53737, + 53738, + 53739, + 53740, + 53741, + 53742, + 53743, + 53744, + 53745, + 53746, + 53747, + 53748, + 53749, + 53750, + 53751, + 53752, + 53753, + 53754, + 53755, + 53756, + 53757, + 53758, + 53759, + 53760, + 53761, + 53762, + 53763, + 53764, + 53765, + 53766, + 53767, + 53768, + 53769, + 53770, + 53771, + 53772, + 53773, + 53774, + 53775, + 53776, + 53777, + 53778, + 53779, + 53780, + 53781, + 53782, + 53783, + 53784, + 53785, + 53786, + 53787, + 53788, + 53789, + 53790, + 53791, + 53792, + 53793, + 53794, + 53795, + 53796, + 53797, + 53798, + 53799, + 53800, + 53801, + 53802, + 53803, + 53804, + 53805, + 53806, + 53807, + 53808, + 53809, + 53810, + 53811, + 53812, + 53813, + 53814, + 53815, + 53816, + 53817, + 53818, + 53819, + 53820, + 53821, + 53822, + 53823, + 53824, + 53825, + 53826, + 53827, + 53828, + 53829, + 53830, + 53831, + 53832, + 53833, + 53834, + 53835, + 53836, + 53837, + 53838, + 53839, + 53840, + 53841, + 53842, + 53843, + 53844, + 53845, + 53846, + 53847, + 53848, + 53849, + 53850, + 53851, + 53852, + 53853, + 53854, + 53855, + 53856, + 53857, + 53858, + 53859, + 53860, + 53861, + 53862, + 53863, + 53864, + 53865, + 53866, + 53867, + 53868, + 53869, + 53870, + 53871, + 53872, + 53873, + 53874, + 53875, + 53876, + 53877, + 53878, + 53879, + 53880, + 53881, + 53882, + 53883, + 53884, + 53885, + 53886, + 53887, + 53888, + 53889, + 53890, + 53891, + 53892, + 53893, + 53894, + 53895, + 53896, + 53897, + 53898, + 53899, + 53900, + 53901, + 53902, + 53903, + 53904, + 53905, + 53906, + 53907, + 53908, + 53909, + 53910, + 53911, + 53912, + 53913, + 53914, + 53915, + 53916, + 53917, + 53918, + 53919, + 53920, + 53921, + 53922, + 53923, + 53924, + 53925, + 53926, + 53927, + 53928, + 53929, + 53930, + 53931, + 53932, + 53933, + 53934, + 53935, + 53936, + 53937, + 53938, + 53939, + 53940, + 53941, + 53942, + 53943, + 53944, + 53945, + 53946, + 53947, + 53948, + 53949, + 53950, + 53951, + 53952, + 53953, + 53954, + 53955, + 53956, + 53957, + 53958, + 53959, + 53960, + 53961, + 53962, + 53963, + 53964, + 53965, + 53966, + 53967, + 53968, + 53969, + 53970, + 53971, + 53972, + 53973, + 53974, + 53975, + 53976, + 53977, + 53978, + 53979, + 53980, + 53981, + 53982, + 53983, + 53984, + 53985, + 53986, + 53987, + 53988, + 53989, + 53990, + 53991, + 53992, + 53993, + 53994, + 53995, + 53996, + 53997, + 53998, + 53999, + 54000, + 54001, + 54002, + 54003, + 54004, + 54005, + 54006, + 54007, + 54008, + 54009, + 54010, + 54011, + 54012, + 54013, + 54014, + 54015, + 54016, + 54017, + 54018, + 54019, + 54020, + 54021, + 54022, + 54023, + 54024, + 54025, + 54026, + 54027, + 54028, + 54029, + 54030, + 54031, + 54032, + 54033, + 54034, + 54035, + 54036, + 54037, + 54038, + 54039, + 54040, + 54041, + 54042, + 54043, + 54044, + 54045, + 54046, + 54047, + 54048, + 54049, + 54050, + 54051, + 54052, + 54053, + 54054, + 54055, + 54056, + 54057, + 54058, + 54059, + 54060, + 54061, + 54062, + 54063, + 54064, + 54065, + 54066, + 54067, + 54068, + 54069, + 54070, + 54071, + 54072, + 54073, + 54074, + 54075, + 54076, + 54077, + 54078, + 54079, + 54080, + 54081, + 54082, + 54083, + 54084, + 54085, + 54086, + 54087, + 54088, + 54089, + 54090, + 54091, + 54092, + 54093, + 54094, + 54095, + 54096, + 54097, + 54098, + 54099, + 54100, + 54101, + 54102, + 54103, + 54104, + 54105, + 54106, + 54107, + 54108, + 54109, + 54110, + 54111, + 54112, + 54113, + 54114, + 54115, + 54116, + 54117, + 54118, + 54119, + 54120, + 54121, + 54122, + 54123, + 54124, + 54125, + 54126, + 54127, + 54128, + 54129, + 54130, + 54131, + 54132, + 54133, + 54134, + 54135, + 54136, + 54137, + 54138, + 54139, + 54140, + 54141, + 54142, + 54143, + 54144, + 54145, + 54146, + 54147, + 54148, + 54149, + 54150, + 54151, + 54152, + 54153, + 54154, + 54155, + 54156, + 54157, + 54158, + 54159, + 54160, + 54161, + 54162, + 54163, + 54164, + 54165, + 54166, + 54167, + 54168, + 54169, + 54170, + 54171, + 54172, + 54173, + 54174, + 54175, + 54176, + 54177, + 54178, + 54179, + 54180, + 54181, + 54182, + 54183, + 54184, + 54185, + 54186, + 54187, + 54188, + 54189, + 54190, + 54191, + 54192, + 54193, + 54194, + 54195, + 54196, + 54197, + 54198, + 54199, + 54200, + 54201, + 54202, + 54203, + 54204, + 54205, + 54206, + 54207, + 54208, + 54209, + 54210, + 54211, + 54212, + 54213, + 54214, + 54215, + 54216, + 54217, + 54218, + 54219, + 54220, + 54221, + 54222, + 54223, + 54224, + 54225, + 54226, + 54227, + 54228, + 54229, + 54230, + 54231, + 54232, + 54233, + 54234, + 54235, + 54236, + 54237, + 54238, + 54239, + 54240, + 54241, + 54242, + 54243, + 54244, + 54245, + 54246, + 54247, + 54248, + 54249, + 54250, + 54251, + 54252, + 54253, + 54254, + 54255, + 54256, + 54257, + 54258, + 54259, + 54260, + 54261, + 54262, + 54263, + 54264, + 54265, + 54266, + 54267, + 54268, + 54269, + 54270, + 54271, + 54272, + 54273, + 54274, + 54275, + 54276, + 54277, + 54278, + 54279, + 54280, + 54281, + 54282, + 54283, + 54284, + 54285, + 54286, + 54287, + 54288, + 54289, + 54290, + 54291, + 54292, + 54293, + 54294, + 54295, + 54296, + 54297, + 54298, + 54299, + 54300, + 54301, + 54302, + 54303, + 54304, + 54305, + 54306, + 54307, + 54308, + 54309, + 54310, + 54311, + 54312, + 54313, + 54314, + 54315, + 54316, + 54317, + 54318, + 54319, + 54320, + 54321, + 54322, + 54323, + 54324, + 54325, + 54326, + 54327, + 54328, + 54329, + 54330, + 54331, + 54332, + 54333, + 54334, + 54335, + 54336, + 54337, + 54338, + 54339, + 54340, + 54341, + 54342, + 54343, + 54344, + 54345, + 54346, + 54347, + 54348, + 54349, + 54350, + 54351, + 54352, + 54353, + 54354, + 54355, + 54356, + 54357, + 54358, + 54359, + 54360, + 54361, + 54362, + 54363, + 54364, + 54365, + 54366, + 54367, + 54368, + 54369, + 54370, + 54371, + 54372, + 54373, + 54374, + 54375, + 54376, + 54377, + 54378, + 54379, + 54380, + 54381, + 54382, + 54383, + 54384, + 54385, + 54386, + 54387, + 54388, + 54389, + 54390, + 54391, + 54392, + 54393, + 54394, + 54395, + 54396, + 54397, + 54398, + 54399, + 54400, + 54401, + 54402, + 54403, + 54404, + 54405, + 54406, + 54407, + 54408, + 54409, + 54410, + 54411, + 54412, + 54413, + 54414, + 54415, + 54416, + 54417, + 54418, + 54419, + 54420, + 54421, + 54422, + 54423, + 54424, + 54425, + 54426, + 54427, + 54428, + 54429, + 54430, + 54431, + 54432, + 54433, + 54434, + 54435, + 54436, + 54437, + 54438, + 54439, + 54440, + 54441, + 54442, + 54443, + 54444, + 54445, + 54446, + 54447, + 54448, + 54449, + 54450, + 54451, + 54452, + 54453, + 54454, + 54455, + 54456, + 54457, + 54458, + 54459, + 54460, + 54461, + 54462, + 54463, + 54464, + 54465, + 54466, + 54467, + 54468, + 54469, + 54470, + 54471, + 54472, + 54473, + 54474, + 54475, + 54476, + 54477, + 54478, + 54479, + 54480, + 54481, + 54482, + 54483, + 54484, + 54485, + 54486, + 54487, + 54488, + 54489, + 54490, + 54491, + 54492, + 54493, + 54494, + 54495, + 54496, + 54497, + 54498, + 54499, + 54500, + 54501, + 54502, + 54503, + 54504, + 54505, + 54506, + 54507, + 54508, + 54509, + 54510, + 54511, + 54512, + 54513, + 54514, + 54515, + 54516, + 54517, + 54518, + 54519, + 54520, + 54521, + 54522, + 54523, + 54524, + 54525, + 54526, + 54527, + 54528, + 54529, + 54530, + 54531, + 54532, + 54533, + 54534, + 54535, + 54536, + 54537, + 54538, + 54539, + 54540, + 54541, + 54542, + 54543, + 54544, + 54545, + 54546, + 54547, + 54548, + 54549, + 54550, + 54551, + 54552, + 54553, + 54554, + 54555, + 54556, + 54557, + 54558, + 54559, + 54560, + 54561, + 54562, + 54563, + 54564, + 54565, + 54566, + 54567, + 54568, + 54569, + 54570, + 54571, + 54572, + 54573, + 54574, + 54575, + 54576, + 54577, + 54578, + 54579, + 54580, + 54581, + 54582, + 54583, + 54584, + 54585, + 54586, + 54587, + 54588, + 54589, + 54590, + 54591, + 54592, + 54593, + 54594, + 54595, + 54596, + 54597, + 54598, + 54599, + 54600, + 54601, + 54602, + 54603, + 54604, + 54605, + 54606, + 54607, + 54608, + 54609, + 54610, + 54611, + 54612, + 54613, + 54614, + 54615, + 54616, + 54617, + 54618, + 54619, + 54620, + 54621, + 54622, + 54623, + 54624, + 54625, + 54626, + 54627, + 54628, + 54629, + 54630, + 54631, + 54632, + 54633, + 54634, + 54635, + 54636, + 54637, + 54638, + 54639, + 54640, + 54641, + 54642, + 54643, + 54644, + 54645, + 54646, + 54647, + 54648, + 54649, + 54650, + 54651, + 54652, + 54653, + 54654, + 54655, + 54656, + 54657, + 54658, + 54659, + 54660, + 54661, + 54662, + 54663, + 54664, + 54665, + 54666, + 54667, + 54668, + 54669, + 54670, + 54671, + 54672, + 54673, + 54674, + 54675, + 54676, + 54677, + 54678, + 54679, + 54680, + 54681, + 54682, + 54683, + 54684, + 54685, + 54686, + 54687, + 54688, + 54689, + 54690, + 54691, + 54692, + 54693, + 54694, + 54695, + 54696, + 54697, + 54698, + 54699, + 54700, + 54701, + 54702, + 54703, + 54704, + 54705, + 54706, + 54707, + 54708, + 54709, + 54710, + 54711, + 54712, + 54713, + 54714, + 54715, + 54716, + 54717, + 54718, + 54719, + 54720, + 54721, + 54722, + 54723, + 54724, + 54725, + 54726, + 54727, + 54728, + 54729, + 54730, + 54731, + 54732, + 54733, + 54734, + 54735, + 54736, + 54737, + 54738, + 54739, + 54740, + 54741, + 54742, + 54743, + 54744, + 54745, + 54746, + 54747, + 54748, + 54749, + 54750, + 54751, + 54752, + 54753, + 54754, + 54755, + 54756, + 54757, + 54758, + 54759, + 54760, + 54761, + 54762, + 54763, + 54764, + 54765, + 54766, + 54767, + 54768, + 54769, + 54770, + 54771, + 54772, + 54773, + 54774, + 54775, + 54776, + 54777, + 54778, + 54779, + 54780, + 54781, + 54782, + 54783, + 54784, + 54785, + 54786, + 54787, + 54788, + 54789, + 54790, + 54791, + 54792, + 54793, + 54794, + 54795, + 54796, + 54797, + 54798, + 54799, + 54800, + 54801, + 54802, + 54803, + 54804, + 54805, + 54806, + 54807, + 54808, + 54809, + 54810, + 54811, + 54812, + 54813, + 54814, + 54815, + 54816, + 54817, + 54818, + 54819, + 54820, + 54821, + 54822, + 54823, + 54824, + 54825, + 54826, + 54827, + 54828, + 54829, + 54830, + 54831, + 54832, + 54833, + 54834, + 54835, + 54836, + 54837, + 54838, + 54839, + 54840, + 54841, + 54842, + 54843, + 54844, + 54845, + 54846, + 54847, + 54848, + 54849, + 54850, + 54851, + 54852, + 54853, + 54854, + 54855, + 54856, + 54857, + 54858, + 54859, + 54860, + 54861, + 54862, + 54863, + 54864, + 54865, + 54866, + 54867, + 54868, + 54869, + 54870, + 54871, + 54872, + 54873, + 54874, + 54875, + 54876, + 54877, + 54878, + 54879, + 54880, + 54881, + 54882, + 54883, + 54884, + 54885, + 54886, + 54887, + 54888, + 54889, + 54890, + 54891, + 54892, + 54893, + 54894, + 54895, + 54896, + 54897, + 54898, + 54899, + 54900, + 54901, + 54902, + 54903, + 54904, + 54905, + 54906, + 54907, + 54908, + 54909, + 54910, + 54911, + 54912, + 54913, + 54914, + 54915, + 54916, + 54917, + 54918, + 54919, + 54920, + 54921, + 54922, + 54923, + 54924, + 54925, + 54926, + 54927, + 54928, + 54929, + 54930, + 54931, + 54932, + 54933, + 54934, + 54935, + 54936, + 54937, + 54938, + 54939, + 54940, + 54941, + 54942, + 54943, + 54944, + 54945, + 54946, + 54947, + 54948, + 54949, + 54950, + 54951, + 54952, + 54953, + 54954, + 54955, + 54956, + 54957, + 54958, + 54959, + 54960, + 54961, + 54962, + 54963, + 54964, + 54965, + 54966, + 54967, + 54968, + 54969, + 54970, + 54971, + 54972, + 54973, + 54974, + 54975, + 54976, + 54977, + 54978, + 54979, + 54980, + 54981, + 54982, + 54983, + 54984, + 54985, + 54986, + 54987, + 54988, + 54989, + 54990, + 54991, + 54992, + 54993, + 54994, + 54995, + 54996, + 54997, + 54998, + 54999, + 55000, + 55001, + 55002, + 55003, + 55004, + 55005, + 55006, + 55007, + 55008, + 55009, + 55010, + 55011, + 55012, + 55013, + 55014, + 55015, + 55016, + 55017, + 55018, + 55019, + 55020, + 55021, + 55022, + 55023, + 55024, + 55025, + 55026, + 55027, + 55028, + 55029, + 55030, + 55031, + 55032, + 55033, + 55034, + 55035, + 55036, + 55037, + 55038, + 55039, + 55040, + 55041, + 55042, + 55043, + 55044, + 55045, + 55046, + 55047, + 55048, + 55049, + 55050, + 55051, + 55052, + 55053, + 55054, + 55055, + 55056, + 55057, + 55058, + 55059, + 55060, + 55061, + 55062, + 55063, + 55064, + 55065, + 55066, + 55067, + 55068, + 55069, + 55070, + 55071, + 55072, + 55073, + 55074, + 55075, + 55076, + 55077, + 55078, + 55079, + 55080, + 55081, + 55082, + 55083, + 55084, + 55085, + 55086, + 55087, + 55088, + 55089, + 55090, + 55091, + 55092, + 55093, + 55094, + 55095, + 55096, + 55097, + 55098, + 55099, + 55100, + 55101, + 55102, + 55103, + 55104, + 55105, + 55106, + 55107, + 55108, + 55109, + 55110, + 55111, + 55112, + 55113, + 55114, + 55115, + 55116, + 55117, + 55118, + 55119, + 55120, + 55121, + 55122, + 55123, + 55124, + 55125, + 55126, + 55127, + 55128, + 55129, + 55130, + 55131, + 55132, + 55133, + 55134, + 55135, + 55136, + 55137, + 55138, + 55139, + 55140, + 55141, + 55142, + 55143, + 55144, + 55145, + 55146, + 55147, + 55148, + 55149, + 55150, + 55151, + 55152, + 55153, + 55154, + 55155, + 55156, + 55157, + 55158, + 55159, + 55160, + 55161, + 55162, + 55163, + 55164, + 55165, + 55166, + 55167, + 55168, + 55169, + 55170, + 55171, + 55172, + 55173, + 55174, + 55175, + 55176, + 55177, + 55178, + 55179, + 55180, + 55181, + 55182, + 55183, + 55184, + 55185, + 55186, + 55187, + 55188, + 55189, + 55190, + 55191, + 55192, + 55193, + 55194, + 55195, + 55196, + 55197, + 55198, + 55199, + 55200, + 55201, + 55202, + 55203, + 55216, + 55217, + 55218, + 55219, + 55220, + 55221, + 55222, + 55223, + 55224, + 55225, + 55226, + 55227, + 55228, + 55229, + 55230, + 55231, + 55232, + 55233, + 55234, + 55235, + 55236, + 55237, + 55238, + 55243, + 55244, + 55245, + 55246, + 55247, + 55248, + 55249, + 55250, + 55251, + 55252, + 55253, + 55254, + 55255, + 55256, + 55257, + 55258, + 55259, + 55260, + 55261, + 55262, + 55263, + 55264, + 55265, + 55266, + 55267, + 55268, + 55269, + 55270, + 55271, + 55272, + 55273, + 55274, + 55275, + 55276, + 55277, + 55278, + 55279, + 55280, + 55281, + 55282, + 55283, + 55284, + 55285, + 55286, + 55287, + 55288, + 55289, + 55290, + 55291, + 63744, + 63745, + 63746, + 63747, + 63748, + 63749, + 63750, + 63751, + 63752, + 63753, + 63754, + 63755, + 63756, + 63757, + 63758, + 63759, + 63760, + 63761, + 63762, + 63763, + 63764, + 63765, + 63766, + 63767, + 63768, + 63769, + 63770, + 63771, + 63772, + 63773, + 63774, + 63775, + 63776, + 63777, + 63778, + 63779, + 63780, + 63781, + 63782, + 63783, + 63784, + 63785, + 63786, + 63787, + 63788, + 63789, + 63790, + 63791, + 63792, + 63793, + 63794, + 63795, + 63796, + 63797, + 63798, + 63799, + 63800, + 63801, + 63802, + 63803, + 63804, + 63805, + 63806, + 63807, + 63808, + 63809, + 63810, + 63811, + 63812, + 63813, + 63814, + 63815, + 63816, + 63817, + 63818, + 63819, + 63820, + 63821, + 63822, + 63823, + 63824, + 63825, + 63826, + 63827, + 63828, + 63829, + 63830, + 63831, + 63832, + 63833, + 63834, + 63835, + 63836, + 63837, + 63838, + 63839, + 63840, + 63841, + 63842, + 63843, + 63844, + 63845, + 63846, + 63847, + 63848, + 63849, + 63850, + 63851, + 63852, + 63853, + 63854, + 63855, + 63856, + 63857, + 63858, + 63859, + 63860, + 63861, + 63862, + 63863, + 63864, + 63865, + 63866, + 63867, + 63868, + 63869, + 63870, + 63871, + 63872, + 63873, + 63874, + 63875, + 63876, + 63877, + 63878, + 63879, + 63880, + 63881, + 63882, + 63883, + 63884, + 63885, + 63886, + 63887, + 63888, + 63889, + 63890, + 63891, + 63892, + 63893, + 63894, + 63895, + 63896, + 63897, + 63898, + 63899, + 63900, + 63901, + 63902, + 63903, + 63904, + 63905, + 63906, + 63907, + 63908, + 63909, + 63910, + 63911, + 63912, + 63913, + 63914, + 63915, + 63916, + 63917, + 63918, + 63919, + 63920, + 63921, + 63922, + 63923, + 63924, + 63925, + 63926, + 63927, + 63928, + 63929, + 63930, + 63931, + 63932, + 63933, + 63934, + 63935, + 63936, + 63937, + 63938, + 63939, + 63940, + 63941, + 63942, + 63943, + 63944, + 63945, + 63946, + 63947, + 63948, + 63949, + 63950, + 63951, + 63952, + 63953, + 63954, + 63955, + 63956, + 63957, + 63958, + 63959, + 63960, + 63961, + 63962, + 63963, + 63964, + 63965, + 63966, + 63967, + 63968, + 63969, + 63970, + 63971, + 63972, + 63973, + 63974, + 63975, + 63976, + 63977, + 63978, + 63979, + 63980, + 63981, + 63982, + 63983, + 63984, + 63985, + 63986, + 63987, + 63988, + 63989, + 63990, + 63991, + 63992, + 63993, + 63994, + 63995, + 63996, + 63997, + 63998, + 63999, + 64000, + 64001, + 64002, + 64003, + 64004, + 64005, + 64006, + 64007, + 64008, + 64009, + 64010, + 64011, + 64012, + 64013, + 64014, + 64015, + 64016, + 64017, + 64018, + 64019, + 64020, + 64021, + 64022, + 64023, + 64024, + 64025, + 64026, + 64027, + 64028, + 64029, + 64030, + 64031, + 64032, + 64033, + 64034, + 64035, + 64036, + 64037, + 64038, + 64039, + 64040, + 64041, + 64042, + 64043, + 64044, + 64045, + 64046, + 64047, + 64048, + 64049, + 64050, + 64051, + 64052, + 64053, + 64054, + 64055, + 64056, + 64057, + 64058, + 64059, + 64060, + 64061, + 64062, + 64063, + 64064, + 64065, + 64066, + 64067, + 64068, + 64069, + 64070, + 64071, + 64072, + 64073, + 64074, + 64075, + 64076, + 64077, + 64078, + 64079, + 64080, + 64081, + 64082, + 64083, + 64084, + 64085, + 64086, + 64087, + 64088, + 64089, + 64090, + 64091, + 64092, + 64093, + 64094, + 64095, + 64096, + 64097, + 64098, + 64099, + 64100, + 64101, + 64102, + 64103, + 64104, + 64105, + 64106, + 64107, + 64108, + 64109, + 64112, + 64113, + 64114, + 64115, + 64116, + 64117, + 64118, + 64119, + 64120, + 64121, + 64122, + 64123, + 64124, + 64125, + 64126, + 64127, + 64128, + 64129, + 64130, + 64131, + 64132, + 64133, + 64134, + 64135, + 64136, + 64137, + 64138, + 64139, + 64140, + 64141, + 64142, + 64143, + 64144, + 64145, + 64146, + 64147, + 64148, + 64149, + 64150, + 64151, + 64152, + 64153, + 64154, + 64155, + 64156, + 64157, + 64158, + 64159, + 64160, + 64161, + 64162, + 64163, + 64164, + 64165, + 64166, + 64167, + 64168, + 64169, + 64170, + 64171, + 64172, + 64173, + 64174, + 64175, + 64176, + 64177, + 64178, + 64179, + 64180, + 64181, + 64182, + 64183, + 64184, + 64185, + 64186, + 64187, + 64188, + 64189, + 64190, + 64191, + 64192, + 64193, + 64194, + 64195, + 64196, + 64197, + 64198, + 64199, + 64200, + 64201, + 64202, + 64203, + 64204, + 64205, + 64206, + 64207, + 64208, + 64209, + 64210, + 64211, + 64212, + 64213, + 64214, + 64215, + 64216, + 64217, + 64256, + 64257, + 64258, + 64259, + 64260, + 64261, + 64262, + 64275, + 64276, + 64277, + 64278, + 64279, + 64285, + 64287, + 64288, + 64289, + 64290, + 64291, + 64292, + 64293, + 64294, + 64295, + 64296, + 64298, + 64299, + 64300, + 64301, + 64302, + 64303, + 64304, + 64305, + 64306, + 64307, + 64308, + 64309, + 64310, + 64312, + 64313, + 64314, + 64315, + 64316, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64327, + 64328, + 64329, + 64330, + 64331, + 64332, + 64333, + 64334, + 64335, + 64336, + 64337, + 64338, + 64339, + 64340, + 64341, + 64342, + 64343, + 64344, + 64345, + 64346, + 64347, + 64348, + 64349, + 64350, + 64351, + 64352, + 64353, + 64354, + 64355, + 64356, + 64357, + 64358, + 64359, + 64360, + 64361, + 64362, + 64363, + 64364, + 64365, + 64366, + 64367, + 64368, + 64369, + 64370, + 64371, + 64372, + 64373, + 64374, + 64375, + 64376, + 64377, + 64378, + 64379, + 64380, + 64381, + 64382, + 64383, + 64384, + 64385, + 64386, + 64387, + 64388, + 64389, + 64390, + 64391, + 64392, + 64393, + 64394, + 64395, + 64396, + 64397, + 64398, + 64399, + 64400, + 64401, + 64402, + 64403, + 64404, + 64405, + 64406, + 64407, + 64408, + 64409, + 64410, + 64411, + 64412, + 64413, + 64414, + 64415, + 64416, + 64417, + 64418, + 64419, + 64420, + 64421, + 64422, + 64423, + 64424, + 64425, + 64426, + 64427, + 64428, + 64429, + 64430, + 64431, + 64432, + 64433, + 64467, + 64468, + 64469, + 64470, + 64471, + 64472, + 64473, + 64474, + 64475, + 64476, + 64477, + 64478, + 64479, + 64480, + 64481, + 64482, + 64483, + 64484, + 64485, + 64486, + 64487, + 64488, + 64489, + 64490, + 64491, + 64492, + 64493, + 64494, + 64495, + 64496, + 64497, + 64498, + 64499, + 64500, + 64501, + 64502, + 64503, + 64504, + 64505, + 64506, + 64507, + 64508, + 64509, + 64510, + 64511, + 64512, + 64513, + 64514, + 64515, + 64516, + 64517, + 64518, + 64519, + 64520, + 64521, + 64522, + 64523, + 64524, + 64525, + 64526, + 64527, + 64528, + 64529, + 64530, + 64531, + 64532, + 64533, + 64534, + 64535, + 64536, + 64537, + 64538, + 64539, + 64540, + 64541, + 64542, + 64543, + 64544, + 64545, + 64546, + 64547, + 64548, + 64549, + 64550, + 64551, + 64552, + 64553, + 64554, + 64555, + 64556, + 64557, + 64558, + 64559, + 64560, + 64561, + 64562, + 64563, + 64564, + 64565, + 64566, + 64567, + 64568, + 64569, + 64570, + 64571, + 64572, + 64573, + 64574, + 64575, + 64576, + 64577, + 64578, + 64579, + 64580, + 64581, + 64582, + 64583, + 64584, + 64585, + 64586, + 64587, + 64588, + 64589, + 64590, + 64591, + 64592, + 64593, + 64594, + 64595, + 64596, + 64597, + 64598, + 64599, + 64600, + 64601, + 64602, + 64603, + 64604, + 64605, + 64606, + 64607, + 64608, + 64609, + 64610, + 64611, + 64612, + 64613, + 64614, + 64615, + 64616, + 64617, + 64618, + 64619, + 64620, + 64621, + 64622, + 64623, + 64624, + 64625, + 64626, + 64627, + 64628, + 64629, + 64630, + 64631, + 64632, + 64633, + 64634, + 64635, + 64636, + 64637, + 64638, + 64639, + 64640, + 64641, + 64642, + 64643, + 64644, + 64645, + 64646, + 64647, + 64648, + 64649, + 64650, + 64651, + 64652, + 64653, + 64654, + 64655, + 64656, + 64657, + 64658, + 64659, + 64660, + 64661, + 64662, + 64663, + 64664, + 64665, + 64666, + 64667, + 64668, + 64669, + 64670, + 64671, + 64672, + 64673, + 64674, + 64675, + 64676, + 64677, + 64678, + 64679, + 64680, + 64681, + 64682, + 64683, + 64684, + 64685, + 64686, + 64687, + 64688, + 64689, + 64690, + 64691, + 64692, + 64693, + 64694, + 64695, + 64696, + 64697, + 64698, + 64699, + 64700, + 64701, + 64702, + 64703, + 64704, + 64705, + 64706, + 64707, + 64708, + 64709, + 64710, + 64711, + 64712, + 64713, + 64714, + 64715, + 64716, + 64717, + 64718, + 64719, + 64720, + 64721, + 64722, + 64723, + 64724, + 64725, + 64726, + 64727, + 64728, + 64729, + 64730, + 64731, + 64732, + 64733, + 64734, + 64735, + 64736, + 64737, + 64738, + 64739, + 64740, + 64741, + 64742, + 64743, + 64744, + 64745, + 64746, + 64747, + 64748, + 64749, + 64750, + 64751, + 64752, + 64753, + 64754, + 64755, + 64756, + 64757, + 64758, + 64759, + 64760, + 64761, + 64762, + 64763, + 64764, + 64765, + 64766, + 64767, + 64768, + 64769, + 64770, + 64771, + 64772, + 64773, + 64774, + 64775, + 64776, + 64777, + 64778, + 64779, + 64780, + 64781, + 64782, + 64783, + 64784, + 64785, + 64786, + 64787, + 64788, + 64789, + 64790, + 64791, + 64792, + 64793, + 64794, + 64795, + 64796, + 64797, + 64798, + 64799, + 64800, + 64801, + 64802, + 64803, + 64804, + 64805, + 64806, + 64807, + 64808, + 64809, + 64810, + 64811, + 64812, + 64813, + 64814, + 64815, + 64816, + 64817, + 64818, + 64819, + 64820, + 64821, + 64822, + 64823, + 64824, + 64825, + 64826, + 64827, + 64828, + 64829, + 64848, + 64849, + 64850, + 64851, + 64852, + 64853, + 64854, + 64855, + 64856, + 64857, + 64858, + 64859, + 64860, + 64861, + 64862, + 64863, + 64864, + 64865, + 64866, + 64867, + 64868, + 64869, + 64870, + 64871, + 64872, + 64873, + 64874, + 64875, + 64876, + 64877, + 64878, + 64879, + 64880, + 64881, + 64882, + 64883, + 64884, + 64885, + 64886, + 64887, + 64888, + 64889, + 64890, + 64891, + 64892, + 64893, + 64894, + 64895, + 64896, + 64897, + 64898, + 64899, + 64900, + 64901, + 64902, + 64903, + 64904, + 64905, + 64906, + 64907, + 64908, + 64909, + 64910, + 64911, + 64914, + 64915, + 64916, + 64917, + 64918, + 64919, + 64920, + 64921, + 64922, + 64923, + 64924, + 64925, + 64926, + 64927, + 64928, + 64929, + 64930, + 64931, + 64932, + 64933, + 64934, + 64935, + 64936, + 64937, + 64938, + 64939, + 64940, + 64941, + 64942, + 64943, + 64944, + 64945, + 64946, + 64947, + 64948, + 64949, + 64950, + 64951, + 64952, + 64953, + 64954, + 64955, + 64956, + 64957, + 64958, + 64959, + 64960, + 64961, + 64962, + 64963, + 64964, + 64965, + 64966, + 64967, + 65008, + 65009, + 65010, + 65011, + 65012, + 65013, + 65014, + 65015, + 65016, + 65017, + 65018, + 65019, + 65136, + 65137, + 65138, + 65139, + 65140, + 65142, + 65143, + 65144, + 65145, + 65146, + 65147, + 65148, + 65149, + 65150, + 65151, + 65152, + 65153, + 65154, + 65155, + 65156, + 65157, + 65158, + 65159, + 65160, + 65161, + 65162, + 65163, + 65164, + 65165, + 65166, + 65167, + 65168, + 65169, + 65170, + 65171, + 65172, + 65173, + 65174, + 65175, + 65176, + 65177, + 65178, + 65179, + 65180, + 65181, + 65182, + 65183, + 65184, + 65185, + 65186, + 65187, + 65188, + 65189, + 65190, + 65191, + 65192, + 65193, + 65194, + 65195, + 65196, + 65197, + 65198, + 65199, + 65200, + 65201, + 65202, + 65203, + 65204, + 65205, + 65206, + 65207, + 65208, + 65209, + 65210, + 65211, + 65212, + 65213, + 65214, + 65215, + 65216, + 65217, + 65218, + 65219, + 65220, + 65221, + 65222, + 65223, + 65224, + 65225, + 65226, + 65227, + 65228, + 65229, + 65230, + 65231, + 65232, + 65233, + 65234, + 65235, + 65236, + 65237, + 65238, + 65239, + 65240, + 65241, + 65242, + 65243, + 65244, + 65245, + 65246, + 65247, + 65248, + 65249, + 65250, + 65251, + 65252, + 65253, + 65254, + 65255, + 65256, + 65257, + 65258, + 65259, + 65260, + 65261, + 65262, + 65263, + 65264, + 65265, + 65266, + 65267, + 65268, + 65269, + 65270, + 65271, + 65272, + 65273, + 65274, + 65275, + 65276, + 65313, + 65314, + 65315, + 65316, + 65317, + 65318, + 65319, + 65320, + 65321, + 65322, + 65323, + 65324, + 65325, + 65326, + 65327, + 65328, + 65329, + 65330, + 65331, + 65332, + 65333, + 65334, + 65335, + 65336, + 65337, + 65338, + 65345, + 65346, + 65347, + 65348, + 65349, + 65350, + 65351, + 65352, + 65353, + 65354, + 65355, + 65356, + 65357, + 65358, + 65359, + 65360, + 65361, + 65362, + 65363, + 65364, + 65365, + 65366, + 65367, + 65368, + 65369, + 65370, + 65382, + 65383, + 65384, + 65385, + 65386, + 65387, + 65388, + 65389, + 65390, + 65391, + 65392, + 65393, + 65394, + 65395, + 65396, + 65397, + 65398, + 65399, + 65400, + 65401, + 65402, + 65403, + 65404, + 65405, + 65406, + 65407, + 65408, + 65409, + 65410, + 65411, + 65412, + 65413, + 65414, + 65415, + 65416, + 65417, + 65418, + 65419, + 65420, + 65421, + 65422, + 65423, + 65424, + 65425, + 65426, + 65427, + 65428, + 65429, + 65430, + 65431, + 65432, + 65433, + 65434, + 65435, + 65436, + 65437, + 65438, + 65439, + 65440, + 65441, + 65442, + 65443, + 65444, + 65445, + 65446, + 65447, + 65448, + 65449, + 65450, + 65451, + 65452, + 65453, + 65454, + 65455, + 65456, + 65457, + 65458, + 65459, + 65460, + 65461, + 65462, + 65463, + 65464, + 65465, + 65466, + 65467, + 65468, + 65469, + 65470, + 65474, + 65475, + 65476, + 65477, + 65478, + 65479, + 65482, + 65483, + 65484, + 65485, + 65486, + 65487, + 65490, + 65491, + 65492, + 65493, + 65494, + 65495, + 65498, + 65499, + 65500 +]; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs new file mode 120000 index 0000000..a044997 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs @@ -0,0 +1 @@ +../shelljs/bin/shjs \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md new file mode 100644 index 0000000..0fe30d4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md @@ -0,0 +1,196 @@ +**cli is a toolkit for rapidly building command line apps - it includes:** + +- Full featured opts/args parser +- Plugin support for adding common options and switches +- Helper methods for working with input/output and spawning child processes +- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js) +- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js) + +Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app. + +## Example apps + +### sort.js + +```javascript +#!/usr/bin/env node +require('cli').withStdinLines(function(lines, newline) { + this.output(lines.sort().join(newline)); +}); +``` + +Try it out + +```bash +$ ./sort.js < input.txt +``` + +Let's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!) + +```javascript +var cli = require('cli'), options = cli.parse(); + +cli.withStdinLines(function(lines, newline) { + lines.sort(!options.n ? null : function(a, b) { + return parseInt(a) > parseInt(b); + }); + if (options.r) lines.reverse(); + this.output(lines.join(newline)); +}); +``` + +### static.js + +Let's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon` + +```javascript +var cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins + +cli.parse({ + log: ['l', 'Enable logging'], + port: ['p', 'Listen on this port', 'number', 8080], + serve: [false, 'Serve static files from PATH', 'path', './public'] +}); + +cli.main(function(args, options) { + var server, middleware = []; + + if (options.log) { + this.debug('Enabling logging'); + middleware.push(require('creationix/log')()); + } + + this.debug('Serving files from ' + options.serve); + middleware.push(require('creationix/static')('/', options.serve, 'index.html')); + + server = this.createServer(middleware).listen(options.port); + + this.ok('Listening on port ' + options.port); +}); +``` + +To output usage information + +```bash +$ ./static.js --help +``` + +To create a daemon that serves files from */tmp*, run + +```bash +$ ./static.js -ld --serve=/tmp +``` + +For more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples) + +## Helper methods + +cli has methods that collect stdin (newline is autodetected as \n or \r\n) + +```javascript +cli.withStdin(callback); //callback receives stdin as a string +cli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline) +``` + +cli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). + +```javascript +cli.withInput(file, function (line, newline, eof) { + if (!eof) { + this.output(line + newline); + } +}); +``` + +*Note: `file` can be omitted if you want to work with stdin* + +To output a progress bar, call + +```javascript +cli.progress(progress); //Where 0 <= progress <= 1 +``` + +To spawn a child process, use + +```javascript +cli.exec(cmd, callback); //callback receives the output of the process (split into lines) +``` + +cli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer) + +## Plugins + +Plugins are a way of adding common opts and can be enabled using + +```javascript +cli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method +``` + +**help** - *enabled by default* + +Adds `-h,--help` to output auto-generated usage information + +**version** + +Adds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json* + +To set your own app name and version, use `cli.setApp(app_name, version)` + +**status** + +Adds options to show/hide the stylized status messages that are output to the console when using one of these methods + +```javascript +cli.debug(msg); //Only shown when using --debug +cli.error(msg); +cli.fatal(msg); //Exits the process after outputting msg +cli.info(msg); +cli.ok(msg); +``` + +`-k,--no-color` will omit ANSI color escapes from the output + +**glob** - *requires* `npm install glob` + +Enables glob matching of arguments + +**daemon** - *requires* `npm install daemon` + +Adds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon + +`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr) + +**timeout** + +Adds `-t,--timeout N` to exit the process after N seconds with an error + +**catchall** + +Adds `-c,--catch` to catch and output uncaughtExceptions and resume execution + +*Note: Plugins are automatically disabled if an option or switch of the same name is already defined* + +## LICENSE + +(MIT license) + +Copyright (c) 2010 Chris O'Hara + +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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js new file mode 100644 index 0000000..f94e973 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js @@ -0,0 +1,1133 @@ +/** + * Copyright (c) 2010 Chris O'Hara + * + * 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. + */ + + //Note: cli includes kof/node-natives and creationix/stack. I couldn't find + //license information for either - contact me if you want your license added + +var cli = exports, + argv, curr_opt, curr_val, full_opt, is_long, + short_tags = [], opt_list, parsed = {}, + usage, argv_parsed, command_list, commands, + daemon, daemon_arg, no_color, show_debug; + +cli.app = null; +cli.version = null; +cli.argv = []; +cli.argc = 0; + +cli.options = {}; +cli.args = []; +cli.command; + +cli.width = 70; +cli.option_width = 25; + +/** + * Bind kof's node-natives (https://github.com/kof/node-natives) to `cli.native` + * + * Rather than requiring node natives (e.g. var fs = require('fs')), all + * native modules can be accessed like `cli.native.fs` + */ +cli.native = {}; +var define_native = function (module) { + Object.defineProperty(cli.native, module, { + enumerable: true, + configurable: true, + get: function() { + delete cli.native[module]; + return cli.native[module] = require(module); + } + }); +}; +var natives = process.binding('natives'); +for (var module in natives) { + define_native(module); +} + +cli.output = cli.native.util.print; +cli.exit = process.exit; + +/** + * Define plugins. Plugins can be enabled and disabled by calling: + * + * `cli.enable(plugin1, [plugin2, ...])` + * `cli.disable(plugin1, [plugin2, ...])` + * + * Methods are chainable - `cli.enable(plugin).disable(plugin2)`. + * + * The 'help' plugin is enabled by default. + */ +var enable = { + help: true, //Adds -h, --help + version: false, //Adds -v,--version => gets version by parsing a nearby package.json + daemon: false, //Adds -d,--daemon [ARG] => (see cli.daemon() below) + status: false, //Adds -k,--no-color & --debug => display plain status messages /display debug messages + timeout: false, //Adds -t,--timeout N => timeout the process after N seconds + catchall: false, //Adds -c,--catch => catch and output uncaughtExceptions + glob: false //Adds glob matching => use cli.glob(arg) +} +cli.enable = function (/*plugins*/) { + Array.prototype.slice.call(arguments).forEach(function (plugin) { + switch (plugin) { + case 'daemon': + try { + daemon = require('daemon'); + if (typeof daemon.daemonize !== 'function') { + throw 'Invalid module'; + } + } catch (e) { + cli.fatal('daemon.node not installed. Please run `npm install daemon`'); + } + break; + case 'catchall': + process.on('uncaughtException', function (err) { + cli.error('Uncaught exception: ' + (err.msg || err)); + }); + break; + case 'help': case 'version': case 'status': + case 'autocomplete': case 'timeout': + //Just add switches. + break; + case 'glob': + cli.glob = require('glob'); + break; + default: + cli.fatal('Unknown plugin "' + plugin + '"'); + break; + } + enable[plugin] = true; + }); + return cli; +} +cli.disable = function (/*plugins*/) { + Array.prototype.slice.call(arguments).forEach(function (plugin) { + if (enable[plugin]) { + enable[plugin] = false; + } + }); + return cli; +} + +/** + * Sets argv (default is process.argv). + * + * @param {Array|String} argv + * @param {Boolean} keep_arg0 (optional - default is false) + * @api public + */ +cli.setArgv = function (arr, keep_arg0) { + if (typeof arr == 'string') { + arr = arr.split(' '); + } else { + arr = arr.slice(); + } + cli.app = arr.shift(); + //Strip off argv[0] if it's a node binary + if (!keep_arg0 && ('node' === cli.native.path.basename(cli.app) + || process.execPath === cli.app)) { + cli.app = arr.shift(); + } + cli.app = cli.native.path.basename(cli.app); + argv_parsed = false; + cli.args = cli.argv = argv = arr; + cli.argc = argv.length; + cli.options = {}; + cli.command = null; +}; +cli.setArgv(process.argv); + +/** + * Returns the next opt, or false if no opts are found. + * + * @return {String} opt + * @api public + */ +cli.next = function () { + if (!argv_parsed) { + cli.args = []; + argv_parsed = true; + } + + curr_val = null; + + //If we're currently in a group of short opts (e.g. -abc), return the next opt + if (short_tags.length) { + curr_opt = short_tags.shift(); + full_opt = '-' + curr_opt; + return curr_opt; + } + + if (!argv.length) { + return false; + } + + curr_opt = argv.shift(); + + //If an escape sequence is found (- or --), subsequent opts are ignored + if (curr_opt === '-' || curr_opt === '--') { + while (argv.length) { + cli.args.push(argv.shift()); + } + return false; + } + + //If the next element in argv isn't an opt, add it to the list of args + if (curr_opt[0] !== '-') { + cli.args.push(curr_opt); + return cli.next(); + } else { + //Check if the opt is short/long + is_long = curr_opt[1] === '-'; + curr_opt = curr_opt.substr(is_long ? 2 : 1); + } + + //Accept grouped short opts, e.g. -abc => -a -b -c + if (!is_long && curr_opt.length > 1) { + short_tags = curr_opt.split(''); + return cli.next(); + } + + var eq, len; + + //Check if the long opt is in the form --option=VALUE + if (is_long && (eq = curr_opt.indexOf('=')) >= 0) { + curr_val = curr_opt.substr(eq + 1); + curr_opt = curr_opt.substr(0, eq); + len = curr_val.length; + //Allow values to be quoted + if ((curr_val[0] === '"' && curr_val[len - 1] === '"') || + (curr_val[0] === "'" && curr_val[len - 1] === "'")) + { + curr_val = curr_val.substr(1, len-2); + } + if (curr_val.match(/^[0-9]+$/)) { + curr_val = parseInt(curr_val, 10); + } + } + + //Save the opt representation for later + full_opt = (is_long ? '--' : '-') + curr_opt; + + return curr_opt; +}; + +/** + * Parses command line opts. + * + * `opts` must be an object with opts defined like: + * long_tag: [short_tag, description, value_type, default_value]; + * + * `commands` is an optional array or object for apps that are of the form + * my_app [OPTIONS] [ARGS] + * The command list is output with usage information + there is bundled + * support for auto-completion, etc. + * + * See README.md for more information. + * + * @param {Object} opts + * @param {Object} commands (optional) + * @return {Object} opts (parsed) + * @api public + */ +cli.parse = function (opts, command_def) { + var default_val, i, parsed = cli.options, seen, + catch_all = !opts; + opt_list = opts || {}; + commands = command_def; + command_list = commands || []; + if (commands && !Array.isArray(commands)) { + command_list = Object.keys(commands); + } + while (o = cli.next()) { + seen = false; + for (opt in opt_list) { + if (!(opt_list[opt] instanceof Array)) { + continue; + } + if (!opt_list[opt][0]) { + opt_list[opt][0] = opt; + } + if (o === opt || o === opt_list[opt][0]) { + seen = true; + if (opt_list[opt].length === 2) { + parsed[opt] = true; + break; + } + default_val = null; + if (opt_list[opt].length === 4) { + default_val = opt_list[opt][3]; + } + if (opt_list[opt][2] instanceof Array) { + for (i = 0, l = opt_list[opt][2].length; i < l; i++) { + if (typeof opt_list[opt][2][i] === 'number') { + opt_list[opt][2][i] += ''; + } + } + parsed[opt] = cli.getArrayValue(opt_list[opt][2], is_long ? null : default_val); + break; + } + if (opt_list[opt][2].toLowerCase) { + opt_list[opt][2] = opt_list[opt][2].toLowerCase(); + } + switch (opt_list[opt][2]) { + case 'string': case 1: case true: + parsed[opt] = cli.getValue(default_val); + break; + case 'int': case 'number': case 'num': + case 'time': case 'seconds': case 'secs': case 'minutes': case 'mins': + case 'x': case 'n': + parsed[opt] = cli.getInt(default_val); + break; + case 'float': case 'decimal': + parsed[opt] = cli.getFloat(default_val); + break; + case 'path': case 'file': case 'directory': case 'dir': + parsed[opt] = cli.getPath(default_val, opt_list[opt][2]); + break; + case 'email': + parsed[opt] = cli.getEmail(default_val); + break; + case 'url': case 'uri': case 'domain': case 'host': + parsed[opt] = cli.getUrl(default_val, opt_list[opt][2]); + break; + case 'ip': + parsed[opt] = cli.getIp(default_val); + break; + case 'bool': case 'boolean': case 'on': + parsed[opt] = true; + break; + case 'false': case 'off': case false: case 0: + parsed[opt] = false; + break; + default: + cli.fatal('Unknown opt type "' + opt_list[opt][2] + '"'); + } + break; + } + } + if (process.env.NODE_DISABLE_COLORS) { + no_color = true; + } + if (!seen) { + if (enable.help && (o === 'h' || o === 'help')) { + cli.getUsage(); + process.exit(); + } else if (enable.version && (o === 'v' || o === 'version')) { + if (cli.version == null) { + cli.parsePackageJson(); + } + console.error(cli.app + ' v' + cli.version); + process.exit(); + } else if (enable.daemon && (o === 'd' || o === 'daemon')) { + daemon_arg = cli.getArrayValue(['start','stop','restart','pid','log'], is_long ? null : 'start'); + continue; + } else if (enable.catchall && (o === 'c' || o === 'catch')) { + continue; + } else if (enable.status && (o === 'k' || o === 'no-color' || o === 'debug')) { + no_color = (o === 'k' || o === 'no-color'); + show_debug = o === 'debug'; + continue; + } else if (enable.timeout && (o === 't' || o === 'timeout')) { + var secs = cli.getInt(); + setTimeout(function () { + cli.fatal('Process timed out after ' + secs + 's'); + }, secs * 1000); + continue; + } else if (catch_all) { + parsed[o] = curr_val || true; + continue; + } + cli.fatal('Unknown option ' + full_opt); + } + } + //Fill the remaining options with their default value or null + for (opt in opt_list) { + default_val = opt_list[opt].length === 4 ? opt_list[opt][3] : null; + if (!(opt_list[opt] instanceof Array)) { + parsed[opt] = opt_list[opt]; + continue; + } else if (typeof parsed[opt] === 'undefined') { + parsed[opt] = default_val; + } + } + if (command_list.length) { + if (cli.args.length === 0) { + if (enable.help) { + cli.getUsage(); + } else { + cli.fatal('A command is required (' + command_list.join(', ') + ').'); + } + process.exit(1); + } else { + cli.command = cli.autocompleteCommand(cli.args.shift()); + } + } + cli.argc = cli.args.length; + return parsed; +}; + +/** + * Helper method for matching a command from the command list. + * + * @param {String} command + * @return {String} full_command + * @api public + */ +cli.autocompleteCommand = function (command) { + var list; + if (!(command_list instanceof Array)) { + list = Object.keys(command_list); + } else { + list = command_list; + } + var i, j = 0, c = command.length, tmp_list; + if (list.length === 0 || list.indexOf(command) !== -1) { + return command; + } + for (i = 0; i < c; i++) { + tmp_list = []; + l = list.length; + if (l <= 1) break; + for (j = 0; j < l; j++) + if (list[j].length >= i && list[j][i] === command[i]) + tmp_list.push(list[j]); + list = tmp_list; + } + l = list.length; + if (l === 1) { + return list[0]; + } else if (l === 0) { + cli.fatal('Unknown command "' + command + '"' + (enable.help ? '. Please see --help for more information' : '')); + } else { + list.sort(); + cli.fatal('The command "' + command + '" is ambiguous and could mean "' + list.join('", "') + '"'); + } +}; + +/** + * Adds methods to output styled status messages to stderr. + * + * Added methods are cli.info(msg), cli.error(msg), cli.ok(msg), and + * cli.debug(msg). + * + * To control status messages, use the 'status' plugin + * 1) debug() messages are hidden by default. Display them with + * the --debug opt. + * 2) to hide all status messages, use the -s or --silent opt. + * + * @api private + */ +cli.status = function (msg, type) { + var pre; + switch (type) { + case 'info': + pre = no_color ? 'INFO:' : '\x1B[33mINFO\x1B[0m:'; + break; + case 'debug': + pre = no_color ? 'DEBUG:' : '\x1B[36mDEBUG\x1B[0m:'; + break; + case 'error': + case 'fatal': + pre = no_color ? 'ERROR:' : '\x1B[31mERROR\x1B[0m:'; + break; + case 'ok': + pre = no_color ? 'OK:' : '\x1B[32mOK\x1B[0m:'; + break; + } + msg = pre + ' ' + msg; + if (type === 'fatal') { + console.error(msg); + process.exit(1); + } + if (enable.status && !show_debug && type === 'debug') { + return; + } + console.error(msg); +}; +['info','error','ok','debug','fatal'].forEach(function (type) { + cli[type] = function (msg) { + cli.status(msg, type); + }; +}); + +/** + * Sets the app name and version. + * + * Usage: + * setApp('myapp', '0.1.0'); + * setApp('./package.json'); //Pull name/version from package.json + * + * @param {String} name + * @return cli (for chaining) + * @api public + */ +cli.setApp = function (name, version) { + if (name.indexOf('package.json') !== -1) { + cli.parsePackageJson(name); + } else { + cli.app = name; + cli.version = version; + } + return cli; +}; + +/** + * Parses the version number from package.json. If no path is specified, cli + * will attempt to locate a package.json in ./, ../ or ../../ + * + * @param {String} path (optional) + * @api public + */ +cli.parsePackageJson = function (path) { + var parse_packagejson = function (path) { + var packagejson = JSON.parse(cli.native.fs.readFileSync(path, 'utf8')); + cli.version = packagejson.version; + cli.app = packagejson.name; + }; + var try_all = function (arr, func, err) { + for (var i = 0, l = arr.length; i < l; i++) { + try { + func(arr[i]); + return; + } catch (e) { + if (i === l-1) { + cli.fatal(err); + } + } + } + }; + try { + if (path) { + return parse_packagejson(path); + } + try_all([ + __dirname + '/package.json', + __dirname + '/../package.json', + __dirname + '/../../package.json' + ], parse_packagejson); + } catch (e) { + cli.fatal('Could not detect ' + cli.app + ' version'); + } +}; + +/** + * Sets the usage string - default is `app [OPTIONS] [ARGS]`. + * + * @param {String} u + * @return cli (for chaining) + * @api public + */ +cli.setUsage = function (u) { + usage = u; + return cli; +}; + +var pad = function (str, len) { + if (typeof len === 'undefined') { + len = str; + str = ''; + } + if (str.length < len) { + len -= str.length; + while (len--) str += ' '; + } + return str; +}; + +/** + * Automatically build usage information from the opts list. If the help + * plugin is enabled (default), this info is displayed with -h, --help. + * + * @api public + */ +cli.getUsage = function () { + var short, desc, optional, line, seen_opts = [], + switch_pad = cli.option_width; + + var trunc_desc = function (pref, desc, len) { + var pref_len = pref.length, + desc_len = cli.width - pref_len, + truncated = ''; + if (desc.length <= desc_len) { + return desc; + } + var desc_words = (desc+'').split(' '), chars = 0, word; + while (desc_words.length) { + truncated += (word = desc_words.shift()) + ' '; + chars += word.length; + if (desc_words.length && chars + desc_words[0].length > desc_len) { + truncated += '\n' + pad(pref_len); + chars = 0; + } + } + return truncated; + }; + + usage = usage || cli.app + ' [OPTIONS]' + (command_list.length ? ' ' : '') + ' [ARGS]'; + if (no_color) { + console.error('Usage:\n ' + usage); + console.error('Options: '); + } else { + console.error('\x1b[1mUsage\x1b[0m:\n ' + usage); + console.error('\n\x1b[1mOptions\x1b[0m: '); + } + for (opt in opt_list) { + + if (opt.length === 1) { + long = opt_list[opt][0]; + short = opt; + } else { + long = opt; + short = opt_list[opt][0]; + } + + //Parse opt_list + desc = opt_list[opt][1].trim(); + type = opt_list[opt].length >= 3 ? opt_list[opt][2] : null; + optional = opt_list[opt].length === 4 ? opt_list[opt][3] : null; + + //Build usage line + if (short === long) { + if (short.length === 1) { + line = ' -' + short; + } else { + line = ' --' + long; + } + } else { + line = ' -' + short + ', --' + long; + } + line += ' '; + + if (type) { + if (type instanceof Array) { + desc += '. VALUE must be either [' + type.join('|') + ']'; + type = 'VALUE'; + } + if (type === true || type === 1) { + type = long.toUpperCase(); + } + type = type.toUpperCase(); + if (type === 'FLOAT' || type === 'INT') { + type = 'NUMBER'; + } + line += optional ? '[' + type + ']' : type; + } + line = pad(line, switch_pad); + line += trunc_desc(line, desc); + line += optional ? ' (Default is ' + optional + ')' : ''; + console.error(line.replace('%s', '%\0s')); + + seen_opts.push(short); + seen_opts.push(long); + } + if (enable.timeout && seen_opts.indexOf('t') === -1 && seen_opts.indexOf('timeout') === -1) { + console.error(pad(' -t, --timeout N', switch_pad) + 'Exit if the process takes longer than N seconds'); + } + if (enable.status) { + if (seen_opts.indexOf('k') === -1 && seen_opts.indexOf('no-color') === -1) { + console.error(pad(' -k, --no-color', switch_pad) + 'Omit color from output'); + } + if (seen_opts.indexOf('debug') === -1) { + console.error(pad(' --debug', switch_pad) + 'Show debug information'); + } + } + if (enable.catchall && seen_opts.indexOf('c') === -1 && seen_opts.indexOf('catch') === -1) { + console.error(pad(' -c, --catch', switch_pad) + 'Catch unanticipated errors'); + } + if (enable.daemon && seen_opts.indexOf('d') === -1 && seen_opts.indexOf('daemon') === -1) { + console.error(pad(' -d, --daemon [ARG]', switch_pad) + 'Daemonize the process. Control the daemon using [start, stop, restart, log, pid]'); + } + if (enable.version && seen_opts.indexOf('v') === -1 && seen_opts.indexOf('version') === -1) { + console.error(pad(' -v, --version', switch_pad) + 'Display the current version'); + } + if (enable.help && seen_opts.indexOf('h') === -1 && seen_opts.indexOf('help') === -1) { + console.error(pad(' -h, --help', switch_pad) + 'Display help and usage details'); + } + if (command_list.length) { + console.error('\n\x1b[1mCommands\x1b[0m: '); + if (!Array.isArray(commands)) { + for (var c in commands) { + line = ' ' + pad(c, switch_pad - 2); + line += trunc_desc(line, commands[c]); + console.error(line); + } + } else { + command_list.sort(); + console.error(' ' + trunc_desc(' ', command_list.join(', '))); + } + } + process.exit(); +}; + +/** + * Generates an error message when an opt is incorrectly used. + * + * @param {String} expects (e.g. 'a value') + * @param {String} type (e.g. 'VALUE') + * @api public + */ +cli.getOptError = function (expects, type) { + var err = full_opt + ' expects ' + expects + + '. Use `' + cli.app + ' ' + full_opt + (is_long ? '=' : ' ') + type + '`'; + return err; +}; + +/** + * Gets the next opt value and validates it with an optional validation + * function. If validation fails or no value can be obtained, this method + * will return the default value (if specified) or exit with err_msg. + * + * @param {String} default_val + * @param {Function} validate_func + * @param {String} err_msg + * @api public + */ +cli.getValue = function (default_val, validate_func, err_msg) { + err_msg = err_msg || cli.getOptError('a value', 'VALUE'); + + var value; + + try { + if (curr_val) { + if (validate_func) { + curr_val = validate_func(curr_val); + } + return curr_val; + } + + //Grouped short opts aren't allowed to have values + if (short_tags.length) { + throw 'Short tags'; + } + + //If there's no args left or the next arg is an opt, return the + //default value (if specified) - otherwise fail + if (!argv.length || (argv[0].length === 1 && argv[0][0] === '-')) { + throw 'No value'; + } + + value = argv.shift(); + + if (value.match(/^[0-9]+$/)) { + value = parseInt(value, 10); + } + + //Run the value through a validation/transformation function if specified + if (validate_func) { + value = validate_func(value); + } + } catch (e) { + + //The value didn't pass the validation/transformation. Unshift the value and + //return the default value (if specified) + if (value) { + argv.unshift(value); + } + return default_val != null ? default_val : cli.fatal(err_msg); + } + return value; +}; + +cli.getInt = function (default_val) { + return cli.getValue(default_val, function (value) { + if (typeof value === 'number') return value; + if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))$/)) { + throw 'Invalid int'; + } + return parseInt(value); + }, cli.getOptError('a number', 'NUMBER')); +} + +cli.getFloat = function (default_val) { + return cli.getValue(default_val, function (value) { + if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))?(?:\.[0-9]*)?$/)) { + throw 'Invalid float'; + } + return parseFloat(value, 10); + }, cli.getOptError('a number', 'NUMBER')); +} + +cli.getUrl = function (default_val, identifier) { + identifier = identifier || 'url'; + return cli.getValue(default_val, function (value) { + if (!value.match(/^(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?:\w+:\w+@)?((?:(?:[-\w\d{1-3}]+\.)+(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|edu|co\.uk|ac\.uk|it|fr|tv|museum|asia|local|travel|[a-z]{2})?)|((\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)(\.(\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)){3}))(?::[\d]{1,5})?(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?:#(?:[-\w~!$ |\/.,*:;=]|%[a-f\d]{2})*)?$/i)) { + throw 'Invalid URL'; + } + return value; + }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); +} + +cli.getEmail = function (default_val) { + return cli.getValue(default_val, function (value) { + if (!value.match(/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/)) { + throw 'Invalid email'; + } + return value; + }, cli.getOptError('an email', 'EMAIL')); +} + +cli.getIp = function (default_val) { + return cli.getValue(default_val, function (value) { + if (!value.match(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)) { + throw 'Invalid IP'; + } + return value; + }, cli.getOptError('an IP', 'IP')); +} + +cli.getPath = function (default_val, identifier) { + identifier = identifier || 'path'; + return cli.getValue(default_val, function (value) { + if (value.match(/[?*:;{}]/)) { + throw 'Invalid path'; + } + return value; + }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); +} + +cli.getArrayValue = function (arr, default_val) { + return cli.getValue(default_val, function (value) { + if (arr.indexOf(value) === -1) { + throw 'Unexpected value'; + } + return value; + }, cli.getOptError('either [' + arr.join('|') + ']', 'VALUE')); +} + +/** + * Gets all data from STDIN (with optional encoding) and sends it to callback. + * + * @param {String} encoding (optional - default is 'utf8') + * @param {Function} callback + * @api public + */ +cli.withStdin = function (encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding; + encoding = 'utf8'; + } + var stream = process.openStdin(), data = ''; + stream.setEncoding(encoding); + stream.on('data', function (chunk) { + data += chunk; + }); + stream.on('end', function () { + callback.apply(cli, [data]); + }); +}; + +/** + * Gets all data from STDIN, splits the data into lines and sends it + * to callback (callback isn't called until all of STDIN is read. To + * process each line as it's received, see the method below + * + * @param {Function} callback + * @api public + */ +cli.withStdinLines = function (callback) { + cli.withStdin(function (data) { + var sep = data.indexOf('\r\n') !== -1 ? '\r\n' : '\n'; + callback.apply(cli, [data.split(sep), sep]); + }); +}; + +/** + * Asynchronously reads a file line by line. When a line is received, + * callback is called with (line, sep) - when EOF is reached, callback + * receives (null, null, true) + * + * @param {String} file (optional - default is 'stdin') + * @param {String} encoding (optional - default is 'utf8') + * @param {Function} callback (line, sep, eof) + * @api public + */ +cli.withInput = function (file, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding; + encoding = 'utf8'; + } else if (typeof file === 'function') { + callback = file; + encoding = 'utf8'; + file = 'stdin'; + } + if (file === 'stdin') { + file = process.openStdin(); + } else { + try { + file = cli.native.fs.createReadStream(file); + file.on('error', cli.fatal); + } catch (e) { + return cli.fatal(e); + } + } + file.setEncoding(encoding); + var lines = [], data = '', eof, sep; + file.on('data', function (chunk) { + if (eof) return; + data += chunk; + if (!sep) { + if (data.indexOf('\r\n') !== -1) { + sep = '\r\n'; + } else if (data.indexOf('\n') !== -1) { + sep = '\n'; + } else { + last_line = data; + return; + } + } + lines = data.split(sep); + data = eof ? null : lines.pop(); + while (lines.length) { + callback.apply(cli, [lines.shift(), sep, false]); + } + }); + file.on('end', function () { + eof = true; + if (data.length) { + callback.apply(cli, [data, sep || '', false]); + } + callback.apply(cli, [null, null, true]); + }); +}; + +/** + * A method for creating and controlling a daemon. + * + * `arg` can be: + * start = daemonizes the process + * stop = stops the daemon if it is running + * restart = alias for stop -> start + * pid = outputs the daemon's PID if it is running + * log = outputs the daemon's log file (stdout + stderr) + * + * @param {String} arg (Optional - default is 'start') + * @param {Function} callback + * @api public + */ +cli.daemon = function (arg, callback) { + if (typeof daemon === 'undefined') { + cli.fatal('Daemon is not initialized'); + } + + if (typeof arg === 'function') { + callback = arg; + arg = 'start'; + } + + var lock_file = '/tmp/' + cli.app + '.pid', + log_file = '/tmp/' + cli.app + '.log'; + + var start = function () { + daemon.daemonize(log_file, lock_file, function (err) { + if (err) return cli.error('Error starting daemon: ' + err); + callback(); + }); + }; + + var stop = function () { + try { + cli.native.fs.readFileSync(lock_file); + } catch (e) { + return cli.error('Daemon is not running'); + }; + daemon.kill(lock_file, function (err, pid) { + if (err && err.errno === 3) { + return cli.error('Daemon is not running'); + } else if (err) { + return cli.error('Error stopping daemon: ' + err.errno); + } + cli.ok('Successfully stopped daemon with pid: ' + pid); + }); + }; + + switch(arg) { + case 'stop': + stop(); + break; + case 'restart': + daemon.stop(lock_file, function () { + start(); + }); + break; + case 'log': + try { + cli.native.fs.createReadStream(log_file, {encoding: 'utf8'}).pipe(process.stdout); + } catch (e) { + return cli.error('No daemon log file'); + }; + break; + case 'pid': + try { + var pid = cli.native.fs.readFileSync(lock_file, 'utf8'); + cli.native.fs.statSync('/proc/' + pid); + cli.info(pid); + } catch (e) { + return cli.error('Daemon is not running'); + }; + break; + default: + start(); + break; + } +} + +/** + * The main entry method. Calling cli.main() is only necessary in + * scripts that have daemon support enabled. `callback` receives (args, options) + * + * @param {Function} callback + * @api public + */ +cli.main = function (callback) { + var after = function () { + callback.apply(cli, [cli.args, cli.options]); + }; + if (enable.daemon && daemon_arg) { + cli.daemon(daemon_arg, after); + } else { + after(); + } +} + +/** + * Bind creationix's stack (https://github.com/creationix/stack). + * + * Create a simple middleware stack by calling: + * + * cli.createServer(middleware).listen(port); + * + * @return {Server} server + * @api public + */ +cli.createServer = function(/*layers*/) { + var defaultStackErrorHandler = function (req, res, err) { + if (err) { + console.error(err.stack); + res.writeHead(500, {"Content-Type": "text/plain"}); + return res.end(err.stack + "\n"); + } + res.writeHead(404, {"Content-Type": "text/plain"}); + res.end("Not Found\n"); + }; + var handle = error = defaultStackErrorHandler, + layers = Array.prototype.slice.call(arguments); + + //Allow createServer(a,b,c) and createServer([a,b,c]) + if (layers.length && layers[0] instanceof Array) { + layers = layers[0]; + } + layers.reverse().forEach(function (layer) { + var child = handle; + handle = function (req, res) { + try { + layer(req, res, function (err) { + if (err) return error(req, res, err); + child(req, res); + }); + } catch (err) { + error(req, res, err); + } + }; + }); + return cli.native.http.createServer(handle); +}; + +/** + * A wrapper for child_process.exec(). + * + * If the child_process exits successfully, `callback` receives an array of + * stdout lines. The current process exits if the child process has an error + * and `errback` isn't defined. + * + * @param {String} cmd + * @param {Function} callback (optional) + * @param {Function} errback (optional) + * @api public + */ +cli.exec = function (cmd, callback, errback) { + cli.native.child_process.exec(cmd, function (err, stdout, stderr) { + err = err || stderr; + if (err) { + if (errback) { + return errback(err, stdout); + } + return cli.fatal('exec() failed\n' + err); + } + if (callback) { + callback(stdout.split('\n')); + } + }); +}; + +/** + * Helper method for outputting a progress bar to the console. + * + * @param {Number} progress (0 <= progress <= 1) + * @api public + */ +var last_progress_call, progress_len = 74; +cli.progress = function (progress, decimals) { + if (progress < 0 || progress > 1 || isNaN(progress)) return; + if (!decimals) decimals = 0; + var now = (new Date()).getTime(); + if (last_progress_call && (now - last_progress_call) < 100 && progress !== 1) { + return; //Throttle progress calls + } + last_progress_call = now; + + + var barLength = Math.floor(progress_len * progress), + str = ''; + if (barLength == 0 && progress > 0) { + barLength = 1; + } + for (var i = 1; i <= progress_len; i++) { + str += i <= barLength ? '#' : ' '; + } + var pwr = Math.pow(10, decimals); + var percentage = Math.floor(progress * 100 * pwr) / pwr + '%'; + for (i = 0; i < decimals; i++) { + percentage += ' '; + } + cli.native.util.print('[' + str + '] ' + percentage + (progress === 1 ? '\n' : '\u000D')); +}; + +/** + * Helper method for outputting a spinner to the console. + * + * @param {String|Boolean} prefix (optional) + * @api public + */ +var spinnerInterval; +cli.spinner = function (prefix, end) { + if (end) { + cli.native.util.print('\u000D' + prefix); + return clearInterval(spinnerInterval); + } + prefix = prefix + ' ' || ''; + var spinner = ['-','\\','|','/'], i = 0, l = spinner.length; + spinnerInterval = setInterval(function () { + cli.native.util.print('\u000D' + prefix + spinner[i++]); + if (i == l) i = 0; + }, 200); +}; diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js new file mode 100755 index 0000000..14c4e79 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +var cli = require('cli'); + +var output_file = function (file) { + cli.withInput(file, function (line, sep, eof) { + if (!eof) { + cli.output(line + sep); + } else if (cli.args.length) { + output_file(cli.args.shift()); + } + }); +}; + +if (cli.args.length) { + output_file(cli.args.shift()); +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js new file mode 100755 index 0000000..2f04491 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +var cli = require('cli'); + +//The second (optional) argument of cli.parse() is a command list +//Type `./command.js --help` for usage info + +//cli enables auto-completion of commands (similiar to npm), e.g. all of +//the following are equivalent and result in "Command is: install": +// $ ./command.js install +// $ ./command.js inst +// $ ./command.js i + +cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']); + +console.log('Command is: ' + cli.command); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js new file mode 100755 index 0000000..dac9cca --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node + +/* All of the following commands are equivalent and write `foo\tbar foo` to out.txt + $ ./echo.js -n -e --output=out.txt "foo\tbar" "foo" + $ ./echo.js --newline --escape --output "out.txt" "foo\tbar" "foo" + $ ./echo.js -ne --output=out.txt "foo\tbar" "foo" + $ ./echo.js -en --output="out.txt" "foo\tbar" "foo" +*/ + +var cli = require('cli'); + +cli.parse({ + newline: ['n', 'Do not output the trailing newline'], + escape: ['e', 'Enable interpretation of backslash escapes'], + separator: ['s', 'Separate arguments using this value', 'string', ' '], + output: [false, 'Write to FILE rather than the console', 'file'] +}); + +cli.main(function (args, options) { + var output = '', i, j, l, output_stream; + + if (this.argc) { + if (options.escape) { + var replace = {'\\n':'\n','\\r':'\r','\\t':'\t','\\e':'\e','\\v':'\v','\\f':'\f','\\c':'\c','\\b':'\b','\\a':'\a','\\\\':'\\'}; + var escape = function (str) { + string += ''; + for (j in replace) { + string = string.replace(i, replace[i]); + } + return string; + } + for (i = 0, l = this.argc; i < l; i++) { + args[i] = escape(args[i]); + } + options.separator = escape(options.separator); + } + output += args.join(options.separator); + } + + if (!options.newline) { + output += '\n'; + } + + try { + if (options.output) { + output_stream = this.native.fs.createWriteStream(options.output) + } else { + output_stream = process.stdout; + } + output_stream.write(output); + } catch (e) { + this.fatal('Could not write to output stream'); + } +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js new file mode 100755 index 0000000..12585c0 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +var cli = require('cli').enable('glob'); + +//Running `./glob.js *.js` will output a list of .js files in this directory +console.log(cli.args); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js new file mode 100755 index 0000000..63632f4 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +var cli = require('../'); + +//You can (optionally) boost the width of output with: +//cli.width = 120; + +//You can also adjust the width of the options/command definitions +//cli.option_width = 25; + +var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s ' + + 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make' + + ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, ' + + 'remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing ' + + 'Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions' + + ' of Lorem Ipsum.'; + +cli.parse({ + foo: ['f', long_desc] +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js new file mode 100755 index 0000000..300c674 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +var cli = require('cli'); + +var i = 0, interval = setInterval(function () { + cli.progress(++i / 100); + if (i === 100) { + clearInterval(interval); + cli.ok('Finished!'); + } +}, 50); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js new file mode 100755 index 0000000..5d22313 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var cli = require('cli'); + +var options = cli.parse({ + numeric: ['n', 'Compare using a numeric sort'], + reverse: ['r', 'Reverse the results'] +}); + +cli.withStdinLines(function (lines, newline) { + lines.sort(!options.numeric ? null : function (a, b) { + return parseInt(a) > parseInt(b); + }); + if (options.reverse) { + lines.reverse(); + } + this.output(lines.join(newline)); +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js new file mode 100755 index 0000000..6100001 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node + +var cli = require('cli'); + +cli.spinner('Working..'); + +setTimeout(function () { + cli.spinner('Working.. done!', true); //End the spinner +}, 3000); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee new file mode 100755 index 0000000..cbf3b16 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee @@ -0,0 +1,27 @@ +#!/usr/bin/env coffee + +cli = require 'cli' + +cli.enable('daemon','status') + .setUsage('static.coffee [OPTIONS]') + +cli.parse { + log: ['l', 'Enable logging'] + port: ['p', 'Listen on this port', 'number', 8080] + serve: [false, 'Serve static files from PATH', 'path', './public'] +} + +middleware = [] + +cli.main (args, options) -> + + if options.log + @debug 'Enabling logging' + middleware.push require('creationix/log')() + + @debug 'Serving files from ' + options.serve + middleware.push require('creationix/static')('/', options.serve, 'index.html') + + server = @createServer(middleware).listen options.port + + @ok 'Listening on port ' + options.port \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js new file mode 100755 index 0000000..eb6fd24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +var cli = require('cli').enable('status', 'daemon'); + +cli.parse({ + log: ['l', 'Enable logging'], + port: ['p', 'Listen on this port', 'number', 8080], + serve: [false, 'Serve static files from PATH', 'path', './public'] +}); + +cli.main(function (args, options) { + var server, middleware = []; + + if (options.log) { + this.debug('Enabling logging'); + middleware.push(require('creationix/log')()); + } + + this.debug('Serving files from ' + options.serve); + middleware.push(require('creationix/static')('/', options.serve, 'index.html')); + + server = this.createServer(middleware).listen(options.port); + + this.ok('Listening on port ' + options.port); +}); \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js new file mode 100644 index 0000000..3966bd7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js @@ -0,0 +1 @@ +module.exports = require('./cli'); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore new file mode 100644 index 0000000..2af4b71 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore @@ -0,0 +1,2 @@ +.*.swp +test/a/ diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml new file mode 100644 index 0000000..baa0031 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md new file mode 100644 index 0000000..cc69164 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md @@ -0,0 +1,250 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +## Attention: node-glob users! + +The API has changed dramatically between 2.x and 3.x. This library is +now 100% JavaScript, and the integer flags have been replaced with an +options object. + +Also, there's an event emitter class, proper tests, and all the other +things you've come to expect from node modules. + +And best of all, no compilation! + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Features + +Please see the [minimatch +documentation](https://github.com/isaacs/minimatch) for more details. + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instanting the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `error` The error encountered. When an error is encountered, the + glob object is in an undefined state, and should be discarded. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `statCache` Collection of all the stat results the glob search + performed. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `1` - Path exists, and is not a directory + * `2` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `abort` Stop the search. + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the glob object, as well. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. It will cause + ELOOP to be triggered one level sooner in the case of cyclical + symbolic links. +* `silent` When an unusual error is encountered + when attempting to read a directory, a warning will be printed to + stderr. Set the `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered + when attempting to read a directory, the process will just continue on + in search of other matches. Set the `strict` option to raise an error + in these cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary to + set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. + Set this flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `nocase` Perform a case-insensitive match. Note that case-insensitive + filesystems will sometimes result in glob returning results that are + case-insensitively matched anyway, since readdir and stat will not + raise an error. +* `debug` Set to enable debug logging in minimatch and glob. +* `globDebug` Set to enable debug logging in glob, but not minimatch. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js new file mode 100644 index 0000000..be122df --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "test/a/**/[cg]/../[cg]" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js new file mode 100644 index 0000000..327a425 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "{./*/*,/*,/usr/local/*}" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js new file mode 100644 index 0000000..f4c69e9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js @@ -0,0 +1,690 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// readdir(PREFIX) as ENTRIES +// If fails, END +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + + + +module.exports = glob + +var fs = require("fs") +, minimatch = require("minimatch") +, Minimatch = minimatch.Minimatch +, inherits = require("inherits") +, EE = require("events").EventEmitter +, path = require("path") +, isDir = {} +, assert = require("assert").ok + +function glob (pattern, options, cb) { + if (typeof options === "function") cb = options, options = {} + if (!options) options = {} + + if (typeof options === "number") { + deprecated() + return + } + + var g = new Glob(pattern, options, cb) + return g.sync ? g.found : g +} + +glob.fnmatch = deprecated + +function deprecated () { + throw new Error("glob's interface has changed. Please see the docs.") +} + +glob.sync = globSync +function globSync (pattern, options) { + if (typeof options === "number") { + deprecated() + return + } + + options = options || {} + options.sync = true + return glob(pattern, options) +} + + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options, cb) + } + + if (typeof options === "function") { + cb = options + options = null + } + + if (typeof cb === "function") { + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) + }) + } + + options = options || {} + + this.EOF = {} + this._emitQueue = [] + + this.maxDepth = options.maxDepth || 1000 + this.maxLength = options.maxLength || Infinity + this.cache = options.cache || {} + this.statCache = options.statCache || {} + + this.changedCwd = false + var cwd = process.cwd() + if (!options.hasOwnProperty("cwd")) this.cwd = cwd + else { + this.cwd = options.cwd + this.changedCwd = path.resolve(options.cwd) !== cwd + } + + this.root = options.root || path.resolve(this.cwd, "/") + this.root = path.resolve(this.root) + if (process.platform === "win32") + this.root = this.root.replace(/\\/g, "/") + + this.nomount = !!options.nomount + + if (!pattern) { + throw new Error("must provide pattern") + } + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + this.strict = options.strict !== false + this.dot = !!options.dot + this.mark = !!options.mark + this.sync = !!options.sync + this.nounique = !!options.nounique + this.nonull = !!options.nonull + this.nosort = !!options.nosort + this.nocase = !!options.nocase + this.stat = !!options.stat + + this.debug = !!options.debug || !!options.globDebug + if (this.debug) + this.log = console.error + + this.silent = !!options.silent + + var mm = this.minimatch = new Minimatch(pattern, options) + this.options = mm.options + pattern = this.pattern = mm.pattern + + this.error = null + this.aborted = false + + // list of all the patterns that ** has resolved do, so + // we can avoid visiting multiple times. + this._globstars = {} + + EE.call(this) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + this.minimatch.set.forEach(iterator.bind(this)) + function iterator (pattern, i, set) { + this._process(pattern, 0, i, function (er) { + if (er) this.emit("error", er) + if (-- n <= 0) this._finish() + }) + } +} + +Glob.prototype.log = function () {} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + + var nou = this.nounique + , all = nou ? [] : {} + + for (var i = 0, l = this.matches.length; i < l; i ++) { + var matches = this.matches[i] + this.log("matches[%d] =", i, matches) + // do like the shell, and spit out the literal glob + if (!matches) { + if (this.nonull) { + var literal = this.minimatch.globSet[i] + if (nou) all.push(literal) + else all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) all.push.apply(all, m) + else m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) all = Object.keys(all) + + if (!this.nosort) { + all = all.sort(this.nocase ? alphasorti : alphasort) + } + + this.log("emitting end", all) + + this.EOF = this.found = all + this.emitMatch(this.EOF, -1) +} + +function alphasorti (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return alphasort(a, b) +} + +function alphasort (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit("abort") +} + +Glob.prototype.pause = function () { + if (this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = true + this.emit("pause") +} + +Glob.prototype.resume = function () { + if (!this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = false + this.emit("resume") + this._processEmitQueue() + //process.nextTick(this.emit.bind(this, "resume")) +} + +Glob.prototype._mark = function (p) { + var c = this.cache[p] + var m = p + if (c) { + var isDir = c === 2 || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + this.statCache[m] = this.statCache[p] + this.cache[m] = this.cache[p] + } + } + + return m +} + +Glob.prototype._pushMatch = function(m, index) { + if (this.mark && m !== this.EOF) + m = this._mark(m) + + if (m !== this.EOF) { + this.matches[index] = this.matches[index] || {} + this.matches[index][m] = true + } + + this._emitQueue.push(m) + this._processEmitQueue() +} + +Glob.prototype.emitMatch = function (m, index) { + if ((!this.stat && !this.mark) || this.statCache[m] || m === this.EOF) { + this._pushMatch(m, index) + } else { + this._stat(m, function(exists, isDir) { + if (exists) + this._pushMatch(m, index) + }) + } +} + +Glob.prototype._processEmitQueue = function (m) { + while (!this._processingEmitQueue && + !this.paused) { + this._processingEmitQueue = true + var m = this._emitQueue.shift() + if (!m) { + this._processingEmitQueue = false + break + } + + this.log('emit!', m === this.EOF ? "end" : "match") + + this.emit(m === this.EOF ? "end" : "match", m) + this._processingEmitQueue = false + } +} + +Glob.prototype._process = function (pattern, depth, index, cb_) { + assert(this instanceof Glob) + + var cb = function cb (er, res) { + assert(this instanceof Glob) + if (this.paused) { + if (!this._processQueue) { + this._processQueue = [] + this.once("resume", function () { + var q = this._processQueue + this._processQueue = null + q.forEach(function (cb) { cb() }) + }) + } + this._processQueue.push(cb_.bind(this, er, res)) + } else { + cb_.call(this, er, res) + } + }.bind(this) + + if (this.aborted) return cb() + + if (depth > this.maxDepth) return cb() + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === "string") { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + prefix = pattern.join("/") + this._stat(prefix, function (exists, isDir) { + // either it's there, or it isn't. + // nothing more to do, either way. + if (exists) { + if (prefix && isAbsolute(prefix) && !this.nomount) { + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + this.emitMatch(prefix, index) + } + return cb() + }) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's "absolute" like /foo/bar, + // or "relative" like "../baz" + prefix = pattern.slice(0, n) + prefix = prefix.join("/") + break + } + + // get the list of entries. + var read + if (prefix === null) read = "." + else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + if (!prefix || !isAbsolute(prefix)) { + prefix = path.join("/", prefix) + } + read = prefix = path.resolve(prefix) + + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } + + this.log('readdir(%j)', read, this.cwd, this.root) + + return this._readdir(read, function (er, entries) { + if (er) { + // not a directory! + // this means that, whatever else comes after this, it can never match + return cb() + } + + // globstar is special + if (pattern[n] === minimatch.GLOBSTAR) { + // test without the globstar, and with every child both below + // and replacing the globstar. + var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] + entries.forEach(function (e) { + if (e.charAt(0) === "." && !this.dot) return + // instead of the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) + // below the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) + }, this) + + s = s.filter(function (pattern) { + var key = gsKey(pattern) + var seen = !this._globstars[key] + this._globstars[key] = true + return seen + }, this) + + if (!s.length) + return cb() + + // now asyncForEach over this + var l = s.length + , errState = null + s.forEach(function (gsPattern) { + this._process(gsPattern, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l <= 0) return cb() + }) + }, this) + + return + } + + // not a globstar + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = pattern[n] + var rawGlob = pattern[n]._glob + , dotOk = this.dot || rawGlob.charAt(0) === "." + + entries = entries.filter(function (e) { + return (e.charAt(0) !== "." || dotOk) && + e.match(pattern[n]) + }) + + // If n === pattern.length - 1, then there's no need for the extra stat + // *unless* the user has specified "mark" or "stat" explicitly. + // We know that they exist, since the readdir returned them. + if (n === pattern.length - 1 && + !this.mark && + !this.stat) { + entries.forEach(function (e) { + if (prefix) { + if (prefix !== "/") e = prefix + "/" + e + else e = prefix + e + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + + if (process.platform === "win32") + e = e.replace(/\\/g, "/") + + this.emitMatch(e, index) + }, this) + return cb.call(this) + } + + + // now test all the remaining entries as stand-ins for that part + // of the pattern. + var l = entries.length + , errState = null + if (l === 0) return cb() // no matches possible + entries.forEach(function (e) { + var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) + this._process(p, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l === 0) return cb.call(this) + }) + }, this) + }) + +} + +function gsKey (pattern) { + return '**' + pattern.map(function (p) { + return (p === minimatch.GLOBSTAR) ? '**' : (''+p) + }).join('/') +} + +Glob.prototype._stat = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterStat(f, abs, cb, er) + } + + this.log('stat', [this.cwd, f, '=', abs]) + + if (!this.stat && this.cache.hasOwnProperty(f)) { + var exists = this.cache[f] + , isDir = exists && (Array.isArray(exists) || exists === 2) + if (this.sync) return cb.call(this, !!exists, isDir) + return process.nextTick(cb.bind(this, !!exists, isDir)) + } + + var stat = this.statCache[abs] + if (this.sync || stat) { + var er + try { + stat = fs.statSync(abs) + } catch (e) { + er = e + } + this._afterStat(f, abs, cb, er, stat) + } else { + fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + } +} + +Glob.prototype._afterStat = function (f, abs, cb, er, stat) { + var exists + assert(this instanceof Glob) + + if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { + this.log("should be ENOTDIR, fake it") + + er = new Error("ENOTDIR, not a directory '" + abs + "'") + er.path = abs + er.code = "ENOTDIR" + stat = null + } + + var emit = !this.statCache[abs] + this.statCache[abs] = stat + + if (er || !stat) { + exists = false + } else { + exists = stat.isDirectory() ? 2 : 1 + if (emit) + this.emit('stat', f, stat) + } + this.cache[f] = this.cache[f] || exists + cb.call(this, !!exists, exists === 2) +} + +Glob.prototype._readdir = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (isAbsolute(f)) { + abs = f + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterReaddir(f, abs, cb, er) + } + + this.log('readdir', [this.cwd, f, abs]) + if (this.cache.hasOwnProperty(f)) { + var c = this.cache[f] + if (Array.isArray(c)) { + if (this.sync) return cb.call(this, null, c) + return process.nextTick(cb.bind(this, null, c)) + } + + if (!c || c === 1) { + // either ENOENT or ENOTDIR + var code = c ? "ENOTDIR" : "ENOENT" + , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) + er.path = f + er.code = code + this.log(f, er) + if (this.sync) return cb.call(this, er) + return process.nextTick(cb.bind(this, er)) + } + + // at this point, c === 2, meaning it's a dir, but we haven't + // had to read it yet, or c === true, meaning it's *something* + // but we don't have any idea what. Need to read it, either way. + } + + if (this.sync) { + var er, entries + try { + entries = fs.readdirSync(abs) + } catch (e) { + er = e + } + return this._afterReaddir(f, abs, cb, er, entries) + } + + fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) +} + +Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { + assert(this instanceof Glob) + if (entries && !er) { + this.cache[f] = entries + // if we haven't asked to stat everything for suresies, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. This also gets us one step + // further into ELOOP territory. + if (!this.mark && !this.stat) { + entries.forEach(function (e) { + if (f === "/") e = f + e + else e = f + "/" + e + this.cache[e] = true + }, this) + } + + return cb.call(this, er, entries) + } + + // now handle errors, and cache the information + if (er) switch (er.code) { + case "ENOTDIR": // totally normal. means it *does* exist. + this.cache[f] = 1 + return cb.call(this, er) + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[f] = false + return cb.call(this, er) + default: // some unusual error. Treat as failure. + this.cache[f] = false + if (this.strict) this.emit("error", er) + if (!this.silent) console.error("glob error", er) + return cb.call(this, er) + } +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json new file mode 100644 index 0000000..5bf0db5 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json @@ -0,0 +1,33 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits", + "_id": "inherits@2.0.1", + "_from": "inherits@2" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json new file mode 100644 index 0000000..f925801 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json @@ -0,0 +1,43 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "3.2.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "engines": { + "node": "*" + }, + "dependencies": { + "minimatch": "~0.2.11", + "inherits": "2" + }, + "devDependencies": { + "tap": "~0.4.0", + "mkdirp": "0", + "rimraf": "1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "BSD", + "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `1` - Path exists, and is not a directory\n * `2` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob", + "_id": "glob@3.2.8", + "dist": { + "shasum": "faed42352b23fd9688f67e91dfd4a6b3f58f0784" + }, + "_from": "glob@>= 3.1.4", + "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js new file mode 100644 index 0000000..245afaf --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js @@ -0,0 +1,176 @@ +// just a little pre-run script to set up the fixtures. +// zz-finish cleans it up + +var mkdirp = require("mkdirp") +var path = require("path") +var i = 0 +var tap = require("tap") +var fs = require("fs") +var rimraf = require("rimraf") + +var files = +[ "a/.abcdef/x/y/z/a" +, "a/abcdef/g/h" +, "a/abcfed/g/h" +, "a/b/c/d" +, "a/bc/e/f" +, "a/c/d/c/b" +, "a/cb/e/f" +] + +var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") +var symlinkFrom = "../.." + +files = files.map(function (f) { + return path.resolve(__dirname, f) +}) + +tap.test("remove fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "remove fixtures") + t.end() + }) +}) + +files.forEach(function (f) { + tap.test(f, function (t) { + var d = path.dirname(f) + mkdirp(d, 0755, function (er) { + if (er) { + t.fail(er) + return t.bailout() + } + fs.writeFile(f, "i like tests", function (er) { + t.ifError(er, "make file") + t.end() + }) + }) + }) +}) + +if (process.platform !== "win32") { + tap.test("symlinky", function (t) { + var d = path.dirname(symlinkTo) + console.error("mkdirp", d) + mkdirp(d, 0755, function (er) { + t.ifError(er) + fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { + t.ifError(er, "make symlink") + t.end() + }) + }) + }) +} + +;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { + w = "/tmp/glob-test/" + w + tap.test("create " + w, function (t) { + mkdirp(w, function (er) { + if (er) + throw er + t.pass(w) + t.end() + }) + }) +}) + + +// generate the bash pattern test-fixtures if possible +if (process.platform === "win32" || !process.env.TEST_REGEN) { + console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") + return +} + +var spawn = require("child_process").spawn; +var globs = + // put more patterns here. + // anything that would be directly in / should be in /tmp/glob-test + ["test/a/*/+(c|g)/./d" + ,"test/a/**/[cg]/../[cg]" + ,"test/a/{b,c,d,e,f}/**/g" + ,"test/a/b/**" + ,"test/**/g" + ,"test/a/abc{fed,def}/g/h" + ,"test/a/abc{fed/g,def}/**/" + ,"test/a/abc{fed/g,def}/**///**/" + ,"test/**/a/**/" + ,"test/+(a|b|c)/a{/,bc*}/**" + ,"test/*/*/*/f" + ,"test/**/f" + ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" + ,"{./*/*,/tmp/glob-test/*}" + ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! + ,"test/a/!(symlink)/**" + ] +var bashOutput = {} +var fs = require("fs") + +globs.forEach(function (pattern) { + tap.test("generate fixture " + pattern, function (t) { + var cmd = "shopt -s globstar && " + + "shopt -s extglob && " + + "shopt -s nullglob && " + + // "shopt >&2; " + + "eval \'for i in " + pattern + "; do echo $i; done\'" + var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) + var out = [] + cp.stdout.on("data", function (c) { + out.push(c) + }) + cp.stderr.pipe(process.stderr) + cp.on("close", function (code) { + out = flatten(out) + if (!out) + out = [] + else + out = cleanResults(out.split(/\r*\n/)) + + bashOutput[pattern] = out + t.notOk(code, "bash test should finish nicely") + t.end() + }) + }) +}) + +tap.test("save fixtures", function (t) { + var fname = path.resolve(__dirname, "bash-results.json") + var data = JSON.stringify(bashOutput, null, 2) + "\n" + fs.writeFile(fname, data, function (er) { + t.ifError(er) + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +function flatten (chunks) { + var s = 0 + chunks.forEach(function (c) { s += c.length }) + var out = new Buffer(s) + s = 0 + chunks.forEach(function (c) { + c.copy(out, s) + s += c.length + }) + + return out.toString().trim() +} + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js new file mode 100644 index 0000000..239ed1a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js @@ -0,0 +1,63 @@ +// basic test +// show that it does the same thing by default as the shell. +var tap = require("tap") +, child_process = require("child_process") +, bashResults = require("./bash-results.json") +, globs = Object.keys(bashResults) +, glob = require("../") +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +globs.forEach(function (pattern) { + var expect = bashResults[pattern] + // anything regarding the symlink thing will fail on windows, so just skip it + if (process.platform === "win32" && + expect.some(function (m) { + return /\/symlink\//.test(m) + })) + return + + tap.test(pattern, function (t) { + glob(pattern, function (er, matches) { + if (er) + throw er + + // sort and unmark, just to match the shell results + matches = cleanResults(matches) + + t.deepEqual(matches, expect, pattern) + t.end() + }) + }) + + tap.test(pattern + " sync", function (t) { + var matches = cleanResults(glob.sync(pattern)) + + t.deepEqual(matches, expect, "should match shell") + t.end() + }) +}) + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') + }) +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json new file mode 100644 index 0000000..593215c --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json @@ -0,0 +1,350 @@ +{ + "test/a/*/+(c|g)/./d": [ + "test/a/b/c/./d" + ], + "test/a/**/[cg]/../[cg]": [ + "test/a/abcdef/g/../g", + "test/a/abcfed/g/../g", + "test/a/b/c/../c", + "test/a/c/../c", + "test/a/c/d/c/../c", + "test/a/symlink/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" + ], + "test/a/{b,c,d,e,f}/**/g": [], + "test/a/b/**": [ + "test/a/b", + "test/a/b/c", + "test/a/b/c/d" + ], + "test/**/g": [ + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed,def}/g/h": [ + "test/a/abcdef/g/h", + "test/a/abcfed/g/h" + ], + "test/a/abc{fed/g,def}/**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/a/abc{fed/g,def}/**///**/": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed/g" + ], + "test/**/a/**/": [ + "test/a", + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/b", + "test/a/b/c", + "test/a/bc", + "test/a/bc/e", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/cb", + "test/a/cb/e", + "test/a/symlink", + "test/a/symlink/a", + "test/a/symlink/a/b", + "test/a/symlink/a/b/c", + "test/a/symlink/a/b/c/a", + "test/a/symlink/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" + ], + "test/+(a|b|c)/a{/,bc*}/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h" + ], + "test/*/*/*/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/**/f": [ + "test/a/bc/e/f", + "test/a/cb/e/f" + ], + "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", + "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" + ], + "{./*/*,/tmp/glob-test/*}": [ + "./examples/g.js", + "./examples/usr-local.js", + "./node_modules/inherits", + "./node_modules/minimatch", + "./node_modules/mkdirp", + "./node_modules/rimraf", + "./node_modules/tap", + "./test/00-setup.js", + "./test/a", + "./test/bash-comparison.js", + "./test/bash-results.json", + "./test/cwd-test.js", + "./test/globstar-match.js", + "./test/mark.js", + "./test/new-glob-optional-options.js", + "./test/nocase-nomagic.js", + "./test/pause-resume.js", + "./test/root-nomount.js", + "./test/root.js", + "./test/stat.js", + "./test/zz-cleanup.js", + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq" + ], + "{/tmp/glob-test/*,*}": [ + "/tmp/glob-test/asdf", + "/tmp/glob-test/bar", + "/tmp/glob-test/baz", + "/tmp/glob-test/foo", + "/tmp/glob-test/quux", + "/tmp/glob-test/qwer", + "/tmp/glob-test/rewq", + "examples", + "glob.js", + "LICENSE", + "node_modules", + "package.json", + "README.md", + "test" + ], + "test/a/!(symlink)/**": [ + "test/a/abcdef", + "test/a/abcdef/g", + "test/a/abcdef/g/h", + "test/a/abcfed", + "test/a/abcfed/g", + "test/a/abcfed/g/h", + "test/a/b", + "test/a/b/c", + "test/a/b/c/d", + "test/a/bc", + "test/a/bc/e", + "test/a/bc/e/f", + "test/a/c", + "test/a/c/d", + "test/a/c/d/c", + "test/a/c/d/c/b", + "test/a/cb", + "test/a/cb/e", + "test/a/cb/e/f" + ] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js new file mode 100644 index 0000000..352c27e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js @@ -0,0 +1,55 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing cwd and searching for **/d", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('**/d', function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('a', function (t) { + glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'b/c/d', 'c/d' ]) + t.end() + }) + }) + + t.test('a/b', function (t) { + glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('a/b/', function (t) { + glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'c/d' ]) + t.end() + }) + }) + + t.test('.', function (t) { + glob('**/d', {cwd: process.cwd()}, function (er, matches) { + t.ifError(er) + t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js new file mode 100644 index 0000000..9b234fa --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js @@ -0,0 +1,19 @@ +var Glob = require("../glob.js").Glob +var test = require('tap').test + +test('globstar should not have dupe matches', function(t) { + var pattern = 'a/**/[gh]' + var g = new Glob(pattern, { cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + console.error('match %j', m) + matches.push(m) + }) + g.on('end', function(set) { + console.error('set', set) + matches = matches.sort() + set = set.sort() + t.same(matches, set, 'should have same set of matches') + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js new file mode 100644 index 0000000..e742820 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js @@ -0,0 +1,82 @@ +var test = require("tap").test +var glob = require('../') +process.chdir(__dirname) + +test("mark, no / on pattern", function (t) { + glob("a/*", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + + if (process.platform !== "win32") + expect.push('a/symlink/') + + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, no / on pattern", function (t) { + glob("a/*", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef', + 'a/abcfed', + 'a/b', + 'a/bc', + 'a/c', + 'a/cb' ] + + if (process.platform !== "win32") + expect.push('a/symlink') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /[^\/]$/) + }) +}) + +test("mark=true, / on pattern", function (t) { + glob("a/*/", {mark: true}, function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) + +test("mark=false, / on pattern", function (t) { + glob("a/*/", function (er, results) { + if (er) + throw er + var expect = [ 'a/abcdef/', + 'a/abcfed/', + 'a/b/', + 'a/bc/', + 'a/c/', + 'a/cb/' ] + if (process.platform !== "win32") + expect.push('a/symlink/') + t.same(results, expect) + t.end() + }).on('match', function(m) { + t.similar(m, /\/$/) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js new file mode 100644 index 0000000..3e7dc5a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js @@ -0,0 +1,10 @@ +var Glob = require('../glob.js').Glob; +var test = require('tap').test; + +test('new glob, with cb, and no options', function (t) { + new Glob(__filename, function(er, results) { + if (er) throw er; + t.same(results, [__filename]); + t.end(); + }); +}); diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js new file mode 100644 index 0000000..2503f23 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js @@ -0,0 +1,113 @@ +var fs = require('fs'); +var test = require('tap').test; +var glob = require('../'); + +test('mock fs', function(t) { + var stat = fs.stat + var statSync = fs.statSync + var readdir = fs.readdir + var readdirSync = fs.readdirSync + + function fakeStat(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = { isDirectory: function() { return true } } + break + case '/tmp/a': + ret = { isDirectory: function() { return false } } + break + } + return ret + } + + fs.stat = function(path, cb) { + var f = fakeStat(path); + if (f) { + process.nextTick(function() { + cb(null, f) + }) + } else { + stat.call(fs, path, cb) + } + } + + fs.statSync = function(path) { + return fakeStat(path) || statSync.call(fs, path) + } + + function fakeReaddir(path) { + var ret + switch (path.toLowerCase()) { + case '/tmp': case '/tmp/': + ret = [ 'a', 'A' ] + break + case '/': + ret = ['tmp', 'tMp', 'tMP', 'TMP'] + } + return ret + } + + fs.readdir = function(path, cb) { + var f = fakeReaddir(path) + if (f) + process.nextTick(function() { + cb(null, f) + }) + else + readdir.call(fs, path, cb) + } + + fs.readdirSync = function(path) { + return fakeReaddir(path) || readdirSync.call(fs, path) + } + + t.pass('mocked') + t.end() +}) + +test('nocase, nomagic', function(t) { + var n = 2 + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/a', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) + glob('/tmp/A', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + if (--n === 0) t.end() + }) +}) + +test('nocase, with some magic', function(t) { + t.plan(2) + var want = [ '/TMP/A', + '/TMP/a', + '/tMP/A', + '/tMP/a', + '/tMp/A', + '/tMp/a', + '/tmp/A', + '/tmp/a' ] + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) + glob('/tmp/*', { nocase: true }, function(er, res) { + if (er) + throw er + t.same(res.sort(), want) + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js new file mode 100644 index 0000000..e1ffbab --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js @@ -0,0 +1,73 @@ +// show that no match events happen while paused. +var tap = require("tap") +, child_process = require("child_process") +// just some gnarly pattern with lots of matches +, pattern = "test/a/!(symlink)/**" +, bashResults = require("./bash-results.json") +, patterns = Object.keys(bashResults) +, glob = require("../") +, Glob = glob.Glob +, path = require("path") + +// run from the root of the project +// this is usually where you're at anyway, but be sure. +process.chdir(path.resolve(__dirname, "..")) + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 : a < b ? -1 : 0 +} + +function cleanResults (m) { + // normalize discrepancies in ordering, duplication, + // and ending slashes. + return m.map(function (m) { + return m.replace(/\/+/g, "/").replace(/\/$/, "") + }).sort(alphasort).reduce(function (set, f) { + if (f !== set[set.length - 1]) set.push(f) + return set + }, []).sort(alphasort).map(function (f) { + // de-windows + return (process.platform !== 'win32') ? f + : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') + }) +} + +var globResults = [] +tap.test("use a Glob object, and pause/resume it", function (t) { + var g = new Glob(pattern) + , paused = false + , res = [] + , expect = bashResults[pattern] + + g.on("pause", function () { + console.error("pause") + }) + + g.on("resume", function () { + console.error("resume") + }) + + g.on("match", function (m) { + t.notOk(g.paused, "must not be paused") + globResults.push(m) + g.pause() + t.ok(g.paused, "must be paused") + setTimeout(g.resume.bind(g), 10) + }) + + g.on("end", function (matches) { + t.pass("reached glob end") + globResults = cleanResults(globResults) + matches = cleanResults(matches) + t.deepEqual(matches, globResults, + "end event matches should be the same as match events") + + t.deepEqual(matches, expect, + "glob matches should be the same as bash results") + + t.end() + }) +}) + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js new file mode 100644 index 0000000..3ac5979 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing root and searching for /b*/**", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) + }) + + t.test('a', function (t) { + glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js new file mode 100644 index 0000000..95c23f9 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js @@ -0,0 +1,46 @@ +var t = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +var glob = require('../') +var path = require('path') + +t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) +}) + + +t.test('a', function (t) { + console.error("root=" + path.resolve('a')) + glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { + t.ifError(er) + var wanted = [ + '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' + ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + }) + + t.like(matches, wanted) + t.end() + }) +}) + +t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + })) + t.end() + }) +}) + +t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js new file mode 100644 index 0000000..6291711 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js @@ -0,0 +1,32 @@ +var glob = require('../') +var test = require('tap').test +var path = require('path') + +test('stat all the things', function(t) { + var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + matches.push(m) + }) + var stats = [] + g.on('stat', function(m) { + stats.push(m) + }) + g.on('end', function(eof) { + stats = stats.sort() + matches = matches.sort() + eof = eof.sort() + t.same(stats, matches) + t.same(eof, matches) + var cache = Object.keys(this.statCache) + t.same(cache.map(function (f) { + return path.relative(__dirname, f) + }).sort(), matches) + + cache.forEach(function(c) { + t.equal(typeof this.statCache[c], 'object') + }, this) + + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js new file mode 100644 index 0000000..e085f0f --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js @@ -0,0 +1,11 @@ +// remove the fixtures +var tap = require("tap") +, rimraf = require("rimraf") +, path = require("path") + +tap.test("cleanup fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "removed") + t.end() + }) +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json new file mode 100755 index 0000000..5b39e2b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json @@ -0,0 +1,57 @@ +{ + "name": "cli", + "description": "A tool for rapidly building command line apps", + "version": "0.4.5", + "homepage": "http://github.com/chriso/cli", + "keywords": [ + "cli", + "command line", + "opts", + "parseopt", + "opt", + "args", + "console", + "argsparse", + "optparse", + "daemon", + "autocomplete", + "command", + "autocompletion" + ], + "author": { + "name": "Chris O'Hara", + "email": "cohara87@gmail.com" + }, + "main": "cli.js", + "bugs": { + "url": "http://github.com/chriso/cli/issues" + }, + "repository": { + "type": "git", + "url": "http://github.com/chriso/cli.git" + }, + "dependencies": { + "glob": ">= 3.1.4" + }, + "contributors": [ + { + "name": "Douglas Meyer" + } + ], + "engines": { + "node": ">=0.2.5" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "readme": "**cli is a toolkit for rapidly building command line apps - it includes:**\n\n- Full featured opts/args parser\n- Plugin support for adding common options and switches\n- Helper methods for working with input/output and spawning child processes\n- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js)\n- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js)\n\nInstall using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app.\n\n## Example apps\n\n### sort.js\n\n```javascript\n#!/usr/bin/env node\nrequire('cli').withStdinLines(function(lines, newline) {\n this.output(lines.sort().join(newline));\n});\n```\n\nTry it out\n\n```bash\n$ ./sort.js < input.txt\n```\n\nLet's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!)\n\n```javascript\nvar cli = require('cli'), options = cli.parse();\n\ncli.withStdinLines(function(lines, newline) {\n lines.sort(!options.n ? null : function(a, b) {\n return parseInt(a) > parseInt(b);\n });\n if (options.r) lines.reverse();\n this.output(lines.join(newline));\n});\n```\n\n### static.js\n\nLet's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon`\n\n```javascript\nvar cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins\n\ncli.parse({\n log: ['l', 'Enable logging'],\n port: ['p', 'Listen on this port', 'number', 8080],\n serve: [false, 'Serve static files from PATH', 'path', './public']\n});\n\ncli.main(function(args, options) {\n var server, middleware = [];\n\n if (options.log) {\n this.debug('Enabling logging');\n middleware.push(require('creationix/log')());\n }\n\n this.debug('Serving files from ' + options.serve);\n middleware.push(require('creationix/static')('/', options.serve, 'index.html'));\n\n server = this.createServer(middleware).listen(options.port);\n\n this.ok('Listening on port ' + options.port);\n});\n```\n\nTo output usage information\n\n```bash\n$ ./static.js --help\n```\n\nTo create a daemon that serves files from */tmp*, run\n\n```bash\n$ ./static.js -ld --serve=/tmp\n```\n\nFor more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples)\n\n## Helper methods\n\ncli has methods that collect stdin (newline is autodetected as \\n or \\r\\n)\n\n```javascript\ncli.withStdin(callback); //callback receives stdin as a string\ncli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline)\n```\n\ncli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). \n\n```javascript\ncli.withInput(file, function (line, newline, eof) {\n if (!eof) {\n this.output(line + newline);\n }\n});\n```\n\n*Note: `file` can be omitted if you want to work with stdin*\n\nTo output a progress bar, call\n\n```javascript\ncli.progress(progress); //Where 0 <= progress <= 1\n```\n\nTo spawn a child process, use\n\n```javascript\ncli.exec(cmd, callback); //callback receives the output of the process (split into lines)\n```\n\ncli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer)\n\n## Plugins\n\nPlugins are a way of adding common opts and can be enabled using \n\n```javascript\ncli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method\n```\n\n**help** - *enabled by default*\n\nAdds `-h,--help` to output auto-generated usage information\n\n**version**\n\nAdds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json*\n\nTo set your own app name and version, use `cli.setApp(app_name, version)`\n\n**status**\n\nAdds options to show/hide the stylized status messages that are output to the console when using one of these methods\n\n```javascript\ncli.debug(msg); //Only shown when using --debug\ncli.error(msg);\ncli.fatal(msg); //Exits the process after outputting msg\ncli.info(msg);\ncli.ok(msg);\n```\n\n`-k,--no-color` will omit ANSI color escapes from the output\n\n**glob** - *requires* `npm install glob`\n\nEnables glob matching of arguments\n\n**daemon** - *requires* `npm install daemon`\n\nAdds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon\n\n`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr)\n\n**timeout**\n\nAdds `-t,--timeout N` to exit the process after N seconds with an error\n\n**catchall**\n\nAdds `-c,--catch` to catch and output uncaughtExceptions and resume execution\n\n*Note: Plugins are automatically disabled if an option or switch of the same name is already defined*\n\n## LICENSE\n\n(MIT license)\n\nCopyright (c) 2010 Chris O'Hara \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "cli@0.4.5", + "dist": { + "shasum": "78f9485cd161b566e9a6c72d7170c4270e81db61" + }, + "_from": "cli@0.4.x", + "_resolved": "https://registry.npmjs.org/cli/-/cli-0.4.5.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore new file mode 100644 index 0000000..aa3fd4b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore @@ -0,0 +1,14 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json new file mode 100644 index 0000000..633c2ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json @@ -0,0 +1,14 @@ +{ + "launchers": { + "node": { + "command": "npm test" + } + }, + "src_files": [ + "./**/*.js" + ], + "before_tests": "npm run build", + "on_exit": "rm test/static/bundle.js", + "test_page": "test/static/index.html", + "launch_in_dev": ["node", "phantomjs"] +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml new file mode 100644 index 0000000..ed178f6 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.9 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE new file mode 100644 index 0000000..a23e08a --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Raynos. + +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md new file mode 100644 index 0000000..5e480ba --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md @@ -0,0 +1,32 @@ +# console-browserify + +[![build status][1]][2] + +[![browser support][3]][4] + +Emulate console for all the browsers + +## Example + +```js +var console = require("console-browserify") + +console.log("hello world!") +``` + +## Installation + +`npm install console-browserify` + +## Contributors + + - Raynos + +## MIT Licenced + + + + [1]: https://secure.travis-ci.org/Raynos/console-browserify.png + [2]: http://travis-ci.org/Raynos/console-browserify + [3]: http://ci.testling.com/Raynos/console-browserify.png + [4]: http://ci.testling.com/Raynos/console-browserify diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js new file mode 100644 index 0000000..bfdf4b3 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js @@ -0,0 +1,85 @@ +/*global window, global*/ +var util = require("util") +var assert = require("assert") + +var slice = Array.prototype.slice +var console +var times = {} + +if (typeof global !== "undefined" && global.console) { + console = global.console +} else if (typeof window !== "undefined" && window.console) { + console = window.console +} else { + console = window.console = {} +} + +var functions = [ + [log, "log"] + , [info, "info"] + , [warn, "warn"] + , [error, "error"] + , [time, "time"] + , [timeEnd, "timeEnd"] + , [trace, "trace"] + , [dir, "dir"] + , [assert, "assert"] +] + +for (var i = 0; i < functions.length; i++) { + var tuple = functions[i] + var f = tuple[0] + var name = tuple[1] + + if (!console[name]) { + console[name] = f + } +} + +module.exports = console + +function log() {} + +function info() { + console.log.apply(console, arguments) +} + +function warn() { + console.log.apply(console, arguments) +} + +function error() { + console.warn.apply(console, arguments) +} + +function time(label) { + times[label] = Date.now() +} + +function timeEnd(label) { + var time = times[label] + if (!time) { + throw new Error("No such label: " + label) + } + + var duration = Date.now() - time + console.log(label + ": " + duration + "ms") +} + +function trace() { + var err = new Error() + err.name = "Trace" + err.message = util.format.apply(null, arguments) + console.error(err.stack) +} + +function dir(object) { + console.log(util.inspect(object) + "\n") +} + +function assert(expression) { + if (!expression) { + var arr = slice.call(arguments, 1) + assert.ok(false, util.format.apply(null, arr)) + } +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json new file mode 100644 index 0000000..72dc038 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json @@ -0,0 +1,80 @@ +{ + "name": "console-browserify", + "version": "0.1.6", + "description": "Emulate console for all the browsers", + "keywords": [], + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "repository": { + "type": "git", + "url": "git://github.com/Raynos/console-browserify.git" + }, + "main": "index", + "homepage": "https://github.com/Raynos/console-browserify", + "contributors": [ + { + "name": "Raynos" + } + ], + "bugs": { + "url": "https://github.com/Raynos/console-browserify/issues", + "email": "raynos2@gmail.com" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~0.2.2", + "browserify": "https://github.com/raynos/node-browserify/tarball/master", + "testem": "~0.2.55", + "jsonify": "0.0.0" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Raynos/console-browserify/raw/master/LICENSE" + } + ], + "scripts": { + "test": "node ./test", + "build": "browserify test/index.js -o test/static/bundle.js", + "testem": "testem" + }, + "testling": { + "files": "test/index.js", + "browsers": { + "ie": [ + "6", + "7", + "8", + "9", + "10" + ], + "firefox": [ + "16", + "17", + "nightly" + ], + "chrome": [ + "22", + "23", + "canary" + ], + "opera": [ + "12", + "next" + ], + "safari": [ + "5.1" + ] + } + }, + "readme": "# console-browserify\n\n[![build status][1]][2]\n\n[![browser support][3]][4]\n\nEmulate console for all the browsers\n\n## Example\n\n```js\nvar console = require(\"console-browserify\")\n\nconsole.log(\"hello world!\")\n```\n\n## Installation\n\n`npm install console-browserify`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n\n\n [1]: https://secure.travis-ci.org/Raynos/console-browserify.png\n [2]: http://travis-ci.org/Raynos/console-browserify\n [3]: http://ci.testling.com/Raynos/console-browserify.png\n [4]: http://ci.testling.com/Raynos/console-browserify\n", + "readmeFilename": "README.md", + "_id": "console-browserify@0.1.6", + "dist": { + "shasum": "de147fc21be8eedd535f133dfc59730431858504" + }, + "_from": "console-browserify@0.1.x", + "_resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-0.1.6.tgz" +} diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js new file mode 100644 index 0000000..26dfaad --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js @@ -0,0 +1,67 @@ +var console = require("../index") +var test = require("tape") + +if (typeof window !== "undefined" && !window.JSON) { + window.JSON = require("jsonify") +} + +test("console has expected methods", function (assert) { + assert.ok(console.log) + assert.ok(console.info) + assert.ok(console.warn) + assert.ok(console.dir) + assert.ok(console.time, "time") + assert.ok(console.timeEnd, "timeEnd") + assert.ok(console.trace, "trace") + assert.ok(console.assert) + + assert.end() +}) + +test("invoke console.log", function (assert) { + console.log("test-log") + + assert.end() +}) + +test("invoke console.info", function (assert) { + console.info("test-info") + + assert.end() +}) + +test("invoke console.warn", function (assert) { + console.warn("test-warn") + + assert.end() +}) + +test("invoke console.time", function (assert) { + console.time("label") + + assert.end() +}) + +test("invoke console.trace", function (assert) { + console.trace("test-trace") + + assert.end() +}) + +test("invoke console.assert", function (assert) { + console.assert(true) + + assert.end() +}) + +test("invoke console.dir", function (assert) { + console.dir("test-dir") + + assert.end() +}) + +test("invoke console.timeEnd", function (assert) { + console.timeEnd("label") + + assert.end() +}) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html new file mode 100644 index 0000000..dd55012 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html @@ -0,0 +1,12 @@ + + + + + TAPE Example + + + + + + + diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js new file mode 100644 index 0000000..8b4c12d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js @@ -0,0 +1,53 @@ +(function () { + var Testem = window.Testem + var regex = /^((?:not )?ok) (\d+) (.+)$/ + + Testem.useCustomAdapter(tapAdapter) + + function tapAdapter(socket){ + var results = { + failed: 0 + , passed: 0 + , total: 0 + , tests: [] + } + + socket.emit('tests-start') + + Testem.handleConsoleMessage = function(msg){ + var m = msg.match(regex) + if (m) { + var passed = m[1] === 'ok' + var test = { + passed: passed ? 1 : 0, + failed: passed ? 0 : 1, + total: 1, + id: m[2], + name: m[3], + items: [] + } + + if (passed) { + results.passed++ + } else { + console.error("failure", m) + + results.failed++ + } + + results.total++ + + // console.log("emitted test", test) + socket.emit('test-result', test) + results.tests.push(test) + } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ + // console.log("emitted all test") + socket.emit('all-test-results', results) + } + + // return false if you want to prevent the console message from + // going to the console + // return false + } + } +}()) diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.gitattributes b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.gitattributes new file mode 100644 index 0000000..4bb50dc --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text eol=lf \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.npmignore b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.npmignore new file mode 100644 index 0000000..0db216b --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.npmignore @@ -0,0 +1,2 @@ +npm-debug.log +node_modules diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.travis.yml b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.travis.yml new file mode 100644 index 0000000..d63ba09 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.8 + - 0.10 + - 0.11 diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/LICENSE b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/LICENSE new file mode 100644 index 0000000..0a35e02 --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/LICENSE @@ -0,0 +1,18 @@ +Copyright 2010, 2011, Chris Winberry . All rights reserved. +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. \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/README.md b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/README.md new file mode 100644 index 0000000..9ed236d --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/README.md @@ -0,0 +1,81 @@ +#htmlparser2 [![NPM version](https://badge.fury.io/js/htmlparser2.png)](https://npmjs.org/package/htmlparser2) [![Build Status](https://secure.travis-ci.org/fb55/htmlparser2.png)](http://travis-ci.org/fb55/htmlparser2) [![Dependency Status](https://david-dm.org/fb55/htmlparser2.png)](https://david-dm.org/fb55/htmlparser2) + +A forgiving HTML/XML/RSS parser written in JS for NodeJS. The parser can handle streams (chunked data) and supports custom handlers for writing custom DOMs/output. + +##Installing + npm install htmlparser2 + +A live demo of htmlparser2 is available at http://demos.forbeslindesay.co.uk/htmlparser2/ + +##Usage + +```javascript +var htmlparser = require("htmlparser2"); +var parser = new htmlparser.Parser({ + onopentag: function(name, attribs){ + if(name === "script" && attribs.type === "text/javascript"){ + console.log("JS! Hooray!"); + } + }, + ontext: function(text){ + console.log("-->", text); + }, + onclosetag: function(tagname){ + if(tagname === "script"){ + console.log("That's it?!"); + } + } +}); +parser.write("Xyz ", + "expected": [ + { + "type": "script", + "name": "script", + "attribs": {}, + "children": [ + { + "data": "", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json new file mode 100644 index 0000000..77438fd --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json @@ -0,0 +1,20 @@ +{ + "name": "Unescaped chars in style", + "options": {}, + "html": "", + "expected": [ + { + "type": "style", + "name": "style", + "attribs": { + "type": "text/css" + }, + "children": [ + { + "data": "\n body > p\n\t{ font-weight: bold; }", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json new file mode 100644 index 0000000..5c2492e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json @@ -0,0 +1,20 @@ +{ + "name": "Extra spaces in tag", + "options": {}, + "html": "the text", + "expected": [ + { + "type": "tag", + "name": "font", + "attribs": { + "size": "14" + }, + "children": [ + { + "data": "the text", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json new file mode 100644 index 0000000..543ccee --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json @@ -0,0 +1,20 @@ +{ + "name": "Unquoted attributes", + "options": {}, + "html": "the text", + "expected": [ + { + "type": "tag", + "name": "font", + "attribs": { + "size": "14" + }, + "children": [ + { + "data": "the text", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json new file mode 100644 index 0000000..544636e --- /dev/null +++ b/proj7/jquery-source/jquery/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json @@ -0,0 +1,15 @@ +{ + "name": "Singular attribute", + "options": {}, + "html": "